-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description * Add new ROCm CI pipeline (`Linux ROCm CI Pipeline`) focusing on inference. * Resolve test errors; disable flaky tests. based on test PR #21614.
- Loading branch information
Showing
8 changed files
with
382 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
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
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
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
238 changes: 238 additions & 0 deletions
238
tools/ci_build/github/azure-pipelines/linux-rocm-ci-pipeline.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,238 @@ | ||
##### start trigger Don't edit it manually, Please do edit set-trigger-rules.py #### | ||
trigger: | ||
branches: | ||
include: | ||
- main | ||
- rel-* | ||
paths: | ||
exclude: | ||
- docs/** | ||
- README.md | ||
- CONTRIBUTING.md | ||
- BUILD.md | ||
- 'js/web' | ||
- 'onnxruntime/core/providers/js' | ||
pr: | ||
branches: | ||
include: | ||
- main | ||
- rel-* | ||
paths: | ||
exclude: | ||
- docs/** | ||
- README.md | ||
- CONTRIBUTING.md | ||
- BUILD.md | ||
- 'js/web' | ||
- 'onnxruntime/core/providers/js' | ||
#### end trigger #### | ||
|
||
name: 'linux_ci_$(Date:yyyyMMdd)_$(Rev:r)' | ||
|
||
# gid of video and render group on gcramdrr1-mi100-085 and -86 | ||
variables: | ||
- name: video | ||
value: 44 | ||
- name: render | ||
value: 109 | ||
- name: RocmVersion | ||
value: 6.1 | ||
- name: RocmVersionPatchSuffix | ||
value: ".3" | ||
|
||
jobs: | ||
- job: Linux_Build | ||
variables: | ||
skipComponentGovernanceDetection: true | ||
CCACHE_DIR: $(Pipeline.Workspace)/ccache | ||
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)] | ||
workspace: | ||
clean: all | ||
pool: onnxruntime-Ubuntu2204-AMD-CPU | ||
timeoutInMinutes: 240 | ||
|
||
steps: | ||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3 | ||
displayName: 'Clean Agent Directories' | ||
condition: always() | ||
|
||
- checkout: self | ||
clean: true | ||
submodules: recursive | ||
|
||
|
||
- template: templates/get-docker-image-steps.yml | ||
parameters: | ||
Dockerfile: tools/ci_build/github/linux/docker/rocm-ci-pipeline-env.Dockerfile | ||
Context: tools/ci_build/github/linux/docker | ||
DockerBuildArgs: "--build-arg ROCM_VERSION=$(RocmVersion)$(RocmVersionPatchSuffix)" | ||
Repository: onnxruntimerocm-cibuild-rocm$(RocmVersion) | ||
|
||
- task: Cache@2 | ||
inputs: | ||
key: '"$(TODAY)" | "$(Build.SourceBranch)" | "$(Build.SourceVersion)"' | ||
path: $(CCACHE_DIR) | ||
cacheHitVar: CACHE_RESTORED | ||
restoreKeys: | | ||
"$(TODAY)" | "$(Build.SourceBranch)" | ||
"$(TODAY)" | | ||
displayName: Cache Task | ||
|
||
- script: mkdir -p $(CCACHE_DIR) | ||
condition: ne(variables.CACHE_RESTORED, 'true') | ||
displayName: Create Cache Dir | ||
|
||
- task: CmdLine@2 | ||
inputs: | ||
script: | | ||
docker run --rm \ | ||
--security-opt seccomp=unconfined \ | ||
--shm-size=1024m \ | ||
--user $UID:$(id -g $USER) \ | ||
--volume $(Build.SourcesDirectory):/onnxruntime_src \ | ||
--volume $(Build.BinariesDirectory):/build \ | ||
--volume $(CCACHE_DIR):/cache \ | ||
-e CCACHE_DIR=/cache \ | ||
--workdir /onnxruntime_src \ | ||
onnxruntimerocm-cibuild-rocm$(RocmVersion) \ | ||
/bin/bash -c " | ||
set -ex; \ | ||
env; \ | ||
ccache -s; \ | ||
python tools/ci_build/build.py \ | ||
--config Release \ | ||
--cmake_extra_defines \ | ||
CMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++ \ | ||
onnxruntime_BUILD_KERNEL_EXPLORER=ON \ | ||
CMAKE_HIP_ARCHITECTURES=gfx90a \ | ||
--mpi_home /opt/ompi \ | ||
--use_rocm \ | ||
--rocm_version=$(RocmVersion) \ | ||
--rocm_home /opt/rocm \ | ||
--nccl_home /opt/rocm \ | ||
--enable_nccl \ | ||
--update \ | ||
--build_dir /build \ | ||
--build \ | ||
--build_shared_lib \ | ||
--parallel \ | ||
--build_wheel \ | ||
--enable_onnx_tests \ | ||
--skip_submodule_sync \ | ||
--use_cache \ | ||
--skip_tests --cmake_path /usr/bin/cmake --ctest_path /usr/bin/ctest; \ | ||
ccache -sv; \ | ||
ccache -z" | ||
workingDirectory: $(Build.SourcesDirectory) | ||
displayName: 'Build onnxruntime' | ||
|
||
- task: CmdLine@2 | ||
inputs: | ||
script: | | ||
cd $(Build.BinariesDirectory)/Release | ||
find -executable -type f > $(Build.BinariesDirectory)/Release/perms.txt | ||
displayName: 'Find Executable Files' | ||
|
||
- task: PublishPipelineArtifact@0 | ||
displayName: 'Publish Pipeline Artifact' | ||
inputs: | ||
artifactName: 'drop-linux' | ||
targetPath: '$(Build.BinariesDirectory)/Release' | ||
|
||
- template: templates/explicitly-defined-final-tasks.yml | ||
|
||
- job: Linux_Test | ||
workspace: | ||
clean: all | ||
pool: AMD-GPU | ||
dependsOn: | ||
- Linux_Build | ||
timeoutInMinutes: 120 | ||
|
||
steps: | ||
- task: DownloadPipelineArtifact@2 | ||
displayName: 'Download Pipeline Artifact' | ||
inputs: | ||
buildType: 'current' | ||
artifactName: 'drop-linux' | ||
targetPath: '$(Build.BinariesDirectory)/Release' | ||
|
||
- checkout: self | ||
clean: true | ||
submodules: recursive | ||
|
||
- template: templates/get-docker-image-steps.yml | ||
parameters: | ||
Dockerfile: tools/ci_build/github/linux/docker/rocm-ci-pipeline-env.Dockerfile | ||
Context: tools/ci_build/github/linux/docker | ||
DockerBuildArgs: "--build-arg ROCM_VERSION=$(RocmVersion)$(RocmVersionPatchSuffix)" | ||
Repository: onnxruntimerocm-cibuild-rocm$(RocmVersion) | ||
|
||
- task: CmdLine@2 | ||
inputs: | ||
script: | | ||
docker run --rm \ | ||
--security-opt seccomp=unconfined \ | ||
--shm-size=1024m \ | ||
--device=/dev/kfd \ | ||
--device=/dev/dri/renderD$DRIVER_RENDER \ | ||
--group-add $(video) \ | ||
--group-add $(render) \ | ||
--user $UID:$(id -g $USER) \ | ||
--volume $(Build.SourcesDirectory):/onnxruntime_src \ | ||
--volume $(Build.BinariesDirectory):/build \ | ||
--volume /data/models:/build/models:ro \ | ||
--workdir /build/Release \ | ||
onnxruntimerocm-cibuild-rocm$(RocmVersion) \ | ||
/bin/bash -c " | ||
set -ex; \ | ||
xargs -a /build/Release/perms.txt chmod a+x; \ | ||
python /onnxruntime_src/tools/ci_build/build.py \ | ||
--config Release \ | ||
--cmake_extra_defines \ | ||
CMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++ \ | ||
onnxruntime_BUILD_KERNEL_EXPLORER=ON \ | ||
CMAKE_HIP_ARCHITECTURES=gfx90a \ | ||
--mpi_home /opt/ompi \ | ||
--use_rocm \ | ||
--rocm_version=$(RocmVersion) \ | ||
--rocm_home /opt/rocm \ | ||
--nccl_home /opt/rocm \ | ||
--enable_nccl \ | ||
--build_dir /build \ | ||
--build_shared_lib \ | ||
--parallel \ | ||
--build_wheel \ | ||
--skip_submodule_sync \ | ||
--test --enable_onnx_tests --enable_transformers_tool_test \ | ||
--cmake_path /usr/bin/cmake --ctest_path /usr/bin/ctest" | ||
workingDirectory: $(Build.SourcesDirectory) | ||
displayName: 'Run onnxruntime unit tests' | ||
|
||
- task: CmdLine@2 | ||
inputs: | ||
script: |- | ||
docker run --rm \ | ||
--security-opt seccomp=unconfined \ | ||
--shm-size=1024m \ | ||
--device=/dev/kfd \ | ||
--device=/dev/dri/renderD$DRIVER_RENDER \ | ||
--group-add $(video) \ | ||
--group-add $(render) \ | ||
--user $UID:$(id -g $USER) \ | ||
--volume $(Build.SourcesDirectory):/onnxruntime_src \ | ||
--volume $(Build.BinariesDirectory):/build \ | ||
-e OPENBLAS_NUM_THREADS=1 \ | ||
-e OPENMP_NUM_THREADS=1 \ | ||
-e MKL_NUM_THREADS=1 \ | ||
-e KERNEL_EXPLORER_BUILD_DIR=/build/Release \ | ||
-e KERNEL_EXPLORER_BATCHED_GEMM_MAX_BATCH_SIZE=8 \ | ||
-e KERNEL_EXPLORER_TEST_USE_CUPY=1 \ | ||
-e CUPY_CACHE_DIR=/build/Release \ | ||
onnxruntimerocm-cibuild-rocm$(RocmVersion) \ | ||
pytest /onnxruntime_src/onnxruntime/python/tools/kernel_explorer/ -n 4 --reruns 1 --durations=100 | ||
workingDirectory: $(Build.SourcesDirectory) | ||
displayName: 'Run kernel explorer tests' | ||
condition: succeededOrFailed() | ||
|
||
- template: templates/clean-agent-build-directory-step.yml |
Oops, something went wrong.