Skip to content

Commit 32fa490

Browse files
authored
Nightly python packages for python 3.14 (#26397)
Update python packaging pipeline to support python 3.14. This is to add python 3.14 wheels to both CUDA 12 and CUDA 13 nightly packaging pipelines. The CUDA 13 pipelines were added in #26420. For linux, two wheels are added for python 3.14 and 3.14t. For Windows, a wheel is added for pyhthon 3.14. Known issues: 1. onnx does not have prebuild package for python 3.14, which causes some pipelines failed. 2. onnxscript and onnx-ir depends on onnx. 3. The CI machine for Windows cuda python packaging has cuda driver 553.24, which does not support CUDA 13.0. TODO: Update cuda driver to 580 or later to test properly. Walkarounds for issues 1 and 2: * For python 3.14, we skip onnx, onnxscript and onnx-ir in requirements.txt. * Disable related tests. When onnx package supports python 3.14 in the future, we can undo the walkarounds and re-enable those tests.
1 parent 36a753d commit 32fa490

29 files changed

+128
-90
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,10 @@ def finalize_options(self):
598598
"Topic :: Software Development :: Libraries :: Python Modules",
599599
"Programming Language :: Python",
600600
"Programming Language :: Python :: 3 :: Only",
601-
"Programming Language :: Python :: 3.10",
602601
"Programming Language :: Python :: 3.11",
603602
"Programming Language :: Python :: 3.12",
604603
"Programming Language :: Python :: 3.13",
604+
"Programming Language :: Python :: 3.14",
605605
]
606606

607607
if enable_training or enable_training_apis:

tools/ci_build/build.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,13 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs):
18431843
run_subprocess(
18441844
[sys.executable, "-m", "unittest", "discover", "-s", "quantization"], cwd=cwd, dll_path=dll_path
18451845
)
1846-
if args.enable_transformers_tool_test:
1846+
1847+
# onnx package does not support python 3.14 yet so skip the transformers tests for python 3.14.
1848+
# we can remove this check when onnx package supports python 3.14.
1849+
if args.enable_transformers_tool_test and (sys.version_info.major, sys.version_info.minor) < (
1850+
3,
1851+
14,
1852+
):
18471853
import google.protobuf # noqa: PLC0415
18481854
import numpy # noqa: PLC0415
18491855

tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ stages:
4444
displayName: 'Download Pipeline Artifact - Win GPU 3.13'
4545
artifact: 'win_gpu_wheel_3.13'
4646
patterns: '*.whl'
47-
47+
- download: build
48+
displayName: 'Download Pipeline Artifact - Win GPU 3.14'
49+
artifact: 'win_gpu_wheel_3.14'
50+
patterns: '*.whl'
4851
- script: find $(Pipeline.Workspace) -name \*win_amd64.whl -exec mv {} $(Pipeline.Workspace)/build/onnxruntime_gpu \;
4952
displayName: 'Merge files together'
5053

tools/ci_build/github/azure-pipelines/py-dml-packaging-pipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,10 @@ extends:
5656
EP_BUILD_FLAGS: --use_dml
5757
EP_NAME: directml
5858
cmake_build_type: ${{ parameters.cmake_build_type }}
59+
- template: stages/py-win-gpu-stage.yml
60+
parameters:
61+
MACHINE_POOL: 'onnxruntime-Win2022-GPU-dml-A10'
62+
PYTHON_VERSION: '3.14'
63+
EP_BUILD_FLAGS: --use_dml
64+
EP_NAME: directml
65+
cmake_build_type: ${{ parameters.cmake_build_type }}

tools/ci_build/github/azure-pipelines/stages/py-cpu-packaging-stage.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ stages:
9494
PythonVersion: '3.12'
9595
Python313_x64:
9696
PythonVersion: '3.13'
97+
Python314_x64:
98+
PythonVersion: '3.14'
9799
variables:
98100
OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)'
99101
ExtraParam: ${{ parameters.build_py_parameters }}
@@ -138,7 +140,7 @@ stages:
138140
parameters:
139141
${{if eq(variables['Build.SourceBranch'], 'refs/heads/main')}}:
140142
symbolExpiryTime: 60
141-
includePublicSymbolServer: true
143+
includePublicSymbolServer: true
142144
symbolsArtifactName: onnxruntime_cpu_win_x64_$(PythonVersion)
143145
symbolsVersion: $(Build.BuildId)
144146
symbolProject: 'ONNX Runtime'
@@ -204,14 +206,21 @@ stages:
204206
extra_build_arg: ${{ parameters.build_py_parameters }}
205207
cmake_build_type: ${{ parameters.cmake_build_type }}
206208
python_version: '3.12'
207-
209+
208210
- template: ../templates/py-macos.yml
209211
parameters:
210212
arch: 'arm64'
211213
extra_build_arg: ${{ parameters.build_py_parameters }}
212214
cmake_build_type: ${{ parameters.cmake_build_type }}
213215
python_version: '3.13'
214216

