Skip to content

Commit eb296c0

Browse files
authored
Merge branch 'main' into dev-qdq-scale
2 parents 566665b + 96a0ca4 commit eb296c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+416
-298
lines changed

.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,6 @@ SpacesInContainerLiterals: true
8989
SpacesInCStyleCastParentheses: false
9090
SpacesInParentheses: false
9191
SpacesInSquareBrackets: false
92+
StatementMacros: [define_data]
9293
TabWidth: 8
9394
UseTab: Never

.github/workflows/auto_update_doc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
contents: write
1919

2020
steps:
21-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222
with:
2323
repository: ${{ github.event.pull_request.head.repo.full_name }}
2424
# Checkout the branch made in the fork. Will automatically push changes
2525
# back to this branch.
2626
ref: ${{ github.head_ref }}
2727
- name: Setup Python
28-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
28+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
2929
with:
3030
python-version: "3.11"
3131
- name: Install ONNX from source and update documentation

.github/workflows/check_urls.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424

2525
- name: urls-checker-code
2626
uses: urlstechie/urlchecker-action@b643b43e2ac605e1475331c7b67247d242b7dce4 # v0.0.34

.github/workflows/clang_tidy_review.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
build:
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2727
# Pleaes note that it won't cause any failure here; it will only post comments in PRs
2828
- name: clang-tidy review
2929
uses: ZedThree/clang-tidy-review@85799d63d217e8d0686b7735fb923acc986d8043 # v0.19.0
3030
with:
3131
apt_packages: "libprotobuf-dev,protobuf-compiler"
32-
cmake_command: "cmake -S . -B .setuptools-cmake-build -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
32+
cmake_command: "cmake -S . -B .setuptools-cmake-build -DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
3333
build_dir: ".setuptools-cmake-build"
3434
exclude: "/third_party/*"
3535
split_workflow: true

.github/workflows/codeql.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545

4646
steps:
4747
- name: Checkout repository
48-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
48+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4949
- name: Set up Python
50-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
50+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
5151
with:
5252
python-version: '3.11'
5353
- name: Install dependencies
@@ -56,7 +56,7 @@ jobs:
5656
5757
# Initializes the CodeQL tools for scanning.
5858
- name: Initialize CodeQL
59-
uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
59+
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
6060
with:
6161
languages: ${{ matrix.language }}
6262
queries: security-extended,security-and-quality
@@ -87,6 +87,6 @@ jobs:
8787
# ./location_of_script_within_repo/buildscript.sh
8888

8989
- name: Perform CodeQL Analysis
90-
uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
90+
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
9191
with:
9292
category: "/language:${{matrix.language}}"

.github/workflows/create_release.yml

+89-33
Original file line numberDiff line numberDiff line change
@@ -5,102 +5,158 @@
55
name: Create Releases
66
on:
77
schedule:
8-
# Run weekly on Monday 00:00 UTC
8+
# Run weekly on Monday 00:00 UTC
99
- cron: '00 00 * * MON'
1010
push:
1111
branches: [main, rel-*]
1212
pull_request:
1313
branches: [main, rel-*]
14-
types:
14+
types:
1515
- labeled # Trigger when a label is added to a PR, more information: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
16-
workflow_dispatch:
16+
workflow_dispatch:
17+
inputs:
18+
publish_pypi_onnxweekly:
19+
description: 'Publish to pypi_onnxweekly'
20+
required: true
21+
type: choice
22+
options:
23+
- 'yes'
24+
- 'no'
25+
default: 'no'
26+
publish_testpypi_onnxweekly:
27+
description: 'Publish to testpypi_onnxweekly'
28+
required: true
29+
type: choice
30+
options:
31+
- 'yes'
32+
- 'no'
33+
default: 'no'
1734

1835
concurrency:
1936
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' }}
2037
cancel-in-progress: true
2138

22-
jobs:
39+
jobs:
2340

2441
call-workflow-ubuntu_x86:
2542
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
2643
uses: ./.github/workflows/release_linux_x86_64.yml
27-
with:
28-
os: "linux_x86_64"
44+
with:
45+
os: "linux_x86_64"
2946
secrets: inherit
3047

3148
call-workflow-ubuntu_aarch64:
3249
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
3350
uses: ./.github/workflows/release_linux_aarch64.yml
34-
with:
35-
os: "linux_aarch64"
51+
with:
52+
os: "linux_aarch64"
3653
secrets: inherit
3754

3855
call-workflow-win:
3956
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
4057
uses: ./.github/workflows/release_win.yml
41-
with:
58+
with:
4259
os: "win"
4360
secrets: inherit
4461

4562
call-workflow-mac:
4663
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
4764
uses: ./.github/workflows/release_mac.yml
48-
with:
65+
with:
4966
os: "macos"
5067
secrets: inherit
5168

