Skip to content

Commit d20d03f

Browse files
committed
Basic CI for hrx-v2
1 parent e698bad commit d20d03f

19 files changed

Lines changed: 135 additions & 61 deletions

.github/workflows/build-android.yml

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

1818
pull_request:
1919
types: [opened, synchronize, reopened]
20+
branches-ignore: ['hrx-v2']
2021
paths: [
2122
'.github/workflows/build-android.yml',
2223
'examples/llama.android/**'

.github/workflows/build-apple.yml

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

2121
pull_request:
2222
types: [opened, synchronize, reopened]
23+
branches-ignore: ['hrx-v2']
2324
paths: [
2425
'.github/workflows/build-apple.yml',
2526
'ggml/src/ggml-metal/**'

.github/workflows/build-cann.yml

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

1818
pull_request:
1919
types: [opened, synchronize, reopened]
20+
branches-ignore: ['hrx-v2']
2021
paths: [
2122
'.github/workflows/build-cann.yml',
2223
'ggml/src/ggml-cann/**'

.github/workflows/build-hrx.yml

Lines changed: 111 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: HRX CI
1+
name: HRX v2 CI
22

33
on:
4+
push:
5+
branches:
6+
- hrx-v2
47
pull_request:
58
types: [opened, synchronize, reopened]
69
branches:
7-
- hrx-integration
10+
- hrx-v2
11+
workflow_dispatch:
812

913
permissions:
1014
contents: read
@@ -15,81 +19,128 @@ concurrency:
1519
cancel-in-progress: true
1620

1721
jobs:
18-
hrx-build:
19-
name: ubuntu-latest
20-
runs-on: ubuntu-latest
22+
hrx2-build:
23+
name: ${{ matrix.name }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
- name: gfx120X
29+
runner: linux-gfx120X-gpu-rocm
30+
rocm_tarball: therock-dist-linux-gfx120X-all-7.14.0a20260617.tar.gz
31+
- name: gfx125X
32+
runner: linux-gfx125X-gpu-rocm
33+
rocm_tarball: therock-dist-linux-gfx125X-dcgpu-7.14.0a20260617.tar.gz
34+
runs-on: ${{ matrix.runner }}
35+
timeout-minutes: 120
36+
defaults:
37+
run:
38+
shell: bash --noprofile --norc -exo pipefail {0}
39+
container:
40+
image: ghcr.io/rocm/no_rocm_image_ubuntu24_04@sha256:fba5f55a122dbb15925e98c51fe65bffe88c36e11ebb25b73daf2bea04202dc3
41+
options: >-
42+
--user 0:0
43+
--device /dev/kfd
44+
--device /dev/dri
2145
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'
46+
DEVWS_REPOSITORY: AaronStGeorge/llamacpp-devws
47+
DEVWS_REF: build-hrx-v2
48+
DEVWS_DIR: /work/llamacpp-devws
49+
ROCM_DIR: /work/rocm
50+
ROCM_TARBALL_BASE_URL: https://rocm.nightlies.amd.com/tarball-multi-arch
51+
ROCM_TARBALL_NAME: ${{ matrix.rocm_tarball }}
3152
CCACHE_COMPILERCHECK: content
53+
HSA_FORCE_FINE_GRAIN_PCIE: "1"
3254

3355
steps:
34-
- name: Checkout llama.cpp (under test)
56+
- name: Checkout dev workspace tooling
57+
uses: actions/checkout@v6
58+
with:
59+
repository: ${{ env.DEVWS_REPOSITORY }}
60+
ref: ${{ env.DEVWS_REF }}
61+
path: devws-src
62+
63+
- name: Checkout llama.cpp under test
3564
uses: actions/checkout@v6
3665
with:
3766
path: llama-src
3867

39-
- name: Checkout bench tooling
68+
- name: Checkout HRX System
4069
uses: actions/checkout@v6
4170
with:
42-
repository: ${{ env.BENCH_REPOSITORY }}
43-
ref: ${{ env.BENCH_REF }}
44-
path: bench
71+
repository: ROCm/hrx-system
72+
ref: main
73+
path: hrx-system-src
4574

46-
- name: Install ROCm build dependencies
47-
run: "${BENCH_DIR}/scripts/hrx/install-rocm-deps.sh"
75+
- name: Runner identity
76+
if: always()
77+
run: |
78+
printf 'RUNNER_NAME=%s\n' "${RUNNER_NAME:-}"
79+
printf 'RUNNER_OS=%s\n' "${RUNNER_OS:-}"
80+
printf 'GITHUB_EVENT_NAME=%s\n' "${GITHUB_EVENT_NAME:-}"
81+
hostname
82+
uname -a
83+
ls -l /dev/kfd /dev/dri || true
84+
printenv | sort | grep -E '^(GITHUB_|RUNNER_|ROCM_|HSA_|HIP_)' || true
85+
86+
- name: Install host build dependencies
87+
run: |
88+
apt-get update
89+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
90+
build-essential \
91+
ca-certificates \
92+
ccache \
93+
cmake \
94+
curl \
95+
git \
96+
glslc \
97+
libvulkan-dev \
98+
ninja-build \
99+
pkg-config \
100+
python3 \
101+
tar \
102+
xz-utils
103+
104+
- name: Stage dev workspace under /work
105+
run: |
106+
rm -rf "${DEVWS_DIR}"
107+
mkdir -p "${DEVWS_DIR}/sources"
108+
cp -a "${GITHUB_WORKSPACE}/devws-src/." "${DEVWS_DIR}/"
109+
cp -a "${GITHUB_WORKSPACE}/llama-src" "${DEVWS_DIR}/sources/llama.cpp"
110+
cp -a "${GITHUB_WORKSPACE}/hrx-system-src" "${DEVWS_DIR}/sources/hrx-system"
111+
git -C "${DEVWS_DIR}/sources/llama.cpp" checkout -B hrx-v2
112+
git -C "${DEVWS_DIR}/sources/hrx-system" checkout -B main
113+
114+
- name: Fetch ROCm nightly tarball
115+
run: |
116+
rm -rf "${ROCM_DIR}" /work/rocm-tarball
117+
mkdir -p "${ROCM_DIR}" /work/rocm-tarball
118+
curl -fsSL "${ROCM_TARBALL_BASE_URL}/${ROCM_TARBALL_NAME}" \
119+
-o "/work/rocm-tarball/${ROCM_TARBALL_NAME}"
120+
tar -xzf "/work/rocm-tarball/${ROCM_TARBALL_NAME}" -C "${ROCM_DIR}"
121+
ln -sfn "${ROCM_DIR}" "${DEVWS_DIR}/rocm"
122+
test -x "${DEVWS_DIR}/rocm/bin/rocminfo"
123+
test -x "${DEVWS_DIR}/rocm/bin/amdclang++"
48124
49125
- name: ccache
50126
uses: ggml-org/ccache-action@v1.2.21
51127
with:
52-
key: ubuntu-latest-${{ env.HRX_ARTIFACT_SET }}
128+
key: hrx-v2-${{ matrix.name }}
53129
evict-old-files: 1d
54130
save: ${{ github.event_name == 'pull_request' }}
55131

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
132+
- name: Build HRX2
72133
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
134+
cd "${DEVWS_DIR}"
135+
python3 skills/bootstrap-hrx-llama-builds/scripts/bootstrap_builds.py \
136+
--action check \
137+
--action hrx \
138+
--action loom \
139+
--action rocm-health \
140+
--action llama-hrx2 \
141+
--gfx-targets auto \
142+
--jobs "$(nproc)"
143+
144+
- name: Verify HRX2 build configuration
82145
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/
146+
grep -F 'GGML_HRX2:BOOL=ON' "${DEVWS_DIR}/build/llama-hrx2/CMakeCache.txt"

.github/workflows/build-riscv.yml

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

1818
pull_request:
1919
types: [opened, synchronize, reopened]
20+
branches-ignore: ['hrx-v2']
2021
paths: [
2122
'.github/workflows/build-riscv.yml',
2223
'ggml/src/ggml-cpu/arch/riscv/**'

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

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

2626
pull_request:
2727
types: [opened, synchronize, reopened]
28+
branches-ignore: ['hrx-v2']
2829
paths: [
2930
'.github/workflows/build-self-hosted.yml',
3031
'**/CMakeLists.txt',

.github/workflows/build-vulkan.yml

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

2020
pull_request:
2121
types: [opened, synchronize, reopened]
22+
branches-ignore: ['hrx-v2']
2223
paths: [
2324
'.github/workflows/build-vulkan.yml',
2425
'ggml/src/ggml-vulkan/**'

.github/workflows/build.yml

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

2727
pull_request:
2828
types: [opened, synchronize, reopened]
29+
branches-ignore: ['hrx-v2']
2930
paths: [
3031
'.github/workflows/build.yml',
3132
'.github/workflows/build-cmake-pkg.yml',

.github/workflows/check-vendor.yml

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

1313
pull_request:
1414
types: [opened, synchronize, reopened]
15+
branches-ignore: ['hrx-v2']
1516
paths: [
1617
'vendor/**',
1718
'scripts/sync_vendor.py'

.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-v2']
89
paths:
910
- .github/workflows/copilot-setup-steps.yml
1011
pull_request:
12+
branches-ignore: ['hrx-v2']
1113
paths:
1214
- .github/workflows/copilot-setup-steps.yml
1315

0 commit comments

Comments
 (0)