Skip to content

Commit

Permalink
Change ORT nightly python packages' name (microsoft#22450)
Browse files Browse the repository at this point in the history
### 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
<!-- - 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 and Ishwar Raut committed Nov 19, 2024
1 parent 67d03b0 commit 833f9c5
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 22 deletions.
2 changes: 0 additions & 2 deletions onnxruntime/python/tools/transformers/machine_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ def get_related_packages(self) -> List[str]:
related_packages = [
"onnxruntime-gpu",
"onnxruntime",
"ort-nightly-gpu",
"ort-nightly",
"onnx",
"transformers",
"protobuf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/python/tools/transformers/run_benchmark.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=")
Expand Down Expand Up @@ -89,10 +88,10 @@ def parse_arg_remove_string(argv, arg_name_equal):
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 833f9c5

Please sign in to comment.