Basic CI for hrx-v2
#127
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
| name: HRX v2 CI | |
| on: | |
| push: | |
| branches: | |
| - hrx-v2 | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - hrx-v2 | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| actions: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| hrx2-build: | |
| name: ${{ matrix.name }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: gfx1151_strix-halo | |
| gpu_target: gfx1151 | |
| runner: linux-gfx1151-gpu-rocm | |
| rocm_tarball: therock-dist-linux-gfx1151-7.14.0a20260617.tar.gz | |
| - name: gfx1201_9070 | |
| gpu_target: gfx1201 | |
| runner: linux-gfx120X-gpu-rocm | |
| rocm_tarball: therock-dist-linux-gfx120X-all-7.14.0a20260617.tar.gz | |
| runs-on: ${{ matrix.runner }} | |
| timeout-minutes: 120 | |
| defaults: | |
| run: | |
| shell: bash --noprofile --norc -exo pipefail {0} | |
| container: | |
| image: ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:fba5f55a122dbb15925e98c51fe65bffe88c36e11ebb25b73daf2bea04202dc3 | |
| options: >- | |
| --user 0:0 | |
| --device /dev/kfd | |
| --device /dev/dri | |
| env: | |
| DEVWS_REPOSITORY: AaronStGeorge/llamacpp-devws | |
| DEVWS_REF: ci-scripts | |
| DEVWS_DIR: ${{ github.workspace }}/devws-src | |
| DEVWS_BUILD_DIR: /work/llamacpp-devws-build | |
| ROCM_DIR: /work/rocm | |
| ROCM_TARBALL_BASE_URL: https://rocm.nightlies.amd.com/tarball-multi-arch | |
| ROCM_TARBALL_NAME: ${{ matrix.rocm_tarball }} | |
| CCACHE_COMPILERCHECK: content | |
| HSA_FORCE_FINE_GRAIN_PCIE: "1" | |
| steps: | |
| - name: Checkout dev workspace tooling | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ${{ env.DEVWS_REPOSITORY }} | |
| ref: ${{ env.DEVWS_REF }} | |
| path: devws-src | |
| - name: Checkout llama.cpp under test | |
| uses: actions/checkout@v6 | |
| with: | |
| path: llama-src | |
| - name: Checkout HRX System | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: ROCm/hrx-system | |
| ref: main | |
| path: hrx-system-src | |
| - name: Runner identity | |
| if: always() | |
| env: | |
| MATRIX_NAME: ${{ matrix.name }} | |
| MATRIX_GPU_TARGET: ${{ matrix.gpu_target }} | |
| MATRIX_RUNS_ON: ${{ matrix.runner }} | |
| run: "${GITHUB_WORKSPACE}/devws-src/ci/runner-info.sh" | |
| - name: Install host build dependencies | |
| run: | | |
| apt-get update | |
| DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| ca-certificates \ | |
| ccache \ | |
| cmake \ | |
| curl \ | |
| git \ | |
| glslc \ | |
| libvulkan-dev \ | |
| ninja-build \ | |
| pkg-config \ | |
| python3 \ | |
| tar \ | |
| xz-utils | |
| - name: Fetch ROCm nightly tarball | |
| run: "${DEVWS_DIR}/ci/fetch-rocm-nightly.sh" | |
| - name: ccache | |
| uses: ggml-org/ccache-action@v1.2.21 | |
| with: | |
| key: hrx-v2-${{ matrix.name }} | |
| evict-old-files: 1d | |
| save: ${{ github.event_name == 'pull_request' }} | |
| - name: Build HRX2 | |
| run: | | |
| cd "${DEVWS_DIR}" | |
| python3 skills/bootstrap-hrx-llama-builds/scripts/bootstrap_builds.py \ | |
| --workspace "${DEVWS_BUILD_DIR}" \ | |
| --action check \ | |
| --action hrx \ | |
| --action loom \ | |
| --action rocm-health \ | |
| --action llama-hrx2 \ | |
| --hrx-source "${GITHUB_WORKSPACE}/hrx-system-src" \ | |
| --llama-source "${GITHUB_WORKSPACE}/llama-src" \ | |
| --skip-source-branch-check \ | |
| --gfx-targets auto \ | |
| --jobs "$(nproc)" | |
| - name: Verify HRX2 build configuration | |
| run: | | |
| grep -F 'GGML_HRX2:BOOL=ON' "${DEVWS_BUILD_DIR}/build/llama-hrx2/CMakeCache.txt" | |
| - name: Run sample MUL_MAT correctness config on HRX2 | |
| run: | | |
| export ROCM_PATH="${DEVWS_BUILD_DIR}/rocm" | |
| export GGML_HRX_ROCM_PATH="${DEVWS_BUILD_DIR}/rocm" | |
| export PATH="${DEVWS_BUILD_DIR}/rocm/bin:${DEVWS_BUILD_DIR}/rocm/lib/llvm/bin:${PATH}" | |
| export LD_LIBRARY_PATH="${DEVWS_BUILD_DIR}/build/llama-hrx2/bin:${DEVWS_BUILD_DIR}/build/hrx-install/lib:${DEVWS_BUILD_DIR}/build/hrx-install/lib64:${DEVWS_BUILD_DIR}/rocm/lib:${DEVWS_BUILD_DIR}/rocm/lib64:${DEVWS_BUILD_DIR}/rocm/lib/rocm_sysdeps/lib:${LD_LIBRARY_PATH:-}" | |
| export IREE_HAL_AMDGPU_LIBHSA_PATH="${DEVWS_BUILD_DIR}/rocm/lib/libhsa-runtime64.so" | |
| mkdir -p "${GITHUB_WORKSPACE}/benchmark-results" | |
| "${DEVWS_DIR}/ci/tools/run-op-test.py" \ | |
| --test-backend-ops "${DEVWS_BUILD_DIR}/build/llama-hrx2/bin/test-backend-ops" \ | |
| --test-file "${DEVWS_DIR}/ci/benchmark-configs/test/mul_mat_f16.txt" \ | |
| --op MUL_MAT \ | |
| --backend HRX20 \ | |
| --output "${GITHUB_WORKSPACE}/benchmark-results/sample-mul-mat-f16-hrx2-test.jsonl" \ | |
| --raw-output "${GITHUB_WORKSPACE}/benchmark-results/sample-mul-mat-f16-hrx2-test.txt" | |
| - name: Run sample MUL_MAT benchmark config on HRX2 | |
| run: | | |
| export ROCM_PATH="${DEVWS_BUILD_DIR}/rocm" | |
| export GGML_HRX_ROCM_PATH="${DEVWS_BUILD_DIR}/rocm" | |
| export PATH="${DEVWS_BUILD_DIR}/rocm/bin:${DEVWS_BUILD_DIR}/rocm/lib/llvm/bin:${PATH}" | |
| export LD_LIBRARY_PATH="${DEVWS_BUILD_DIR}/build/llama-hrx2/bin:${DEVWS_BUILD_DIR}/build/hrx-install/lib:${DEVWS_BUILD_DIR}/build/hrx-install/lib64:${DEVWS_BUILD_DIR}/rocm/lib:${DEVWS_BUILD_DIR}/rocm/lib64:${DEVWS_BUILD_DIR}/rocm/lib/rocm_sysdeps/lib:${LD_LIBRARY_PATH:-}" | |
| export IREE_HAL_AMDGPU_LIBHSA_PATH="${DEVWS_BUILD_DIR}/rocm/lib/libhsa-runtime64.so" | |
| mkdir -p "${GITHUB_WORKSPACE}/benchmark-results" | |
| "${DEVWS_DIR}/ci/tools/run-op-perf.py" \ | |
| --test-backend-ops "${DEVWS_BUILD_DIR}/build/llama-hrx2/bin/test-backend-ops" \ | |
| --test-file "${DEVWS_DIR}/ci/benchmark-configs/test/mul_mat_f16.txt" \ | |
| --op MUL_MAT \ | |
| --backend HRX20 \ | |
| --output "${GITHUB_WORKSPACE}/benchmark-results/sample-mul-mat-f16-hrx2-perf.jsonl" \ | |
| --raw-output "${GITHUB_WORKSPACE}/benchmark-results/sample-mul-mat-f16-hrx2-perf.txt" | |
| - name: Upload HRX2 benchmark results | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: hrx2-benchmark-results-${{ matrix.name }} | |
| path: benchmark-results/ | |
| if-no-files-found: error |