Skip to content
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

Adding python3.12 support to ORT #18814

Merged
merged 20 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ def finalize_options(self):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ stages:
PythonVersion: '3.10'
Python311:
PythonVersion: '3.11'
Python312:
PythonVersion: '3.12'

steps:
- checkout: self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ stages:
EP_NAME: gpu
CudaVersion: ${{ parameters.cuda_version }}

- template: ../templates/py-win-gpu.yml
parameters:
MACHINE_POOL: 'onnxruntime-Win2022-GPU-T4'
PYTHON_VERSION: '3.12'
EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home=${{ variables.win_trt_home }} --cuda_home=${{ variables.win_cuda_home }} --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
EP_NAME: gpu
CudaVersion: ${{ parameters.cuda_version }}


- ${{ if eq(parameters.enable_linux_gpu, true) }}:
- template: ../templates/py-linux-gpu.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
PythonVersion: '3.10'
Python311:
PythonVersion: '3.11'
Python312:
PythonVersion: '3.12'
steps:
- checkout: none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ stages:
PythonVersion: '3.11'
MsbuildPlatform: x64
buildArch: x64
Python312_x64:
PythonVersion: '3.12'
MsbuildPlatform: x64
buildArch: x64
# Training build cannot support Win32 for now because one or more of its python
# dependencies does not support Win32. So, don't build a training package for Win32
${{ if not(contains(parameters.build_py_parameters, '--enable_training')) }}:
Expand All @@ -96,6 +100,10 @@ stages:
PythonVersion: '3.11'
MsbuildPlatform: Win32
buildArch: x86
Python312_x86:
PythonVersion: '3.12'
MsbuildPlatform: Win32
buildArch: x86
variables:
OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)'
EnvSetupScript: setup_env.bat
Expand Down Expand Up @@ -295,6 +303,14 @@ stages:
ENV_SETUP_SCRIPT: setup_env_gpu.bat
EP_NAME: gpu

- template: py-win-gpu.yml
parameters:
MACHINE_POOL: 'onnxruntime-Win2022-GPU-T4'
PYTHON_VERSION: '3.12'
EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home="C:\local\TensorRT-8.6.1.6.Windows10.x86_64.cuda-11.8" --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
ENV_SETUP_SCRIPT: setup_env_gpu.bat
EP_NAME: gpu

- template: py-win-gpu.yml
parameters:
MACHINE_POOL: 'onnxruntime-Win2022-GPU-dml-A10'
Expand Down Expand Up @@ -327,6 +343,14 @@ stages:
ENV_SETUP_SCRIPT: setup_env.bat
EP_NAME: directml

- template: py-win-gpu.yml
parameters:
MACHINE_POOL: 'onnxruntime-Win2022-GPU-dml-A10'
PYTHON_VERSION: '3.12'
EP_BUILD_FLAGS: --use_dml --cmake_extra_defines CMAKE_SYSTEM_VERSION=10.0.18362.0 --enable_wcos
ENV_SETUP_SCRIPT: setup_env.bat
EP_NAME: directml

- ${{ if eq(parameters.enable_mac_cpu, true) }}:
- job: MacOS_py_Wheels
timeoutInMinutes: 180
Expand All @@ -346,6 +370,8 @@ stages:
PythonVersion: '3.10'
Python311:
PythonVersion: '3.11'
Python312:
PythonVersion: '3.12'
steps:
- checkout: self
clean: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ stages:
OpsetVersion: ${{ parameters.opset_version }}
CudaVersion: ${{ parameters.cuda_version }}
UploadWheel: ${{ parameters.upload_wheel }}
Python312:
PythonVersion: '3.12'
TorchVersion: ${{ parameters.torch_version }}
OpsetVersion: ${{ parameters.opset_version }}
CudaVersion: ${{ parameters.cuda_version }}
UploadWheel: ${{ parameters.upload_wheel }}

steps:
- task: CmdLine@2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ steps:
variables = {
"PythonManylinuxDir": "/opt/python/cp311-cp311"
}
elif version == "3.12":
variables = {
"PythonManylinuxDir": "/opt/python/cp312-cp312"
}
else:
raise ValueError("Unsupported Python version: '{}'".format(version))

Expand Down
2 changes: 1 addition & 1 deletion tools/ci_build/github/linux/build_linux_python_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