217+
- template: ../templates/py-macos.yml
218+
parameters:
219+
arch: 'arm64'
220+
extra_build_arg: ${{ parameters.build_py_parameters }}
221+
cmake_build_type: ${{ parameters.cmake_build_type }}
222+
python_version: '3.14'
223+
215224
- ${{ if eq(parameters.enable_linux_arm, true) }}:
216225
- stage: Python_Packaging_Linux_ARM
217226
dependsOn: []

tools/ci_build/github/azure-pipelines/stages/py-gpu-packaging-stage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ parameters:
3535
- '3.11'
3636
- '3.12'
3737
- '3.13'
38+
- '3.14'
3839

3940
stages:
4041
- ${{ if eq(parameters.cuda_version, '12.8') }}:

tools/ci_build/github/azure-pipelines/stages/py-linux-gpu-stage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ stages:
5050
variables:
5151
- name: extra_build_args
5252
${{ if ne(parameters.extra_build_arg, '') }}:
53-
value: -x ${{ parameters.extra_build_arg }}
53+
value: '-x "${{ parameters.extra_build_arg }}"'
5454
${{ if eq(parameters.extra_build_arg, '') }}:
5555
value: ''
5656
- template: ../templates/common-variables.yml

tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ stages:
175175
176176
- stage: Win_py_${{ parameters.EP_NAME }}_Wheels_${{ replace(parameters.PYTHON_VERSION,'.','_') }}_Tests
177177
dependsOn: Win_py_${{ parameters.EP_NAME }}_Wheels_${{ replace(parameters.PYTHON_VERSION,'.','_') }}_Build
178+
# Skip this stage for Python 3.14 for now until onnx package support python 3.14.
179+
condition: and(succeeded(), ne('${{ parameters.PYTHON_VERSION }}', '3.14'))
178180
jobs:
179181
- job: Win_py_${{ parameters.EP_NAME }}_Wheels_${{ replace(parameters.PYTHON_VERSION,'.','_') }}_Tests
180182
workspace:
@@ -223,6 +225,8 @@ stages:
223225
Copy-Item -Path $(Build.sourcesDirectory)/onnxruntime/test/python/onnx_backend_test_series.py -Destination $(Agent.TempDirectory)\ort_test_data
224226
Copy-Item -Recurse -Path $(Build.sourcesDirectory)/onnxruntime/test/testdata -Destination $(Agent.TempDirectory)\ort_test_data
225227
cd $(Agent.TempDirectory)\ort_test_data
228+
python -m pip install psutil py-cpuinfo py3nvml
229+
python -c "import onnxruntime; onnxruntime.print_debug_info()"
226230
python onnx_backend_test_series.py
227231
workingDirectory: '$(Build.sourcesDirectory)'
228232
displayName: 'Run Python Tests'

tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ steps:
2727
set AZCOPY_AUTO_LOGIN_TYPE=AZCLI
2828
azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.CudaVersion }} $(Agent.TempDirectory)
2929
30+
# Since CUDA 13.0, CUDA DLLs are in bin\x64 folder instead of bin folder for Windows.
3031
- powershell: |
31-
Write-Host "##vso[task.prependpath]$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}\bin;$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}\extras\CUPTI\lib64"
32+
Write-Host "##vso[task.prependpath]$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}\bin;$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}\bin\x64;$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}\extras\CUPTI\lib64"
3233
displayName: 'Append CUDA SDK Directory to PATH'
3334
3435
- task: CmdLine@2

tools/ci_build/github/azure-pipelines/templates/py-linux-qnn.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ parameters:
2727
displayName: QNN SDK version
2828
type: string
2929
default: 2.39.0.250926
30-
30+
3131
- name: is1ES
3232
displayName: 'Whether the pipeline is running in 1ES'
3333
type: boolean
@@ -50,7 +50,7 @@ jobs:
5050
variables:
5151
- name: extra_build_args
5252
${{ if ne(parameters.extra_build_arg, '') }}:
53-
value: -x ${{ parameters.extra_build_arg }}
53+
value: '-x "${{ parameters.extra_build_arg }}"'
5454
${{ if eq(parameters.extra_build_arg, '') }}:
5555
value: ''
5656
steps:
@@ -79,4 +79,3 @@ jobs:
7979
arguments: -i onnxruntimecpubuildpythonx86_64_qnn -d "${{ parameters.device }}" -c ${{ parameters.cmake_build_type }} $(extra_build_args)
8080
env:
8181
ADDITIONAL_DOCKER_PARAMETER: "--volume $(QnnSDKRootDir):/qnn_sdk"
82-

0 commit comments

Comments
 (0)