Skip to content

Commit

Permalink
Add python 3.13 support (#22380)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
snnn authored Oct 15, 2024
1 parent 8159723 commit 4af593a
Show file tree
Hide file tree
Showing 70 changed files with 152 additions and 1,795 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

set -e
set -x
export PATH=/opt/python/cp38-cp38/bin:$PATH
export PATH=/opt/python/cp312-cp312/bin:$PATH

ls /build
ls /build/deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ jobs:

- script: |
set -e -x
rm -rf /tmp/scripts
cp -r tools/ci_build/github/linux/docker/inference/x86_64/python/cpu/scripts /tmp
/tmp/scripts/install_protobuf.sh -p $(Build.BinariesDirectory)/installed -d cmake/deps.txt
python3 tools/ci_build/build.py \
--config Release \
--android \
Expand All @@ -78,7 +75,7 @@ jobs:
--use_qnn \
--qnn_home $(QnnSDKRootDir) \
--cmake_generator=Ninja \
--skip_tests --path_to_protoc_exe $(Build.BinariesDirectory)/installed/bin/protoc
--skip_tests
displayName: Build QNN EP
- script: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ parameters:
variables:
- template: templates/common-variables.yml
- name: docker_base_image
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241010.2
- name: linux_trt_version
value: 10.3.0.26-1.cuda11.8
- name: Repository
Expand Down
6 changes: 2 additions & 4 deletions tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,20 @@ stages:
onnxruntimecpubuildcentos8x64 \
/bin/bash -c '
set -ex; \
python3.9 /onnxruntime_src/tools/ci_build/build.py \
python3.12 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build --cmake_generator 'Ninja' \
--config Debug \
--skip_submodule_sync \
--build_shared_lib \
--parallel --use_binskim_compliant_compile_flags \
--build_csharp \
--enable_onnx_tests --enable_address_sanitizer \
--update --build;
LD_PRELOAD=/usr/lib64/libasan.so.6 python3.9 /onnxruntime_src/tools/ci_build/build.py \
python3.12 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build --cmake_generator 'Ninja' \
--config Debug \
--skip_submodule_sync \
--build_shared_lib \
--parallel --use_binskim_compliant_compile_flags \
--build_csharp \
--enable_onnx_tests --enable_address_sanitizer \
--test;
'
Expand Down
132 changes: 0 additions & 132 deletions tools/ci_build/github/azure-pipelines/linux-cpu-aten-pipeline.yml

This file was deleted.

99 changes: 0 additions & 99 deletions tools/ci_build/github/azure-pipelines/linux-cpu-eager-pipeline.yml

This file was deleted.

19 changes: 10 additions & 9 deletions tools/ci_build/github/azure-pipelines/linux-gpu-ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ parameters:
variables:
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241010.2
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241010.2

- name: Repository
${{ if eq(parameters.CudaVersion, '11.8') }}:
Expand Down Expand Up @@ -175,13 +175,14 @@ stages:
-e NVIDIA_TF32_OVERRIDE=0 \
$(Repository) \
/bin/bash -c '
set -e
nvidia-smi; \
/sbin/ldconfig -N -v $(sed "s/:/ /" <<< $LD_LIBRARY_PATH) 2>/dev/null | grep -E "libcudart.so|libcudnn.so|libnvinfer.so"; \
cat /usr/local/cuda/include/cuda.h | grep -m1 CUDA_VERSION; \
cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -m1 -A 2; \
ln -s /opt/python/cp38-cp38/bin/python3 /tmp/python3; \
/tmp/python3 -m pip install /build/Release/dist/*.whl; \
/tmp/python3 -u -c "from onnxruntime.capi._pybind_state import (OrtDevice as C_OrtDevice) ; \
export PATH=/opt/python/cp312-cp312/bin:$PATH; \
python3 -m pip install /build/Release/dist/*.whl; \
python3 -u -c "from onnxruntime.capi._pybind_state import (OrtDevice as C_OrtDevice) ; \
ort_device = C_OrtDevice(C_OrtDevice.cuda(), C_OrtDevice.default_memory(), 0); \
print(ort_device); print(ort_device.device_type(), C_OrtDevice.cuda()); \
assert(ort_device.device_type()==1); assert(C_OrtDevice.cuda()==1);" \
Expand All @@ -204,13 +205,13 @@ stages:
/bin/bash -c '
set -ex; \
cp /onnxruntime_src/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt /tmp/requirements.txt; \
ln -s /opt/python/cp38-cp38/bin/python3 /tmp/python3; \
/tmp/python3 -m pip install -r /tmp/requirements.txt; \
/tmp/python3 -m pip install /build/Release/dist/*.whl; \
export PATH=/opt/python/cp312-cp312/bin:$PATH; \
python3 -m pip install -r /tmp/requirements.txt; \
python3 -m pip install /build/Release/dist/*.whl; \
cd /build/Release && xargs -a /build/Release/perms.txt chmod a+x; \
cd /onnxruntime_src/java && /onnxruntime_src/java/gradlew cmakeCheck -DcmakeBuildDir=/build/Release -DUSE_CUDA=1; \
cd /tmp; \
/tmp/python3 /onnxruntime_src/tools/ci_build/build.py \
python3 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build --config Release --test --skip_submodule_sync --build_shared_lib --parallel --use_binskim_compliant_compile_flags --build_wheel --enable_onnx_tests \
--enable_transformers_tool_test --use_cuda --cuda_version=${{parameters.CudaVersion}} --cuda_home=/usr/local/cuda --cudnn_home=/usr/local/cuda \
--enable_pybind --build_java --ctest_path "" ; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ parameters:
variables:
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241010.2
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1
value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241010.2
- name: linux_trt_version
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: 10.4.0.26-1.cuda11.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ stages:

- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
versionSpec: '3.12'
addToPath: true
architecture: ${{ parameters.BuildArch }}

Expand Down
Loading

0 comments on commit 4af593a

Please sign in to comment.