|
| 1 | +name: HRX CI |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened] |
| 6 | + branches: |
| 7 | + - hrx-integration |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + actions: read |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + hrx-build: |
| 19 | + name: ubuntu-latest |
| 20 | + runs-on: ubuntu-latest |
| 21 | + env: |
| 22 | + HRX_WORK_DIR: ${{ github.workspace }} |
| 23 | + # Public location for bench tooling (rsuderman/llamacpp_ci and fork |
| 24 | + # AaronStGeorge/llamacpp_ci) |
| 25 | + #TODO: switch to ROCm/llamacpp-hrx-bench once it is open sourced. |
| 26 | + BENCH_REPOSITORY: AaronStGeorge/llamacpp_ci |
| 27 | + BENCH_REF: 'main' |
| 28 | + BENCH_DIR: ${{ github.workspace }}/bench |
| 29 | + LLAMA_SRC_DIR: ${{ github.workspace }}/llama-src |
| 30 | + HRX_ARTIFACT_SET: 'core-with-upstream-hip' |
| 31 | + CCACHE_COMPILERCHECK: content |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout llama.cpp (under test) |
| 35 | + uses: actions/checkout@v6 |
| 36 | + with: |
| 37 | + path: llama-src |
| 38 | + |
| 39 | + - name: Checkout bench tooling |
| 40 | + uses: actions/checkout@v6 |
| 41 | + with: |
| 42 | + repository: ${{ env.BENCH_REPOSITORY }} |
| 43 | + ref: ${{ env.BENCH_REF }} |
| 44 | + path: bench |
| 45 | + |
| 46 | + - name: Install ROCm build dependencies |
| 47 | + run: "${BENCH_DIR}/scripts/hrx/install-rocm-deps.sh" |
| 48 | + |
| 49 | + - name: ccache |
| 50 | + uses: ggml-org/ccache-action@v1.2.21 |
| 51 | + with: |
| 52 | + key: ubuntu-latest-${{ env.HRX_ARTIFACT_SET }} |
| 53 | + evict-old-files: 1d |
| 54 | + save: ${{ github.event_name == 'pull_request' }} |
| 55 | + |
| 56 | + - name: Checkout HRX |
| 57 | + run: "${BENCH_DIR}/scripts/hrx/checkout-hrx.sh" |
| 58 | + |
| 59 | + - name: Fetch ROCm assets |
| 60 | + run: "${BENCH_DIR}/scripts/hrx/fetch-rocm-assets.sh" |
| 61 | + |
| 62 | + - name: Build HRX |
| 63 | + run: "${BENCH_DIR}/scripts/hrx/build-hrx.sh" |
| 64 | + |
| 65 | + - name: Validate HRX |
| 66 | + run: "${BENCH_DIR}/scripts/hrx/validate-hrx.sh" |
| 67 | + |
| 68 | + - name: Build llama.cpp with HRX |
| 69 | + run: "${BENCH_DIR}/scripts/hrx/build-llama-hrx.sh" |
| 70 | + |
| 71 | + - name: Run sample MUL_MAT correctness config on CPU |
| 72 | + run: | |
| 73 | + . "${BENCH_DIR}/scripts/hrx/env.sh" |
| 74 | + "${BENCH_DIR}/tools/run-op-test.py" \ |
| 75 | + --test-backend-ops "${LLAMA_BUILD_DIR}/bin/test-backend-ops" \ |
| 76 | + --test-file "${BENCH_DIR}/benchmark-configs/test/mul_mat_f16.txt" \ |
| 77 | + --op MUL_MAT \ |
| 78 | + --backend CPU \ |
| 79 | + --output benchmark-results/sample-mul-mat-f16-cpu-test.jsonl |
| 80 | +
|
| 81 | + - name: Run sample MUL_MAT benchmark config on CPU |
| 82 | + run: | |
| 83 | + . "${BENCH_DIR}/scripts/hrx/env.sh" |
| 84 | + "${BENCH_DIR}/tools/run-op-perf.py" \ |
| 85 | + --test-backend-ops "${LLAMA_BUILD_DIR}/bin/test-backend-ops" \ |
| 86 | + --test-file "${BENCH_DIR}/benchmark-configs/test/mul_mat_f16.txt" \ |
| 87 | + --op MUL_MAT \ |
| 88 | + --backend CPU \ |
| 89 | + --output benchmark-results/sample-mul-mat-f16-cpu-perf.jsonl |
| 90 | +
|
| 91 | + - name: Upload CPU benchmark results |
| 92 | + uses: actions/upload-artifact@v5 |
| 93 | + with: |
| 94 | + name: cpu-benchmark-results |
| 95 | + path: benchmark-results/ |
0 commit comments