Skip to content
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

Set CUDA12 as default in GPU packages #21438

Merged
merged 17 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ parameters:
- name: CudaVersion
displayName: CUDA version
type: string
default: '11.8'
default: '12.2'
values:
- 11.8
- 12.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ parameters:
- name: CudaVersion
displayName: CUDA version
type: string
default: '11.8'
default: '12.2'
values:
- 11.8
- 12.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
- name: TrtVersion
displayName: TensorRT Version
type: string
default: 10.0.cuda_11_8_cudnn_8
default: 10.0.cuda_12_4_cudnn_9
values:
- 8.4.cuda_11_6_cudnn_8
- 8.5.cuda_11_8_cudnn_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resources:
branches:
include:
- main
- rel-*
branch: main

parameters:
Expand All @@ -16,15 +17,15 @@ parameters:
variables:
- name: ArtifactFeed
${{ if eq(parameters.isReleaseBuild, false) }}:
value: ort-cuda-12-nightly
value: ORT-Nightly
${{ else }}:
value: onnxruntime-cuda-12

stages:
- template: stages/nuget-cuda-publishing-stage.yml
parameters:
artifact_feed: $(ArtifactFeed)
- template: stages/nuget-cuda-publishing-stage.yml
parameters:
artifact_feed: $(ArtifactFeed)

- template: stages/java-cuda-publishing-stage.yml
parameters:
artifact_feed: $(ArtifactFeed)
- template: stages/java-cuda-publishing-stage.yml
parameters:
artifact_feed: $(ArtifactFeed)
26 changes: 21 additions & 5 deletions tools/ci_build/github/azure-pipelines/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,22 @@ resources:
- rel-*
branch: main

parameters:
- name: isReleaseBuild
type: boolean
default: false

variables:
- name: ArtifactFeed
${{ if eq(parameters.isReleaseBuild, false) }}:
value: ort-cuda-11-nightly
${{ else }}:
value: onnxruntime-cuda-11

stages:
- template: templates/publish-nuget-steps.yml
parameters:
stage_name: 'Publish_NuGet_Packag_And_Report'
stage_name: 'Publish_NuGet_Package_And_Report'
include_cpu_ep: true
download_artifacts_steps:
- download: build
Expand All @@ -25,7 +37,11 @@ stages:
artifact: 'drop-signed-nuget-Training-CPU'
- script: move "$(Pipeline.Workspace)\build\drop-signed-nuget-Training-CPU\*" $(Build.BinariesDirectory)\nuget-artifact\final-package

- download: build
displayName: 'Download Pipeline Artifact - Signed NuGet Package'
artifact: 'drop-signed-nuget-GPU'
- script: move "$(Pipeline.Workspace)\build\drop-signed-nuget-GPU\*" $(Build.BinariesDirectory)\nuget-artifact\final-package
# Publish CUDA 11 Nuget/Java pkgs to ADO feed
- template: stages/nuget-cuda-publishing-stage.yml
parameters:
artifact_feed: $(ArtifactFeed)

- template: stages/java-cuda-publishing-stage.yml
parameters:
artifact_feed: $(ArtifactFeed)
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parameters:
variables:
- name: ArtifactFeed
${{ if eq(parameters.isReleaseBuild, false) }}:
value: ort-cuda-12-nightly
value: ORT-Nightly
tianleiwu marked this conversation as resolved.
Show resolved Hide resolved
${{ else }}:
value: onnxruntime-cuda-12
yf711 marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stages:
jobs:
- job: JAR_Publishing_GPU
#TD-DO: figure out a way to package nightly jar. Currently Java version are set from VERSION_NUMBER file
condition: ${{ eq(parameters.artifact_feed, 'onnxruntime-cuda-12') }}
condition: ${{ or(eq(parameters.artifact_feed, 'onnxruntime-cuda-11'), eq(parameters.artifact_feed, 'onnxruntime-cuda-12')) }}
workspace:
clean: all
pool: 'onnxruntime-Win-CPU-2022'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
default: false
- name: CudaVersion
type: string
default: '11.8'
default: '12.2'
values:
- 11.8
- 12.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ parameters:
default: false
- name: PrimaryCUDAVersion
type: string
default: '11.8'
default: '12.2'
- name: SecondaryCUDAVersion
type: string
default: '12.2'
default: '11.8'

steps:
- ${{ if eq(parameters.DownloadCUDA, 'true') }}:
Expand Down
13 changes: 10 additions & 3 deletions tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ pr:
#### end trigger ####

