From 5188f4c28d92389eb6707f21fc750e5637102b82 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 25 Oct 2024 21:18:09 -0400 Subject: [PATCH 1/2] Split DML test out of cuda --- .../azure-pipelines/stages/py-win-gpu-stage.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml index 88937cc2e154d..276d4bbe1346a 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-win-gpu-stage.yml @@ -65,9 +65,13 @@ stages: targetPath: $(Build.ArtifactStagingDirectory) artifactName: win_${{ parameters.EP_NAME }}_wheel_${{ parameters.PYTHON_VERSION }} variables: - GRADLE_OPTS: '-Dorg.gradle.daemon=false' - VSGenerator: 'Visual Studio 17 2022' - CUDA_MODULE_LOADING: 'LAZY' + - name: GRADLE_OPTS + value: '-Dorg.gradle.daemon=false' + - name: VSGenerator + value: 'Visual Studio 17 2022' + - name: CUDA_MODULE_LOADING + value: 'LAZY' + steps: - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 displayName: 'Clean Agent Directories' @@ -190,7 +194,7 @@ stages: TargetPath: '$(Build.ArtifactStagingDirectory)' - task: PowerShell@2 - displayName: 'Install ONNX' + displayName: 'Install Third Party Dependencies' inputs: filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/install_third_party_deps.ps1' workingDirectory: '$(Build.BinariesDirectory)' @@ -203,6 +207,6 @@ stages: Copy-Item -Path $(Build.sourcesDirectory)/onnxruntime/test/python/onnx_backend_test_series.py -Destination $(Agent.TempDirectory)\ort_test_data Copy-Item -Recurse -Path $(Build.sourcesDirectory)/onnxruntime/test/testdata -Destination $(Agent.TempDirectory)\ort_test_data cd $(Agent.TempDirectory)\ort_test_data - python onnx_backend_test_series.py + python onnx_backend_test_series.py --devices DML workingDirectory: '$(Build.sourcesDirectory)' displayName: 'Run Python Tests' From ff7327016facd962e7e9c137c0377eb7f3512454 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Fri, 25 Oct 2024 21:20:06 -0400 Subject: [PATCH 2/2] lintrunner --- onnxruntime/test/python/onnx_backend_test_series.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/onnxruntime/test/python/onnx_backend_test_series.py b/onnxruntime/test/python/onnx_backend_test_series.py index 64fbf5ad15e07..f8992fb70e8e8 100644 --- a/onnxruntime/test/python/onnx_backend_test_series.py +++ b/onnxruntime/test/python/onnx_backend_test_series.py @@ -105,7 +105,7 @@ def load_jsonc(basename: str): return json.loads("\n".join(lines)) -def create_backend_test(devices:list[str] = None, test_name=None): +def create_backend_test(devices: list[str] = None, test_name=None): """Creates an OrtBackendTest and adds its TestCase's to global scope so unittest will find them.""" overrides = load_jsonc("onnx_backend_test_series_overrides.jsonc") @@ -198,10 +198,10 @@ def parse_args(): parser.add_argument( "--devices", type=str, - choices=["CPU", "CUDA", "MIGRAPHX", "DNNL", "DML", "OPENVINO_GPU", "OPENVINO_CPU", "OPENVINO_NPU","OPENVINO"], + choices=["CPU", "CUDA", "MIGRAPHX", "DNNL", "DML", "OPENVINO_GPU", "OPENVINO_CPU", "OPENVINO_NPU", "OPENVINO"], nargs="+", # allows multiple values default=["CPU"], # default to ["CPU"] if no input is given - help="Select one or more devices CPU, CUDA, MIGRAPHX, DNNL, DML, OPENVINO_GPU, OPENVINO_CPU, OPENVINO_NPU, OPENVINO" + help="Select one or more devices CPU, CUDA, MIGRAPHX, DNNL, DML, OPENVINO_GPU, OPENVINO_CPU, OPENVINO_NPU, OPENVINO", ) # parse just our args. python unittest has its own args and arg parsing, and that runs inside unittest.main() @@ -214,5 +214,5 @@ def parse_args(): if __name__ == "__main__": args = parse_args() - create_backend_test(args.devices,args.test_name) - unittest.main() \ No newline at end of file + create_backend_test(args.devices, args.test_name) + unittest.main()