Skip to content

Limit the Pipeline ability to build cuda 11 #24073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/03-mobile.yml
Original file line number Diff line number Diff line change
@@ -131,6 +131,6 @@ body:
id: ep-version
attributes:
label: Execution Provider Library Version
placeholder: ex. CUDA 11.6 or ROCm 5.1.1
placeholder: ex. CUDA 12.2 or ROCm 5.1.1
validations:
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/05-performance.yml
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ body:
id: ep-version
attributes:
label: Execution Provider Library Version
placeholder: ex. CUDA 11.6 or ROCm 5.1.1
placeholder: ex. CUDA 12.2 or ROCm 5.1.1
validations:
required: false
- type: textarea
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/06-training.yml
Original file line number Diff line number Diff line change
@@ -72,6 +72,6 @@ body:
id: ep-version
attributes:
label: Execution Provider Library Version
placeholder: ex. CUDA 11.6 or ROCm 5.1.1
placeholder: ex. CUDA 12.2 or ROCm 5.1.1
validations:
required: false
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/08-general.yml
Original file line number Diff line number Diff line change
@@ -125,6 +125,6 @@ body:
id: ep-version
attributes:
label: Execution Provider Library Version
placeholder: ex. CUDA 11.6 or ROCm 5.1.1
placeholder: ex. CUDA 12.2 or ROCm 5.1.1
validations:
required: false
1 change: 0 additions & 1 deletion js/node/script/install.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@

// The purpose of this script is to download the required binaries for the platform and architecture.
// Currently, most of the binaries are already bundled in the package, except for the following:
// - Linux/x64/CUDA 11
// - Linux/x64/CUDA 12
//
// The CUDA binaries are not bundled because they are too large to be allowed in the npm registry. Instead, they are
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
import sys

TRT_DOCKER_FILES = {
"10.9_cuda11.8_cudnn8": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda11_tensorrt10",
"10.9_cuda12.8_cudnn9": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_cuda12_tensorrt10",
"BIN": "tools/ci_build/github/linux/docker/Dockerfile.ubuntu_tensorrt_bin",
}
Original file line number Diff line number Diff line change
@@ -143,29 +143,11 @@

### Setup Environment (CUDA) without docker

First, we need install CUDA 11.8 or 12.x, [cuDNN](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html), and [TensorRT](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html) in the machine.
First, we need install CUDA 12.x, [cuDNN](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html), and [TensorRT](https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html) in the machine.

The verison of CuDNN can be found in https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements.

Check warning on line 148 in onnxruntime/python/tools/transformers/models/stable_diffusion/README.md

GitHub Actions / Optional Lint

[misspell] reported by reviewdog 🐶 "verison" is a misspelling of "version" Raw Output: ./onnxruntime/python/tools/transformers/models/stable_diffusion/README.md:148:4: "verison" is a misspelling of "version"
The version of TensorRT can be found in https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html#requirements.

#### CUDA 11.8:

In the Conda environment, install PyTorch 2.1 up to 2.3.1, and other required packages like the following:
```
pip install torch>=2.1,<2.4 --index-url https://download.pytorch.org/whl/cu118
pip install --upgrade polygraphy onnx-graphsurgeon --extra-index-url https://pypi.ngc.nvidia.com
pip install -r requirements/cuda11/requirements.txt
```

For Windows, install nvtx like the following:
```
conda install -c conda-forge nvtx
```

We cannot directly `pip install tensorrt` for CUDA 11. Follow https://github.com/NVIDIA/TensorRT/issues/2773 to install TensorRT for CUDA 11 in Linux.

For Windows, pip install the tensorrt wheel in the downloaded TensorRT zip file instead. Like `pip install tensorrt-8.6.1.6.windows10.x86_64.cuda-11.8\tensorrt-8.6.1.6\python\tensorrt-8.6.1-cp310-none-win_amd64.whl`.

