From 9a0fc2ed5d47483e34d2581b9399bc7429417efa Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Tue, 26 Mar 2024 15:44:27 +0800 Subject: [PATCH] install ONNX by source --- tools/ci_build/build.py | 7 --- .../templates/jobs/win-ci-prebuild-steps.yml | 58 +++++++++---------- 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index e1649ae251d88..7dfdbc301622a 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 864513bc4d671..3a8ceef13b529 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 @@ -106,34 +106,34 @@ steps: displayName: Install ccache and update PATH to use linked versions of gcc, cc, etc - - ${{ if eq(parameters.WITHCACHE, true) }}: - - task: Cache@2 - # machinepool is used to ensure the compiler is same - inputs: - key: '"$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} | $(Build.SourcesDirectory)/cmake/deps.txt, $(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1, $(Build.SourcesDirectory)/tools/ci_build/github/windows/helpers.ps1' - path: $(Agent.TempDirectory)/deps_ccache - restoreKeys: | - "$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} - displayName: Cache Task - - - task: PowerShell@2 - displayName: 'Install ONNX' +- ${{ if eq(parameters.WITHCACHE, true) }}: + - task: Cache@2 + # machinepool is used to ensure the compiler is same inputs: - filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' - workingDirectory: '$(Build.BinariesDirectory)' - ${{ if eq(parameters.WITHCACHE, true) }}: - arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} -use_cache - ${{ else }}: - arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} + key: '"$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} | $(Build.SourcesDirectory)/cmake/deps.txt, $(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1, $(Build.SourcesDirectory)/tools/ci_build/github/windows/helpers.ps1' + path: $(Agent.TempDirectory)/deps_ccache + restoreKeys: | + "$(TODAY)" | ${{ parameters.buildArch }} | ${{ parameters.BuildConfig }} | ${{ parameters.MachinePool }} + displayName: Cache Task + +- task: PowerShell@2 + displayName: 'Install ONNX' + inputs: + filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' + workingDirectory: '$(Build.BinariesDirectory)' ${{ if eq(parameters.WITHCACHE, true) }}: - env: - CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache - CCACHE_COMPILERCHECK: content - - - ${{ if eq(parameters.WITHCACHE, true) }}: - - powershell: | - ccache -sv - ccache -z - displayName: cache stat - env: - CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache + arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} -use_cache + ${{ else }}: + arguments: -cpu_arch ${{ parameters.buildArch }} -install_prefix $(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\installed -build_config ${{ parameters.BuildConfig }} + ${{ if eq(parameters.WITHCACHE, true) }}: + env: + CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache + CCACHE_COMPILERCHECK: content + +- ${{ if eq(parameters.WITHCACHE, true) }}: + - powershell: | + ccache -sv + ccache -z + displayName: cache stat + env: + CCACHE_DIR: $(Agent.TempDirectory)/deps_ccache