Skip to content

Commit

Permalink
Merge pull request #1497 from 0x3878f/pir_develop_19
Browse files Browse the repository at this point in the history
Update the package release workflow
  • Loading branch information
risemeup1 authored Feb 7, 2025
2 parents 9071329 + 3332c80 commit 3c7fd18
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 118 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12']
architecture: [ 'x64' ]
architecture: [ 'aarch64' ]

steps:
# Checkout the latest branch of Paddle2ONNX.
Expand All @@ -31,9 +31,9 @@ jobs:
entrypoint: bash
args: .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }}

- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6
with:
name: wheels
name: LinuxRelease_${{ matrix.architecture }}_py${{ matrix.python-version }}
path: dist

- name: Publish package
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release_linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12']
architecture: [ 'x64' ]
architecture: [ 'x86_64' ]

steps:
# Checkout the latest branch of Paddle2ONNX.
Expand All @@ -28,9 +28,9 @@ jobs:
entrypoint: bash
args: .github/workflows/scripts/entrypoint.sh ${{ matrix.python-version }}

- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6
with:
name: wheels-${{ matrix.python-version }}-${{ matrix.architecture }}
name: LinuxRelease_${{ matrix.architecture }}_py${{ matrix.python-version }}
path: dist

- name: Publish package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ jobs:
export PIP_EXTRA_INDEX_URL="https://www.paddlepaddle.org.cn/packages/nightly/cpu/"
python -m build --wheel
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6
with:
name: wheels
name: MacRelease_${{ matrix.architecture }}_py${{ matrix.python-version }}
path: dist

- name: Publish package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_win_amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ jobs:
$Env:PIP_EXTRA_INDEX_URL="https://www.paddlepaddle.org.cn/packages/nightly/cpu/"
python -m build --wheel
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6
with:
name: wheels
name: WindowsRelease_${{ matrix.architecture }}_py${{ matrix.python-version }}
path: dist

- name: Publish package
Expand Down
6 changes: 4 additions & 2 deletions paddle2onnx/mapper/mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,12 @@ class Mapper {
if (in_pir_mode) {
if (if_in_cf_block) {
auto op = pir_parser_->sub_blocks_ops[pir_op_idx_];
return pir_parser_->OpHasAttr(op, name);
return pir_parser_->OpHasAttr(
op, pir_parser_->GetOpArgName(pir_op_idx_, name, true));
} else {
auto op = pir_parser_->global_blocks_ops[pir_op_idx_];
return pir_parser_->OpHasAttr(op, name);
return pir_parser_->OpHasAttr(
op, pir_parser_->GetOpArgName(pir_op_idx_, name, false));
}
} else {
auto& op = parser_->GetOpDesc(block_idx_, op_idx_);
Expand Down
16 changes: 14 additions & 2 deletions paddle2onnx/mapper/tensor/reduce_mean.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ void ReduceMeanMapper::Opset18() {
GetAttr(axis_name_, &dim_);
}
} else {
GetAttr("axis", &dim_);
if (HasAttr(axis_name_)) {
GetAttr(axis_name_, &dim_);
} else {
TryGetInputValue(axis_name_, &dim_);
}
if (dim_.size() == 0) {
reduce_all_ = true;
} else {
Expand All @@ -51,6 +55,9 @@ void ReduceMeanMapper::Opset18() {
if (IsAttrVar(axis_name_)) {
auto info = GetAttrVar(axis_name_);
dims = helper_->AutoCast(info[0].name, info[0].dtype, P2ODataType::INT64);
} else if(HasInput(axis_name_)) {
auto info = GetInput(axis_name_);
dims = helper_->AutoCast(info[0].name, info[0].dtype, P2ODataType::INT64);
} else {
if (!reduce_all_) {
dims = helper_->Constant(ONNX_NAMESPACE::TensorProto::INT64, dim_);
Expand Down Expand Up @@ -92,7 +99,12 @@ void ReduceMeanMapper::Opset11() {
GetAttr(axis_name_, &dim_);
}
} else {
GetAttr("axis", &dim_);
if (HasAttr(axis_name_)) {
GetAttr(axis_name_, &dim_);
} else {
Assert(TryGetInputValue(axis_name_, &dim_),
"Can not get input 'axis(dim)' value.");
}
if (dim_.size() == 0) {
reduce_all_ = true;
} else {
Expand Down
104 changes: 0 additions & 104 deletions tools/scripts/paddle2onnx_build.sh

This file was deleted.

0 comments on commit 3c7fd18

Please sign in to comment.