Skip to content

Commit

Permalink
Linux_C_API_Packaging_GPU
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Jun 2, 2024
1 parent 30aead3 commit 53b603f
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ parameters:
type: boolean

stages:
- template: ../templates/c-api-gpu.yml
parameters:
CudaVersion: ${{ parameters.CudaVersion }}
docker_base_image: ${{ parameters.docker_base_image }}
buildJava: ${{ parameters.buildJava }}
EP: cuda
- stage: Linux_C_API_Packaging_GPU
dependsOn: []
jobs:
- template: ../templates/c-api-gpu.yml
parameters:
CudaVersion: ${{ parameters.CudaVersion }}
docker_base_image: ${{ parameters.docker_base_image }}
buildJava: ${{ parameters.buildJava }}
EP: cuda

- template: ../templates/c-api-gpu.yml
parameters:
CudaVersion: ${{ parameters.CudaVersion }}
docker_base_image: ${{ parameters.docker_base_image }}
buildJava: ${{ parameters.buildJava }}
buildNodejs: ${{ parameters.buildNodejs }}
EP: tensorrt
- template: ../templates/c-api-gpu.yml
parameters:
CudaVersion: ${{ parameters.CudaVersion }}
docker_base_image: ${{ parameters.docker_base_image }}
buildJava: ${{ parameters.buildJava }}
buildNodejs: ${{ parameters.buildNodejs }}
EP: tensorrt

- stage: Linux_Packaging_combined_CUDA
dependsOn:
Expand Down
140 changes: 69 additions & 71 deletions tools/ci_build/github/azure-pipelines/templates/c-api-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,83 +14,81 @@ parameters:

- name: EP
type: string
stages:
- stage: Linux_C_API_Packaging_GPU
dependsOn: []
jobs:
- job: Linux_C_API_Packaging_{{ parameters.EP }}
workspace:
clean: all
timeoutInMinutes: 150
pool: 'onnxruntime-Ubuntu2204-AMD-CPU'
variables:
- name: CUDA_VERSION_MAJOR
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: '11'
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: '12'
- name: CUDA_VERSION
value: ${{ parameters.CudaVersion }}
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
- name: linux_trt_version
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: 10.0.1.6-1.cuda11.8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: 10.0.1.6-1.cuda12.4

steps:
- template: set-version-number-variables-step.yml
- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/gpu/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/x86_64/default/gpu
${{ if eq(parameters.EP, 'tensorrt') }}:
DockerBuildArgs: "
--build-arg BASEIMAGE=${{ variables.docker_base_image }}
--build-arg TRT_VERSION=${{ variables.linux_trt_version }}
--build-arg BUILD_UID=$( id -u )
"
${{ if eq(parameters.EP, 'cuda') }}:
DockerBuildArgs: "
--build-arg BASEIMAGE=${{ variables.docker_base_image }}
--build-arg BUILD_UID=$( id -u )
"
Repository: onnxruntime${{ parameters.EP }}${{ variables.CUDA_VERSION_MAJOR }}build

- script: $(Build.SourcesDirectory)/tools/ci_build/github/linux/build_${{ parameters.EP }}_c_api_package.sh
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Build ${{ parameters.EP }} C API Package'
jobs:
- job: Linux_C_API_Packaging_{{ parameters.EP }}
workspace:
clean: all
timeoutInMinutes: 150
pool: 'onnxruntime-Ubuntu2204-AMD-CPU'
variables:
- name: CUDA_VERSION_MAJOR
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: '11'
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: '12'
- name: CUDA_VERSION
value: ${{ parameters.CudaVersion }}
- name: docker_base_image
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: nvidia/cuda:11.8.0-cudnn8-devel-ubi8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: nvidia/cuda:12.2.2-cudnn8-devel-ubi8
- name: linux_trt_version
${{ if eq(parameters.CudaVersion, '11.8') }}:
value: 10.0.1.6-1.cuda11.8
${{ if eq(parameters.CudaVersion, '12.2') }}:
value: 10.0.1.6-1.cuda12.4

- ${{ if eq(parameters.buildJava, true) }}:
- template: java-api-artifacts-package-and-publish-steps-posix.yml
parameters:
arch: 'linux-x64'
buildConfig: 'Release'
artifactName: 'onnxruntime-java-linux-x64-${{ parameters.EP }}'
version: '$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
nativeLibraryName: 'libonnxruntime4j_jni.so'
steps:
- template: set-version-number-variables-step.yml
- template: get-docker-image-steps.yml
parameters:
Dockerfile: tools/ci_build/github/linux/docker/inference/x86_64/default/gpu/Dockerfile
Context: tools/ci_build/github/linux/docker/inference/x86_64/default/gpu
${{ if eq(parameters.EP, 'tensorrt') }}:
DockerBuildArgs: "
--build-arg BASEIMAGE=${{ variables.docker_base_image }}
--build-arg TRT_VERSION=${{ variables.linux_trt_version }}
--build-arg BUILD_UID=$( id -u )
"
${{ if eq(parameters.EP, 'cuda') }}:
DockerBuildArgs: "
--build-arg BASEIMAGE=${{ variables.docker_base_image }}
--build-arg BUILD_UID=$( id -u )
"
Repository: onnxruntime${{ parameters.EP }}${{ variables.CUDA_VERSION_MAJOR }}build

- ${{ if eq(parameters.buildNodejs, 'true') }}:
- template: nodejs-artifacts-package-and-publish-steps-posix.yml
parameters:
arch: 'x64'
os: 'linux'
artifactName: 'drop-onnxruntime-nodejs-linux-x64-${{ parameters.EP }}'
- script: $(Build.SourcesDirectory)/tools/ci_build/github/linux/build_${{ parameters.EP }}_c_api_package.sh
workingDirectory: $(Build.SourcesDirectory)
displayName: 'Build ${{ parameters.EP }} C API Package'

- template: c-api-artifacts-package-and-publish-steps-posix.yml
- ${{ if eq(parameters.buildJava, true) }}:
- template: java-api-artifacts-package-and-publish-steps-posix.yml
parameters:
arch: 'linux-x64'
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x64-${{ parameters.EP }}-$(OnnxRuntimeVersion)'
artifactNameNoVersionString: 'onnxruntime-linux-x64-${{ parameters.EP }}'
libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
artifactName: 'onnxruntime-java-linux-x64-${{ parameters.EP }}'
version: '$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
nativeLibraryName: 'libonnxruntime4j_jni.so'

- template: component-governance-component-detection-steps.yml
- ${{ if eq(parameters.buildNodejs, 'true') }}:
- template: nodejs-artifacts-package-and-publish-steps-posix.yml
parameters:
condition: 'succeeded'
- template: clean-agent-build-directory-step.yml
arch: 'x64'
os: 'linux'
artifactName: 'drop-onnxruntime-nodejs-linux-x64-${{ parameters.EP }}'

- template: c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x64-${{ parameters.EP }}-$(OnnxRuntimeVersion)'
artifactNameNoVersionString: 'onnxruntime-linux-x64-${{ parameters.EP }}'
libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'

- template: component-governance-component-detection-steps.yml
parameters:
condition: 'succeeded'
- template: clean-agent-build-directory-step.yml

0 comments on commit 53b603f

Please sign in to comment.