-
Notifications
You must be signed in to change notification settings - Fork 331
[rocjitsu] Add CI workflow with HIP device kernel tests #6448
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,94 @@ | ||
| # rocjitsu CI: build from source and run the full test suite. | ||
| # | ||
| # How it works: | ||
| # 1. Sparse-checkout emulation/rocjitsu | ||
| # 2. Install ROCm from the AMD apt repo (provides hipcc and device | ||
| # libraries for compiling HIP test kernels). See | ||
| # https://github.com/ROCm/rocm-systems/pull/6479 for an | ||
| # alternative using pip rocm-sdk-core (TheRock). | ||
| # 3. Build with clang + ninja in Release mode | ||
| # 4. Run the full ctest suite on the CPU emulator | ||
| # | ||
| # No GPU hardware is needed. rocjitsu's tests run on its built-in | ||
| # CPU emulator, which simulates AMD GPU execution. HIP kernels are | ||
| # compiled for gfx950 by hipcc, then loaded and executed by the | ||
| # emulator at test time. | ||
| # | ||
| # Excluded tests: | ||
| # RocminfoTest — spawns rocminfo under LD_PRELOAD with the KMD | ||
| # interposer, which requires /dev/kfd (unavailable on CI runners). | ||
|
|
||
| name: rocjitsu CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "emulation/rocjitsu/**" | ||
| - ".github/workflows/rocjitsu-ci.yml" | ||
| push: | ||
| branches: [develop] | ||
| paths: | ||
| - "emulation/rocjitsu/**" | ||
| - ".github/workflows/rocjitsu-ci.yml" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-test: | ||
| name: Linux (clang, Release) | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| sparse-checkout: emulation/rocjitsu | ||
|
|
||
| - name: Install system dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y ninja-build clang libdrm-dev | ||
|
|
||
| - name: Install ROCm (hipcc + device libraries) | ||
| run: | | ||
| # Add the AMD ROCm apt repo and its signing key. | ||
| sudo mkdir -p --mode=0755 /etc/apt/keyrings | ||
| wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key \ | ||
| | gpg --dearmor \ | ||
| | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null | ||
| echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] \ | ||
| https://repo.radeon.com/rocm/apt/latest noble main" \ | ||
| | sudo tee /etc/apt/sources.list.d/rocm.list | ||
|
|
||
| # Pin priority 600: prefer ROCm packages from repo.radeon.com | ||
| # over Ubuntu's defaults, without overriding manually installed | ||
| # packages. This is the AMD-recommended apt setup for ROCm. | ||
| echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \ | ||
| | sudo tee /etc/apt/preferences.d/rocm-pin-600 | ||
|
|
||
| sudo apt-get update | ||
| sudo apt-get install -y hip-runtime-amd rocm-hip-sdk | ||
| echo "ROCM_PATH=/opt/rocm" >> $GITHUB_ENV | ||
|
|
||
| # Sanity check: hipcc can compile a trivial HIP kernel | ||
| echo '__global__ void k(){}' \ | ||
| | /opt/rocm/bin/hipcc -x hip --offload-arch=gfx950 \ | ||
| --cuda-device-only -c -o /dev/null - | ||
|
|
||
| - name: Configure | ||
| run: > | ||
| cmake -B build -G Ninja | ||
| -S emulation/rocjitsu | ||
| -DCMAKE_C_COMPILER=clang | ||
| -DCMAKE_CXX_COMPILER=clang++ | ||
| -DCMAKE_BUILD_TYPE=Release | ||
| -DCMAKE_CXX_FLAGS="-Werror" | ||
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
|
|
||
| - name: Build | ||
| run: cmake --build build -j$(nproc) | ||
|
|
||
| - name: Test | ||
| run: > | ||
| ctest --test-dir build | ||
| --output-on-failure | ||
| --timeout 120 | ||
| --exclude-regex "RocminfoTest" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not grab therock tarball / pip install?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I (well, Claude) was trying initially, but couldn't get it work one CI job where it failed: https://github.com/ROCm/rocm-systems/actions/runs/26478854701/job/77971169397
So when Claude got it working with an apt install I pivoted to this approach. I can try with therock again, is would be nicer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works now: #6499
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doubles the download size, but I'm fine with that. @kuhar I'm going close this PR in favour of TheRock version #6499