#### CUDA 12.*:
The official package of onnxruntime-gpu 1.19.x is built for CUDA 12.x. You can install it and other python packages like the following:
```
Original file line number Diff line number Diff line change
@@ -76,12 +76,12 @@ variables:
- name: ReleaseVersionSuffix
value: ''
- name: win_trt_version
value: 11.8
value: 12.2

- name: win_trt_home
value: $(Agent.TempDirectory)\${{ variables.win_trt_folder_cuda11 }}
value: $(Agent.TempDirectory)\${{ variables.win_trt_folder_cuda12 }}
- name: win_cuda_home
value: $(Agent.TempDirectory)\v11.8
value: $(Agent.TempDirectory)\v12.2

stages:
- template: stages/set_packaging_variables_stage.yml
@@ -110,13 +110,13 @@ stages:

- template: stages/java-cuda-packaging-stage.yml
parameters:
CudaVersion: 11.8
CudaVersion: 12.2
SpecificArtifact: ${{ parameters.SpecificArtifact }}
BuildId: ${{ parameters.BuildId }}

- template: stages/nuget-combine-cuda-stage.yml
parameters:
CudaVersion: 11.8
CudaVersion: 12.2
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
UseIncreasedTimeoutForTests: ${{ parameters.UseIncreasedTimeoutForTests }}
win_trt_home: ${{ variables.win_trt_home }}
Original file line number Diff line number Diff line change
@@ -50,7 +50,6 @@ parameters:
type: string
default: '12.2'
values:
- 11.8
- 12.2

variables:
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ parameters:
type: string
default: '12.2'
values:
- 11.8
- 12.2

- name: SpecificArtifact
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ parameters:
type: string
default: '12.2'
values:
- 11.8
- 12.2

variables:
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@ parameters:
type: string
default: '12.2'
values:
- 11.8
- 12.2

variables:
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ parameters:
type: string
default: 10.9_cuda12.8_cudnn9
values:
- 10.9_cuda11.8_cudnn8
- 10.9_cuda12.8_cudnn9
- BIN

1 change: 0 additions & 1 deletion tools/ci_build/github/azure-pipelines/post-merge-jobs.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ parameters:
type: string
default: '12.2'
values:
- 11.8
- 12.2

variables:

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -2,9 +2,8 @@ parameters:
- name: CudaVersion
displayName: 'CUDA version'
type: string
default: '11.8'
default: '12.2'
values:
- 11.8
- 12.2
- name: machine_pool
type: string
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
- name: CudaVersion
type: string
default: '11.8'
default: '12.2'
- name: buildJava
type: boolean
- name: buildNodejs
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@ parameters:
displayName: 'CUDA version. Windows Only.'
default: '12.2'
values:
- 11.8
- 12.2

- name: PythonVersions
Original file line number Diff line number Diff line change
@@ -22,9 +22,8 @@ parameters:

- name: cuda_version
type: string
default: '11.8'
default: '12.2'
values:
- 11.8
- 12.2

stages:
@@ -67,8 +66,8 @@ stages:

- template: ../templates/get-docker-image-steps.yml
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
Dockerfile: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/default/cuda12/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/${{ parameters.arch }}/default/cuda12
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 }}

Original file line number Diff line number Diff line change
@@ -19,9 +19,8 @@ parameters:
default: ''
- name: CudaVersion
type: string
default: '11.8'
default: '12.2'
values:
- 11.8
- 12.2

- name: cmake_build_type
24 changes: 12 additions & 12 deletions tools/ci_build/github/azure-pipelines/templates/jobs/set-winenv.yml
Original file line number Diff line number Diff line change
@@ -10,12 +10,12 @@ parameters:
- name: PrimaryCUDAVersion
type: string
default: '12.2'
- name: SecondaryCUDAVersion
type: string
default: '11.8'
- name: win_trt_folder_cuda11
type: string
default: 'TensorRT-10.9.0.34.Windows10.x86_64.cuda-11.8'
# - name: SecondaryCUDAVersion
# type: string
# default: '11.8'
# - name: win_trt_folder_cuda11
# type: string
# default: 'TensorRT-10.9.0.34.Windows10.x86_64.cuda-11.8'
- name: win_trt_folder_cuda12
type: string
default: 'TensorRT-10.9.0.34.Windows10.x86_64.cuda-12.8'
@@ -25,16 +25,16 @@ steps:
- powershell: |
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.PrimaryCUDAVersion }}" $(Agent.TempDirectory)
displayName: 'Download Primary CUDA SDK v${{ parameters.PrimaryCUDAVersion }}'
- 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 }}'
# - 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_cuda12 }}" $(Agent.TempDirectory)
displayName: 'Download ${{ parameters.win_trt_folder_cuda12 }}'
- 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_cuda11 }}" $(Agent.TempDirectory)
# displayName: 'Download ${{ parameters.win_trt_folder_cuda11 }}'

- task: BatchScript@1
displayName: 'setup env'
Loading