Commit 51b2562cd for llama.cpp

commit 51b2562cd0db941d14dd58b39ccdd84c3ecd1086
Author: Geramy Loveless <gloveless@jqluv.com>
Date:   Wed Dec 2 01:20:04 2026 -0800

    ci : add HRX self-hosted runners (#33489)

    * ci : add HRX self-hosted runners

    * ci : add ccache to the HRX self-hosted jobs

    * Update .github/workflows/ci-self-hosted-hrx.yml

    Co-authored-by: Aaron Teo <taronaeo@gmail.com>

    ---------

    Co-authored-by: Aaron Teo <taronaeo@gmail.com>

diff --git a/.github/workflows/ci-self-hosted-hrx.yml b/.github/workflows/ci-self-hosted-hrx.yml
new file mode 100644
index 000000000..480add2cb
--- /dev/null
+++ b/.github/workflows/ci-self-hosted-hrx.yml
@@ -0,0 +1,115 @@
+name: CI (self-hosted HRX backend)
+
+on:
+  workflow_dispatch: # allows manual triggering
+  push:
+    branches:
+      - master
+    paths: [
+      '.github/workflows/ci-self-hosted-hrx.yml',
+      'ci/run.sh',
+      '**/CMakeLists.txt',
+      '**/.cmake',
+      '**/*.h',
+      '**/*.hpp',
+      '**/*.c',
+      '**/*.cpp',
+      '**/*.loom'
+    ]
+
+  pull_request:
+    types: [opened, synchronize, reopened]
+    paths: [
+      '.github/workflows/ci-self-hosted-hrx.yml',
+      'ci/run.sh',
+      '**/CMakeLists.txt',
+      '**/.cmake',
+      'ggml/src/*',
+      'ggml/src/ggml-cpu/**',
+      'ggml/src/ggml-hrx/**'
+    ]
+
+cache-mode: none
+permissions:
+  contents: read
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
+  cancel-in-progress: true
+
+env:
+  # note: this is dud token to avoid rate limiting (https://github.com/ggml-org/llama.cpp/pull/25706#issuecomment-4979941302)
+  HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
+  GGML_NLOOP: 3
+  GGML_N_THREADS: 1
+  LLAMA_ARG_LOG_COLORS: 1
+  LLAMA_ARG_LOG_PREFIX: 1
+  LLAMA_ARG_LOG_TIMESTAMPS: 1
+
+jobs:
+  gpu-hrx:
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          # Strix Halo (iGPU, RDNA3.5)
+          - gpu: gfx1151
+            runner: [self-hosted, Linux, strix-halo, devlab-dispatch]
+          # Radeon AI PRO R9700 (dGPU, RDNA4)
+          - gpu: gfx1201
+            runner: [self-hosted, Linux, radeon-r9700, devlab-dispatch]
+
+    name: gpu-hrx (${{ matrix.gpu }})
+    runs-on: ${{ matrix.runner }}
+    timeout-minutes: 120
+
+    steps:
+      - name: Clone
+        id: checkout
+        uses: actions/checkout@v6
+
+      - name: Install HRX SDK
+        id: hrx-sdk
+        run: |
+          HRX_SDK_PATH=${HRX_SDK_PATH:-$RUNNER_TOOL_CACHE/hrx-sdk/v0.2.0}
+          if [ ! -f "$HRX_SDK_PATH/lib/cmake/hrx/hrx-config.cmake" ]; then
+            curl -L https://github.com/ROCm/hrx-system/archive/refs/tags/v0.2.0.tar.gz | tar xz -C "$RUNNER_TEMP"
+            cd "$RUNNER_TEMP/hrx-system-0.2.0"
+            python3 dev.py cmake setup
+            source .venv/bin/activate
+            cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DIREE_ENABLE_WERROR_FLAG=OFF \
+                  -DLIBHRX_BUILD=ON -DLIBHRX_BUILD_HIP_BINDING=OFF -DLIBHRX_BUILD_PASSTHROUGH=OFF -DLIBHRX_BUILD_CTS=OFF
+            cmake --build build --target hrx hrx-info loomc_shared
+            cmake --install build --prefix "$HRX_SDK_PATH" --component HrxPublicDist
+          fi
+          echo "HRX_SDK_PATH=$HRX_SDK_PATH" >> "$GITHUB_ENV"
+
+      - name: ccache
+        uses: ggml-org/ccache-action@v1.2.24
+        with:
+          restore: false
+          save: false
+
+      - name: ccache-buckets-restore
+        uses: ./.github/actions/ccache-buckets
+        with:
+          key: self-hosted-gpu-hrx-${{ matrix.gpu }}
+          folder: llama.cpp
+          hf_bucket: ggml-org/cache
+
+      - name: Test
+        id: ggml-ci
+        run: |
+          GG_BUILD_HRX=1 bash ./ci/run.sh "$RUNNER_TEMP/results/llama.cpp" "$RUNNER_TEMP/mnt/llama.cpp"
+
+      - name: ccache-buckets-save
+        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
+        uses: ./.github/actions/ccache-buckets
+        env:
+          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
+        with:
+          key: self-hosted-gpu-hrx-${{ matrix.gpu }}
+          folder: llama.cpp
+          evict-old-files: 1d
+          hf_bucket: ggml-org/cache
+          save: true
diff --git a/ci/run.sh b/ci/run.sh
index 5ea5f52ab..e6a874f3b 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -110,7 +110,8 @@ if [ ! -z ${GG_BUILD_HRX} ]; then
     fi

     # TODO: HRX has no quantized KV cache yet (SET_ROWS into q8_0)
-    CTEST_EXTRA="-E test-llama-context"
+    # TODO: HRX cannot run the sampling ops of test-backend-sampler yet
+    CTEST_EXTRA="-E test-llama-context|test-backend-sampler"
 fi

 if [ ! -z ${GG_BUILD_SYCL} ]; then
@@ -343,7 +344,7 @@ function gg_run_ctest_with_model_debug {
     cd build-ci-debug
     set -e

-    (LLAMACPP_TEST_MODELFILE="$model" time ctest -C Debug --output-on-failure -L model) 2>&1 | tee -a $OUT/${ci}-ctest.log
+    (LLAMACPP_TEST_MODELFILE="$model" time ctest -C Debug --output-on-failure -L model ${CTEST_EXTRA}) 2>&1 | tee -a $OUT/${ci}-ctest.log

     set +e
     cd ..
@@ -356,7 +357,7 @@ function gg_run_ctest_with_model_release {
     cd build-ci-release
     set -e

-    (LLAMACPP_TEST_MODELFILE="$model" time ctest -C Release --output-on-failure -L model) 2>&1 | tee -a $OUT/${ci}-ctest.log
+    (LLAMACPP_TEST_MODELFILE="$model" time ctest -C Release --output-on-failure -L model ${CTEST_EXTRA}) 2>&1 | tee -a $OUT/${ci}-ctest.log

     # test memory leaks
     #if [[ ! -z ${GG_BUILD_METAL} ]]; then