Skip to content

Commit 0668b9e

Browse files
HRX CI: run on self-hosted ROCm GPU runners for gfx1151/gfx1201 (#22)
* HRX CI: run on self-hosted ROCm GPU runners for gfx1151/gfx1201 Replace the ubuntu-latest CPU job with a matrix on linux-gfx1151-gpu-rocm and linux-gfx120X-gpu-rocm, building for the runner's gfx target and running the sample MUL_MAT correctness/perf configs on the HRX0 backend. Fetch per-arch rocwmma dev artifacts. BENCH_REF temporarily points at the p066-multi-arch-ci branch of the bench tooling; restore to main when this merges. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Options should already be set up in the container * debug * HRX CI: run container as root, write build outputs off the bind mount Run the job container with --user 0:0 so checkout can write the runner's _work tree on runners whose agent owns it as root (the plain shark65 runner); the image's default tester user (uid 1001) only works on the prolense fleet where _work is 1001-owned. Add --device kfd/dri for GPU access on runners that don't inject devices. Point HRX_WORK_DIR and LLAMA_BUILD_DIR at a container-local /work path so ROCm downloads and build trees are reclaimed on container removal instead of accumulating in the persistent runner's bind-mounted workspace. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * cleanup comments * HRX CI: source runtime-env.sh in op-test/perf steps The bench tooling moved runtime env setup (LD_LIBRARY_PATH incl. the HRX install lib, and HSA_FORCE_FINE_GRAIN_PCIE=1 for gfx12) out of fetch-rocm-assets.sh into runtime-env.sh. Build/validate scripts source it internally; the op-test and op-perf steps invoke the python tools directly, so source runtime-env.sh there too. Without it those steps would now run with neither the HRX libs on LD_LIBRARY_PATH nor the gfx12 fine-grained-memory flag, which is what produced the MUL_MAT NaNs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * ggml-hrx: port to renamed HRX export-info field (constant_byte_length) Upstream HRX renamed hrx_executable_export_info_t.constant_count -> constant_byte_length (now the byte length of the constants buffer, not a uint32 count). Update the catalog-kernel ABI check accordingly: constant_count * sizeof(uint32_t) == constants_size becomes constant_byte_length == constants_size and fix the corresponding diagnostic log. Needed to build ggml-hrx against the bumped HRX (ROCm/hrx upstream main); verified building against e8275fbb5. * cleanup * ci: on hrx-integration, run only build-hrx.yml (push + pull_request) The fork's hrx-integration branch should run only the HRX CI, not the upstream llama.cpp matrix. - build-hrx.yml: add a push trigger for hrx-integration (was pull_request-only). - Every other workflow whose push/pull_request/pull_request_target could match hrx-integration now carries branches-ignore: ['hrx-integration'] (build.yml, build-vulkan/cann/apple/android/riscv/self-hosted, server*, check-vendor, hip-quality-check, python-*, labeler, copilot-setup-steps, etc.). - gguf-publish is tag-only (can't fire on a branch push) and the rest were already scoped to master. Verified: only build-hrx.yml fires on hrx-integration for push and PR events. Caveat: these touch upstream workflow files, so upstream merges into hrx-integration may conflict on them (build-hrx.yml itself does not). * ignore * ci(hrx): runner-identity debug block + GPU health-check step - Debug (runner identity): first step, if: always(), logs RUNNER_NAME, hostname, uname, /dev/kfd|dri, lspci, RUNNER_*/GITHUB_* env -- so the specific self-hosted runner behind a failure is identifiable from the log alone. - GPU health check: after 'Fetch ROCm assets' (prefix binaries present), runs the bench runner-health.sh (rocminfo/amd-smi/rocm-smi diagnostics + fail-fast on /dev/kfd missing, dead rocminfo, or expected gfx arch not enumerated). Caveat: neither detects the gfx1151 coherence NaN flake (GPU reports healthy); the debug block enables post-hoc identification. runner-health.sh must be on the bench at BENCH_REF (AaronStGeorge/llamacpp_ci) for the health step to resolve. * ci(hrx): add MUL_MAT failure-rate loop (per-runner diagnostic) Run the failing mul_mat_f16 config N times (MULMAT_LOOP_N, default 50) in one job and print the fail/pass count + RUNNER_NAME, to answer: on a bad machine does it fail every iteration or only some, and what's the rate per machine? Advisory (continue-on-error) and placed BEFORE the gating correctness step so it still runs on a failing machine. Correlate the count with RUNNER_NAME from the Debug step. * ci(hrx): move runner-identity dump into bench script Replace the inline "Debug (runner identity)" block with a call to runner-identity.sh (in the bench repo, alongside runner-health.sh). The step now runs right after the bench checkout (earliest the script is available) instead of first; matrix values are passed via MATRIX_* env since a script can't read ${{ matrix.* }}. if: always() retained. Requires runner-identity.sh on the bench BENCH_REF branch (committed on AaronStGeorge/llamacpp_ci runner-health). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * cleanup --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent be6db45 commit 0668b9e

20 files changed

Lines changed: 104 additions & 21 deletions

.github/workflows/build-android.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
]
1717

1818
pull_request:
19+
branches-ignore: ['hrx-integration']
1920
types: [opened, synchronize, reopened]
2021
paths: [
2122
'.github/workflows/build-android.yml',

.github/workflows/build-apple.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
]
2020

2121
pull_request:
22+
branches-ignore: ['hrx-integration']
2223
types: [opened, synchronize, reopened]
2324
paths: [
2425
'.github/workflows/build-apple.yml',

.github/workflows/build-cann.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
]
1717

1818
pull_request:
19+
branches-ignore: ['hrx-integration']
1920
types: [opened, synchronize, reopened]
2021
paths: [
2122
'.github/workflows/build-cann.yml',

.github/workflows/build-hrx.yml

Lines changed: 78 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: HRX CI
22

33
on:
4+
push:
5+
branches:
6+
- hrx-integration
47
pull_request:
58
types: [opened, synchronize, reopened]
69
branches:
@@ -16,40 +19,95 @@ concurrency:
1619

1720
jobs:
1821
hrx-build:
19-
name: ubuntu-latest
20-
runs-on: ubuntu-latest
22+
name: ${{ matrix.name }} (${{ matrix.gpu_target }})
23+
strategy:
24+
# Per-arch failures are independent; keep both signals.
25+
fail-fast: false
26+
matrix:
27+
include:
28+
- name: gfx1151_strix-halo
29+
gpu_target: gfx1151
30+
runs_on: linux-gfx1151-gpu-rocm
31+
extra_rocm_artifacts: rocwmma_dev_gfx1151
32+
- name: gfx1201_9070
33+
gpu_target: gfx1201
34+
runs_on: linux-gfx120X-gpu-rocm
35+
extra_rocm_artifacts: rocwmma_dev_gfx120X-all
36+
runs-on: ${{ matrix.runs_on }}
37+
timeout-minutes: 10
38+
defaults:
39+
run:
40+
# --noprofile skips loading ~/.bash_profile
41+
# --norc skips loading ~/.bashrc
42+
# -exo pipefail:
43+
# -e exit immediately if any command fails
44+
# -x print each command before executing
45+
# -o pipefail ensure pipeline fails if any command in it fails
46+
# {0} github actions placeholder for the command to run
47+
shell: bash --noprofile --norc -exo pipefail {0}
48+
container:
49+
image: ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:fba5f55a122dbb15925e98c51fe65bffe88c36e11ebb25b73daf2bea04202dc3
50+
# --user 0:0: actions running inside the container need to write to some
51+
# files set up outside the container by the runner agent. In
52+
# June 2026 some runner agents set those files up with
53+
# permissions for a "tester" user with UID/GID 1001, which
54+
# matches the user in no_rocm_image_ubuntu24_04, and some are
55+
# set up as root; accessing a file owned by root with user
56+
# "tester" gives an EACCES. Running as root is the common
57+
# denominator.
58+
# --device kfd/dri: GPU access.
59+
options: >-
60+
--user 0:0
61+
--device /dev/kfd
62+
--device /dev/dri
2163
env:
22-
HRX_WORK_DIR: ${{ github.workspace }}
64+
# Write out of tree build/install to a non-bind-mounted directory. In June
65+
# 2026 a debug test showed some runners had assets dated from 6 months ago
66+
# in the bind-mounted github workspace, it seems like nothing cleans it up
67+
# currently. Writing to an non-bind-mounted directory ensures that
68+
# rocm-artifacts/builds are cleaned up when docker container is removed.
69+
HRX_WORK_DIR: /work
2370
# Public location for bench tooling (rsuderman/llamacpp_ci and fork
2471
# AaronStGeorge/llamacpp_ci)
2572
#TODO: switch to ROCm/llamacpp-hrx-bench once it is open sourced.
2673
BENCH_REPOSITORY: AaronStGeorge/llamacpp_ci
2774
BENCH_REF: 'main'
75+
# actions/checkout@v6 does auto-cleanup, an in-tree build would be
76+
# auto-cleaned as well.
2877
BENCH_DIR: ${{ github.workspace }}/bench
2978
LLAMA_SRC_DIR: ${{ github.workspace }}/llama-src
30-
HRX_ARTIFACT_SET: 'core-with-upstream-hip'
79+
LLAMA_BUILD_DIR: /work/llama-build
80+
HRX_EXTRA_ROCM_ARTIFACTS: ${{ matrix.extra_rocm_artifacts }}
81+
GGML_HRX_AMDGPU_TARGETS: ${{ matrix.gpu_target }}
3182
CCACHE_COMPILERCHECK: content
3283

3384
steps:
34-
- name: Checkout llama.cpp (under test)
35-
uses: actions/checkout@v6
36-
with:
37-
path: llama-src
38-
3985
- name: Checkout bench tooling
4086
uses: actions/checkout@v6
4187
with:
4288
repository: ${{ env.BENCH_REPOSITORY }}
4389
ref: ${{ env.BENCH_REF }}
4490
path: bench
4591

92+
- name: Runner info
93+
env:
94+
MATRIX_NAME: ${{ matrix.name }}
95+
MATRIX_GPU_TARGET: ${{ matrix.gpu_target }}
96+
MATRIX_RUNS_ON: ${{ matrix.runs_on }}
97+
run: "${BENCH_DIR}/scripts/hrx/runner-info.sh"
98+
99+
- name: Checkout llama.cpp (under test)
100+
uses: actions/checkout@v6
101+
with:
102+
path: llama-src
103+
46104
- name: Install ROCm build dependencies
47105
run: "${BENCH_DIR}/scripts/hrx/install-rocm-deps.sh"
48106

49107
- name: ccache
50108
uses: ggml-org/ccache-action@v1.2.21
51109
with:
52-
key: ubuntu-latest-${{ env.HRX_ARTIFACT_SET }}
110+
key: ${{ matrix.gpu_target }}
53111
evict-old-files: 1d
54112
save: ${{ github.event_name == 'pull_request' }}
55113

@@ -68,28 +126,30 @@ jobs:
68126
- name: Build llama.cpp with HRX
69127
run: "${BENCH_DIR}/scripts/hrx/build-llama-hrx.sh"
70128

71-
- name: Run sample MUL_MAT correctness config on CPU
129+
- name: Run sample MUL_MAT correctness config on HRX
72130
run: |
73131
. "${BENCH_DIR}/scripts/hrx/env.sh"
132+
. "${BENCH_DIR}/scripts/hrx/runtime-env.sh"
74133
"${BENCH_DIR}/tools/run-op-test.py" \
75134
--test-backend-ops "${LLAMA_BUILD_DIR}/bin/test-backend-ops" \
76135
--test-file "${BENCH_DIR}/benchmark-configs/test/mul_mat_f16.txt" \
77136
--op MUL_MAT \
78-
--backend CPU \
79-
--output benchmark-results/sample-mul-mat-f16-cpu-test.jsonl
137+
--backend HRX0 \
138+
--output benchmark-results/sample-mul-mat-f16-hrx-test.jsonl
80139
81-
- name: Run sample MUL_MAT benchmark config on CPU
140+
- name: Run sample MUL_MAT benchmark config on HRX
82141
run: |
83142
. "${BENCH_DIR}/scripts/hrx/env.sh"
143+
. "${BENCH_DIR}/scripts/hrx/runtime-env.sh"
84144
"${BENCH_DIR}/tools/run-op-perf.py" \
85145
--test-backend-ops "${LLAMA_BUILD_DIR}/bin/test-backend-ops" \
86146
--test-file "${BENCH_DIR}/benchmark-configs/test/mul_mat_f16.txt" \
87147
--op MUL_MAT \
88-
--backend CPU \
89-
--output benchmark-results/sample-mul-mat-f16-cpu-perf.jsonl
148+
--backend HRX0 \
149+
--output benchmark-results/sample-mul-mat-f16-hrx-perf.jsonl
90150
91-
- name: Upload CPU benchmark results
151+
- name: Upload benchmark results
92152
uses: actions/upload-artifact@v5
93153
with:
94-
name: cpu-benchmark-results
154+
name: benchmark-results-${{ matrix.name }}
95155
path: benchmark-results/

.github/workflows/build-riscv.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616
]
1717

1818
pull_request:
19+
branches-ignore: ['hrx-integration']
1920
types: [opened, synchronize, reopened]
2021
paths: [
2122
'.github/workflows/build-riscv.yml',

.github/workflows/build-self-hosted.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ on:
2424
]
2525

2626
pull_request:
27+
branches-ignore: ['hrx-integration']
2728
types: [opened, synchronize, reopened]
2829
paths: [
2930
'.github/workflows/build-self-hosted.yml',

.github/workflows/build-vulkan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
]
1919

2020
pull_request:
21+
branches-ignore: ['hrx-integration']
2122
types: [opened, synchronize, reopened]
2223
paths: [
2324
'.github/workflows/build-vulkan.yml',

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ on:
2525
]
2626

2727
pull_request:
28+
branches-ignore: ['hrx-integration']
2829
types: [opened, synchronize, reopened]
2930
paths: [
3031
'.github/workflows/build.yml',

.github/workflows/check-vendor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
]
1212

1313
pull_request:
14+
branches-ignore: ['hrx-integration']
1415
types: [opened, synchronize, reopened]
1516
paths: [
1617
'vendor/**',

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ name: "Copilot Setup Steps"
55
on:
66
workflow_dispatch:
77
push:
8+
branches-ignore: ['hrx-integration']
89
paths:
910
- .github/workflows/copilot-setup-steps.yml
1011
pull_request:
12+
branches-ignore: ['hrx-integration']
1113
paths:
1214
- .github/workflows/copilot-setup-steps.yml
1315

0 commit comments

Comments
 (0)