Skip to content

Commit e31b5af

Browse files
[IntelNav] ci: verify libggml-hip.so contains every requested gfx target
After the v0.1.2 incident where AMDGPU_TARGETS edits were uncommitted at tag time and the tarball silently shipped with the stale narrow arch list, add a post-Build CI step that: - Locates the freshly-built libggml-hip.so under build/. - Strings out every gfx<NNN> token baked into it. - Diffs against the configured AMDGPU_TARGETS (now job-scope so the Verify step can read it). - Fails loudly if any requested target is missing. Catches both the v0.1.2 class of bug (workflow file out of sync with intent) AND any future ROCm toolchain regression where a target silently fails to compile and the build still succeeds.
1 parent 1870daf commit e31b5af

1 file changed

Lines changed: 45 additions & 14 deletions

File tree

.github/workflows/intelnav-release.yml

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,21 @@ jobs:
166166
# ---------------------------------------------------------------------
167167
linux-x64-rocm:
168168
runs-on: ubuntu-22.04
169+
env:
170+
# Native bytecode for every shipping Radeon arch we'd plausibly
171+
# see in IntelNav users' machines. Build cost is ~30 % more
172+
# than a narrow target list, but the resulting tarball runs
173+
# without HSA_OVERRIDE_GFX_VERSION on any of them. The runtime
174+
# `gpu_compat` shim still applies as belt-and-suspenders for
175+
# arches that get added to consumer-grade hardware after a
176+
# given tarball was cut. Set here at job scope so the post-Build
177+
# verification step can diff against what landed in the binary.
178+
# gfx9xx — Vega + CDNA1/2/3 (radeon vii, MI50/100/200/300)
179+
# gfx103x — RDNA2 (RX 6x00, e.g. 6600 = gfx1032)
180+
# gfx110x — RDNA3 (RX 7x00)
181+
# gfx115x — RDNA3.5 (Strix Point APU iGPUs)
182+
# gfx120x — RDNA4 (RX 9x00)
183+
AMDGPU_TARGETS: "gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102;gfx1150;gfx1151;gfx1200;gfx1201"
169184
steps:
170185
- uses: actions/checkout@v6
171186
with: { fetch-depth: 0 }
@@ -212,20 +227,6 @@ jobs:
212227
evict-old-files: 1d
213228

214229
- name: Configure
215-
env:
216-
# Native bytecode for every shipping Radeon arch we'd plausibly
217-
# see in IntelNav users' machines. Build cost is ~30 % more
218-
# than a narrow target list, but the resulting tarball runs
219-
# without HSA_OVERRIDE_GFX_VERSION on any of them. The runtime
220-
# `gpu_compat` shim still applies as belt-and-suspenders for
221-
# arches that get added to consumer-grade hardware after a
222-
# given tarball was cut.
223-
# gfx9xx — Vega + CDNA1/2/3 (radeon vii, MI50/100/200/300)
224-
# gfx103x — RDNA2 (RX 6x00, e.g. 6600 = gfx1032)
225-
# gfx110x — RDNA3 (RX 7x00)
226-
# gfx115x — RDNA3.5 (Strix Point APU iGPUs)
227-
# gfx120x — RDNA4 (RX 9x00)
228-
AMDGPU_TARGETS: "gfx900;gfx906;gfx908;gfx90a;gfx942;gfx1030;gfx1031;gfx1032;gfx1100;gfx1101;gfx1102;gfx1150;gfx1151;gfx1200;gfx1201"
229230
run: |
230231
cmake -B build \
231232
${{ env.CMAKE_COMMON }} \
@@ -239,6 +240,36 @@ jobs:
239240
- name: Build
240241
run: cmake --build build -j $(nproc) --target llama
241242

243+
- name: Verify gfx targets compiled into libggml-hip.so
244+
# Catches the v0.1.2 mistake where AMDGPU_TARGETS edits weren't
245+
# committed before the tag fired and the tarball shipped with
246+
# the stale arch list. We extract every gfx string baked into
247+
# the .so, diff against the configured targets, fail loudly
248+
# if any are missing.
249+
run: |
250+
set -euo pipefail
251+
SO=$(find build -name 'libggml-hip.so' -type f | head -1)
252+
if [ -z "$SO" ]; then
253+
echo "::error::libggml-hip.so not found under build/"; exit 1
254+
fi
255+
echo "Inspecting $SO"
256+
BAKED=$(strings "$SO" | grep -oE 'gfx[0-9]+[a-z]*' | sort -u | tr '\n' ' ')
257+
echo "baked archs: $BAKED"
258+
MISSING=()
259+
IFS=';' read -ra WANT <<< "$AMDGPU_TARGETS"
260+
for arch in "${WANT[@]}"; do
261+
if ! echo "$BAKED" | grep -qw "$arch"; then
262+
MISSING+=("$arch")
263+
fi
264+
done
265+
if [ ${#MISSING[@]} -ne 0 ]; then
266+
echo "::error::libggml-hip.so is missing target(s): ${MISSING[*]}"
267+
echo "::error::expected: ${WANT[*]}"
268+
echo "::error::baked: $BAKED"
269+
exit 1
270+
fi
271+
echo "✓ every requested gfx target is in the binary"
272+
242273
- name: Package
243274
run: .github/actions/intelnav-pack.sh linux-x64-rocm
244275
shell: bash

0 commit comments

Comments
 (0)