# Put 3.8 at the last because Ubuntu 20.04 use python 3.8 and we will upload the intermediate build files of this
# config to Azure DevOps Artifacts and download them to a Ubuntu 20.04 machine to run the tests.
PYTHON_EXES=("/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11" "/opt/python/cp38-cp38/bin/python3.8")
PYTHON_EXES=("/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11" "/opt/python/cp312-cp312/bin/python3.12" "/opt/python/cp38-cp38/bin/python3.8")
while getopts "d:p:x:c:" parameter_Option
do case "${parameter_Option}"
in
#GPU or CPU.
d) BUILD_DEVICE=${OPTARG};;
p) PYTHON_EXES=${OPTARG};;

Check warning on line 18 in tools/ci_build/github/linux/build_linux_python_package.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/build_linux_python_package.sh#L18 <ShellCheck.SC2178>

Variable was used as an array but is now assigned a string.
Raw output
./tools/ci_build/github/linux/build_linux_python_package.sh:18:4: warning: Variable was used as an array but is now assigned a string. (ShellCheck.SC2178)
x) EXTRA_ARG=${OPTARG};;
c) BUILD_CONFIG=${OPTARG};;
*) echo "Usage: $0 -d <GPU|CPU> [-p <python_exe_path>] [-x <extra_build_arg>] [-c <build_config>]"
Expand Down Expand Up @@ -62,7 +62,7 @@
fi

if [ "$BUILD_DEVICE" == "GPU" ]; then
SHORT_CUDA_VERSION=$(echo $CUDA_VERSION | sed 's/\([[:digit:]]\+\.[[:digit:]]\+\)\.[[:digit:]]\+/\1/')

Check notice on line 65 in tools/ci_build/github/linux/build_linux_python_package.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/build_linux_python_package.sh#L65 <ShellCheck.SC2001>

