From af00a20f8aeba17a68ea8a7c5f41df2c27d96116 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Tue, 15 Oct 2024 18:44:59 -0700 Subject: [PATCH] Change ORT nightly python packages' name (#22450) ### Description Our nightly CPU python package's name is "ort-nightly" instead of "onnxruntime". It was because of some historical reasons. Tensorflow was like that. Now we would prefer to make them the same. Do this change for all nightly python packages, including CPU, GPU(CUDA), and maybe others. ### Motivation and Context --- onnxruntime/python/tools/transformers/machine_info.py | 2 -- .../python/tools/transformers/models/llama/benchmark_all.py | 6 +----- .../tools/transformers/models/whisper/benchmark_all.py | 6 +----- onnxruntime/python/tools/transformers/run_benchmark.sh | 2 +- setup.py | 5 ++--- .../azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml | 2 +- .../templates/py-packaging-selectable-stage.yml | 6 +++--- .../github/azure-pipelines/templates/py-packaging-stage.yml | 2 +- .../github/azure-pipelines/templates/py-win-gpu.yml | 2 +- 9 files changed, 11 insertions(+), 22 deletions(-) diff --git a/onnxruntime/python/tools/transformers/machine_info.py b/onnxruntime/python/tools/transformers/machine_info.py index 288e36facb..d4194abbd1 100644 --- a/onnxruntime/python/tools/transformers/machine_info.py +++ b/onnxruntime/python/tools/transformers/machine_info.py @@ -129,8 +129,6 @@ class MachineInfo: related_packages = [ "onnxruntime-gpu", "onnxruntime", - "ort-nightly-gpu", - "ort-nightly", "onnx", "transformers", "protobuf", diff --git a/onnxruntime/python/tools/transformers/models/llama/benchmark_all.py b/onnxruntime/python/tools/transformers/models/llama/benchmark_all.py index 2433ae3d9b..af5afc54e5 100644 --- a/onnxruntime/python/tools/transformers/models/llama/benchmark_all.py +++ b/onnxruntime/python/tools/transformers/models/llama/benchmark_all.py @@ -249,11 +249,7 @@ def save_results(results, filename): installed_packages = pkg_resources.working_set installed_packages_list = sorted( - [ - f"{i.key}=={i.version}" - for i in installed_packages - if i.key in ["ort-nightly-gpu", "ort-nightly", "onnxruntime", "onnxruntime-gpu"] - ] + [f"{i.key}=={i.version}" for i in installed_packages if i.key in ["onnxruntime", "onnxruntime-gpu"]] ) ort_pkg_name = "" diff --git a/onnxruntime/python/tools/transformers/models/whisper/benchmark_all.py b/onnxruntime/python/tools/transformers/models/whisper/benchmark_all.py index 814b0dd1ef..b7f5c2294f 100644 --- a/onnxruntime/python/tools/transformers/models/whisper/benchmark_all.py +++ b/onnxruntime/python/tools/transformers/models/whisper/benchmark_all.py @@ -291,11 +291,7 @@ def save_results(results, filename): installed_packages = pkg_resources.working_set installed_packages_list = sorted( - [ - f"{i.key}=={i.version}" - for i in installed_packages - if i.key in ["ort-nightly-gpu", "ort-nightly", "onnxruntime", "onnxruntime-gpu"] - ] + [f"{i.key}=={i.version}" for i in installed_packages if i.key in ["onnxruntime", "onnxruntime-gpu"]] ) ort_pkg_name = "" ort_pkg_version = "" diff --git a/onnxruntime/python/tools/transformers/run_benchmark.sh b/onnxruntime/python/tools/transformers/run_benchmark.sh index 77d0c3a766..ddc8b781a5 100755 --- a/onnxruntime/python/tools/transformers/run_benchmark.sh +++ b/onnxruntime/python/tools/transformers/run_benchmark.sh @@ -1,3 +1,4 @@ +#!/bin/bash # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for @@ -91,7 +92,6 @@ fi if [ "$run_install" = true ] ; then - pip uninstall --yes ort-nightly ort-gpu-nightly pip uninstall --yes onnxruntime pip uninstall --yes onnxruntime-gpu if [ "$run_cpu_fp32" = true ] || [ "$run_cpu_int8" = true ]; then diff --git a/setup.py b/setup.py index 379cd664fe..739671f406 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,6 @@ def parse_arg_remove_string(argv, arg_name_equal): # Any combination of the following arguments can be applied if parse_arg_remove_boolean(sys.argv, "--nightly_build"): - package_name = "ort-nightly" nightly_build = True wheel_name_suffix = parse_arg_remove_string(sys.argv, "--wheel_name_suffix=") @@ -89,10 +88,10 @@ elif parse_arg_remove_boolean(sys.argv, "--use_azure"): pass elif parse_arg_remove_boolean(sys.argv, "--use_qnn"): is_qnn = True - package_name = "onnxruntime-qnn" if not nightly_build else "ort-nightly-qnn" + package_name = "onnxruntime-qnn" if is_rocm or is_migraphx: - package_name = "onnxruntime-rocm" if not nightly_build else "ort-rocm-nightly" + package_name = "onnxruntime-rocm" # PEP 513 defined manylinux1_x86_64 and manylinux1_i686 # PEP 571 defined manylinux2010_x86_64 and manylinux2010_i686 diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml index 34de1201fa..3586ac895b 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml @@ -216,7 +216,7 @@ jobs: - ${{ if eq(parameters.EnablePython, true) }}: - powershell: | - python3 -m pip uninstall -y ort-nightly-gpu ort-nightly onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml ort-nightly-directml -qq + python3 -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq Get-ChildItem -Path dist/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname} workingDirectory: '$(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\${{ parameters.BuildConfig }}' diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml index 8a6434e757..4310c7f780 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml @@ -241,7 +241,7 @@ stages: **/*.dll - powershell: | - python -m pip uninstall -y ort-nightly-gpu ort-nightly onnxruntime onnxruntime-gpu -qq + python -m pip uninstall -y onnxruntime onnxruntime-gpu -qq Get-ChildItem -Path $(Build.ArtifactStagingDirectory)/*.whl | foreach {pip --disable-pip-version-check install --force-reinstall --upgrade $_.fullname tabulate} python -m pip install protobuf==3.18.1 Remove-Item -Recurse -Force onnxruntime @@ -334,7 +334,7 @@ stages: rm -rf $(Build.BinariesDirectory)/Release/onnxruntime $(Build.BinariesDirectory)/Release/pybind11 sudo rm -f /build /onnxruntime_src sudo ln -s $(Build.SourcesDirectory) /onnxruntime_src - python3 -m pip uninstall -y ort-nightly-gpu ort-nightly onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml ort-nightly-directml -qq + python3 -m pip uninstall -y onnxruntime onnxruntime-gpu onnxruntime-training onnxruntime-directml -qq cp $(Build.SourcesDirectory)/tools/ci_build/github/linux/docker/scripts/manylinux/requirements.txt $(Build.BinariesDirectory)/requirements.txt # Test ORT with the latest ONNX release. sed -i "s/git+http:\/\/github\.com\/onnx\/onnx.*/onnx/" $(Build.BinariesDirectory)/requirements.txt @@ -497,7 +497,7 @@ stages: **/*.dll - powershell: | - python -m pip uninstall -y ort-nightly-gpu ort-nightly onnxruntime onnxruntime-gpu -qq + python -m pip uninstall -y onnxruntime onnxruntime-gpu -qq Get-ChildItem -Path $(Build.ArtifactStagingDirectory)/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname tabulate} Remove-Item -Recurse -Force onnxruntime python onnx_backend_test_series.py diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 64f64d5374..1c2e3627a2 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -241,7 +241,7 @@ stages: continueOnError: true - powershell: | - python -m pip uninstall -y ort-nightly-gpu ort-nightly onnxruntime onnxruntime-gpu -qq + python -m pip uninstall -y onnxruntime onnxruntime-gpu -qq Get-ChildItem -Path $(Build.ArtifactStagingDirectory)/*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname tabulate} Remove-Item -Recurse -Force onnxruntime if ("$(ExtraParam)" -contains "--use_azure") { diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml index 656912f0a0..71500e4ef9 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml @@ -259,7 +259,7 @@ stages: arguments: -cpu_arch x64 -install_prefix $(Build.BinariesDirectory)\${{ parameters.cmake_build_type }}\installed -build_config ${{ parameters.cmake_build_type }} - powershell: | - python -m pip uninstall -y ort-nightly-gpu ort-nightly onnxruntime onnxruntime-gpu -qq + python -m pip uninstall -y onnxruntime onnxruntime-gpu -qq Get-ChildItem -Path $(Build.ArtifactStagingDirectory)/*cp${{ replace(parameters.PYTHON_VERSION,'.','') }}*.whl | foreach {pip --disable-pip-version-check install --upgrade $_.fullname tabulate} mkdir -p $(Agent.TempDirectory)\ort_test_data Copy-Item -Path $(Build.sourcesDirectory)/onnxruntime/test/python/onnx_backend_test_series.py -Destination $(Agent.TempDirectory)\ort_test_data