Skip to content

Commit 4af593a

Browse files
authored
Add python 3.13 support (#22380)
1. Add python 3.13 to our python packaging pipelines 2. Because numpy 2.0.0 doesn't support thread free python, this PR also upgrades numpy to the latest 3. Delete some unused files.
1 parent 8159723 commit 4af593a

File tree

70 files changed

+152
-1795
lines changed

Some content is hidden

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

70 files changed

+152
-1795
lines changed

tools/ci_build/github/android/build_aar_and_copy_artifacts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
set -e
88
set -x
9-
export PATH=/opt/python/cp38-cp38/bin:$PATH
9+
export PATH=/opt/python/cp312-cp312/bin:$PATH
1010

1111
ls /build
1212
ls /build/deps

tools/ci_build/github/azure-pipelines/android-arm64-v8a-QNN-crosscompile-ci-pipeline.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ jobs:
6363

6464
- script: |
6565
set -e -x
66-
rm -rf /tmp/scripts
67-
cp -r tools/ci_build/github/linux/docker/inference/x86_64/python/cpu/scripts /tmp
68-
/tmp/scripts/install_protobuf.sh -p $(Build.BinariesDirectory)/installed -d cmake/deps.txt
6966
python3 tools/ci_build/build.py \
7067
--config Release \
7168
--android \
@@ -78,7 +75,7 @@ jobs:
7875
--use_qnn \
7976
--qnn_home $(QnnSDKRootDir) \
8077
--cmake_generator=Ninja \
81-
--skip_tests --path_to_protoc_exe $(Build.BinariesDirectory)/installed/bin/protoc
78+
--skip_tests
8279
displayName: Build QNN EP
8380
8481
- script: |

tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ parameters:
4242
variables:
4343
- template: templates/common-variables.yml
4444
- name: docker_base_image
45-
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1
45+
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241010.2
4646
- name: linux_trt_version
4747
value: 10.3.0.26-1.cuda11.8
4848
- name: Repository

tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,20 @@ stages:
8282
onnxruntimecpubuildcentos8x64 \
8383
/bin/bash -c '
8484
set -ex; \
85-
python3.9 /onnxruntime_src/tools/ci_build/build.py \
85+
python3.12 /onnxruntime_src/tools/ci_build/build.py \
8686
--build_dir /build --cmake_generator 'Ninja' \
8787
--config Debug \
8888
--skip_submodule_sync \
8989
--build_shared_lib \
9090
--parallel --use_binskim_compliant_compile_flags \
91-
--build_csharp \
9291
--enable_onnx_tests --enable_address_sanitizer \
9392
--update --build;
94-
LD_PRELOAD=/usr/lib64/libasan.so.6 python3.9 /onnxruntime_src/tools/ci_build/build.py \
93+
python3.12 /onnxruntime_src/tools/ci_build/build.py \
9594
--build_dir /build --cmake_generator 'Ninja' \
9695
--config Debug \
9796
--skip_submodule_sync \
9897
--build_shared_lib \
9998
--parallel --use_binskim_compliant_compile_flags \
100-
--build_csharp \
10199
--enable_onnx_tests --enable_address_sanitizer \
102100
--test;
103101
'

tools/ci_build/github/azure-pipelines/linux-cpu-aten-pipeline.yml

Lines changed: 0 additions & 132 deletions
This file was deleted.

tools/ci_build/github/azure-pipelines/linux-cpu-eager-pipeline.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ parameters:
4949
variables:
5050
- name: docker_base_image
5151
${{ if eq(parameters.CudaVersion, '11.8') }}:
52-
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1
52+
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241010.2
5353
${{ if eq(parameters.CudaVersion, '12.2') }}:
54-
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1
54+
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241010.2
5555

5656
- name: Repository
5757
${{ if eq(parameters.CudaVersion, '11.8') }}:
@@ -175,13 +175,14 @@ stages:
175175
-e NVIDIA_TF32_OVERRIDE=0 \
176176
$(Repository) \
177177
/bin/bash -c '
178+
set -e
178179
nvidia-smi; \
179180
/sbin/ldconfig -N -v $(sed "s/:/ /" <<< $LD_LIBRARY_PATH) 2>/dev/null | grep -E "libcudart.so|libcudnn.so|libnvinfer.so"; \
180181
cat /usr/local/cuda/include/cuda.h | grep -m1 CUDA_VERSION; \
181182
cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -m1 -A 2; \
182-
ln -s /opt/python/cp38-cp38/bin/python3 /tmp/python3; \
183-
/tmp/python3 -m pip install /build/Release/dist/*.whl; \
184-
/tmp/python3 -u -c "from onnxruntime.capi._pybind_state import (OrtDevice as C_OrtDevice) ; \
183+
export PATH=/opt/python/cp312-cp312/bin:$PATH; \
184+
python3 -m pip install /build/Release/dist/*.whl; \
185+
python3 -u -c "from onnxruntime.capi._pybind_state import (OrtDevice as C_OrtDevice) ; \
185186
ort_device = C_OrtDevice(C_OrtDevice.cuda(), C_OrtDevice.default_memory(), 0); \
186187
print(ort_device); print(ort_device.device_type(), C_OrtDevice.cuda()); \
187188
assert(ort_device.device_type()==1); assert(C_OrtDevice.cuda()==1);" \
@@ -204,13 +205,13 @@ stages:
204205
/bin/bash -c '
205206
set -ex; \
206207
cp /onnxruntime_src/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt /tmp/requirements.txt; \
207-
ln -s /opt/python/cp38-cp38/bin/python3 /tmp/python3; \
208-
/tmp/python3 -m pip install -r /tmp/requirements.txt; \
209-
/tmp/python3 -m pip install /build/Release/dist/*.whl; \
208+
export PATH=/opt/python/cp312-cp312/bin:$PATH; \
209+
python3 -m pip install -r /tmp/requirements.txt; \
210+
python3 -m pip install /build/Release/dist/*.whl; \
210211
cd /build/Release && xargs -a /build/Release/perms.txt chmod a+x; \
211212
cd /onnxruntime_src/java && /onnxruntime_src/java/gradlew cmakeCheck -DcmakeBuildDir=/build/Release -DUSE_CUDA=1; \
212213
cd /tmp; \
213-
/tmp/python3 /onnxruntime_src/tools/ci_build/build.py \
214+
python3 /onnxruntime_src/tools/ci_build/build.py \
214215
--build_dir /build --config Release --test --skip_submodule_sync --build_shared_lib --parallel --use_binskim_compliant_compile_flags --build_wheel --enable_onnx_tests \
215216
--enable_transformers_tool_test --use_cuda --cuda_version=${{parameters.CudaVersion}} --cuda_home=/usr/local/cuda --cudnn_home=/usr/local/cuda \
216217
--enable_pybind --build_java --ctest_path "" ; \

tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ parameters:
3939
variables:
4040
- name: docker_base_image
4141
${{ if eq(parameters.CudaVersion, '11.8') }}:
42-
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1
42+
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241010.2
4343
${{ if eq(parameters.CudaVersion, '12.2') }}:
44-
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1
44+
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241010.2
4545
- name: linux_trt_version
4646
${{ if eq(parameters.CudaVersion, '11.8') }}:
4747
value: 10.4.0.26-1.cuda11.8

tools/ci_build/github/azure-pipelines/nuget/templates/dml-vs-2022.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ stages:
8585

8686
- task: UsePythonVersion@0
8787
inputs:
88-
versionSpec: '3.8'
88+
versionSpec: '3.12'
8989
addToPath: true
9090
architecture: ${{ parameters.BuildArch }}
9191

0 commit comments

Comments
 (0)