From 0d33602ef0ff6971a92d634c92f6963b96f98077 Mon Sep 17 00:00:00 2001 From: yf711 Date: Thu, 10 Oct 2024 17:23:57 -0700 Subject: [PATCH 01/44] test --- .../github/azure-pipelines/bigmodels-ci-pipeline.yml | 8 ++++---- .../azure-pipelines/templates/common-variables.yml | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml index 6fd02f6b59867..edeaa28fe4dbf 100644 --- a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml @@ -42,11 +42,11 @@ parameters: variables: - template: templates/common-variables.yml - name: docker_base_image - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1 - name: linux_trt_version - value: 10.3.0.26-1.cuda11.8 + value: ${{ variables.linux_trt_version_cuda12 }} - name: Repository - value: 'onnxruntimecuda11manylinuxbuild' + value: 'onnxruntimecuda12manylinuxbuild' stages: - stage: Build_Onnxruntime_Cuda @@ -123,7 +123,7 @@ stages: --build_shared_lib \ --parallel \ --build_wheel \ - --enable_onnx_tests --use_cuda --cuda_version=${{variables.common_cuda_version}} --cuda_home=/usr/local/cuda-${{variables.common_cuda_version}} --cudnn_home=/usr/local/cuda-${{variables.common_cuda_version}} \ + --enable_onnx_tests --use_cuda --cuda_version=12.2 --cuda_home=/usr/local/cuda-12 --cudnn_home=/usr/local/cuda-12 \ --enable_cuda_profiling --enable_cuda_nhwc_ops \ --enable_pybind --build_java \ --use_cache \ diff --git a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml index e7f703fa592a3..007ae16a62be1 100644 --- a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml +++ b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml @@ -1,3 +1,8 @@ variables: - common_cuda_version: '11.8' - common_cuda_baseimg: 'nvidia/cuda:11.8.0-cudnn8-devel-ubi8' + common_trt_version: '10.4.0.26' + linux_trt_version_cuda11: ${{ variables.common_trt_version }}-1.cuda11.8 + linux_trt_version_cuda12: ${{ variables.common_trt_version }}-1.cuda12.6 + common_linux_trt_version: ${{ variables.linux_trt_version_cuda11 }} + win_trt_folder_cuda11: TensorRT-${{ variables.common_trt_version }}.Windows10.x86_64.cuda-11.8 + win_trt_folder_cuda12: TensorRT-${{ variables.common_trt_version }}.Windows10.x86_64.cuda-12.6 + common_win_trt_folder: ${{ variables.win_trt_folder_cuda11 }} From 12bb26ee60a726c5f4c28d936b8b656dda986022 Mon Sep 17 00:00:00 2001 From: yf711 Date: Fri, 11 Oct 2024 10:34:18 -0700 Subject: [PATCH 02/44] change --- .../github/azure-pipelines/bigmodels-ci-pipeline.yml | 9 ++++----- .../azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml index edeaa28fe4dbf..8477195697ab8 100644 --- a/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/bigmodels-ci-pipeline.yml @@ -40,13 +40,12 @@ parameters: default: 0 variables: - - template: templates/common-variables.yml - name: docker_base_image - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 - name: linux_trt_version - value: ${{ variables.linux_trt_version_cuda12 }} + value: 10.3.0.26-1.cuda11.8 - name: Repository - value: 'onnxruntimecuda12manylinuxbuild' + value: 'onnxruntimecuda11manylinuxbuild' stages: - stage: Build_Onnxruntime_Cuda @@ -123,7 +122,7 @@ stages: --build_shared_lib \ --parallel \ --build_wheel \ - --enable_onnx_tests --use_cuda --cuda_version=12.2 --cuda_home=/usr/local/cuda-12 --cudnn_home=/usr/local/cuda-12 \ + --enable_onnx_tests --use_cuda --cuda_version=11.8 --cuda_home=/usr/local/cuda-11.8 --cudnn_home=/usr/local/cuda-11.8 \ --enable_cuda_profiling --enable_cuda_nhwc_ops \ --enable_pybind --build_java \ --use_cache \ diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml index 6717e8b4faaa2..fee017a9a2149 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml @@ -37,6 +37,7 @@ parameters: - 12.2 variables: + - template: templates/common-variables.yml - name: docker_base_image ${{ if eq(parameters.CudaVersion, '11.8') }}: value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 From 6732c0002c601ec15935875ec90bef55da87880b Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 13:37:55 -0700 Subject: [PATCH 03/44] update linux trt ci --- .../github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml index fee017a9a2149..06d0aa8a91da1 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml @@ -45,9 +45,9 @@ variables: value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1 - name: linux_trt_version ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: 10.4.0.26-1.cuda11.8 + value: linux_trt_version_cuda11 ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: 10.4.0.26-1.cuda12.6 + value: linux_trt_version_cuda12 jobs: - job: Linux_Build From 8f9f8fdb177744ed5a2828e32cdbda5de5d89417 Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 13:40:20 -0700 Subject: [PATCH 04/44] update win trt ci --- .../github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml index 7c04d6aa2e739..676916ba2e063 100644 --- a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml @@ -37,11 +37,12 @@ parameters: - 12.2 variables: + - template: templates/common-variables.yml - name: win_trt_folder ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8 + value: win_trt_folder_cuda11 ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6 + value: win_trt_folder_cuda12 jobs: - job: 'build' From f80d9f75641672475e8cbc7c091a659aadbfe244 Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 13:55:29 -0700 Subject: [PATCH 05/44] simplify py-linux-gpu --- .../stages/py-cuda-packaging-stage.yml | 2 -- .../azure-pipelines/templates/py-linux-gpu.yml | 16 +++++++++------- .../templates/py-packaging-stage.yml | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml index f9f90b43f0cf6..eb240a9b999f3 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml @@ -79,7 +79,5 @@ stages: cuda_version: ${{ parameters.cuda_version }} ${{ if eq(parameters.cuda_version, '11.8') }}: docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 - trt_version: 10.4.0.26-1.cuda11.8 ${{ if eq(parameters.cuda_version, '12.2') }}: docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1 - trt_version: 10.4.0.26-1.cuda12.6 diff --git a/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml index d19472bcbab5a..0df30bfd0f971 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml @@ -20,12 +20,6 @@ parameters: - name: docker_base_image type: string -- name: trt_version - type: string - default: '10.4.0.26-1.cuda11.8' - values: - - 10.4.0.26-1.cuda11.8 - - 10.4.0.26-1.cuda12.6 - name: cuda_version type: string default: '11.8' @@ -33,6 +27,14 @@ parameters: - 11.8 - 12.2 +variables: + - template: templates/common-variables.yml + - name: trt_version + ${{ if eq(parameters.cuda_version, '11.8') }}: + value: linux_trt_version_cuda11 + ${{ if eq(parameters.cuda_version, '12.2') }}: + value: linux_trt_version_cuda12 + stages: - stage: Linux_py_GPU_Wheels_${{ parameters.arch }} dependsOn: [] @@ -62,7 +64,7 @@ stages: parameters: Dockerfile: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/python/cuda/Dockerfile Context: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/python/cuda - DockerBuildArgs: "--build-arg BASEIMAGE=${{ parameters.docker_base_image }} --build-arg TRT_VERSION=${{ parameters.trt_version }} --build-arg BUILD_UID=$( id -u )" + DockerBuildArgs: "--build-arg BASEIMAGE=${{ parameters.docker_base_image }} --build-arg TRT_VERSION=${{ variables.trt_version }} --build-arg BUILD_UID=$( id -u )" Repository: onnxruntimecuda${{ replace(parameters.cuda_version, '.', '') }}xtrt86build${{ parameters.arch }} diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index edaae227ee78f..598f72af1bf90 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -446,7 +446,6 @@ stages: docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 extra_build_arg: ${{ parameters.build_py_parameters }} cmake_build_type: ${{ parameters.cmake_build_type }} - trt_version: '10.4.0.26-1.cuda11.8' cuda_version: '11.8' - ${{ if eq(parameters.enable_windows_arm64_qnn, true) }}: From f24af9cddc269c9a014debe28eef6a218a5416c5 Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 13:57:50 -0700 Subject: [PATCH 06/44] fix --- .../github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml | 4 ++-- .../github/azure-pipelines/templates/py-linux-gpu.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml index 06d0aa8a91da1..d8c0465ca280e 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-ci-pipeline.yml @@ -45,9 +45,9 @@ variables: value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1 - name: linux_trt_version ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: linux_trt_version_cuda11 + value: ${{ variables.linux_trt_version_cuda11 }} ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: linux_trt_version_cuda12 + value: ${{ variables.linux_trt_version_cuda12 }} jobs: - job: Linux_Build diff --git a/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml index 0df30bfd0f971..16e3a74df126e 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml @@ -31,9 +31,9 @@ variables: - template: templates/common-variables.yml - name: trt_version ${{ if eq(parameters.cuda_version, '11.8') }}: - value: linux_trt_version_cuda11 + value: ${{ variables.linux_trt_version_cuda11 }} ${{ if eq(parameters.cuda_version, '12.2') }}: - value: linux_trt_version_cuda12 + value: ${{ variables.linux_trt_version_cuda12 }} stages: - stage: Linux_py_GPU_Wheels_${{ parameters.arch }} From 211a98a42c9de52fdda026a7ef744e63bf0ccfd3 Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 14:00:46 -0700 Subject: [PATCH 07/44] fix --- .../github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml index 676916ba2e063..f4ab9ee5b4a5c 100644 --- a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml @@ -40,9 +40,9 @@ variables: - template: templates/common-variables.yml - name: win_trt_folder ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: win_trt_folder_cuda11 + value: ${{ variables.win_trt_folder_cuda11 }} ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: win_trt_folder_cuda12 + value: ${{ variables.win_trt_folder_cuda12 }} jobs: - job: 'build' From d161f8206a63e216d730d272fba2837e76c295ee Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 14:05:21 -0700 Subject: [PATCH 08/44] test --- .../azure-pipelines/templates/py-linux-gpu.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml index 16e3a74df126e..e83a8db5000e9 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml @@ -27,14 +27,6 @@ parameters: - 11.8 - 12.2 -variables: - - template: templates/common-variables.yml - - name: trt_version - ${{ if eq(parameters.cuda_version, '11.8') }}: - value: ${{ variables.linux_trt_version_cuda11 }} - ${{ if eq(parameters.cuda_version, '12.2') }}: - value: ${{ variables.linux_trt_version_cuda12 }} - stages: - stage: Linux_py_GPU_Wheels_${{ parameters.arch }} dependsOn: [] @@ -53,6 +45,12 @@ stages: value: -x ${{ parameters.extra_build_arg }} ${{ if eq(parameters.extra_build_arg, '') }}: value: '' + - template: templates/common-variables.yml + - name: trt_version + ${{ if eq(parameters.cuda_version, '11.8') }}: + value: ${{ variables.linux_trt_version_cuda11 }} + ${{ if eq(parameters.cuda_version, '12.2') }}: + value: ${{ variables.linux_trt_version_cuda12 }} steps: - checkout: self clean: true From d36e43618c33344e1667eb1e6d3f7228eb6da711 Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 14:07:27 -0700 Subject: [PATCH 09/44] fix --- .../ci_build/github/azure-pipelines/templates/py-linux-gpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml index e83a8db5000e9..65326f3507a34 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-linux-gpu.yml @@ -45,7 +45,7 @@ stages: value: -x ${{ parameters.extra_build_arg }} ${{ if eq(parameters.extra_build_arg, '') }}: value: '' - - template: templates/common-variables.yml + - template: common-variables.yml - name: trt_version ${{ if eq(parameters.cuda_version, '11.8') }}: value: ${{ variables.linux_trt_version_cuda11 }} From 0230216bd05aa10014a12dd2d7ec083061451897 Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 14:40:25 -0700 Subject: [PATCH 10/44] test --- .../github/azure-pipelines/templates/jobs/set-winenv.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml index 6a2b7f4566b61..a9a24bef8f6c7 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml @@ -15,6 +15,7 @@ parameters: default: '11.8' steps: + - template: ../common-variables.yml - ${{ if eq(parameters.DownloadCUDA, 'true') }}: - powershell: | azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.PrimaryCUDAVersion }}" $(Agent.TempDirectory) @@ -34,5 +35,6 @@ steps: displayName: 'setup env' inputs: filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}' + arguments: '' modifyEnvironment: true workingFolder: '$(Build.BinariesDirectory)' From 32f41fdf7fb9a25054680f23b23c62d0a0eab8fc Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 14:45:02 -0700 Subject: [PATCH 11/44] test set-winenv --- .../templates/jobs/set-winenv.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml index a9a24bef8f6c7..3047b3fbccb35 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml @@ -14,8 +14,15 @@ parameters: type: string default: '11.8' +variables: + - template: templates/common-variables.yml + - name: win_trt_folder + ${{ if eq(parameters.CudaVersion, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.CudaVersion, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} + steps: - - template: ../common-variables.yml - ${{ if eq(parameters.DownloadCUDA, 'true') }}: - powershell: | azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.PrimaryCUDAVersion }}" $(Agent.TempDirectory) @@ -25,11 +32,11 @@ steps: displayName: 'Download Secondary CUDA SDK v${{ parameters.SecondaryCUDAVersion }}' - ${{ if eq(parameters.DownloadTRT, 'true') }}: - powershell: | - azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8" $(Agent.TempDirectory) - displayName: 'Download TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8' + azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ variables.win_trt_folder_cuda11 }}" $(Agent.TempDirectory) + displayName: 'Download ${{ variables.win_trt_folder_cuda11 }}' - powershell: | - azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6" $(Agent.TempDirectory) - displayName: 'Download TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6' + azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ variables.win_trt_folder_cuda11 }}" $(Agent.TempDirectory) + displayName: 'Download ${{ variables.win_trt_folder_cuda11 }}' - task: BatchScript@1 displayName: 'setup env' From 3fc325eba2d9bbf18cedb83577548a68f455e92e Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 14:57:43 -0700 Subject: [PATCH 12/44] test set-winenv --- .../templates/jobs/set-winenv.yml | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml index 3047b3fbccb35..aaa475d3daf0e 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml @@ -13,14 +13,12 @@ parameters: - name: SecondaryCUDAVersion type: string default: '11.8' - -variables: - - template: templates/common-variables.yml - - name: win_trt_folder - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: ${{ variables.win_trt_folder_cuda11 }} - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: ${{ variables.win_trt_folder_cuda12 }} + - name: win_trt_folder_cuda11 + type: string + default: 'TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8' + - name: win_trt_folder_cuda12 + type: string + default: 'TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6' steps: - ${{ if eq(parameters.DownloadCUDA, 'true') }}: @@ -32,11 +30,11 @@ steps: displayName: 'Download Secondary CUDA SDK v${{ parameters.SecondaryCUDAVersion }}' - ${{ if eq(parameters.DownloadTRT, 'true') }}: - powershell: | - azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ variables.win_trt_folder_cuda11 }}" $(Agent.TempDirectory) - displayName: 'Download ${{ variables.win_trt_folder_cuda11 }}' + azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder_cuda11 }}" $(Agent.TempDirectory) + displayName: 'Download ${{ parameters.win_trt_folder_cuda11 }}' - powershell: | - azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ variables.win_trt_folder_cuda11 }}" $(Agent.TempDirectory) - displayName: 'Download ${{ variables.win_trt_folder_cuda11 }}' + azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder_cuda12 }}" $(Agent.TempDirectory) + displayName: 'Download ${{ variables.win_trt_folder_cuda12 }}' - task: BatchScript@1 displayName: 'setup env' From efb057f6ee67612eadffc692c7311ef059ed392d Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 15:12:13 -0700 Subject: [PATCH 13/44] update c-api-pkg & cuda-pkg --- .../azure-pipelines/c-api-noopenmp-packaging-pipelines.yml | 3 ++- .../github/azure-pipelines/cuda-packaging-pipeline.yml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml b/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml index e2d977bd60986..4fb53ef2d056f 100644 --- a/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml +++ b/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml @@ -77,13 +77,14 @@ resources: ref: 5eda9aded5462201e6310105728d33016e637ea7 variables: +- template: templates/common-variables.yml - name: ReleaseVersionSuffix value: '' - name: win_trt_version value: 11.8 - name: win_trt_home - value: $(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8 + value: $(Agent.TempDirectory)\${{ variables.win_trt_folder_cuda11 }} - name: win_cuda_home value: $(Agent.TempDirectory)\v11.8 diff --git a/tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml b/tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml index 7118e85e9ea4b..9b103715e734d 100644 --- a/tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml @@ -59,13 +59,14 @@ parameters: - 12.2 variables: + - template: templates/common-variables.yml - name: ReleaseVersionSuffix value: '' - name: win_trt_home ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: $(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8 + value: $(Agent.TempDirectory)\${{ variables.win_trt_folder_cuda11 }} ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: $(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6 + value: $(Agent.TempDirectory)\${{ variables.win_trt_folder_cuda12 }} - name: win_cuda_home ${{ if eq(parameters.CudaVersion, '11.8') }}: value: $(Agent.TempDirectory)\v11.8 From 382cdae7ad75681cc5badd2f814fc7c12fbeb78e Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 15:15:29 -0700 Subject: [PATCH 14/44] cuda12 as common version --- .../github/azure-pipelines/templates/common-variables.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml index 007ae16a62be1..3e891524b2c6c 100644 --- a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml +++ b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml @@ -2,7 +2,7 @@ variables: common_trt_version: '10.4.0.26' linux_trt_version_cuda11: ${{ variables.common_trt_version }}-1.cuda11.8 linux_trt_version_cuda12: ${{ variables.common_trt_version }}-1.cuda12.6 - common_linux_trt_version: ${{ variables.linux_trt_version_cuda11 }} + common_linux_trt_version: ${{ variables.linux_trt_version_cuda12 }} win_trt_folder_cuda11: TensorRT-${{ variables.common_trt_version }}.Windows10.x86_64.cuda-11.8 win_trt_folder_cuda12: TensorRT-${{ variables.common_trt_version }}.Windows10.x86_64.cuda-12.6 - common_win_trt_folder: ${{ variables.win_trt_folder_cuda11 }} + common_win_trt_folder: ${{ variables.win_trt_folder_cuda12 }} From 57d36048d1c45ff71d48a16acdb187096d8bf156 Mon Sep 17 00:00:00 2001 From: yf711 Date: Mon, 14 Oct 2024 15:36:30 -0700 Subject: [PATCH 15/44] post merge: set cuda12 as default --- .../azure-pipelines/post-merge-jobs.yml | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml b/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml index 833e97b437c33..e981cb3e83ce6 100644 --- a/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml +++ b/tools/ci_build/github/azure-pipelines/post-merge-jobs.yml @@ -1,3 +1,20 @@ +parameters: +- name: CudaVersion + displayName: CUDA version + type: string + default: '12.2' + values: + - 11.8 + - 12.2 + +variables: + - template: templates/common-variables.yml + - name: win_trt_folder + ${{ if eq(parameters.CudaVersion, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.CudaVersion, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} + stages: - ${{ if or(startsWith(variables['System.CollectionUri'], 'https://dev.azure.com/aiinfra/'),startsWith(variables['System.CollectionUri'], 'https://aiinfra.visualstudio.com/')) }}: - template: templates/web-ci.yml @@ -206,7 +223,7 @@ stages: BuildConfig: 'RelWithDebInfo' EnvSetupScript: setup_env_cuda.bat buildArch: x64 - additionalBuildFlags: --enable_pybind --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8" --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 + additionalBuildFlags: --enable_pybind --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 msbuildPlatform: x64 isX86: false job_name_suffix: x64_RelWithDebInfo @@ -226,7 +243,7 @@ stages: BuildConfig: 'RelWithDebInfo' EnvSetupScript: setup_env_trt.bat buildArch: x64 - additionalBuildFlags: --enable_pybind --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8" --enable_cuda_profiling --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 + additionalBuildFlags: --enable_pybind --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --enable_cuda_profiling --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\${{ variables.win_trt_folder }}" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 msbuildPlatform: x64 isX86: false job_name_suffix: x64_RelWithDebInfo From 658d893b2a68d8225fe06171dfa35b80397ae1f6 Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 10:53:44 -0700 Subject: [PATCH 16/44] test trt10.5 --- .../github/azure-pipelines/templates/common-variables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml index 3e891524b2c6c..c2e8fdb4be9ec 100644 --- a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml +++ b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml @@ -1,5 +1,5 @@ variables: - common_trt_version: '10.4.0.26' + common_trt_version: '10.5.0.18' linux_trt_version_cuda11: ${{ variables.common_trt_version }}-1.cuda11.8 linux_trt_version_cuda12: ${{ variables.common_trt_version }}-1.cuda12.6 common_linux_trt_version: ${{ variables.linux_trt_version_cuda12 }} From 1765761309aabd9af19579b099a482a9e4ba5400 Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 10:59:45 -0700 Subject: [PATCH 17/44] test trt10.5 on ep_perf --- onnxruntime/python/tools/tensorrt/perf/build/build_image.py | 2 +- .../linux-gpu-tensorrt-daily-perf-pipeline.yml | 2 +- .../github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/onnxruntime/python/tools/tensorrt/perf/build/build_image.py b/onnxruntime/python/tools/tensorrt/perf/build/build_image.py index 763d160fa56b5..f207f072018ba 100644 --- a/onnxruntime/python/tools/tensorrt/perf/build/build_image.py +++ b/onnxruntime/python/tools/tensorrt/perf/build/build_image.py @@ -18,7 +18,7 @@ "8.6.cuda_11_8_cudnn_8": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6", "8.6.cuda_12_3_cudnn_9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_3_tensorrt8_6", "10.4.cuda_11_8_cudnn_8": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10", - "10.4.cuda_12_5_cudnn_9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10", + "10.5.cuda_12_5_cudnn_9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10", "BIN": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_tensorrt_bin", } diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml index fb2c86dbf68e3..865307ec95e94 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml @@ -13,7 +13,7 @@ parameters: - 8.6.cuda_11_8_cudnn_8 - 8.6.cuda_12_3_cudnn_9 - 10.4.cuda_11_8_cudnn_8 - - 10.4.cuda_12_5_cudnn_9 + - 10.5.cuda_12_5_cudnn_9 - BIN - name: UseTensorrtOssParser diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 index 523318f09aba6..e75ede5aeb8f3 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 +++ b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 @@ -5,7 +5,7 @@ # Dockerfile to run ONNXRuntime with TensorRT integration # Build base image with required system packages -FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04 AS base +FROM nvidia/cuda:12.6.1-cudnn-devel-ubuntu20.04 AS base # The local directory into which to build and install CMAKE ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code @@ -31,7 +31,7 @@ RUN pip install --upgrade pip RUN pip install setuptools>=68.2.2 psutil # Install TensorRT -RUN version="10.4.0.26-1+cuda12.6" &&\ +RUN version="10.5.0.18-1+cuda12.6" &&\ apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub &&\ apt-get update &&\ apt-get install -y \ From ec627eafeef079178388a785d418eb9fe7eb168a Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 14:16:15 -0700 Subject: [PATCH 18/44] revert ep_perf cuda --- .../github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 index e75ede5aeb8f3..d53aad676c447 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 +++ b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 @@ -5,7 +5,7 @@ # Dockerfile to run ONNXRuntime with TensorRT integration # Build base image with required system packages -FROM nvidia/cuda:12.6.1-cudnn-devel-ubuntu20.04 AS base +FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.04 AS base # The local directory into which to build and install CMAKE ARG ONNXRUNTIME_LOCAL_CODE_DIR=/code From 8193f814d0b3c87d482dcebe738112e1e92e8d0b Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 14:35:27 -0700 Subject: [PATCH 19/44] test nuget-linux-cuda-packaging-stage for nuget cuda11/12 pkg ci --- .../nuget-linux-cuda-packaging-stage.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml index fc6da88917f62..af0fe4b4184a6 100644 --- a/tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml @@ -68,6 +68,7 @@ stages: timeoutInMinutes: 180 pool: 'onnxruntime-Ubuntu2204-AMD-CPU' variables: + - template: ../templates/common-variables.yml - name: CUDA_VERSION_MAJOR ${{ if eq(parameters.CudaVersion, '11.8') }}: value: '11' @@ -75,12 +76,11 @@ stages: value: '12' - name: CUDA_VERSION value: ${{ parameters.CudaVersion }} - - name: linux_trt_version - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: 10.4.0.26-1.cuda11.8 - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: 10.4.0.26-1.cuda12.6 + ${{ if eq(parameters.cuda_version, '11.8') }}: + value: ${{ variables.linux_trt_version_cuda11 }} + ${{ if eq(parameters.cuda_version, '12.2') }}: + value: ${{ variables.linux_trt_version_cuda12 }} steps: - checkout: self clean: true @@ -140,16 +140,17 @@ stages: clean: all pool: 'Onnxruntime-Linux-GPU' variables: + - template: ../templates/common-variables.yml - name: CUDA_VERSION_MAJOR ${{ if eq(parameters.CudaVersion, '11.8') }}: value: '11' ${{ if eq(parameters.CudaVersion, '12.2') }}: value: '12' - name: linux_trt_version - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: 10.4.0.26-1.cuda11.8 - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: 10.4.0.26-1.cuda12.6 + ${{ if eq(parameters.cuda_version, '11.8') }}: + value: ${{ variables.linux_trt_version_cuda11 }} + ${{ if eq(parameters.cuda_version, '12.2') }}: + value: ${{ variables.linux_trt_version_cuda12 }} steps: - checkout: self # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime submodules: false From 20079c813801a08f0bd4df2ad5de1f3db0640164 Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 14:42:34 -0700 Subject: [PATCH 20/44] update nuget/templates/test_linux.yml for nuget cuda11/12 pkg ci --- .../github/azure-pipelines/nuget/templates/test_linux.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml index b1e5816fb748e..d302ecca72d0d 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml @@ -23,6 +23,7 @@ stages: pool: ${{ parameters.AgentPool }} variables: + - template: ../../templates/common-variables.yml - name: OnnxRuntimeBuildDirectory value: '$(Build.BinariesDirectory)' @@ -61,7 +62,7 @@ stages: ${{ if eq(parameters.CudaVersion, '12.2') }}: DockerBuildArgs: " --build-arg BASEIMAGE=nvidia/cuda:12.2.2-devel-ubuntu20.04 - --build-arg TRT_VERSION=10.4.0.26-1+cuda12.6 + --build-arg TRT_VERSION=${{ variables.linux_trt_version_cuda12 }} --build-arg BUILD_UID=$( id -u ) " ${{ else }}: From 8e1903f3cad14c013992004cbea9fb0e1a5d96a4 Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 14:50:31 -0700 Subject: [PATCH 21/44] fix --- .../stages/nuget-linux-cuda-packaging-stage.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml index af0fe4b4184a6..d331c76bc264e 100644 --- a/tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/nuget-linux-cuda-packaging-stage.yml @@ -77,9 +77,9 @@ stages: - name: CUDA_VERSION value: ${{ parameters.CudaVersion }} - name: linux_trt_version - ${{ if eq(parameters.cuda_version, '11.8') }}: + ${{ if eq(parameters.CudaVersion, '11.8') }}: value: ${{ variables.linux_trt_version_cuda11 }} - ${{ if eq(parameters.cuda_version, '12.2') }}: + ${{ if eq(parameters.CudaVersion, '12.2') }}: value: ${{ variables.linux_trt_version_cuda12 }} steps: - checkout: self @@ -147,9 +147,9 @@ stages: ${{ if eq(parameters.CudaVersion, '12.2') }}: value: '12' - name: linux_trt_version - ${{ if eq(parameters.cuda_version, '11.8') }}: + ${{ if eq(parameters.CudaVersion, '11.8') }}: value: ${{ variables.linux_trt_version_cuda11 }} - ${{ if eq(parameters.cuda_version, '12.2') }}: + ${{ if eq(parameters.CudaVersion, '12.2') }}: value: ${{ variables.linux_trt_version_cuda12 }} steps: - checkout: self # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime From 20d44f992262cf8424c8511e84d952bc498a8cdb Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 15:05:12 -0700 Subject: [PATCH 22/44] Py-cuda11-test CI: introducing variables to py-package-test-pipeline.yml --- .../github/azure-pipelines/py-package-test-pipeline.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml b/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml index fc66cd9f145f7..69e8a176fa806 100644 --- a/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml @@ -5,6 +5,9 @@ resources: trigger: true branch: main # branch to pick the artifact, Used only for manual triggered pipeline runs for testing the pipeline itself +variables: + - template: templates/common-variables.yml + stages: - stage: Linux_Test_CPU_x86_64_stage jobs: @@ -55,7 +58,7 @@ stages: python_wheel_suffix: '_gpu' timeout: 480 docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 - trt_version: '10.4.0.26-1.cuda11.8' + trt_version: ${{ variables.linux_trt_version_cuda11 }} cuda_version: '11.8' From 02a53d502a72279d59735c3fd9fa13df8cf8de9f Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 15:06:45 -0700 Subject: [PATCH 23/44] revert trt version --- .../github/azure-pipelines/templates/common-variables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml index c2e8fdb4be9ec..3e891524b2c6c 100644 --- a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml +++ b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml @@ -1,5 +1,5 @@ variables: - common_trt_version: '10.5.0.18' + common_trt_version: '10.4.0.26' linux_trt_version_cuda11: ${{ variables.common_trt_version }}-1.cuda11.8 linux_trt_version_cuda12: ${{ variables.common_trt_version }}-1.cuda12.6 common_linux_trt_version: ${{ variables.linux_trt_version_cuda12 }} From 2b32be73111182b8788c276350653f1621a8d63c Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 15:24:50 -0700 Subject: [PATCH 24/44] Py-Cuda11/12 Test CIs: remove trt_version usage from parameters --- .../py-cuda-package-test-pipeline.yml | 1 - .../py-package-test-pipeline.yml | 4 ---- .../templates/py-packaging-linux-test-cuda.yml | 17 +++++++++-------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml b/tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml index 062b88a326dcf..5cbe8ff35ccf5 100644 --- a/tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/py-cuda-package-test-pipeline.yml @@ -19,6 +19,5 @@ stages: python_wheel_suffix: '_gpu' timeout: 480 docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1 - trt_version: '10.4.0.26-1.cuda12.6' cuda_version: '12.2' diff --git a/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml b/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml index 69e8a176fa806..a907f798cfd30 100644 --- a/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml @@ -5,9 +5,6 @@ resources: trigger: true branch: main # branch to pick the artifact, Used only for manual triggered pipeline runs for testing the pipeline itself -variables: - - template: templates/common-variables.yml - stages: - stage: Linux_Test_CPU_x86_64_stage jobs: @@ -58,7 +55,6 @@ stages: python_wheel_suffix: '_gpu' timeout: 480 docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 - trt_version: ${{ variables.linux_trt_version_cuda11 }} cuda_version: '11.8' diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-linux-test-cuda.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-linux-test-cuda.yml index 4ca462bf962f5..08826fe7817dd 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-linux-test-cuda.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-linux-test-cuda.yml @@ -16,12 +16,6 @@ parameters: - name: docker_base_image type: string -- name: trt_version - type: string - default: '10.4.0.26-1.cuda11.8' - values: - - 10.4.0.26-1.cuda11.8 - - 10.4.0.26-1.cuda12.6 - name: cuda_version type: string default: '11.8' @@ -47,7 +41,14 @@ jobs: - job: Linux_Test_GPU${{ parameters.extra_job_id }}_${{ parameters.arch }} timeoutInMinutes: ${{ parameters.timeout }} variables: - skipComponentGovernanceDetection: true + - template: common-variables.yml + - name: skipComponentGovernanceDetection + value: true + - name: trt_version + ${{ if eq(parameters.cuda_version, '11.8') }}: + value: ${{ variables.linux_trt_version_cuda11 }} + ${{ if eq(parameters.cuda_version, '12.2') }}: + value: ${{ variables.linux_trt_version_cuda12 }} workspace: clean: all pool: ${{ parameters.machine_pool }} @@ -92,7 +93,7 @@ jobs: parameters: Dockerfile: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/python/cuda/Dockerfile Context: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/python/cuda - DockerBuildArgs: "--build-arg BASEIMAGE=${{ parameters.docker_base_image }} --build-arg TRT_VERSION=${{ parameters.trt_version }} --build-arg BUILD_UID=$( id -u )" + DockerBuildArgs: "--build-arg BASEIMAGE=${{ parameters.docker_base_image }} --build-arg TRT_VERSION=${{ variables.trt_version }} --build-arg BUILD_UID=$( id -u )" Repository: onnxruntimecuda${{ replace(parameters.cuda_version, '.', '') }}xtrt86build${{ parameters.arch }} - task: Bash@3 From f152222fd996e2809e40861c4e72c9be94cb9808 Mon Sep 17 00:00:00 2001 From: yf711 Date: Tue, 15 Oct 2024 17:45:35 -0700 Subject: [PATCH 25/44] py-linux-cuda-package-test-job --- .../stages/jobs/py-linux-cuda-package-test-job.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml index 545996a4ffc79..5da38fa6bf76e 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml @@ -42,16 +42,17 @@ jobs: dependsOn: [ ] timeoutInMinutes: ${{ parameters.timeout }} variables: + - template: ../../templates/common-variables.yml - name: docker_base_image ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 ${{ if eq(parameters.CudaVersion, '12.2') }}: value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241008.1 - name: linux_trt_version ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: 10.4.0.26-1.cuda11.8 + value: ${{ variables.linux_trt_version_cuda11 }} ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: 10.4.0.26-1.cuda12.6 + value: ${{ variables.linux_trt_version_cuda12 }} pool: ${{ parameters.machine_pool }} steps: - checkout: self From 18003c64b664244f2a30bfe43bcdffaa17cc9703 Mon Sep 17 00:00:00 2001 From: yf711 Date: Wed, 16 Oct 2024 10:01:14 -0700 Subject: [PATCH 26/44] test updating py-win-gpu template --- .../azure-pipelines/templates/py-win-gpu.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml index e89227d51de32..fc53ae758eddc 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml @@ -63,9 +63,19 @@ stages: pool: name: onnxruntime-Win-CPU-2022 variables: - GRADLE_OPTS: '-Dorg.gradle.daemon=false' - VSGenerator: 'Visual Studio 17 2022' - CUDA_MODULE_LOADING: 'LAZY' + # The build machine pool doesn't have dotnet, so it can't run CG. + - template: common-variables.yml + - name: GRADLE_OPTS + value: '-Dorg.gradle.daemon=false' + - name: VSGenerator + value: 'Visual Studio 17 2022' + - name: CUDA_MODULE_LOADING + value: 'LAZY' + - name: win_trt_folder + ${{ if eq(parameters.CudaVersion, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.CudaVersion, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} steps: - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 displayName: 'Clean Agent Directories' From e47cf6ae35447d1af155221f1e16012850581b96 Mon Sep 17 00:00:00 2001 From: yf711 Date: Wed, 16 Oct 2024 13:57:08 -0700 Subject: [PATCH 27/44] simplify py-cuda-packaging-stage --- .../stages/py-cuda-packaging-stage.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml index eb240a9b999f3..82cdc9735bc38 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml @@ -54,6 +54,14 @@ parameters: - '3.11' - '3.12' +variables: + - template: ../templates/common-variables.yml + - name: win_trt_folder + ${{ if eq(parameters.CudaVersion, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.CudaVersion, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} + stages: - ${{ if eq(parameters.enable_windows_gpu, true) }}: - ${{ each python_version in parameters.PythonVersions }}: @@ -64,10 +72,7 @@ stages: CudaVersion: ${{ parameters.cuda_version }} SpecificArtifact: ${{ parameters.SpecificArtifact }} BuildId: ${{ parameters.BuildId }} - ${{ if eq(parameters.cuda_version, '11.8') }}: - EP_BUILD_FLAGS: --enable_lto --use_tensorrt --tensorrt_home=$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8 --cuda_home=$(Agent.TempDirectory)\v11.8 --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" - ${{ if eq(parameters.cuda_version, '12.2') }}: - EP_BUILD_FLAGS: --enable_lto --use_tensorrt --tensorrt_home=$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6 --cuda_home=$(Agent.TempDirectory)\v12.2 --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --enable_lto --use_tensorrt --tensorrt_home=$(Agent.TempDirectory)\${{ variables.win_trt_folder }} --cuda_home=$(Agent.TempDirectory)\v${{ parameters.cuda_version }} --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" - ${{ if eq(parameters.enable_linux_gpu, true) }}: - template: ../templates/py-linux-gpu.yml From d8737d42ce02d525701a47acf02c036515274b10 Mon Sep 17 00:00:00 2001 From: yf711 Date: Wed, 16 Oct 2024 14:13:54 -0700 Subject: [PATCH 28/44] adjust py-cuda-packaging-stage --- .../stages/py-cuda-packaging-stage.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml index 82cdc9735bc38..5ff36b4849c18 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml @@ -54,15 +54,14 @@ parameters: - '3.11' - '3.12' -variables: - - template: ../templates/common-variables.yml - - name: win_trt_folder - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: ${{ variables.win_trt_folder_cuda11 }} - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: ${{ variables.win_trt_folder_cuda12 }} - stages: + - variables: + - template: ../templates/common-variables.yml + - name: win_trt_folder + ${{ if eq(parameters.cuda_version, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.cuda_version, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} - ${{ if eq(parameters.enable_windows_gpu, true) }}: - ${{ each python_version in parameters.PythonVersions }}: - template: ../templates/py-win-gpu.yml From f493f8c0a32d92361412be25c2280e234c5e6f99 Mon Sep 17 00:00:00 2001 From: yf711 Date: Wed, 16 Oct 2024 14:53:39 -0700 Subject: [PATCH 29/44] Free trt_build_flag out of EP_BUILD_FLAG; read variables by py-win-gpu --- .../stages/py-cuda-packaging-stage.yml | 10 ++------- .../templates/py-packaging-stage.yml | 3 +++ .../azure-pipelines/templates/py-win-gpu.yml | 21 ++++++++++++------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml index 5ff36b4849c18..c96c582d19b6a 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml @@ -55,13 +55,6 @@ parameters: - '3.12' stages: - - variables: - - template: ../templates/common-variables.yml - - name: win_trt_folder - ${{ if eq(parameters.cuda_version, '11.8') }}: - value: ${{ variables.win_trt_folder_cuda11 }} - ${{ if eq(parameters.cuda_version, '12.2') }}: - value: ${{ variables.win_trt_folder_cuda12 }} - ${{ if eq(parameters.enable_windows_gpu, true) }}: - ${{ each python_version in parameters.PythonVersions }}: - template: ../templates/py-win-gpu.yml @@ -71,7 +64,8 @@ stages: CudaVersion: ${{ parameters.cuda_version }} SpecificArtifact: ${{ parameters.SpecificArtifact }} BuildId: ${{ parameters.BuildId }} - EP_BUILD_FLAGS: --enable_lto --use_tensorrt --tensorrt_home=$(Agent.TempDirectory)\${{ variables.win_trt_folder }} --cuda_home=$(Agent.TempDirectory)\v${{ parameters.cuda_version }} --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --enable_lto --cuda_home=$(Agent.TempDirectory)\v${{ parameters.cuda_version }} --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + use_tensorrt: True - ${{ if eq(parameters.enable_linux_gpu, true) }}: - template: ../templates/py-linux-gpu.yml diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 598f72af1bf90..4a6dcc02a0a02 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -287,6 +287,7 @@ stages: EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} cmake_build_type: ${{ parameters.cmake_build_type }} + use_tensorrt: True - template: py-win-gpu.yml parameters: @@ -297,6 +298,7 @@ stages: EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} cmake_build_type: ${{ parameters.cmake_build_type }} + use_tensorrt: True - template: py-win-gpu.yml parameters: @@ -307,6 +309,7 @@ stages: EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} cmake_build_type: ${{ parameters.cmake_build_type }} + use_tensorrt: True - template: py-win-gpu.yml parameters: diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml index fc53ae758eddc..dcb32c0472ab8 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml @@ -52,6 +52,10 @@ parameters: type: boolean default: false +- name: use_tensorrt + type: boolean + default: false + stages: - stage: Win_py_${{ parameters.EP_NAME }}_Wheels_${{ replace(parameters.PYTHON_VERSION,'.','_') }}_Build dependsOn: [] @@ -76,6 +80,11 @@ stages: value: ${{ variables.win_trt_folder_cuda11 }} ${{ if eq(parameters.CudaVersion, '12.2') }}: value: ${{ variables.win_trt_folder_cuda12 }} + - name: trt_build_flag + ${{ if eq(parameters.use_tensorrt, true) }}: + value: '--use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\${{ variables.win_trt_folder }}"' + ${{ if eq(parameters.use_tensorrt, false) }}: + value: '' steps: - task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 displayName: 'Clean Agent Directories' @@ -105,19 +114,17 @@ stages: - template: jobs/set-winenv.yml parameters: EnvSetupScript: ${{ parameters.ENV_SETUP_SCRIPT }} - ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), contains(parameters.EP_BUILD_FLAGS, 'use_tensorrt')) }}: + ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true) }}: DownloadCUDA: true - ${{ if contains(parameters.EP_BUILD_FLAGS, 'use_tensorrt') }}: - DownloadTRT: true + DownloadTRT: ${{ parameters.use_tensorrt }} - ${{ if eq(parameters.ENV_SETUP_SCRIPT, '') }}: - template: jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} - ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), contains(parameters.EP_BUILD_FLAGS, 'use_tensorrt')) }}: + ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true) }}: DownloadCUDA: true - ${{ if contains(parameters.EP_BUILD_FLAGS, 'use_tensorrt') }}: - DownloadTRT: true + DownloadTRT: ${{ parameters.use_tensorrt }} - task: PythonScript@0 displayName: 'Update deps.txt' @@ -147,7 +154,7 @@ stages: --enable_pybind --enable_onnx_tests --parallel --use_binskim_compliant_compile_flags --update - $(TelemetryOption) ${{ parameters.BUILD_PY_PARAMETERS }} ${{ parameters.EP_BUILD_FLAGS }} + $(TelemetryOption) ${{ parameters.BUILD_PY_PARAMETERS }} ${{ parameters.EP_BUILD_FLAGS }} ${{ variables.trt_build_flag }} workingDirectory: '$(Build.BinariesDirectory)' # building with build.py so the parallelization parameters are added to the msbuild command From 1c7dca3cc34b5b4c10f93de01e48180f5e58cb5f Mon Sep 17 00:00:00 2001 From: yf711 Date: Wed, 16 Oct 2024 14:55:49 -0700 Subject: [PATCH 30/44] fix --- .../ci_build/github/azure-pipelines/templates/py-win-gpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml index dcb32c0472ab8..2324235cd74a0 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml @@ -114,7 +114,7 @@ stages: - template: jobs/set-winenv.yml parameters: EnvSetupScript: ${{ parameters.ENV_SETUP_SCRIPT }} - ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true) }}: + ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true)) }}: DownloadCUDA: true DownloadTRT: ${{ parameters.use_tensorrt }} @@ -122,7 +122,7 @@ stages: - template: jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} - ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true) }}: + ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true)) }}: DownloadCUDA: true DownloadTRT: ${{ parameters.use_tensorrt }} From 00275e96288012411cdeee47623831d4b6c493ff Mon Sep 17 00:00:00 2001 From: yf711 Date: Wed, 16 Oct 2024 15:15:25 -0700 Subject: [PATCH 31/44] explicitly assign CudaVersion for py-cuda11 pkg stages --- .../azure-pipelines/templates/py-packaging-stage.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 4a6dcc02a0a02..561dc49742774 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -282,7 +282,8 @@ stages: parameters: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.10' - EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8" --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + CudaVersion: 11.8 + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} @@ -293,7 +294,8 @@ stages: parameters: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.11' - EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8" --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + CudaVersion: 11.8 + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} @@ -304,7 +306,8 @@ stages: parameters: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.12' - EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8" --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + CudaVersion: 11.8 + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} From 1d0c40a86ab3327cda418f6d8eacc83cc3c49f40 Mon Sep 17 00:00:00 2001 From: yf711 Date: Wed, 16 Oct 2024 18:42:18 -0700 Subject: [PATCH 32/44] clean unused param of download_win_gpu_library, introduce "win_trt_folder" --- .../nuget/templates/test_win.yml | 10 ++++- .../stages/java-cuda-packaging-stage.yml | 8 +++- .../stages/nuget-win-cuda-packaging-stage.yml | 12 +++++- .../jobs/download_win_gpu_library.yml | 41 ++++--------------- .../azure-pipelines/templates/py-win-gpu.yml | 6 +-- .../azure-pipelines/templates/win-ci.yml | 16 ++++---- 6 files changed, 47 insertions(+), 46 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml index ddcea447adc94..b29000f1730a0 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml @@ -26,16 +26,22 @@ stages: pool: ${{ parameters.AgentPool }} variables: + - template: ../../templates/common-variables.yml - name: OnnxRuntimeBuildDirectory value: '$(Build.BinariesDirectory)' - name: SKIPNONPACKAGETESTS value: 'ON' - name: runCodesignValidationInjection value: false - - name: CUDA_MODULE_LOADINGL + - name: CUDA_MODULE_LOADING value: 'LAZY' - name: GRADLE_OPTS value: '-Dorg.gradle.daemon=false' + - name: win_trt_folder + ${{ if eq(parameters.CudaVersion, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.CudaVersion, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} steps: - task: UsePythonVersion@0 @@ -51,9 +57,9 @@ stages: - ${{ if ne( parameters.CudaVersion, '') }}: - template: ../../templates/jobs/download_win_gpu_library.yml parameters: - DownloadCUDA: true DownloadTRT: true CudaVersion: ${{ parameters.CudaVersion }} + win_trt_folder: ${{ variables.win_trt_folder }} - task: BatchScript@1 displayName: 'Setup Visual Studio env vars' diff --git a/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml index 7bc61268805f2..f4cdc521353e6 100644 --- a/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml @@ -88,8 +88,14 @@ stages: pool: 'onnxruntime-Win2022-GPU-A10' timeoutInMinutes: 60 variables: + - template: ../templates/common-variables.yml - name: runCodesignValidationInjection value: false + - name: win_trt_folder + ${{ if eq(parameters.CudaVersion, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.CudaVersion, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} steps: - template: ../templates/set-version-number-variables-step.yml @@ -97,8 +103,8 @@ stages: - template: ../templates/jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} - DownloadCUDA: true DownloadTRT: true + win_trt_folder: ${{ variables.win_trt_folder }} - template: ../templates/flex-downloadPipelineArtifact.yml parameters: diff --git a/tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml index 445066f08995a..2704479d125db 100644 --- a/tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml @@ -18,6 +18,9 @@ parameters: - name: CudaVersion type: string default: '11.8' + values: + - 11.8 + - 12.2 - name: win_cuda_home type: string @@ -89,8 +92,15 @@ stages: clean: all pool: 'onnxruntime-Win2022-GPU-A10' variables: + - template: ../templates/common-variables.yml + - name: win_trt_folder + ${{ if eq(parameters.CudaVersion, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.CudaVersion, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} CUDA_MODULE_LOADINGL: 'LAZY' GRADLE_OPTS: '-Dorg.gradle.daemon=false' + steps: - checkout: self # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime - checkout: onnxruntime-inference-examples # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime-inference-examples @@ -102,9 +112,9 @@ stages: - script: dir $(Build.SourcesDirectory) - template: ../templates/jobs/download_win_gpu_library.yml parameters: - DownloadCUDA: true DownloadTRT: true CudaVersion: ${{ parameters.CudaVersion }} + win_trt_folder: ${{ variables.win_trt_folder }} - template: ../templates/set-version-number-variables-step.yml parameters: diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml index e196ecb312f96..0db6c1f889b9f 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml @@ -1,7 +1,4 @@ parameters: - - name: DownloadCUDA - type: boolean - default: false - name: DownloadTRT type: boolean default: false @@ -11,12 +8,10 @@ parameters: values: - 11.8 - 12.2 - - name: TrtVersion + - name: win_trt_folder type: string - default: '10.4.0.26' - values: - - 8.6.1.6 - - 10.4.0.26 + default: '' + steps: - ${{ if eq(parameters.DownloadCUDA, true) }}: @@ -32,35 +27,17 @@ steps: script: | echo %PATH% displayName: 'Print PATH after download CUDA SDK' - - - ${{ if eq(parameters.DownloadTRT, true) }}: - - ${{ if eq(parameters.CudaVersion, '11.8') }}: - - powershell: | - Write-Host "##vso[task.setvariable variable=trtCudaVersion;]11.8" - displayName: Set trtCudaVersion - - ${{ if and(eq(parameters.CudaVersion, '12.2'), eq(parameters.TrtVersion, '8.6.1.6')) }}: - - powershell: | - Write-Host "##vso[task.setvariable variable=trtCudaVersion;]12.0" - displayName: Set trtCudaVersion - - ${{ if and(eq(parameters.CudaVersion, '12.2'), eq(parameters.TrtVersion, '10.4.0.26')) }}: - - powershell: | - Write-Host "##vso[task.setvariable variable=trtCudaVersion;]12.6" - displayName: Set trtCudaVersion - - - script: | - echo $(trtCudaVersion) && echo TensorRT-${{ parameters.TrtVersion }}.Windows10.x86_64.cuda-$(trtCudaVersion) - displayName: Get trtCudaVersion and Directory Name - + - ${{ if and(eq(parameters.DownloadTRT, true), ne( parameters.win_trt_folder, '')) }}: - powershell: | - azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/local/TensorRT-${{ parameters.TrtVersion }}.Windows10.x86_64.cuda-$(trtCudaVersion) $(Agent.TempDirectory) - displayName: 'Download TensorRT-${{ parameters.TrtVersion }}.Windows10.x86_64.cuda-$(trtCudaVersion)' + azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder }} $(Agent.TempDirectory) + displayName: 'Download ${{ parameters.win_trt_folder }}' - powershell: | - Write-Host "##vso[task.prependpath]$(Agent.TempDirectory)\TensorRT-${{ parameters.TrtVersion }}.Windows10.x86_64.cuda-$(trtCudaVersion)\lib" - displayName: 'Append TensorRT-${{ parameters.TrtVersion }} Directory to PATH' + Write-Host "##vso[task.prependpath]$(Agent.TempDirectory)\${{ parameters.win_trt_folder }}\lib" + displayName: 'Append ${{ parameters.win_trt_folder }} Directory to PATH' - task: CmdLine@2 inputs: script: | echo %PATH% - displayName: 'Print PATH after download TensorRT' + displayName: 'Print PATH after download TensorRT' \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml index 2324235cd74a0..79e85b87bd0cd 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml @@ -122,9 +122,9 @@ stages: - template: jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} - ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true)) }}: - DownloadCUDA: true - DownloadTRT: ${{ parameters.use_tensorrt }} + ${{ if eq(parameters.use_tensorrt, true) }}: + DownloadTRT: true + win_trt_folder: ${{ variables.win_trt_folder }} - task: PythonScript@0 displayName: 'Update deps.txt' diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml index 52547fd9a796b..56d7ba1762868 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml @@ -85,6 +85,7 @@ stages: - stage: Windows_Packaging_${{ parameters.stage_name_suffix }} dependsOn: [] variables: + - template: common-variables.yml GRADLE_OPTS: '-Dorg.gradle.daemon=false' VSGenerator: 'Visual Studio 17 2022' CUDA_MODULE_LOADING: 'LAZY' @@ -96,6 +97,11 @@ stages: timeoutParameter: '--test_all_timeout 72000' ${{ else }}: timeoutParameter: '' + - name: win_trt_folder + ${{ if eq(parameters.CudaVersion, '11.8') }}: + value: ${{ variables.win_trt_folder_cuda11 }} + ${{ if eq(parameters.CudaVersion, '12.2') }}: + value: ${{ variables.win_trt_folder_cuda12 }} jobs: - job: Windows_Packaging_${{ parameters.stage_name_suffix }} workspace: @@ -142,14 +148,12 @@ stages: - template: jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} - ${{ if contains(parameters.buildparameter, 'use_cuda') }}: - DownloadCUDA: true ${{ if contains(parameters.buildparameter, 'use_tensorrt') }}: - DownloadCUDA: true DownloadTRT: true + win_trt_folder: ${{ variables.win_trt_folder }} - powershell: | Write-Host "##vso[task.prependpath]C:\Program Files (x86)\dotnet" - displayName: 'Append dotnet x86 Directory to PATH' + displayName: 'Append dotnet x86 Directory to PATH' condition: and(succeeded(), eq('${{ parameters.buildArch}}', 'x86')) - template: download-deps.yml @@ -373,11 +377,9 @@ stages: - template: jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} - ${{ if contains(parameters.buildparameter, 'use_cuda') }}: - DownloadCUDA: true ${{ if contains(parameters.buildparameter, 'use_tensorrt') }}: - DownloadCUDA: true DownloadTRT: true + win_trt_folder: ${{ variables.win_trt_folder }} - powershell: | Write-Host "##vso[task.prependpath]C:\Program Files (x86)\dotnet" From 20c40a96965e6dfdd2b0e7cdf765dec6027299ad Mon Sep 17 00:00:00 2001 From: yf711 Date: Thu, 17 Oct 2024 09:11:36 -0700 Subject: [PATCH 33/44] pass win_trt_folder path via parameters --- .../templates/jobs/set-winenv.yml | 21 ++++++------------- .../templates/jobs/win-ci-vs-2022-job.yml | 4 ++++ .../azure-pipelines/templates/py-win-gpu.yml | 3 ++- .../win-gpu-tensorrt-ci-pipeline.yml | 14 ++++++------- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml index aaa475d3daf0e..dcf9c195cdd10 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml @@ -4,21 +4,15 @@ parameters: - name: DownloadCUDA type: boolean default: false - - name: DownloadTRT - type: boolean - default: false - name: PrimaryCUDAVersion type: string default: '12.2' - name: SecondaryCUDAVersion type: string default: '11.8' - - name: win_trt_folder_cuda11 + - name: win_trt_folder type: string - default: 'TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8' - - name: win_trt_folder_cuda12 - type: string - default: 'TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6' + default: '' steps: - ${{ if eq(parameters.DownloadCUDA, 'true') }}: @@ -28,13 +22,10 @@ steps: - powershell: | azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.SecondaryCUDAVersion }}" $(Agent.TempDirectory) displayName: 'Download Secondary CUDA SDK v${{ parameters.SecondaryCUDAVersion }}' - - ${{ if eq(parameters.DownloadTRT, 'true') }}: - - powershell: | - azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder_cuda11 }}" $(Agent.TempDirectory) - displayName: 'Download ${{ parameters.win_trt_folder_cuda11 }}' + - ${{ if ne(parameters.win_trt_folder, '') }}: - powershell: | - azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder_cuda12 }}" $(Agent.TempDirectory) - displayName: 'Download ${{ variables.win_trt_folder_cuda12 }}' + azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder }}" $(Agent.TempDirectory) + displayName: 'Download ${{ parameters.win_trt_folder }}' - task: BatchScript@1 displayName: 'setup env' @@ -42,4 +33,4 @@ steps: filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}' arguments: '' modifyEnvironment: true - workingFolder: '$(Build.BinariesDirectory)' + workingFolder: '$(Build.BinariesDirectory)' \ No newline at end of file diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml index 34de1201fa049..d9864afde55af 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml @@ -55,10 +55,14 @@ parameters: type: number default: 0 +- name: Cuda_Version + type: string + default: '' jobs: - job: build_${{ parameters.job_name_suffix }} variables: + OrtPackageId: 'Microsoft.ML.OnnxRuntime' OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)' DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml index 79e85b87bd0cd..215a08e988319 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml @@ -116,7 +116,8 @@ stages: EnvSetupScript: ${{ parameters.ENV_SETUP_SCRIPT }} ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true)) }}: DownloadCUDA: true - DownloadTRT: ${{ parameters.use_tensorrt }} + ${{ if eq(parameters.use_tensorrt, true) }}: + win_trt_folder: ${{ variables.win_trt_folder }} - ${{ if eq(parameters.ENV_SETUP_SCRIPT, '') }}: - template: jobs/download_win_gpu_library.yml diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml index f4ab9ee5b4a5c..187a92e76a5f5 100644 --- a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml @@ -34,20 +34,18 @@ parameters: default: '12.2' values: - 11.8 - - 12.2 + - 12.2 -variables: +jobs: +- job: 'build' + pool: 'onnxruntime-Win2022-GPU-A10' + variables: - template: templates/common-variables.yml - name: win_trt_folder ${{ if eq(parameters.CudaVersion, '11.8') }}: value: ${{ variables.win_trt_folder_cuda11 }} ${{ if eq(parameters.CudaVersion, '12.2') }}: value: ${{ variables.win_trt_folder_cuda12 }} - -jobs: -- job: 'build' - pool: 'onnxruntime-Win2022-GPU-A10' - variables: MsbuildArguments: '-detailedsummary -maxcpucount -consoleloggerparameters:PerformanceSummary' EnvSetupScript: setup_env_trt.bat skipComponentGovernanceDetection: true @@ -61,6 +59,8 @@ jobs: EnvSetupScript: $(EnvSetupScript) DownloadCUDA: true DownloadTRT: true + win_trt_folder_cuda11: ${{ variables.win_trt_folder_cuda11 }} + win_trt_folder_cuda12: ${{ variables.win_trt_folder_cuda12 }} BuildArch: 'x64' BuildConfig: RelWithDebInfo MachinePool: 'onnxruntime-Win2022-GPU-A10' From e9a393eb67170ea98518bbe0f83780729fc4732a Mon Sep 17 00:00:00 2001 From: yf711 Date: Thu, 17 Oct 2024 09:15:30 -0700 Subject: [PATCH 34/44] Revert "pass win_trt_folder path via parameters" This reverts commit 20c40a96965e6dfdd2b0e7cdf765dec6027299ad. --- .../templates/jobs/set-winenv.yml | 21 +++++++++++++------ .../templates/jobs/win-ci-vs-2022-job.yml | 4 ---- .../azure-pipelines/templates/py-win-gpu.yml | 3 +-- .../win-gpu-tensorrt-ci-pipeline.yml | 14 ++++++------- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml index dcf9c195cdd10..aaa475d3daf0e 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml @@ -4,15 +4,21 @@ parameters: - name: DownloadCUDA type: boolean default: false + - name: DownloadTRT + type: boolean + default: false - name: PrimaryCUDAVersion type: string default: '12.2' - name: SecondaryCUDAVersion type: string default: '11.8' - - name: win_trt_folder + - name: win_trt_folder_cuda11 type: string - default: '' + default: 'TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8' + - name: win_trt_folder_cuda12 + type: string + default: 'TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6' steps: - ${{ if eq(parameters.DownloadCUDA, 'true') }}: @@ -22,10 +28,13 @@ steps: - powershell: | azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.SecondaryCUDAVersion }}" $(Agent.TempDirectory) displayName: 'Download Secondary CUDA SDK v${{ parameters.SecondaryCUDAVersion }}' - - ${{ if ne(parameters.win_trt_folder, '') }}: + - ${{ if eq(parameters.DownloadTRT, 'true') }}: + - powershell: | + azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder_cuda11 }}" $(Agent.TempDirectory) + displayName: 'Download ${{ parameters.win_trt_folder_cuda11 }}' - powershell: | - azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder }}" $(Agent.TempDirectory) - displayName: 'Download ${{ parameters.win_trt_folder }}' + azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder_cuda12 }}" $(Agent.TempDirectory) + displayName: 'Download ${{ variables.win_trt_folder_cuda12 }}' - task: BatchScript@1 displayName: 'setup env' @@ -33,4 +42,4 @@ steps: filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}' arguments: '' modifyEnvironment: true - workingFolder: '$(Build.BinariesDirectory)' \ No newline at end of file + workingFolder: '$(Build.BinariesDirectory)' diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml index d9864afde55af..34de1201fa049 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml @@ -55,14 +55,10 @@ parameters: type: number default: 0 -- name: Cuda_Version - type: string - default: '' jobs: - job: build_${{ parameters.job_name_suffix }} variables: - OrtPackageId: 'Microsoft.ML.OnnxRuntime' OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)' DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml index 215a08e988319..79e85b87bd0cd 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml @@ -116,8 +116,7 @@ stages: EnvSetupScript: ${{ parameters.ENV_SETUP_SCRIPT }} ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true)) }}: DownloadCUDA: true - ${{ if eq(parameters.use_tensorrt, true) }}: - win_trt_folder: ${{ variables.win_trt_folder }} + DownloadTRT: ${{ parameters.use_tensorrt }} - ${{ if eq(parameters.ENV_SETUP_SCRIPT, '') }}: - template: jobs/download_win_gpu_library.yml diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml index 187a92e76a5f5..f4ab9ee5b4a5c 100644 --- a/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-gpu-tensorrt-ci-pipeline.yml @@ -34,18 +34,20 @@ parameters: default: '12.2' values: - 11.8 - - 12.2 + - 12.2 -jobs: -- job: 'build' - pool: 'onnxruntime-Win2022-GPU-A10' - variables: +variables: - template: templates/common-variables.yml - name: win_trt_folder ${{ if eq(parameters.CudaVersion, '11.8') }}: value: ${{ variables.win_trt_folder_cuda11 }} ${{ if eq(parameters.CudaVersion, '12.2') }}: value: ${{ variables.win_trt_folder_cuda12 }} + +jobs: +- job: 'build' + pool: 'onnxruntime-Win2022-GPU-A10' + variables: MsbuildArguments: '-detailedsummary -maxcpucount -consoleloggerparameters:PerformanceSummary' EnvSetupScript: setup_env_trt.bat skipComponentGovernanceDetection: true @@ -59,8 +61,6 @@ jobs: EnvSetupScript: $(EnvSetupScript) DownloadCUDA: true DownloadTRT: true - win_trt_folder_cuda11: ${{ variables.win_trt_folder_cuda11 }} - win_trt_folder_cuda12: ${{ variables.win_trt_folder_cuda12 }} BuildArch: 'x64' BuildConfig: RelWithDebInfo MachinePool: 'onnxruntime-Win2022-GPU-A10' From fb38fdca63897182a2117b752baa3023fb995b91 Mon Sep 17 00:00:00 2001 From: yf711 Date: Thu, 17 Oct 2024 09:15:35 -0700 Subject: [PATCH 35/44] Revert "clean unused param of download_win_gpu_library," This reverts commit 1d0c40a86ab3327cda418f6d8eacc83cc3c49f40. --- .../nuget/templates/test_win.yml | 10 +---- .../stages/java-cuda-packaging-stage.yml | 8 +--- .../stages/nuget-win-cuda-packaging-stage.yml | 12 +----- .../jobs/download_win_gpu_library.yml | 41 +++++++++++++++---- .../azure-pipelines/templates/py-win-gpu.yml | 6 +-- .../azure-pipelines/templates/win-ci.yml | 16 ++++---- 6 files changed, 46 insertions(+), 47 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml index b29000f1730a0..ddcea447adc94 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/test_win.yml @@ -26,22 +26,16 @@ stages: pool: ${{ parameters.AgentPool }} variables: - - template: ../../templates/common-variables.yml - name: OnnxRuntimeBuildDirectory value: '$(Build.BinariesDirectory)' - name: SKIPNONPACKAGETESTS value: 'ON' - name: runCodesignValidationInjection value: false - - name: CUDA_MODULE_LOADING + - name: CUDA_MODULE_LOADINGL value: 'LAZY' - name: GRADLE_OPTS value: '-Dorg.gradle.daemon=false' - - name: win_trt_folder - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: ${{ variables.win_trt_folder_cuda11 }} - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: ${{ variables.win_trt_folder_cuda12 }} steps: - task: UsePythonVersion@0 @@ -57,9 +51,9 @@ stages: - ${{ if ne( parameters.CudaVersion, '') }}: - template: ../../templates/jobs/download_win_gpu_library.yml parameters: + DownloadCUDA: true DownloadTRT: true CudaVersion: ${{ parameters.CudaVersion }} - win_trt_folder: ${{ variables.win_trt_folder }} - task: BatchScript@1 displayName: 'Setup Visual Studio env vars' diff --git a/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml index f4cdc521353e6..7bc61268805f2 100644 --- a/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml @@ -88,14 +88,8 @@ stages: pool: 'onnxruntime-Win2022-GPU-A10' timeoutInMinutes: 60 variables: - - template: ../templates/common-variables.yml - name: runCodesignValidationInjection value: false - - name: win_trt_folder - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: ${{ variables.win_trt_folder_cuda11 }} - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: ${{ variables.win_trt_folder_cuda12 }} steps: - template: ../templates/set-version-number-variables-step.yml @@ -103,8 +97,8 @@ stages: - template: ../templates/jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} + DownloadCUDA: true DownloadTRT: true - win_trt_folder: ${{ variables.win_trt_folder }} - template: ../templates/flex-downloadPipelineArtifact.yml parameters: diff --git a/tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml index 2704479d125db..445066f08995a 100644 --- a/tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/nuget-win-cuda-packaging-stage.yml @@ -18,9 +18,6 @@ parameters: - name: CudaVersion type: string default: '11.8' - values: - - 11.8 - - 12.2 - name: win_cuda_home type: string @@ -92,15 +89,8 @@ stages: clean: all pool: 'onnxruntime-Win2022-GPU-A10' variables: - - template: ../templates/common-variables.yml - - name: win_trt_folder - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: ${{ variables.win_trt_folder_cuda11 }} - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: ${{ variables.win_trt_folder_cuda12 }} CUDA_MODULE_LOADINGL: 'LAZY' GRADLE_OPTS: '-Dorg.gradle.daemon=false' - steps: - checkout: self # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime - checkout: onnxruntime-inference-examples # due to checkout multiple repos, the root directory is $(Build.SourcesDirectory)/onnxruntime-inference-examples @@ -112,9 +102,9 @@ stages: - script: dir $(Build.SourcesDirectory) - template: ../templates/jobs/download_win_gpu_library.yml parameters: + DownloadCUDA: true DownloadTRT: true CudaVersion: ${{ parameters.CudaVersion }} - win_trt_folder: ${{ variables.win_trt_folder }} - template: ../templates/set-version-number-variables-step.yml parameters: diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml index 0db6c1f889b9f..e196ecb312f96 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml @@ -1,4 +1,7 @@ parameters: + - name: DownloadCUDA + type: boolean + default: false - name: DownloadTRT type: boolean default: false @@ -8,10 +11,12 @@ parameters: values: - 11.8 - 12.2 - - name: win_trt_folder + - name: TrtVersion type: string - default: '' - + default: '10.4.0.26' + values: + - 8.6.1.6 + - 10.4.0.26 steps: - ${{ if eq(parameters.DownloadCUDA, true) }}: @@ -27,17 +32,35 @@ steps: script: | echo %PATH% displayName: 'Print PATH after download CUDA SDK' - - ${{ if and(eq(parameters.DownloadTRT, true), ne( parameters.win_trt_folder, '')) }}: + + - ${{ if eq(parameters.DownloadTRT, true) }}: + - ${{ if eq(parameters.CudaVersion, '11.8') }}: + - powershell: | + Write-Host "##vso[task.setvariable variable=trtCudaVersion;]11.8" + displayName: Set trtCudaVersion + - ${{ if and(eq(parameters.CudaVersion, '12.2'), eq(parameters.TrtVersion, '8.6.1.6')) }}: + - powershell: | + Write-Host "##vso[task.setvariable variable=trtCudaVersion;]12.0" + displayName: Set trtCudaVersion + - ${{ if and(eq(parameters.CudaVersion, '12.2'), eq(parameters.TrtVersion, '10.4.0.26')) }}: + - powershell: | + Write-Host "##vso[task.setvariable variable=trtCudaVersion;]12.6" + displayName: Set trtCudaVersion + + - script: | + echo $(trtCudaVersion) && echo TensorRT-${{ parameters.TrtVersion }}.Windows10.x86_64.cuda-$(trtCudaVersion) + displayName: Get trtCudaVersion and Directory Name + - powershell: | - azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/local/${{ parameters.win_trt_folder }} $(Agent.TempDirectory) - displayName: 'Download ${{ parameters.win_trt_folder }}' + azcopy.exe cp --recursive https://lotusscus.blob.core.windows.net/models/local/TensorRT-${{ parameters.TrtVersion }}.Windows10.x86_64.cuda-$(trtCudaVersion) $(Agent.TempDirectory) + displayName: 'Download TensorRT-${{ parameters.TrtVersion }}.Windows10.x86_64.cuda-$(trtCudaVersion)' - powershell: | - Write-Host "##vso[task.prependpath]$(Agent.TempDirectory)\${{ parameters.win_trt_folder }}\lib" - displayName: 'Append ${{ parameters.win_trt_folder }} Directory to PATH' + Write-Host "##vso[task.prependpath]$(Agent.TempDirectory)\TensorRT-${{ parameters.TrtVersion }}.Windows10.x86_64.cuda-$(trtCudaVersion)\lib" + displayName: 'Append TensorRT-${{ parameters.TrtVersion }} Directory to PATH' - task: CmdLine@2 inputs: script: | echo %PATH% - displayName: 'Print PATH after download TensorRT' \ No newline at end of file + displayName: 'Print PATH after download TensorRT' diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml index 79e85b87bd0cd..2324235cd74a0 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-gpu.yml @@ -122,9 +122,9 @@ stages: - template: jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} - ${{ if eq(parameters.use_tensorrt, true) }}: - DownloadTRT: true - win_trt_folder: ${{ variables.win_trt_folder }} + ${{ if or(contains(parameters.EP_BUILD_FLAGS, 'use_cuda'), eq(parameters.use_tensorrt, true)) }}: + DownloadCUDA: true + DownloadTRT: ${{ parameters.use_tensorrt }} - task: PythonScript@0 displayName: 'Update deps.txt' diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml index 56d7ba1762868..52547fd9a796b 100644 --- a/tools/ci_build/github/azure-pipelines/templates/win-ci.yml +++ b/tools/ci_build/github/azure-pipelines/templates/win-ci.yml @@ -85,7 +85,6 @@ stages: - stage: Windows_Packaging_${{ parameters.stage_name_suffix }} dependsOn: [] variables: - - template: common-variables.yml GRADLE_OPTS: '-Dorg.gradle.daemon=false' VSGenerator: 'Visual Studio 17 2022' CUDA_MODULE_LOADING: 'LAZY' @@ -97,11 +96,6 @@ stages: timeoutParameter: '--test_all_timeout 72000' ${{ else }}: timeoutParameter: '' - - name: win_trt_folder - ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: ${{ variables.win_trt_folder_cuda11 }} - ${{ if eq(parameters.CudaVersion, '12.2') }}: - value: ${{ variables.win_trt_folder_cuda12 }} jobs: - job: Windows_Packaging_${{ parameters.stage_name_suffix }} workspace: @@ -148,12 +142,14 @@ stages: - template: jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} + ${{ if contains(parameters.buildparameter, 'use_cuda') }}: + DownloadCUDA: true ${{ if contains(parameters.buildparameter, 'use_tensorrt') }}: + DownloadCUDA: true DownloadTRT: true - win_trt_folder: ${{ variables.win_trt_folder }} - powershell: | Write-Host "##vso[task.prependpath]C:\Program Files (x86)\dotnet" - displayName: 'Append dotnet x86 Directory to PATH' + displayName: 'Append dotnet x86 Directory to PATH' condition: and(succeeded(), eq('${{ parameters.buildArch}}', 'x86')) - template: download-deps.yml @@ -377,9 +373,11 @@ stages: - template: jobs/download_win_gpu_library.yml parameters: CudaVersion: ${{ parameters.CudaVersion }} + ${{ if contains(parameters.buildparameter, 'use_cuda') }}: + DownloadCUDA: true ${{ if contains(parameters.buildparameter, 'use_tensorrt') }}: + DownloadCUDA: true DownloadTRT: true - win_trt_folder: ${{ variables.win_trt_folder }} - powershell: | Write-Host "##vso[task.prependpath]C:\Program Files (x86)\dotnet" From 6ae457a45743c55173240377e69f2f0f00d88f17 Mon Sep 17 00:00:00 2001 From: yf711 Date: Thu, 17 Oct 2024 10:07:17 -0700 Subject: [PATCH 36/44] update py-packaging-selectable-stage (not being used) --- .../templates/py-packaging-selectable-stage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml index 8a6434e757a3c..80a848f218980 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-selectable-stage.yml @@ -379,9 +379,10 @@ stages: pool: 'onnxruntime-Win2022-GPU-A10' timeoutInMinutes: 300 variables: + - template: common-variables.yml CUDA_VERSION: '11.8' buildArch: x64 - EpBuildFlags: --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8" --cuda_version=$(CUDA_VERSION) --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$(CUDA_VERSION)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80" + EpBuildFlags: --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\${{ variables.win_trt_folder_cuda11 }}" --cuda_version=$(CUDA_VERSION) --cuda_home="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$(CUDA_VERSION)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=37;50;52;60;61;70;75;80" EnvSetupScript: setup_env_gpu.bat EP_NAME: gpu VSGenerator: 'Visual Studio 17 2022' From 71e060f035cbb57a1a05190bc22475d4a1744785 Mon Sep 17 00:00:00 2001 From: yf711 Date: Thu, 17 Oct 2024 10:08:35 -0700 Subject: [PATCH 37/44] apply trt10.5 --- .../github/azure-pipelines/templates/common-variables.yml | 2 +- .../templates/jobs/download_win_gpu_library.yml | 6 +++--- .../github/azure-pipelines/templates/jobs/set-winenv.yml | 4 ++-- .../linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 | 2 +- .../docker/Dockerfile.package_ubi8_cuda_tensorrt10_0_torch | 2 +- .../github/linux/docker/Dockerfile.package_ubuntu_2004_gpu | 2 +- .../linux/docker/Dockerfile.package_ubuntu_2004_gpu_ffmpeg | 2 +- .../github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 | 2 +- .../linux/docker/inference/x86_64/python/cuda/Dockerfile | 2 +- tools/ci_build/github/windows/setup_env_gpu.bat | 4 ++-- tools/ci_build/github/windows/setup_env_trt.bat | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml index 3e891524b2c6c..c2e8fdb4be9ec 100644 --- a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml +++ b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml @@ -1,5 +1,5 @@ variables: - common_trt_version: '10.4.0.26' + common_trt_version: '10.5.0.18' linux_trt_version_cuda11: ${{ variables.common_trt_version }}-1.cuda11.8 linux_trt_version_cuda12: ${{ variables.common_trt_version }}-1.cuda12.6 common_linux_trt_version: ${{ variables.linux_trt_version_cuda12 }} diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml index e196ecb312f96..8b3101a34f760 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/download_win_gpu_library.yml @@ -13,10 +13,10 @@ parameters: - 12.2 - name: TrtVersion type: string - default: '10.4.0.26' + default: '10.5.0.18' values: - 8.6.1.6 - - 10.4.0.26 + - 10.5.0.18 steps: - ${{ if eq(parameters.DownloadCUDA, true) }}: @@ -42,7 +42,7 @@ steps: - powershell: | Write-Host "##vso[task.setvariable variable=trtCudaVersion;]12.0" displayName: Set trtCudaVersion - - ${{ if and(eq(parameters.CudaVersion, '12.2'), eq(parameters.TrtVersion, '10.4.0.26')) }}: + - ${{ if and(eq(parameters.CudaVersion, '12.2'), eq(parameters.TrtVersion, '10.5.0.18')) }}: - powershell: | Write-Host "##vso[task.setvariable variable=trtCudaVersion;]12.6" displayName: Set trtCudaVersion diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml index aaa475d3daf0e..99d3ccef187da 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml @@ -15,10 +15,10 @@ parameters: default: '11.8' - name: win_trt_folder_cuda11 type: string - default: 'TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8' + default: 'TensorRT-10.5.0.18.Windows10.x86_64.cuda-11.8' - name: win_trt_folder_cuda12 type: string - default: 'TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6' + default: 'TensorRT-10.5.0.18.Windows10.x86_64.cuda-12.6' steps: - ${{ if eq(parameters.DownloadCUDA, 'true') }}: diff --git a/tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 b/tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 index c1a445e29fc89..4ddfa65939906 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 +++ b/tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 @@ -6,7 +6,7 @@ # Build base image with required system packages ARG BASEIMAGE=nvidia/cuda:12.5.1-cudnn-devel-ubi8 -ARG TRT_VERSION=10.4.0.26-1.cuda12.6 +ARG TRT_VERSION=10.5.0.18-1.cuda12.6 FROM $BASEIMAGE AS base ARG TRT_VERSION ENV PATH /opt/python/cp38-cp38/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/src/tensorrt/bin:${PATH} diff --git a/tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0_torch b/tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0_torch index a228ebed165eb..44eafa08e5ef5 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0_torch +++ b/tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0_torch @@ -6,7 +6,7 @@ # Build base image with required system packages ARG BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubi8 -ARG TRT_VERSION=10.4.0.26-1.cuda11.8 +ARG TRT_VERSION=10.5.0.18-1.cuda11.8 FROM $BASEIMAGE AS base ARG TRT_VERSION ENV PATH /opt/python/cp38-cp38/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/src/tensorrt/bin:${PATH} diff --git a/tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2004_gpu b/tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2004_gpu index 6a4244b7aad0d..f5855c65eb9bd 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2004_gpu +++ b/tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2004_gpu @@ -6,7 +6,7 @@ # Build base image with required system packages ARG BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 -ARG TRT_VERSION=10.4.0.26-1+cuda11.8 +ARG TRT_VERSION=10.5.0.18-1+cuda11.8 ARG LD_LIBRARY_PATH_ARG=/usr/local/lib64:/usr/local/cuda/lib64 FROM $BASEIMAGE AS base ARG TRT_VERSION diff --git a/tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2004_gpu_ffmpeg b/tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2004_gpu_ffmpeg index 418c551ab38b4..47562467df893 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2004_gpu_ffmpeg +++ b/tools/ci_build/github/linux/docker/Dockerfile.package_ubuntu_2004_gpu_ffmpeg @@ -6,7 +6,7 @@ # Build base image with required system packages ARG BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 -ARG TRT_VERSION=10.4.0.26-1+cuda11.8 +ARG TRT_VERSION=10.5.0.18-1+cuda11.8 ARG LD_LIBRARY_PATH_ARG=/usr/local/lib64:/usr/local/cuda/lib64 FROM $BASEIMAGE AS base ARG TRT_VERSION diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 index a7d8f220ea9b3..da9cc789f674b 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 +++ b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 @@ -31,7 +31,7 @@ RUN pip install --upgrade pip RUN pip install psutil setuptools>=68.2.2 # Install TensorRT -RUN version="10.4.0.26-1+cuda11.8" &&\ +RUN version="10.5.0.18-1+cuda11.8" &&\ apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub &&\ apt-get update &&\ apt-get install -y \ diff --git a/tools/ci_build/github/linux/docker/inference/x86_64/python/cuda/Dockerfile b/tools/ci_build/github/linux/docker/inference/x86_64/python/cuda/Dockerfile index 85b1469a038fd..af7c2ba6d654e 100644 --- a/tools/ci_build/github/linux/docker/inference/x86_64/python/cuda/Dockerfile +++ b/tools/ci_build/github/linux/docker/inference/x86_64/python/cuda/Dockerfile @@ -5,7 +5,7 @@ ARG BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubi8 FROM $BASEIMAGE -ARG TRT_VERSION=10.4.0.26-1.cuda11.8 +ARG TRT_VERSION=10.5.0.18-1.cuda11.8 #Install TensorRT only if TRT_VERSION is not empty RUN if [ -n "${TRT_VERSION}" ]; then \ diff --git a/tools/ci_build/github/windows/setup_env_gpu.bat b/tools/ci_build/github/windows/setup_env_gpu.bat index 6a660ecaa40d2..7285e66a149d1 100644 --- a/tools/ci_build/github/windows/setup_env_gpu.bat +++ b/tools/ci_build/github/windows/setup_env_gpu.bat @@ -6,10 +6,10 @@ if exist PATH=%AGENT_TEMPDIRECTORY%\v12.2\ ( ) else ( set PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\extras\CUPTI\lib64;%PATH% ) -set PATH=%AGENT_TEMPDIRECTORY%\TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6\lib;%PATH% +set PATH=%AGENT_TEMPDIRECTORY%\TensorRT-10.5.0.18.Windows10.x86_64.cuda-12.6\lib;%PATH% @REM The default version is still cuda v12.2, because set cuda v11.8 after it -set PATH=%PATH%;%AGENT_TEMPDIRECTORY%\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8\lib +set PATH=%PATH%;%AGENT_TEMPDIRECTORY%\TensorRT-10.5.0.18.Windows10.x86_64.cuda-11.8\lib if exist PATH=%AGENT_TEMPDIRECTORY%\v11.8\ ( set PATH=%PATH%;%AGENT_TEMPDIRECTORY%\v11.8\bin;%AGENT_TEMPDIRECTORY%\v11.8\extras\CUPTI\lib64 ) else ( diff --git a/tools/ci_build/github/windows/setup_env_trt.bat b/tools/ci_build/github/windows/setup_env_trt.bat index 4f2272e306570..3e4ecf66f457a 100644 --- a/tools/ci_build/github/windows/setup_env_trt.bat +++ b/tools/ci_build/github/windows/setup_env_trt.bat @@ -6,6 +6,6 @@ if exist PATH=%AGENT_TEMPDIRECTORY%\v12.2\ ( ) else ( set PATH=%PATH%;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\extras\CUPTI\lib64 ) -set PATH=%AGENT_TEMPDIRECTORY%\TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6\lib;%PATH% +set PATH=%AGENT_TEMPDIRECTORY%\TensorRT-10.5.0.18.Windows10.x86_64.cuda-12.6\lib;%PATH% set GRADLE_OPTS=-Dorg.gradle.daemon=false set CUDA_MODULE_LOADING=LAZY From 2db4db3604321715a34710c3634a8a4dc7a0c8f8 Mon Sep 17 00:00:00 2001 From: yf711 Date: Thu, 17 Oct 2024 10:40:28 -0700 Subject: [PATCH 38/44] fix ep_perf with 10.5 --- onnxruntime/python/tools/tensorrt/perf/build/build_image.py | 2 +- .../linux-gpu-tensorrt-daily-perf-pipeline.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onnxruntime/python/tools/tensorrt/perf/build/build_image.py b/onnxruntime/python/tools/tensorrt/perf/build/build_image.py index f207f072018ba..3ebc33c02592d 100644 --- a/onnxruntime/python/tools/tensorrt/perf/build/build_image.py +++ b/onnxruntime/python/tools/tensorrt/perf/build/build_image.py @@ -17,7 +17,7 @@ TRT_DOCKER_FILES = { "8.6.cuda_11_8_cudnn_8": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_8_tensorrt8_6", "8.6.cuda_12_3_cudnn_9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_3_tensorrt8_6", - "10.4.cuda_11_8_cudnn_8": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10", + "10.5.cuda_11_8_cudnn_8": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10", "10.5.cuda_12_5_cudnn_9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10", "BIN": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_tensorrt_bin", } diff --git a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml index 865307ec95e94..83cf26614a285 100644 --- a/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-gpu-tensorrt-daily-perf-pipeline.yml @@ -8,11 +8,11 @@ parameters: - name: TrtVersion displayName: TensorRT Version type: string - default: 10.4.cuda_12_5_cudnn_9 + default: 10.5.cuda_12_5_cudnn_9 values: - 8.6.cuda_11_8_cudnn_8 - 8.6.cuda_12_3_cudnn_9 - - 10.4.cuda_11_8_cudnn_8 + - 10.5.cuda_11_8_cudnn_8 - 10.5.cuda_12_5_cudnn_9 - BIN From 498853f7d99a4550e37df7db1fcf9ad3c0de4c0f Mon Sep 17 00:00:00 2001 From: yf711 Date: Thu, 17 Oct 2024 11:23:26 -0700 Subject: [PATCH 39/44] fix merge conflicts --- .../stages/jobs/py-linux-cuda-package-test-job.yml | 2 +- .../azure-pipelines/stages/py-cuda-packaging-stage.yml | 2 +- .../azure-pipelines/templates/jobs/set-winenv.yml | 1 - .../azure-pipelines/templates/py-packaging-stage.yml | 10 ++++++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml b/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml index d8a2a34c84f78..c3e79c4b45613 100644 --- a/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml +++ b/tools/ci_build/github/azure-pipelines/stages/jobs/py-linux-cuda-package-test-job.yml @@ -45,7 +45,7 @@ jobs: - template: ../../templates/common-variables.yml - name: docker_base_image ${{ if eq(parameters.CudaVersion, '11.8') }}: - value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241008.1 + value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241015.1 ${{ if eq(parameters.CudaVersion, '12.2') }}: value: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241015.1 - name: linux_trt_version diff --git a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml index a352e54cf602a..a2d9f6a39b990 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml @@ -63,7 +63,7 @@ stages: CudaVersion: ${{ parameters.cuda_version }} SpecificArtifact: ${{ parameters.SpecificArtifact }} BuildId: ${{ parameters.BuildId }} - EP_BUILD_FLAGS: --enable_lto --cuda_home=$(Agent.TempDirectory)\v${{ parameters.cuda_version }} --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --enable_lto --cuda_home=$(Agent.TempDirectory)\v$(CudaVersion) --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" use_tensorrt: True - ${{ if eq(parameters.enable_linux_gpu, true) }}: diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml index 99d3ccef187da..71b929b995349 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml @@ -40,6 +40,5 @@ steps: displayName: 'setup env' inputs: filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}' - arguments: '' modifyEnvironment: true workingFolder: '$(Build.BinariesDirectory)' diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 0e143ecbf9744..c0ede38566a80 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -287,7 +287,7 @@ stages: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.10' CudaVersion: 11.8 - EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v$(CudaVersion)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} @@ -299,7 +299,7 @@ stages: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.11' CudaVersion: 11.8 - EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v$(CudaVersion)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} @@ -311,7 +311,7 @@ stages: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.12' CudaVersion: 11.8 - EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v$(CudaVersion)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} @@ -322,11 +322,13 @@ stages: parameters: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.13' - EP_BUILD_FLAGS: --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8" --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + CudaVersion: 11.8 + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v$(CudaVersion)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} cmake_build_type: ${{ parameters.cmake_build_type }} + use_tensorrt: True - template: py-win-gpu.yml parameters: From bb0d023389e28cd49e824e3b758f86312c7be55a Mon Sep 17 00:00:00 2001 From: yf711 Date: Fri, 18 Oct 2024 13:27:28 -0700 Subject: [PATCH 40/44] Fix debian version format --- .../nuget/templates/test_linux.yml | 4 +-- .../templates/common-variables.yml | 1 + .../Dockerfile.ubuntu_cuda11_tensorrt10 | 34 +++++++++---------- .../Dockerfile.ubuntu_cuda12_tensorrt10 | 34 +++++++++---------- 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml b/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml index d302ecca72d0d..f9ecfb7cf7938 100644 --- a/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml +++ b/tools/ci_build/github/azure-pipelines/nuget/templates/test_linux.yml @@ -53,7 +53,7 @@ stages: inputs: script: | ln -sf /data/models $(Build.BinariesDirectory) - + # As for Debian installation, replace '-1.' by '-1+' when assigning trt version below - ${{if contains(parameters.StageSuffix , 'GPU') }}: - template: ../../templates/get-docker-image-steps.yml parameters: @@ -62,7 +62,7 @@ stages: ${{ if eq(parameters.CudaVersion, '12.2') }}: DockerBuildArgs: " --build-arg BASEIMAGE=nvidia/cuda:12.2.2-devel-ubuntu20.04 - --build-arg TRT_VERSION=${{ variables.linux_trt_version_cuda12 }} + --build-arg TRT_VERSION=${{ replace(variables.linux_trt_version_cuda12, '-1.', '-1+') }} --build-arg BUILD_UID=$( id -u ) " ${{ else }}: diff --git a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml index c2e8fdb4be9ec..8113bd8e3bfca 100644 --- a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml +++ b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml @@ -1,5 +1,6 @@ variables: common_trt_version: '10.5.0.18' + # As for Debian installation, replace '-1.' by '-1+' when assigning trt version below linux_trt_version_cuda11: ${{ variables.common_trt_version }}-1.cuda11.8 linux_trt_version_cuda12: ${{ variables.common_trt_version }}-1.cuda12.6 common_linux_trt_version: ${{ variables.linux_trt_version_cuda12 }} diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 index da9cc789f674b..84dee11536033 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 +++ b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10 @@ -31,26 +31,26 @@ RUN pip install --upgrade pip RUN pip install psutil setuptools>=68.2.2 # Install TensorRT -RUN version="10.5.0.18-1+cuda11.8" &&\ +RUN TRT_VERSION="10.5.0.18-1+cuda11.8" &&\ apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub &&\ apt-get update &&\ apt-get install -y \ - libnvinfer-dev=${version} \ - libnvinfer-dispatch-dev=${version} \ - libnvinfer-dispatch10=${version} \ - libnvinfer-headers-dev=${version} \ - libnvinfer-headers-plugin-dev=${version} \ - libnvinfer-lean-dev=${version} \ - libnvinfer-lean10=${version} \ - libnvinfer-plugin-dev=${version} \ - libnvinfer-plugin10=${version} \ - libnvinfer-vc-plugin-dev=${version} \ - libnvinfer-vc-plugin10=${version} \ - libnvinfer10=${version} \ - libnvonnxparsers-dev=${version} \ - libnvonnxparsers10=${version} \ - tensorrt-dev=${version} \ - libnvinfer-bin=${version} + libnvinfer-dev=${TRT_VERSION} \ + libnvinfer-dispatch-dev=${TRT_VERSION} \ + libnvinfer-dispatch10=${TRT_VERSION} \ + libnvinfer-headers-dev=${TRT_VERSION} \ + libnvinfer-headers-plugin-dev=${TRT_VERSION} \ + libnvinfer-lean-dev=${TRT_VERSION} \ + libnvinfer-lean10=${TRT_VERSION} \ + libnvinfer-plugin-dev=${TRT_VERSION} \ + libnvinfer-plugin10=${TRT_VERSION} \ + libnvinfer-vc-plugin-dev=${TRT_VERSION} \ + libnvinfer-vc-plugin10=${TRT_VERSION} \ + libnvinfer10=${TRT_VERSION} \ + libnvonnxparsers-dev=${TRT_VERSION} \ + libnvonnxparsers10=${TRT_VERSION} \ + tensorrt-dev=${TRT_VERSION} \ + libnvinfer-bin=${TRT_VERSION} # Compile trtexec if not installed RUN if [ ! -d /usr/src/tensorrt/bin ] || [ ! -f /usr/src/tensorrt/bin/trtexec ]; then \ diff --git a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 index d53aad676c447..372e4f1763379 100644 --- a/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 +++ b/tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10 @@ -31,26 +31,26 @@ RUN pip install --upgrade pip RUN pip install setuptools>=68.2.2 psutil # Install TensorRT -RUN version="10.5.0.18-1+cuda12.6" &&\ +RUN TRT_VERSION="10.5.0.18-1+cuda12.6" &&\ apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub &&\ apt-get update &&\ apt-get install -y \ - libnvinfer-dev=${version} \ - libnvinfer-dispatch-dev=${version} \ - libnvinfer-dispatch10=${version} \ - libnvinfer-headers-dev=${version} \ - libnvinfer-headers-plugin-dev=${version} \ - libnvinfer-lean-dev=${version} \ - libnvinfer-lean10=${version} \ - libnvinfer-plugin-dev=${version} \ - libnvinfer-plugin10=${version} \ - libnvinfer-vc-plugin-dev=${version} \ - libnvinfer-vc-plugin10=${version} \ - libnvinfer10=${version} \ - libnvonnxparsers-dev=${version} \ - libnvonnxparsers10=${version} \ - tensorrt-dev=${version} \ - libnvinfer-bin=${version} + libnvinfer-dev=${TRT_VERSION} \ + libnvinfer-dispatch-dev=${TRT_VERSION} \ + libnvinfer-dispatch10=${TRT_VERSION} \ + libnvinfer-headers-dev=${TRT_VERSION} \ + libnvinfer-headers-plugin-dev=${TRT_VERSION} \ + libnvinfer-lean-dev=${TRT_VERSION} \ + libnvinfer-lean10=${TRT_VERSION} \ + libnvinfer-plugin-dev=${TRT_VERSION} \ + libnvinfer-plugin10=${TRT_VERSION} \ + libnvinfer-vc-plugin-dev=${TRT_VERSION} \ + libnvinfer-vc-plugin10=${TRT_VERSION} \ + libnvinfer10=${TRT_VERSION} \ + libnvonnxparsers-dev=${TRT_VERSION} \ + libnvonnxparsers10=${TRT_VERSION} \ + tensorrt-dev=${TRT_VERSION} \ + libnvinfer-bin=${TRT_VERSION} # Compile trtexec if not installed RUN if [ ! -d /usr/src/tensorrt/bin ] || [ ! -f /usr/src/tensorrt/bin/trtexec ]; then \ From 67786ccf8272c96bb9f336f7cde681bfce3f08eb Mon Sep 17 00:00:00 2001 From: yf711 Date: Fri, 18 Oct 2024 13:27:46 -0700 Subject: [PATCH 41/44] fix cuda version usage --- .../azure-pipelines/stages/py-cuda-packaging-stage.yml | 2 +- .../azure-pipelines/templates/py-packaging-stage.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml index a2d9f6a39b990..5e7534bad99f4 100644 --- a/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/py-cuda-packaging-stage.yml @@ -63,7 +63,7 @@ stages: CudaVersion: ${{ parameters.cuda_version }} SpecificArtifact: ${{ parameters.SpecificArtifact }} BuildId: ${{ parameters.BuildId }} - EP_BUILD_FLAGS: --enable_lto --cuda_home=$(Agent.TempDirectory)\v$(CudaVersion) --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --enable_lto --cuda_home=$(Agent.TempDirectory)\v${{ parameters.cuda_version }} --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" use_tensorrt: True - ${{ if eq(parameters.enable_linux_gpu, true) }}: diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index c0ede38566a80..76186cbd50492 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -287,7 +287,7 @@ stages: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.10' CudaVersion: 11.8 - EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v$(CudaVersion)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} @@ -299,7 +299,7 @@ stages: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.11' CudaVersion: 11.8 - EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v$(CudaVersion)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} @@ -311,7 +311,7 @@ stages: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.12' CudaVersion: 11.8 - EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v$(CudaVersion)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} @@ -323,7 +323,7 @@ stages: MACHINE_POOL: 'onnxruntime-Win2022-GPU-A10' PYTHON_VERSION: '3.13' CudaVersion: 11.8 - EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v$(CudaVersion)" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" + EP_BUILD_FLAGS: --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" ENV_SETUP_SCRIPT: setup_env_gpu.bat EP_NAME: gpu publish_symbols: ${{ parameters.publish_symbols }} From 8391b24447fcca4c01599b3270255fbf76ac8a21 Mon Sep 17 00:00:00 2001 From: yf711 Date: Fri, 18 Oct 2024 13:43:46 -0700 Subject: [PATCH 42/44] remove redundant var --- .../github/azure-pipelines/templates/common-variables.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml index 8113bd8e3bfca..b57e45a1069fe 100644 --- a/tools/ci_build/github/azure-pipelines/templates/common-variables.yml +++ b/tools/ci_build/github/azure-pipelines/templates/common-variables.yml @@ -3,7 +3,5 @@ variables: # As for Debian installation, replace '-1.' by '-1+' when assigning trt version below linux_trt_version_cuda11: ${{ variables.common_trt_version }}-1.cuda11.8 linux_trt_version_cuda12: ${{ variables.common_trt_version }}-1.cuda12.6 - common_linux_trt_version: ${{ variables.linux_trt_version_cuda12 }} win_trt_folder_cuda11: TensorRT-${{ variables.common_trt_version }}.Windows10.x86_64.cuda-11.8 - win_trt_folder_cuda12: TensorRT-${{ variables.common_trt_version }}.Windows10.x86_64.cuda-12.6 - common_win_trt_folder: ${{ variables.win_trt_folder_cuda12 }} + win_trt_folder_cuda12: TensorRT-${{ variables.common_trt_version }}.Windows10.x86_64.cuda-12.6 \ No newline at end of file From ada49925b83d268f206ad9371c339b0a01e1310b Mon Sep 17 00:00:00 2001 From: yf711 Date: Wed, 16 Oct 2024 17:44:22 -0700 Subject: [PATCH 43/44] unlease nested control flow op pytest --- tools/ci_build/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index 384569997b9b6..9ca6a255966f7 100644 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -2123,10 +2123,10 @@ def run_onnxruntime_tests(args, source_dir, ctest_path, build_dir, configs): if not args.disable_ml_ops and not args.use_tensorrt: run_subprocess([sys.executable, "onnxruntime_test_python_mlops.py"], cwd=cwd, dll_path=dll_path) - # if args.use_tensorrt: - # run_subprocess( - # [sys.executable, "onnxruntime_test_python_nested_control_flow_op.py"], cwd=cwd, dll_path=dll_path - # ) + if args.use_tensorrt: + run_subprocess( + [sys.executable, "onnxruntime_test_python_nested_control_flow_op.py"], cwd=cwd, dll_path=dll_path + ) try: import onnx # noqa: F401 From 755b9cd488356204108072dd4c9e5ba86ef2d090 Mon Sep 17 00:00:00 2001 From: yf711 Date: Fri, 25 Oct 2024 13:58:22 -0700 Subject: [PATCH 44/44] fix merge --- .../ci_build/github/azure-pipelines/py-package-test-pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml b/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml index b913273c358ae..a0e49692220f9 100644 --- a/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/py-package-test-pipeline.yml @@ -50,7 +50,6 @@ stages: - Linux_Test_CPU_aarch64_stage - Packages_Somking_Test jobs: - jobs: - job: Final # Run this step only if all previous steps are succeeded and (this build was triggered by a resource trigger or it was triggered by another build). condition: and(succeeded(), eq(variables['Build.Reason'], 'ResourceTrigger'))