From ab2eaedfaa1e1abe5c128cfbccf8c6a45b75480e Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Thu, 28 Mar 2024 03:29:34 +0800 Subject: [PATCH] Install ONNX by buildling source code in Windows DML stage (#20079) ### Description In #20073, I use pin onnx version to unblock the whole PR CI. In fact, we could use the onnx that installed by building source code, that the onnx version is controlled by deps.txt. For some history reason, DML stage installed onnx from pypi. Now, the onnx can be installed as other stages. add an option to skip installing onnx in win-ci-prebuild-step --- tools/ci_build/build.py | 7 ------- .../templates/jobs/win-ci-prebuild-steps.yml | 5 +++++ tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index e1649ae251..7dfdbc3016 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -2083,13 +2083,6 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs): # For CUDA or DML enabled builds test IOBinding feature if args.use_cuda or args.use_dml: log.info("Testing IOBinding feature") - if args.use_dml: - run_subprocess( - [sys.executable, "-m", "pip", "uninstall", "--yes", "onnx"], cwd=cwd, dll_path=dll_path - ) - run_subprocess( - [sys.executable, "-m", "pip", "install", "-q", "onnx==1.15.0"], cwd=cwd, dll_path=dll_path - ) run_subprocess([sys.executable, "onnxruntime_test_python_iobinding.py"], cwd=cwd, dll_path=dll_path) if args.use_cuda: diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml index 864513bc4d..67a2543bfb 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-prebuild-steps.yml @@ -13,6 +13,10 @@ parameters: type: boolean default: false +- name: InstallONNX + type: boolean + default: true + - name: WITHCACHE type: boolean default: false @@ -106,6 +110,7 @@ steps: displayName: Install ccache and update PATH to use linked versions of gcc, cc, etc +- ${{ if eq(parameters.InstallONNX, true) }}: - ${{ if eq(parameters.WITHCACHE, true) }}: - task: Cache@2 # machinepool is used to ensure the compiler is same diff --git a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml index 53eea1d69f..c333c7ef08 100644 --- a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml @@ -68,6 +68,7 @@ stages: BuildConfig: Debug MachinePool: 'onnxruntime-Win-CPU-2022' WithCache: false + InstallONNX: false Today: $(TODAY) - task: PythonScript@0 @@ -155,7 +156,7 @@ stages: GenerateDocumentation: false WITH_CACHE: false MachinePool: 'onnxruntime-Win-CPU-2022' - + - stage: x86_release dependsOn: [] jobs: @@ -256,5 +257,3 @@ stages: GenerateDocumentation: false WITH_CACHE: false MachinePool: 'onnxruntime-Win-CPU-2022' - -