See if you can use ${variable//search/replace} instead.
Raw output
./tools/ci_build/github/linux/build_linux_python_package.sh:65:26: info: See if you can use ${variable//search/replace} instead. (ShellCheck.SC2001)

Check notice on line 65 in tools/ci_build/github/linux/build_linux_python_package.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/build_linux_python_package.sh#L65 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/build_linux_python_package.sh:65:31: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
#Enable CUDA and TRT EPs.
BUILD_ARGS+=("--nvcc_threads=1" "--use_cuda" "--use_tensorrt" "--cuda_version=$SHORT_CUDA_VERSION" "--tensorrt_home=/usr" "--cuda_home=/usr/local/cuda-$SHORT_CUDA_VERSION" "--cudnn_home=/usr/local/cuda-$SHORT_CUDA_VERSION" "--cmake_extra_defines" "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80")
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ FROM build_cpython AS build_cpython311
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2

FROM build_cpython AS build_cpython312
COPY build_scripts/cpython-pubkey-312-313.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.12.1

FROM build_cpython AS all_python
COPY build_scripts/install-pypy.sh \
build_scripts/pypy.sha256 \
Expand All @@ -127,6 +131,7 @@ COPY --from=build_cpython38 /opt/_internal /opt/_internal/
COPY --from=build_cpython39 /opt/_internal /opt/_internal/
COPY --from=build_cpython310 /opt/_internal /opt/_internal/
COPY --from=build_cpython311 /opt/_internal /opt/_internal/
COPY --from=build_cpython312 /opt/_internal /opt/_internal/
RUN manylinux-entrypoint /build_scripts/finalize-python.sh


Expand All @@ -140,6 +145,7 @@ COPY build_scripts/finalize.sh \
build_scripts/requirements3.9.txt \
build_scripts/requirements3.10.txt \
build_scripts/requirements3.11.txt \
build_scripts/requirements3.12.txt \
build_scripts/requirements-base-tools.txt \
/build_scripts/
COPY build_scripts/requirements-tools/* /build_scripts/requirements-tools/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ FROM build_cpython AS build_cpython311
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2

FROM build_cpython AS build_cpython312
COPY build_scripts/cpython-pubkey-312-313.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.12.1

FROM build_cpython AS all_python
COPY build_scripts/install-pypy.sh \
build_scripts/pypy.sha256 \
Expand All @@ -131,6 +135,7 @@ COPY --from=build_cpython38 /opt/_internal /opt/_internal/
COPY --from=build_cpython39 /opt/_internal /opt/_internal/
COPY --from=build_cpython310 /opt/_internal /opt/_internal/
COPY --from=build_cpython311 /opt/_internal /opt/_internal/
COPY --from=build_cpython312 /opt/_internal /opt/_internal/
RUN manylinux-entrypoint /build_scripts/finalize-python.sh

FROM runtime_base
Expand All @@ -143,6 +148,7 @@ COPY build_scripts/finalize.sh \
build_scripts/requirements3.9.txt \
build_scripts/requirements3.10.txt \
build_scripts/requirements3.11.txt \
build_scripts/requirements3.12.txt \
build_scripts/requirements-base-tools.txt \
/build_scripts/
COPY build_scripts/requirements-tools/* /build_scripts/requirements-tools/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ FROM build_cpython AS build_cpython311
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2

FROM build_cpython AS build_cpython312
COPY build_scripts/cpython-pubkey-312-313.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.12.1


FROM build_cpython AS all_python
COPY build_scripts/install-pypy.sh \
Expand All @@ -147,6 +151,7 @@ COPY --from=build_cpython38 /opt/_internal /opt/_internal/
COPY --from=build_cpython39 /opt/_internal /opt/_internal/
COPY --from=build_cpython310 /opt/_internal /opt/_internal/
COPY --from=build_cpython311 /opt/_internal /opt/_internal/
COPY --from=build_cpython312 /opt/_internal /opt/_internal/
RUN manylinux-entrypoint /build_scripts/finalize-python.sh


Expand All @@ -160,6 +165,7 @@ COPY build_scripts/finalize.sh \
build_scripts/requirements3.9.txt \
build_scripts/requirements3.10.txt \
build_scripts/requirements3.11.txt \
build_scripts/requirements3.12.txt \
build_scripts/requirements-base-tools.txt \
/build_scripts/
COPY build_scripts/requirements-tools/* /build_scripts/requirements-tools/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ FROM build_cpython AS build_cpython311
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2

FROM build_cpython AS build_cpython312
COPY build_scripts/cpython-pubkey-312-313.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.12.1

FROM build_cpython AS all_python
COPY build_scripts/install-pypy.sh \
build_scripts/pypy.sha256 \
Expand All @@ -130,6 +134,7 @@ COPY --from=build_cpython38 /opt/_internal /opt/_internal/
COPY --from=build_cpython39 /opt/_internal /opt/_internal/
COPY --from=build_cpython310 /opt/_internal /opt/_internal/
COPY --from=build_cpython311 /opt/_internal /opt/_internal/
COPY --from=build_cpython312 /opt/_internal /opt/_internal/
RUN manylinux-entrypoint /build_scripts/finalize-python.sh


Expand All @@ -143,6 +148,7 @@ COPY build_scripts/finalize.sh \
build_scripts/requirements3.9.txt \
build_scripts/requirements3.10.txt \
build_scripts/requirements3.11.txt \
build_scripts/requirements3.12.txt \
build_scripts/requirements-base-tools.txt \
/build_scripts/
COPY build_scripts/requirements-tools/* /build_scripts/requirements-tools/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ FROM build_cpython AS build_cpython311
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2

FROM build_cpython AS build_cpython312
COPY build_scripts/cpython-pubkey-312-313.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.12.1

FROM build_cpython AS all_python
COPY build_scripts/install-pypy.sh \
build_scripts/pypy.sha256 \
Expand All @@ -130,6 +134,7 @@ COPY --from=build_cpython38 /opt/_internal /opt/_internal/
COPY --from=build_cpython39 /opt/_internal /opt/_internal/
COPY --from=build_cpython310 /opt/_internal /opt/_internal/
COPY --from=build_cpython311 /opt/_internal /opt/_internal/
COPY --from=build_cpython312 /opt/_internal /opt/_internal/
RUN manylinux-entrypoint /build_scripts/finalize-python.sh


Expand All @@ -143,6 +148,7 @@ COPY build_scripts/finalize.sh \
build_scripts/requirements3.9.txt \
build_scripts/requirements3.10.txt \
build_scripts/requirements3.11.txt \
build_scripts/requirements3.12.txt \
build_scripts/requirements-base-tools.txt \
/build_scripts/
COPY build_scripts/requirements-tools/* /build_scripts/requirements-tools/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ FROM build_cpython AS build_cpython311
COPY build_scripts/cpython-pubkey-310-311.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.11.2

FROM build_cpython AS build_cpython312
COPY build_scripts/cpython-pubkey-312-313.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.12.1

FROM build_cpython AS all_python
COPY build_scripts/finalize-python.sh \
/build_scripts/
Expand All @@ -122,6 +126,7 @@ COPY --from=build_cpython38 /opt/_internal /opt/_internal/
COPY --from=build_cpython39 /opt/_internal /opt/_internal/
COPY --from=build_cpython310 /opt/_internal /opt/_internal/
COPY --from=build_cpython311 /opt/_internal /opt/_internal/
COPY --from=build_cpython312 /opt/_internal /opt/_internal/
RUN manylinux-entrypoint /build_scripts/finalize-python.sh


Expand All @@ -135,6 +140,7 @@ COPY build_scripts/finalize.sh \
build_scripts/requirements3.9.txt \
build_scripts/requirements3.10.txt \
build_scripts/requirements3.11.txt \
build_scripts/requirements3.12.txt \
build_scripts/requirements-base-tools.txt \
/build_scripts/
COPY build_scripts/requirements-tools/* /build_scripts/requirements-tools/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
set -e -x
pushd .
PYTHON_EXES=("/opt/python/cp38-cp38/bin/python3.8" "/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11")
PYTHON_EXES=("/opt/python/cp38-cp38/bin/python3.8" "/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11" "/opt/python/cp312-cp312/bin/python3.12")
CURRENT_DIR=$(pwd)
if ! [ -x "$(command -v protoc)" ]; then
$CURRENT_DIR/install_protobuf.sh

Check notice on line 7 in tools/ci_build/github/linux/docker/inference/x64/python/cpu/scripts/install_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/inference/x64/python/cpu/scripts/install_deps.sh#L7 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/inference/x64/python/cpu/scripts/install_deps.sh:7:3: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
fi
popd
export ONNX_ML=1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
numpy==1.21.6 ; python_version < '3.11'
numpy==1.24.2 ; python_version >= '3.11'
numpy==1.24.2 ; python_version == '3.11'
numpy==1.26.0 ; python_version >= '3.12'
mypy
pytest
setuptools>=68.2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
USE_CONDA=false

while getopts p:h:d:v:tmurc parameter_Option
do case "${parameter_Option}"

Check warning on line 13 in tools/ci_build/github/linux/docker/scripts/install_python_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/install_python_deps.sh#L13 <ShellCheck.SC2220>

Invalid flags are not handled. Add a *) case.
Raw output
./tools/ci_build/github/linux/docker/scripts/install_python_deps.sh:13:4: warning: Invalid flags are not handled. Add a *) case. (ShellCheck.SC2220)
in
p) PYTHON_VER=${OPTARG};;
h) TORCH_VERSION=${OPTARG};;
d) DEVICE_TYPE=${OPTARG};;
v) CU_VER=${OPTARG};;
t) INSTALL_DEPS_TRAINING=true;;
m) INSTALL_DEPS_DISTRIBUTED_SETUP=true;;

Check warning on line 20 in tools/ci_build/github/linux/docker/scripts/install_python_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/install_python_deps.sh#L20 <ShellCheck.SC2034>

INSTALL_DEPS_DISTRIBUTED_SETUP appears unused. Verify use (or export if used externally).
Raw output
./tools/ci_build/github/linux/docker/scripts/install_python_deps.sh:20:4: warning: INSTALL_DEPS_DISTRIBUTED_SETUP appears unused. Verify use (or export if used externally). (ShellCheck.SC2034)
u) ORTMODULE_BUILD=true;;
r) TARGET_ROCM=true;;
c) USE_CONDA=true;;
Expand Down Expand Up @@ -46,23 +46,25 @@
PYTHON_EXE="/opt/python/cp310-cp310/bin/python3.10"
elif [[ "$PYTHON_VER" = "3.11" && -d "/opt/python/cp311-cp311" ]]; then
PYTHON_EXE="/opt/python/cp311-cp311/bin/python3.11"
elif [[ "$PYTHON_VER" = "3.12" && -d "/opt/python/cp312-cp312" ]]; then
PYTHON_EXE="/opt/python/cp312-cp312/bin/python3.12"
else
PYTHON_EXE="/usr/bin/python${PYTHON_VER}"
fi

export ONNX_ML=1
export CMAKE_ARGS="-DONNX_GEN_PB_TYPE_STUBS=OFF -DONNX_WERROR=OFF"
${PYTHON_EXE} -m pip install -r ${0/%install_python_deps\.sh/requirements\.txt}

Check notice on line 57 in tools/ci_build/github/linux/docker/scripts/install_python_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/install_python_deps.sh#L57 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/install_python_deps.sh:57:33: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
if [ $DEVICE_TYPE = "gpu" ]; then

Check notice on line 58 in tools/ci_build/github/linux/docker/scripts/install_python_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/install_python_deps.sh#L58 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/install_python_deps.sh:58:6: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
if [[ $INSTALL_DEPS_TRAINING = true ]]; then
if [[ $ORTMODULE_BUILD = false ]]; then
${PYTHON_EXE} -m pip install -r ${0/%install_python_deps.sh/training\/requirements.txt}

Check notice on line 61 in tools/ci_build/github/linux/docker/scripts/install_python_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/install_python_deps.sh#L61 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/install_python_deps.sh:61:39: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
else
if [[ $TARGET_ROCM = false ]]; then
${PYTHON_EXE} -m pip install -r ${0/%install_python_deps.sh/training\/ortmodule\/stage1\/requirements_torch${TORCH_VERSION}_cu${CU_VER}\/requirements.txt}

Check notice on line 64 in tools/ci_build/github/linux/docker/scripts/install_python_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/install_python_deps.sh#L64 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/install_python_deps.sh:64:41: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
${PYTHON_EXE} -m pip install -r ${0/%install_python_deps.sh/training\/ortmodule\/stage2\/requirements.txt}

Check notice on line 65 in tools/ci_build/github/linux/docker/scripts/install_python_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/install_python_deps.sh#L65 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/install_python_deps.sh:65:41: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
else
${PYTHON_EXE} -m pip install -r ${0/%install_python_deps.sh/training\/ortmodule\/stage1\/requirements_rocm\/requirements.txt}

Check notice on line 67 in tools/ci_build/github/linux/docker/scripts/install_python_deps.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/install_python_deps.sh#L67 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/install_python_deps.sh:67:41: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
fi
fi
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PARENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." &> /dev/null && pwd)"
source "$PARENT_DIR/install_dotnet.sh"

if [ ! -d "/opt/conda/bin" ]; then
PYTHON_EXES=("/opt/python/cp38-cp38/bin/python3.8" "/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11")
PYTHON_EXES=("/opt/python/cp38-cp38/bin/python3.8" "/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11" "/opt/python/cp312-cp312/bin/python3.12")
else
PYTHON_EXES=("/opt/conda/bin/python")
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
graphviz

if [ ! -d "/opt/conda/bin" ]; then
PYTHON_EXES=("/opt/python/cp38-cp38/bin/python3.8" "/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11")
PYTHON_EXES=("/opt/python/cp38-cp38/bin/python3.8" "/opt/python/cp39-cp39/bin/python3.9" "/opt/python/cp310-cp310/bin/python3.10" "/opt/python/cp311-cp311/bin/python3.11" "/opt/python/cp312-cp312/bin/python3.12")
else
PYTHON_EXES=("/opt/conda/bin/python")
fi

os_major_version=$(tr -dc '0-9.' < /etc/redhat-release |cut -d \. -f1)

Check warning on line 14 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L14 <ShellCheck.SC2034>

os_major_version appears unused. Verify use (or export if used externally).
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:14:1: warning: os_major_version appears unused. Verify use (or export if used externally). (ShellCheck.SC2034)

SYS_LONG_BIT=$(getconf LONG_BIT)
mkdir -p /tmp/src
GLIBC_VERSION=$(getconf GNU_LIBC_VERSION | cut -f 2 -d \.)

Check warning on line 18 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L18 <ShellCheck.SC2034>

GLIBC_VERSION appears unused. Verify use (or export if used externally).
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:18:1: warning: GLIBC_VERSION appears unused. Verify use (or export if used externally). (ShellCheck.SC2034)

DISTRIBUTOR=$(lsb_release -i -s)

if [[ ("$DISTRIBUTOR" = "CentOS" || "$DISTRIBUTOR" = "RedHatEnterprise") && $SYS_LONG_BIT = "64" ]]; then
LIBDIR="lib64"
else
LIBDIR="lib"

Check warning on line 25 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L25 <ShellCheck.SC2034>

LIBDIR appears unused. Verify use (or export if used externally).
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:25:3: warning: LIBDIR appears unused. Verify use (or export if used externally). (ShellCheck.SC2034)
fi

cd /tmp/src
source $(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/install_shared_deps.sh

Check warning on line 29 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L29 <ShellCheck.SC2046>

Quote this to prevent word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:29:8: warning: Quote this to prevent word splitting. (ShellCheck.SC2046)

Check notice on line 29 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L29 <ShellCheck.SC1091>

Not following: ./install_shared_deps.sh: openBinaryFile: does not exist (No such file or directory)
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:29:8: info: Not following: ./install_shared_deps.sh: openBinaryFile: does not exist (No such file or directory) (ShellCheck.SC1091)

cd /tmp/src

if ! [ -x "$(command -v protoc)" ]; then
source ${0/%install_deps_eager\.sh/..\/install_protobuf.sh}

Check warning on line 34 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L34 <ShellCheck.SC1090>

ShellCheck can't follow non-constant source. Use a directive to specify location.
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:34:10: warning: ShellCheck can't follow non-constant source. Use a directive to specify location. (ShellCheck.SC1090)

Check notice on line 34 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L34 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:34:10: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
fi

export ONNX_ML=1
Expand All @@ -39,8 +39,8 @@

for PYTHON_EXE in "${PYTHON_EXES[@]}"
do
${PYTHON_EXE} -m pip install -r ${0/%install_deps_eager\.sh/requirements\.txt}

Check notice on line 42 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L42 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:42:35: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
${PYTHON_EXE} -m pip install -r ${0/%install_deps_eager\.sh/..\/training\/ortmodule\/stage1\/torch_eager_cpu\/requirements.txt}

Check notice on line 43 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L43 <ShellCheck.SC2086>

Double quote to prevent globbing and word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:43:35: info: Double quote to prevent globbing and word splitting. (ShellCheck.SC2086)
done

cd /tmp/src
Expand All @@ -48,7 +48,7 @@
tar -jxvf valgrind-3.16.1.tar.bz2
cd valgrind-3.16.1
./configure --prefix=/usr --libdir=/usr/lib64 --enable-only64bit --enable-tls
make -j$(getconf _NPROCESSORS_ONLN)

Check warning on line 51 in tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh

View workflow job for this annotation

GitHub Actions / shellcheck

[shellcheck] tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh#L51 <ShellCheck.SC2046>

Quote this to prevent word splitting.
Raw output
./tools/ci_build/github/linux/docker/scripts/manylinux/install_deps_eager.sh:51:8: warning: Quote this to prevent word splitting. (ShellCheck.SC2046)
make install

cd /
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
numpy==1.21.6 ; python_version < '3.11'
numpy==1.24.2 ; python_version >= '3.11'
numpy==1.24.2 ; python_version == '3.11'
numpy==1.26.0 ; python_version >= '3.12'
mypy
pytest
setuptools>=68.2.2
Expand Down
3 changes: 2 additions & 1 deletion tools/ci_build/github/linux/docker/scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cerberus
numpy==1.21.6 ; python_version < '3.11'
numpy==1.24.2 ; python_version >= '3.11'
numpy==1.24.2 ; python_version == '3.11'
numpy==1.26.0 ; python_version >= '3.12'
mypy
pytest
setuptools==69.0.3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpy==1.21.6 ; python_version < '3.11'
numpy==1.24.2 ; python_version >= '3.11'
numpy==1.24.2 ; python_version == '3.11'
numpy==1.26.0 ; python_version >= '3.12'
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
pandas
scikit-learn
numpy==1.21.6 ; python_version < '3.11'
numpy==1.24.2 ; python_version >= '3.11'
numpy==1.24.2 ; python_version == '3.11'
numpy==1.26.0 ; python_version >= '3.12'
transformers==v4.36.0
accelerate==0.25.0
rsa==4.9
Expand Down
3 changes: 2 additions & 1 deletion tools/ci_build/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# packages used by transformers python unittest (only enabled in Linux CPU CI Pipeline)
packaging
protobuf==3.20.2
numpy==1.24.0
numpy==1.24.0 ; python_version < '3.12'
numpy==1.26.0 ; python_version >= '3.12'
coloredlogs==15.0
transformers==4.36.0
psutil
Expand Down
Loading