Skip to content

Commit

Permalink
Replace reference to python 3.8 with python 3.10 (microsoft#22692)
Browse files Browse the repository at this point in the history
### Description
This PR will set default python to 3.10 except
tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml. This is
needed because we are no longer using python 3.8

This PR excludes changes for Big Models CI, because it will require
additional changes. Which will be track in
USER STORY 52729



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
jchen351 authored Nov 8, 2024
1 parent 1936712 commit e7987a6
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
onnxruntimecpubuild \
/opt/python/cp38-cp38/bin/python3.8 /onnxruntime_src/tools/ci_build/build.py \
/opt/python/cp310-cp310/bin/python3.10 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build/2 --cmake_generator Ninja \
--config Debug \
--skip_submodule_sync \
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
onnxruntimecpubuild \
/opt/python/cp38-cp38/bin/python3.8 /onnxruntime_src/tools/ci_build/build.py \
/opt/python/cp310-cp310/bin/python3.10 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build/5 --cmake_generator Ninja \
--config Debug \
--skip_submodule_sync \
Expand All @@ -231,7 +231,7 @@ jobs:
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
onnxruntimecpubuild \
/opt/python/cp38-cp38/bin/python3.8 /onnxruntime_src/tools/ci_build/build.py \
/opt/python/cp310-cp310/bin/python3.10 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build/6a \
--cmake_generator Ninja \
--config MinSizeRel \
Expand All @@ -258,7 +258,7 @@ jobs:
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
onnxruntimecpubuild \
/opt/python/cp38-cp38/bin/python3.8 /onnxruntime_src/tools/ci_build/build.py \
/opt/python/cp310-cp310/bin/python3.10 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build/6b \
--cmake_generator Ninja \
--config MinSizeRel \
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
-e NIGHTLY_BUILD \
-e BUILD_BUILDNUMBER \
onnxruntimecpubuild \
/opt/python/cp38-cp38/bin/python3.8 /onnxruntime_src/tools/ci_build/build.py \
/opt/python/cp310-cp310/bin/python3.10 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build/6c \
--cmake_generator Ninja \
--config MinSizeRel \
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
-e ALLOW_RELEASED_ONNX_OPSET_ONLY=1 \
-e NIGHTLY_BUILD \
onnxruntimecpubuild \
/opt/python/cp38-cp38/bin/python3.8 /onnxruntime_src/tools/ci_build/build.py \
/opt/python/cp310-cp310/bin/python3.10 /onnxruntime_src/tools/ci_build/build.py \
--build_dir /build/7 \
--cmake_generator Ninja \
--config MinSizeRel \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ stages:
-e BUILD_REASON=$(Build.Reason) \
-e BUILD_BRANCH=$(Build.SourceBranch) \
onnxruntimecpubuild \
/opt/python/cp38-cp38/bin/python3 /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_ort_and_check_binary_size.py \
/opt/python/cp310-cp310/bin/python3 /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_ort_and_check_binary_size.py \
--build_dir /build/1a \
${BINARY_SIZE_THRESHOLD_ARGS} \
"/onnxruntime_src/${{ parameters.BuildConfigFile }}"
Expand Down Expand Up @@ -147,7 +147,7 @@ stages:
-e BUILD_REASON=$(Build.Reason) \
-e BUILD_BRANCH=$(Build.SourceBranch) \
onnxruntimecpubuild \
/opt/python/cp38-cp38/bin/python3 /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_ort_and_check_binary_size.py \
/opt/python/cp310-cp310/bin/python3 /onnxruntime_src/tools/ci_build/github/linux/ort_minimal/build_ort_and_check_binary_size.py \
--build_dir /build/1b \
--with_debug_info \
"/onnxruntime_src/${{ parameters.BuildConfigFile }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ jobs:
submodules: none

- task: UsePythonVersion@0
displayName: Use Python 3.11
displayName: Use Python 3.10
inputs:
versionSpec: 3.11
versionSpec: 3.10

- task: NodeTool@0
inputs:
versionSpec: '20.x'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ RUN dnf install -y bash wget &&\

# Install python3
RUN dnf install -y \
python3.8 \
python38-pip \
python38-wheel &&\
python3.10 \
python310-pip \
python310-wheel &&\
cd /usr/local/bin &&\
ln -s /usr/bin/python3 python3.8 &&\
ln -s /usr/bin/pip3 pip3.8;
ln -s /usr/bin/python3 python3.10 &&\
ln -s /usr/bin/pip3 pip3.10;

RUN pip3 install --upgrade pip
RUN pip3 install setuptools>=68.2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG BASEIMAGE=nvidia/cuda:12.5.1-cudnn-devel-ubi8
ARG TRT_VERSION=10.6.0.26-1.cuda12.6
FROM $BASEIMAGE AS base
ARG TRT_VERSION
ENV PATH /opt/python/cp38-cp38/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/src/tensorrt/bin:${PATH}
ENV PATH /opt/python/cp310-cp310/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/src/tensorrt/bin:${PATH}

RUN dnf install -y bash wget &&\
dnf clean dbcache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ echo "installing for os major version : $os_major_version"
dnf install -y glibc-langpack-\*
yum install -y which redhat-lsb-core expat-devel tar unzip zlib-devel make bzip2 bzip2-devel perl-IPC-Cmd openssl-devel wget

# export PATH=/opt/python/cp38-cp38/bin:$PATH

echo "installing rapidjson for AzureEP"
wget https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.tar.gz
tar zxvf v1.1.0.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ echo "installing for os major version : $os_major_version"
dnf install -y glibc-langpack-\*
yum install -y which redhat-lsb-core expat-devel tar unzip zlib-devel make bzip2 bzip2-devel perl-IPC-Cmd openssl-devel wget

# export PATH=/opt/python/cp38-cp38/bin:$PATH

echo "installing rapidjson for AzureEP"
wget https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.tar.gz
tar zxvf v1.1.0.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ echo "installing for os major version : $os_major_version"
dnf install -y glibc-langpack-\*
yum install -y which redhat-lsb-core expat-devel tar unzip zlib-devel make bzip2 bzip2-devel perl-IPC-Cmd openssl-devel wget

# export PATH=/opt/python/cp38-cp38/bin:$PATH

echo "installing rapidjson for AzureEP"
wget https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.tar.gz
tar zxvf v1.1.0.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

BUILD_DIR=${1:?"usage: $0 <build directory>"}

Expand All @@ -26,7 +26,7 @@ python3 /onnxruntime_src/tools/ci_build/build.py \
--build_wheel \
--skip_tests \
--enable_training_ops \
--enable_pybind --cmake_extra_defines PYTHON_INCLUDE_DIR=/opt/python/cp38-cp38/include/python3.8 PYTHON_LIBRARY=/usr/lib64/librt.so \
--enable_pybind --cmake_extra_defines PYTHON_INCLUDE_DIR=/opt/python/cp310-cp310/include/python3.10 PYTHON_LIBRARY=/usr/lib64/librt.so \
--use_nnapi \
--use_coreml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -e
set -x
export PATH=/opt/python/cp38-cp38/bin:$PATH
export PATH=/opt/python/cp310-cp310/bin:$PATH
USAGE_TEXT="Usage:
-b|--build-directory <build directory>
Specifies the build directory. Required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pip3 install --user --upgrade pip
pip3 install --user numpy torch pytest
pip3 install --user /build/Release/dist/*.whl

export PYTHONPATH=/onnxruntime_src/tools:/usr/local/lib/python3.8/site-packages:$PYTHONPATH
export PYTHONPATH=/onnxruntime_src/tools:/usr/local/lib/python3.10/site-packages:$PYTHONPATH

python3 -m pytest -v /onnxruntime_src/tools/test/test_custom_ops_pytorch_exporter.py || exit 1

Expand Down

0 comments on commit e7987a6

Please sign in to comment.