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
This commit is contained in:
Yi Zhang 2024-03-28 03:29:34 +08:00 committed by GitHub
parent 4df9d16f98
commit ab2eaedfaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 10 deletions

View file

@ -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:

View file

@ -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

View file

@ -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'