forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Java CUDA 12 support (microsoft#20583)
### Description - This PR combine all CUDA 12 stage into the Zip-nuget-... pipeline. - It also enables the cuda12 support ### Motivation and Context <!-- - 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
Showing
10 changed files
with
509 additions
and
1,039 deletions.
There are no files selected for viewing
566 changes: 33 additions & 533 deletions
566
tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml
Large diffs are not rendered by default.
Oops, something went wrong.
199 changes: 0 additions & 199 deletions
199
tools/ci_build/github/azure-pipelines/cuda-packaging-pipeline.yml
This file was deleted.
Oops, something went wrong.
187 changes: 187 additions & 0 deletions
187
tools/ci_build/github/azure-pipelines/stages/java-cuda-packaging-stage.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
parameters: | ||
- name: CudaVersion | ||
type: string | ||
- name: SpecificArtifact | ||
type: string | ||
- name: BuildId | ||
type: string | ||
|
||
stages: | ||
- stage: Java_GPU_Packaging | ||
dependsOn: | ||
- Linux_C_API_Packaging_Combined_CUDA | ||
- Windows_Packaging_CUDA | ||
- Windows_Packaging_TensorRT | ||
- Download_Java_Tools | ||
jobs: | ||
- job: Jar_Packaging_GPU | ||
workspace: | ||
clean: all | ||
pool: 'onnxruntime-Win-CPU-2022' | ||
dependsOn: [] | ||
condition: succeeded() | ||
steps: | ||
- checkout: self | ||
submodules: false | ||
- template: ../templates/set-version-number-variables-step.yml | ||
|
||
- template: ../templates/flex-downloadPipelineArtifact.yml | ||
parameters: | ||
StepName: 'Download Pipeline Artifact - Win x64' | ||
ArtifactName: 'drop-onnxruntime-java-win-x64-tensorrt' | ||
TargetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-win-x64' | ||
SpecificArtifact: ${{ parameters.specificArtifact }} | ||
BuildId: ${{ parameters.BuildId }} | ||
|
||
- template: ../templates/flex-downloadPipelineArtifact.yml | ||
parameters: | ||
stepName: 'Download Pipeline Artifact - Linux x64' | ||
artifactName: 'drop-onnxruntime-java-linux-x64-cuda' | ||
targetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-linux-x64' | ||
SpecificArtifact: ${{ parameters.specificArtifact }} | ||
BuildId: ${{ parameters.BuildId }} | ||
|
||
- template: ../templates/flex-downloadPipelineArtifact.yml | ||
parameters: | ||
StepName: 'Download Pipeline Artifact - Linux x64' | ||
ArtifactName: 'drop-onnxruntime-java-linux-x64-tensorrt' | ||
targetPath: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-linux-x64-tensorrt' | ||
SpecificArtifact: ${{ parameters.specificArtifact }} | ||
BuildId: ${{ parameters.BuildId }} | ||
|
||
- task: PowerShell@2 | ||
displayName: 'PowerShell Script' | ||
inputs: | ||
targetType: filePath | ||
filePath: $(Build.SourcesDirectory)\tools\ci_build\github\windows\jar_gpu_packaging.ps1 | ||
failOnStderr: true | ||
showWarnings: true | ||
workingDirectory: '$(Build.BinariesDirectory)\java-artifact' | ||
|
||
- task: CopyFiles@2 | ||
displayName: 'Copy Java Files to Artifact Staging Directory' | ||
inputs: | ||
SourceFolder: '$(Build.BinariesDirectory)\java-artifact\onnxruntime-java-win-x64' | ||
TargetFolder: '$(Build.ArtifactStagingDirectory)' | ||
|
||
- task: PublishPipelineArtifact@1 | ||
displayName: 'Publish Pipeline Artifact' | ||
inputs: | ||
targetPath: '$(Build.ArtifactStagingDirectory)' | ||
artifact: 'onnxruntime-java-gpu' | ||
|
||
- template: ../templates/component-governance-component-detection-steps.yml | ||
parameters: | ||
condition: 'succeeded' | ||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 | ||
displayName: 'Clean Agent Directories' | ||
condition: always() | ||
- job: Final_Jar_Testing_Windows_GPU | ||
dependsOn: | ||
Jar_Packaging_GPU | ||
workspace: | ||
clean: all | ||
pool: 'onnxruntime-Win2022-GPU-T4' | ||
timeoutInMinutes: 60 | ||
variables: | ||
- name: runCodesignValidationInjection | ||
value: false | ||
|
||
steps: | ||
- template: ../templates/set-version-number-variables-step.yml | ||
|
||
- template: ../templates/jobs/download_win_gpu_library.yml | ||
parameters: | ||
CudaVersion: ${{ parameters.CudaVersion }} | ||
DownloadCUDA: true | ||
DownloadTRT: true | ||
|
||
- template: ../templates/flex-downloadPipelineArtifact.yml | ||
parameters: | ||
StepName: 'Download Final Jar' | ||
ArtifactName: onnxruntime-java-gpu | ||
TargetPath: '$(Build.BinariesDirectory)\final-jar' | ||
SpecificArtifact: ${{ parameters.SpecificArtifact }} | ||
BuildId: ${{ parameters.BuildId }} | ||
|
||
- template: ../templates/flex-downloadPipelineArtifact.yml | ||
parameters: | ||
StepName: 'Download Jar Tools' | ||
ArtifactName: onnxruntime-java-tools | ||
TargetPath: '$(Build.BinariesDirectory)\final-jar' | ||
SpecificArtifact: ${{ parameters.SpecificArtifact }} | ||
BuildId: ${{ parameters.BuildId }} | ||
|
||
- task: CmdLine@2 | ||
inputs: | ||
script: | | ||
mkdir test | ||
pushd test | ||
jar xf $(Build.BinariesDirectory)\final-jar\testing.jar | ||
popd | ||
java -DUSE_CUDA=1 -jar junit-platform-console-standalone-1.6.2.jar -cp .;.\test;protobuf-java-3.21.7.jar;onnxruntime_gpu-$(OnnxRuntimeVersion).jar --scan-class-path --fail-if-no-tests --disable-banner | ||
workingDirectory: '$(Build.BinariesDirectory)\final-jar' | ||
|
||
- template: ../templates/component-governance-component-detection-steps.yml | ||
parameters: | ||
condition: 'succeeded' | ||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 | ||
displayName: 'Clean Agent Directories' | ||
condition: always() | ||
- job: Final_Jar_Testing_Linux_GPU | ||
dependsOn: | ||
Jar_Packaging_GPU | ||
workspace: | ||
clean: all | ||
pool: 'Onnxruntime-Linux-GPU' | ||
variables: | ||
- name: runCodesignValidationInjection | ||
value: false | ||
- 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 | ||
timeoutInMinutes: 60 | ||
|
||
steps: | ||
- checkout: self | ||
submodules: false | ||
- template: ../templates/set-version-number-variables-step.yml | ||
|
||
- template: ../templates/flex-downloadPipelineArtifact.yml | ||
parameters: | ||
StepName: 'Download Final Jar' | ||
ArtifactName: onnxruntime-java-gpu | ||
TargetPath: '$(Build.BinariesDirectory)/final-jar' | ||
SpecificArtifact: ${{ parameters.specificArtifact }} | ||
BuildId: ${{ parameters.BuildId }} | ||
|
||
- template: ../templates/get-docker-image-steps.yml | ||
parameters: | ||
Dockerfile: tools/ci_build/github/linux/docker/Dockerfile.package_ubi8_cuda_tensorrt10_0 | ||
Context: tools/ci_build/github/linux/docker/ | ||
DockerBuildArgs: " | ||
--build-arg BUILD_UID=$( id -u ) | ||
--build-arg BASEIMAGE=${{ variables.docker_base_image }} | ||
--build-arg TRT_VERSION=${{ variables.linux_trt_version }} | ||
" | ||
Repository: onnxruntimeubi8packagestest | ||
UpdateDepsTxt: false | ||
|
||
- bash: | | ||
docker run --rm \ | ||
--gpus all \ | ||
--volume $(Build.SourcesDirectory):/onnxruntime_src \ | ||
--volume $(Build.BinariesDirectory):/build \ | ||
--volume /data/models:/build/models:ro \ | ||
onnxruntimeubi8packagestest \ | ||
/bin/bash /onnxruntime_src/tools/ci_build/github/linux/java_linux_final_test.sh -r /build -v $(OnnxRuntimeVersion) | ||
displayName: 'Test' | ||
- template: ../templates/component-governance-component-detection-steps.yml | ||
parameters: | ||
condition: 'succeeded' | ||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 | ||
displayName: 'Clean Agent Directories' | ||
condition: always() |
Oops, something went wrong.