-
Notifications
You must be signed in to change notification settings - Fork 4k
win arm64 python packages #27299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
win arm64 python packages #27299
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7299cad
Try fix double nuget package
eserscor a965c0b
Try add ARM packages
eserscor af43c78
.
eserscor b445336
.
eserscor f63cf57
.
eserscor 472a73e
.
eserscor fe366a1
.
eserscor a7789a9
Forgotten file
eserscor ef3e31d
Fix
eserscor 08d87dd
Update
eserscor 36cd99f
Build dir
eserscor 017e3c2
Working directory
eserscor bc0d885
.
eserscor da4ca7e
.
eserscor 21f122a
Apply suggestions from code review
eserscor d5df1b6
Syntax fixes
eserscor bd99d44
Code review comments
eserscor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
175 changes: 175 additions & 0 deletions
175
tools/ci_build/github/azure-pipelines/templates/py-win-cpu.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,175 @@ | ||
| parameters: | ||
| - name: ARCHITECTURE | ||
| type: string | ||
| default: 'x64' | ||
| values: | ||
| - x64 | ||
| - arm64 | ||
|
|
||
| - name: build_py_parameters | ||
| displayName: 'Specify extra build parameters' | ||
| type: string | ||
| default: '--use_azure' | ||
|
|
||
| - name: cmake_build_type | ||
| type: string | ||
| displayName: 'CMake build type for Windows. Only for Windows CPU packages.' | ||
| default: 'RelWithDebInfo' | ||
| values: | ||
| - Debug | ||
| - Release | ||
| - RelWithDebInfo | ||
| - MinSizeRel | ||
|
|
||
| jobs: | ||
| - job: Windows_py_Wheels_${{parameters.ARCHITECTURE}} | ||
| ${{ if eq(parameters.ARCHITECTURE, 'arm64') }}: | ||
| pool: | ||
| name: 'onnxruntime-qnn-windows-vs-2022-arm64' | ||
| os: windows | ||
| hostArchitecture: Arm64 | ||
| demands: | ||
| - Agent.Version -equals 4.264.2 | ||
| ${{ else }}: | ||
| pool: | ||
| name: 'onnxruntime-Win-CPU-VS2022-Latest' | ||
| os: windows | ||
| templateContext: | ||
| sdl: | ||
| codeSignValidation: | ||
| enabled: true | ||
| # TODO: check why pyd file was not signed | ||
| break: false | ||
| additionalTargetsGlobPattern: f|**\*.pyd | ||
| psscriptanalyzer: | ||
| enabled: true | ||
| binskim: | ||
| enabled: true | ||
| scanOutputDirectoryOnly: true | ||
| ${{ if eq(parameters.ARCHITECTURE, 'arm64') }}: | ||
| outputs: | ||
| - output: pipelineArtifact | ||
| targetPath: $(Build.ArtifactStagingDirectory) | ||
| artifactName: onnxruntime-win-$(PythonVersion)-arm64 | ||
| ${{ else }}: | ||
| outputs: | ||
| - output: pipelineArtifact | ||
| targetPath: $(Build.ArtifactStagingDirectory) | ||
| artifactName: onnxruntime-win-$(PythonVersion) | ||
| strategy: | ||
| matrix: | ||
| Python311_${{parameters.ARCHITECTURE}}: | ||
| PythonVersion: '3.11' | ||
| Python312_${{parameters.ARCHITECTURE}}: | ||
| PythonVersion: '3.12' | ||
| Python313_${{parameters.ARCHITECTURE}}: | ||
| PythonVersion: '3.13' | ||
| Python314_${{parameters.ARCHITECTURE}}: | ||
| PythonVersion: '3.14' | ||
| variables: | ||
| OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)' | ||
| ExtraParam: ${{ parameters.build_py_parameters }} | ||
| timeoutInMinutes: 180 | ||
| workspace: | ||
| clean: all | ||
|
|
||
| steps: | ||
| - checkout: self | ||
| clean: true | ||
| submodules: recursive | ||
|
|
||
| - template: setup-build-tools.yml | ||
| parameters: | ||
| host_cpu_arch: ${{parameters.ARCHITECTURE}} | ||
| python_version: $(PythonVersion) | ||
|
|
||
| - template: set-nightly-build-option-variable-step.yml | ||
|
|
||
| - script: python -m pip install -r $(Build.SourcesDirectory)\tools\ci_build\github\windows\python\requirements.txt | ||
| env: | ||
| TMPDIR: "$(Agent.TempDirectory)" | ||
|
|
||
| - task: PythonScript@0 | ||
| displayName: 'Build' | ||
| inputs: | ||
| scriptPath: '$(Build.SourcesDirectory)\tools\ci_build\build.py' | ||
| arguments: > | ||
| --config ${{ parameters.cmake_build_type }} | ||
| --enable_lto | ||
| --build_dir $(Build.SourcesDirectory)\build | ||
| --skip_submodule_sync | ||
| --cmake_generator "Visual Studio 17 2022" | ||
| --enable_pybind | ||
| --enable_onnx_tests --use_vcpkg --use_vcpkg_ms_internal_asset_cache --build | ||
| ${{ parameters.build_py_parameters }} | ||
| --parallel --use_binskim_compliant_compile_flags --update | ||
| $(TelemetryOption) | ||
|
|
||
| # - task: VSBuild@1 | ||
|
eserscor marked this conversation as resolved.
Outdated
|
||
| # displayName: 'Build' | ||
| # inputs: | ||
| # solution: '$(Build.SourcesDirectory)\${{ parameters.cmake_build_type }}\onnxruntime.sln' | ||
| # platform: '${{parameters.ARCHITECTURE}}' | ||
| # configuration: ${{ parameters.cmake_build_type }} | ||
| # msbuildArchitecture: '${{parameters.ARCHITECTURE}}' | ||
| # maximumCpuCount: true | ||
| # logProjectEvents: true | ||
| # workingFolder: '$(Build.SourcesDirectory)\${{ parameters.cmake_build_type }}' | ||
| # createLogFile: true | ||
|
|
||
| - ${{if or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/rel-'))}}: | ||
| - template: publish-symbolrequestprod-api.yml | ||
| parameters: | ||
| ${{if eq(variables['Build.SourceBranch'], 'refs/heads/main')}}: | ||
| symbolExpiryTime: 60 | ||
| includePublicSymbolServer: true | ||
| symbolsArtifactName: onnxruntime_cpu_win_x64_$(PythonVersion) | ||
|
eserscor marked this conversation as resolved.
Outdated
|
||
| symbolsVersion: $(Build.BuildId) | ||
| symbolProject: 'ONNX Runtime' | ||
| subscription: 'OnnxrunTimeCodeSign_20240611' | ||
| searchPattern: | | ||
| $(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}\onnxruntime.pdb | ||
| $(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}\onnxruntime_providers_shared.pdb | ||
| $(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}\onnxruntime_pybind11_state.pdb | ||
|
|
||
| # Esrp signing | ||
| - template: win-esrp-dll.yml | ||
| parameters: | ||
| FolderPath: '$(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}\onnxruntime\capi' | ||
| DisplayName: 'ESRP - Sign Native dlls' | ||
| DoEsrp: true | ||
| Pattern: '*.pyd,*.dll' | ||
|
|
||
| - task: PythonScript@0 | ||
| displayName: 'Build wheel' | ||
| inputs: | ||
| scriptPath: '$(Build.SourcesDirectory)\setup.py' | ||
| arguments: 'bdist_wheel ${{ parameters.build_py_parameters }} $(NightlyBuildOption)' | ||
| workingDirectory: '$(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}' | ||
|
|
||
| - task: CopyFiles@2 | ||
| displayName: 'Copy Python Wheel to: $(Build.ArtifactStagingDirectory)' | ||
| inputs: | ||
| SourceFolder: '$(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}\dist' | ||
| Contents: '*.whl' | ||
| TargetFolder: '$(Build.ArtifactStagingDirectory)' | ||
|
|
||
| - script: | | ||
| 7z x *.whl | ||
| workingDirectory: '$(Build.ArtifactStagingDirectory)' | ||
| displayName: 'unzip the package' | ||
|
|
||
|
|
||
| - powershell: | | ||
| if ("$(PythonVersion)" -notcontains "3.14") { | ||
| python -m pip uninstall -y onnxruntime onnxruntime-gpu -qq | ||
| Get-ChildItem -Path $(Build.ArtifactStagingDirectory)/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname tabulate} | ||
| Remove-Item -Recurse -Force onnxruntime | ||
| if ("$(ExtraParam)" -contains "--use_azure") { | ||
|
eserscor marked this conversation as resolved.
Outdated
|
||
| $env:path="$(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\_deps\vcpkg-src\installed\x64-windows\bin;$(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\_deps\vcpkg-src\installed\x86-windows\bin;$env:path" | ||
|
eserscor marked this conversation as resolved.
Outdated
|
||
| python onnxruntime_test_python_azure.py | ||
| } | ||
| python onnx_backend_test_series.py | ||
| } | ||
| workingDirectory: '$(Build.SourcesDirectory)\build\${{ parameters.cmake_build_type }}\${{ parameters.cmake_build_type }}' | ||
| displayName: 'Run Python Tests' | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.