5269
call-workflow-sdist:
5370
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
5471
uses: ./.github/workflows/release_sdist.yml
55-
with:
72+
with:
5673
os: "macos"
5774
secrets: inherit
5875

59-
publish_to_pypi-onnx-weekly:
60-
name: Publish to pypi-onnx-weekly
76+
publish_devbuild_to_testpypi:
77+
name: Publish devbuild to test.pypi
78+
runs-on: ubuntu-latest
79+
needs: [call-workflow-ubuntu_x86, call-workflow-ubuntu_aarch64, call-workflow-mac, call-workflow-win, call-workflow-sdist]
80+
if: ${{ always() }} && (github.event.inputs.publish_wheel_testpypi == 'yes' )
81+
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs
82+
83+
environment:
84+
name: testpypi_onnxweekly
85+
url: https://test.pypi.org/p/onnx-weekly
86+
87+
permissions:
88+
contents: write # IMPORTANT: mandatory for making GitHub Releases
89+
id-token: write
90+
91+
steps:
92+
93+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
94+
if: (github.event_name == 'workflow_dispatch' ) && ((needs.call-workflow-mac.result == 'success') || (needs.call-workflow-ubuntu_x86.result == 'success') || (needs.call-workflow-ubuntu_aarch64.result == 'success') || (needs.call-workflow-win.result == 'success'))
95+
with:
96+
pattern: wheels*
97+
path: dist
98+
merge-multiple: true
99+
100+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
101+
if: (github.event_name == 'workflow_dispatch' ) && (needs.call-workflow-sdist.result == 'success')
102+
with:
103+
pattern: sdist
104+
path: dist
105+
merge-multiple: true
106+
107+
- name: Publish dev-build to test.pypi
108+
if: (github.ref == 'refs/heads/main') && (github.event.inputs.publish_testpypi_onnxweekly == 'yes') && (github.repository_owner == 'onnx')
109+
110+
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc
111+
with:
112+
repository-url: https://test.pypi.org/legacy/
113+
verbose: true
114+
print-hash: true
115+
116+
117+
publish_devbuild_to_pypi:
118+
name: Publish devbuild to pypi
61119
runs-on: ubuntu-latest
62120
needs: [call-workflow-ubuntu_x86, call-workflow-ubuntu_aarch64, call-workflow-mac, call-workflow-win, call-workflow-sdist]
63-
if: ${{ always() }} && (github.event_name == 'schedule') # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs
64-
65-
environment:
66-
name: pypi-weekly
121+
if: ${{ always() }} && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs
122+
123+
environment:
124+
name: pypi-weekly
67125
url: https://pypi.org/p/onnx-weekly
68126

69127
permissions:
70128
contents: write # IMPORTANT: mandatory for making GitHub Releases
71-
id-token: write # IMPORTANT: mandatory for sigstore
129+
id-token: write
72130

73131
steps:
74-
75132
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
76-
if: (github.event_name == 'schedule') && ((needs.call-workflow-mac.result == 'success') || (needs.call-workflow-ubuntu_x86.result == 'success') || (needs.call-workflow-ubuntu_aarch64.result == 'success') || (needs.call-workflow-win.result == 'success'))
133+
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && ((needs.call-workflow-mac.result == 'success') || (needs.call-workflow-ubuntu_x86.result == 'success') || (needs.call-workflow-ubuntu_aarch64.result == 'success') || (needs.call-workflow-win.result == 'success'))
77134
with:
78-
pattern: wheels*
135+
pattern: wheels*
79136
path: dist
80137
merge-multiple: true
81138

82139
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
83-
if: (github.event_name == 'schedule') && (needs.call-workflow-sdist.result == 'success')
140+
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && (needs.call-workflow-sdist.result == 'success')
84141
with:
85-
pattern: sdist
142+
pattern: sdist
86143
path: dist
87144
merge-multiple: true
88145

89-
- name: Publish onnx-weekly to PyPI
90-
if: (github.event_name == 'schedule') && (github.repository_owner == 'onnx')
91-
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597
146+
- name: Publish devbuild to pypi
147+
if: (github.ref == 'refs/heads/main') && (github.event_name == 'schedule' || github.event.inputs.publish_pypi_onnxweekly == 'yes') && (github.repository_owner == 'onnx')
148+
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc
92149
with:
93-
repository-url: https://pypi.org/legacy/
150+
repository-url: https://upload.pypi.org/legacy/
94151
verbose: true
95152
print-hash: true
96153

97-
98-
test_sdist:
99-
needs: [publish_to_pypi-onnx-weekly]
154+
test_sdist:
155+
needs: [publish_devbuild_to_pypi]
100156
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
101157
uses: ./.github/workflows/release_test_weekly_sdist.yml
102-
with:
103-
os: "macos"
158+
with:
159+
os: "macos"
104160
secrets: inherit
105-
161+
106162