parameters:
- name: CudaVersion
displayName: CUDA version
type: string
default: '12.2'
values:
- 11.8
- 12.2
- name: RunOnnxRuntimeTests
displayName: Run Tests?
type: boolean
Expand All @@ -43,7 +50,7 @@ stages:
EnvSetupScript: setup_env_cuda.bat
buildArch: x64
additionalBuildFlags: >-
--enable_pybind --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8"
--enable_pybind --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}"
--enable_cuda_profiling --enable_transformers_tool_test
--cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86
--cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON
Expand All @@ -65,7 +72,7 @@ stages:
EnvSetupScript: setup_env_cuda.bat
buildArch: x64
additionalBuildFlags: >-
--enable_pybind --enable_training --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8"
--enable_pybind --enable_training --use_cuda --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}"
--skip_onnx_tests
--cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86
msbuildPlatform: x64
Expand Down Expand Up @@ -105,7 +112,7 @@ stages:
# note: need to specify `--gen_doc` when creating the build config so it has to be in additionalBuildFlags
additionalBuildFlags: >-
--gen_doc validate --skip_tests --enable_pybind --use_dml --use_cuda
--cuda_home="$(Agent.TempDirectory)\v11.8"
--cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}"
--cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86
--cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF
msbuildPlatform: x64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ pr:
- 'js/web'
- 'onnxruntime/core/providers/js'
#### end trigger ####
parameters:
- name: CudaVersion
displayName: CUDA version
type: string
default: '12.2'
values:
- 11.8
- 12.2

variables:
- name: win_trt_folder
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: TensorRT-10.0.1.6.Windows10.x86_64.cuda-11.8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: TensorRT-10.0.1.6.Windows10.x86_64.cuda-12.4

jobs:
- job: 'build'
Expand Down Expand Up @@ -55,7 +70,7 @@ jobs:
WithCache: True
Today: $(TODAY)
AdditionalKey: "gpu-tensorrt | RelWithDebInfo"
BuildPyArguments: '--config RelWithDebInfo --parallel --use_binskim_compliant_compile_flags --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\TensorRT-10.0.1.6.Windows10.x86_64.cuda-11.8" --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86'
BuildPyArguments: '--config RelWithDebInfo --parallel --use_binskim_compliant_compile_flags --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --update --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\${{ variables.win_trt_folder }}" --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86'
MsbuildArguments: $(MsbuildArguments)
BuildArch: 'x64'
Platform: 'x64'
Expand All @@ -75,7 +90,7 @@ jobs:
del wheel_filename_file
python.exe -m pip install -q --upgrade %WHEEL_FILENAME%
set PATH=$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo;%PATH%
python $(Build.SourcesDirectory)\tools\ci_build\build.py --config RelWithDebInfo --use_binskim_compliant_compile_flags --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --test --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\TensorRT-10.0.1.6.Windows10.x86_64.cuda-11.8" --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75
python $(Build.SourcesDirectory)\tools\ci_build\build.py --config RelWithDebInfo --use_binskim_compliant_compile_flags --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --test --cmake_generator "Visual Studio 17 2022" --build_wheel --enable_onnx_tests --use_tensorrt --tensorrt_home="$(Agent.TempDirectory)\${{ variables.win_trt_folder }}" --cuda_home="$(Agent.TempDirectory)\v${{ parameters.CudaVersion }}" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86

workingDirectory: '$(Build.BinariesDirectory)\RelWithDebInfo\RelWithDebInfo'
displayName: 'Run tests'
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Please overwrite BASEIMAGE, TRT_VERSION and other arguments with
# --docker-build-args ' --build-arg BASEIMAGE=other_base_image --build-arg TRT_VERSION=other_trt_version etc...'
# for other cuda version and TRT version
ARG BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubi8
ARG BASEIMAGE=nvidia/cuda:12.5.1-cudnn-devel-ubi8

FROM $BASEIMAGE
ARG TRT_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Dockerfile to Test ONNX Runtime on UBI8 with TensorRT 10.0 and CUDA 11.8 by default

# Build base image with required system packages
ARG BASEIMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubi8
ARG TRT_VERSION=10.0.1.6-1.cuda11.8
ARG BASEIMAGE=nvidia/cuda:12.5.1-cudnn-devel-ubi8
ARG TRT_VERSION=10.0.1.6-1.cuda12.4
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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,22 @@ RUN version="10.0.1.6-1+cuda12.4" &&\
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 \
tensorrt=${version}
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}

# Compile trtexec if not installed
RUN if [ ! -d /usr/src/tensorrt/bin ] || [ ! -f /usr/src/tensorrt/bin/trtexec ]; then \
Expand Down
Loading