Skip to content

Commit

Permalink
Refactor cuda packaging pipeline (microsoft#22542)
Browse files Browse the repository at this point in the history
<!-- Describe your changes. -->

<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
  • Loading branch information
jchen351 authored and ankitm3k committed Dec 11, 2024
1 parent 8800830 commit f76cf32
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 141 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
trigger: none
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

parameters:
- name: enable_linux_cuda
type: boolean
Expand All @@ -22,29 +17,11 @@ parameters:
- Release
- RelWithDebInfo
- MinSizeRel
extends:
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
# For non-production pipelines, use "Unofficial" as defined below.
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
sdl:
tsa:
enabled: true
codeSignValidation:
enabled: true
break: true
policheck:
enabled: true
exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml'
pool:
name: 'onnxruntime-Win-CPU-2022' # Name of your hosted pool
os: windows # OS of the image. This value cannot be a variable. Allowed values: windows, linux, macOS

stages:
- template: stages/py-gpu-packaging-stage.yml
parameters:
enable_linux_cuda: ${{ parameters.enable_linux_cuda }}
enable_windows_cuda: ${{ parameters.enable_windows_cuda }}
cmake_build_type: ${{ parameters.cmake_build_type }}
cuda_version: '11.8'
stages:
- template: stages/py-gpu-packaging-stage.yml
parameters:
enable_linux_cuda: ${{ parameters.enable_linux_cuda }}
enable_windows_cuda: ${{ parameters.enable_windows_cuda }}
cmake_build_type: ${{ parameters.cmake_build_type }}
cuda_version: '11.8'
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,13 @@ parameters:
- RelWithDebInfo
- MinSizeRel


extends:
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
# For non-production pipelines, use "Unofficial" as defined below.
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
sdl:
tsa:
enabled: true
codeSignValidation:
enabled: true
break: true
policheck:
enabled: true
exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml'
# Update the pool with your team's 1ES hosted pool.
pool:
name: 'onnxruntime-Win-CPU-2022' # Name of your hosted pool
os: windows # OS of the image. This value cannot be a variable. Allowed values: windows, linux, macOS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
trigger: none
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

parameters:
- name: cmake_build_type
type: string
Expand All @@ -14,28 +9,10 @@ parameters:
- Release
- RelWithDebInfo
- MinSizeRel
extends:
# The pipeline extends the 1ES PT which will inject different SDL and compliance tasks.
# For non-production pipelines, use "Unofficial" as defined below.
# For productions pipelines, use "Official".
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
sdl:
tsa:
enabled: true
codeSignValidation:
enabled: true
break: true
policheck:
enabled: true
exclusionsFile: '$(Build.SourcesDirectory)\tools\ci_build\policheck_exclusions.xml'

pool:
name: 'onnxruntime-Win-CPU-2022' # Name of your hosted pool
os: windows # OS of the image. This value cannot be a variable. Allowed values: windows, linux, macOS

stages:
- template: stages/py-gpu-packaging-stage.yml
parameters:
enable_windows_dml: true
cmake_build_type: ${{ parameters.cmake_build_type }}
stages:
- template: stages/py-gpu-packaging-stage.yml
parameters:
enable_windows_dml: true
cmake_build_type: ${{ parameters.cmake_build_type }}
publish_symbols: true
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,5 @@ stages:
build_py_parameters: ${{ parameters.build_py_parameters }}
cmake_build_type: ${{ parameters.cmake_build_type }}
qnn_sdk_version: ${{ parameters.qnn_sdk_version }}
publish_symbols: true

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ parameters:
- '3.12'
- '3.13'

- name: publish_symbols
type: boolean
default: false

stages:
- ${{ if eq(parameters.enable_windows_cuda, true) }}:
- ${{ each python_version in parameters.PythonVersions }}:
Expand All @@ -56,8 +60,10 @@ stages:
PYTHON_VERSION: ${{ python_version }}
EP_NAME: gpu
CudaVersion: ${{ parameters.cuda_version }}
EP_BUILD_FLAGS: --use_dml --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.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"

- ${{ if eq(parameters.enable_linux_cuda, true) }}:
- template: py-linux-gpu-stage.yml
Expand All @@ -70,7 +76,8 @@ stages:
${{ if eq(parameters.cuda_version, '11.8') }}:
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda11_x64_almalinux8_gcc11:20241120.3
${{ if eq(parameters.cuda_version, '12.2') }}:
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241120.3
docker_base_image: onnxruntimebuildcache.azurecr.io/internal/azureml/onnxruntime/build/cuda12_x64_ubi8_gcc12:20241020.1
trt_version: 10.4.0.26-1.cuda12.6

- ${{ if eq(parameters.enable_windows_dml, true) }}:
- ${{ each python_version in parameters.PythonVersions }}:
Expand All @@ -79,5 +86,7 @@ stages:
MACHINE_POOL: 'onnxruntime-Win2022-GPU-dml-A10'
PYTHON_VERSION: ${{ python_version }}
EP_BUILD_FLAGS: --use_dml --cmake_extra_defines CMAKE_SYSTEM_VERSION=10.0.18362.0 --enable_wcos
ENV_SETUP_SCRIPT: setup_env.bat
EP_NAME: directml
publish_symbols: ${{ parameters.publish_symbols }}
cmake_build_type: ${{ parameters.cmake_build_type }}
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ stages:
mv $(Build.BinariesDirectory)/dist ./dist
pushd dist
find . -name \*.whl -exec unzip -qq -o {} \;
rm -r onnxruntime
popd
pushd ${{ parameters.cmake_build_type }}
find . -name \*.whl -exec unzip -qq -o {} \;
Expand Down
Loading

0 comments on commit f76cf32

Please sign in to comment.