.github/workflows/lint.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
name: Optional Lint
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2727
- name: misspell # Check spellings as well
2828
uses: reviewdog/action-misspell@ef8b22c1cca06c8d306fc6be302c3dab0f6ca12f # v1.23.0
2929
with:
@@ -57,9 +57,9 @@ jobs:
5757
permissions:
5858
security-events: write
5959
steps:
60-
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
60+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6161
- name: Setup Python
62-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
62+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
6363
with:
6464
# Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset.
6565
python-version: "3.10"
@@ -99,7 +99,7 @@ jobs:
9999
# To toggle linter comments in the files page, press `i` on the keyboard
100100
if: always()
101101
continue-on-error: true
102-
uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
102+
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
103103
with:
104104
# Path to SARIF file relative to the root of the repository
105105
sarif_file: lintrunner.sarif

.github/workflows/main.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ jobs:
2828
fail-fast: false
2929
matrix:
3030
os: [ubuntu-24.04, windows-latest, macos-latest]
31-
python_version: ['3.12', '3.11', '3.10', '3.9', '3.8']
32-
include:
31+
python_version: ['3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
32+
include:
33+
- python_version: '3.13'
34+
onnx_ml: 1
35+
debug_build: 1
36+
documentation: 1
37+
protobuf_type: 'Internal'
3338
- python_version: '3.12'
3439
onnx_ml: 1
3540
debug_build: 1
@@ -58,10 +63,10 @@ jobs:
5863
runs-on: ${{ matrix.os }}
5964
steps:
6065
- name: Checkout repository
61-
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
66+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
6267

6368
- name: Set up Python
64-
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
69+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
6570
with:
6671
python-version: ${{ matrix.python_version }}
6772

@@ -70,15 +75,6 @@ jobs:
7075
python --version
7176
cmake --version
7277
73-
# 2024.10.15: This step can be adjusted or even deleted if we decide to use a higher G++ or protobuf version.
74-
# With the current protobuf version, g++13 does not compile due to missing headers
75-
- name: Show versions g++
76-
if: startsWith(matrix.os,'ubuntu')
77-
run: |
78-
sudo apt install g++-11
79-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 12
80-
g++ --version
81-
8278
- name: Install external protobuf - Linux
8379
if: matrix.protobuf_type == 'External' && startsWith(matrix.os,'ubuntu')
8480
run: |
@@ -131,7 +127,7 @@ jobs:
131127
ONNX_BUILD_TESTS: 1
132128
CMAKE_ARGS: "-DONNX_WERROR=ON"
133129

134-
- name: Build and install ONNX - Windows
130+
- name: Build and install ONNX - Windows (setup.py build_ext)
135131
if: matrix.os == 'windows-latest' && matrix.python_version != '3.9' && matrix.python_version != '3.8' && matrix.python_version != '3.12'
136132
run: |
137133
python setup.py build_ext --inplace
@@ -142,7 +138,7 @@ jobs:
142138
ONNX_BUILD_TESTS: 1
143139
CMAKE_ARGS: "-DONNX_WERROR=OFF -DONNX_USE_PROTOBUF_SHARED_LIBS=OFF -DONNX_USE_LITE_PROTO=ON"
144140

145-
- name: Build and install ONNX - Windows
141+
- name: Build and install ONNX - Windows (pip)
146142
if: matrix.os == 'windows-latest' && (matrix.python_version == '3.9' || matrix.python_version == '3.8' || matrix.python_version == '3.12')
147143
run: |
148144
pip install -e . -v
@@ -209,18 +205,22 @@ jobs:
209205
run: |
210206
pip install -r docs/docsgen/source/requirements.txt
211207
cd docs/docsgen && make text
212-
continue-on-error: true
208+
continue-on-error: false
213209

214210
- name: Run Python tests with numpy<2.0 (win, mac)
211+
# Python 3.13 support was added at numpy 2.1.0
215212
if: (matrix.python_version == '3.11' || matrix.python_version == '3.12') && (matrix.os == 'windows-latest' || matrix.os == 'macos-latest')
216213
run: |
217214
pip install "numpy<2.0" pillow
218215
pytest -s
219216
220-
- name: Run Python tests with numpy<2.0 (ubuntu)
221-
if: (matrix.python_version == '3.11' || matrix.python_version == '3.12' ) && startsWith(matrix.os,'ubuntu')
217+
- name: Run Python tests with numpy<2.0 (ubuntu, python<3.13)
218+
# python 3.13 support was added at numpy 2.1.0
219+
if: (matrix.python_version == '3.11' || matrix.python_version == '3.12') && startsWith(matrix.os,'ubuntu')
222220
run: |
223221
# 2024.10.15: Error message: The headers or library files could not be found for jpeg, a required dependency when compiling Pillow from source.
224222
sudo apt-get install libjpeg-dev zlib1g-dev libpng-dev
225223
pip install --prefer-binary "numpy<2.0" pillow
226224
pytest -s
225+
226+

0 commit comments

Comments
 (0)