Skip to content

tests: record the gfx1152 llama.cpp bundle gap so the next one is not silent - #7491

Merged
danielhanchen merged 2 commits into
mainfrom
gfx1152-llamacpp-bundle-gap
Jul 27, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
gfx1152-llamacpp-bundle-gap

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #7431. Tests only, no production code changes.

#7431 made gfx1152 (Krackan Point, Radeon 860M/840M) a first-class arch. That fixed the torch side: those laptops were pulling gfx1150 wheels built for a different LLVM target, and repo.amd.com publishes gfx1150 and gfx1152 as separate index leaves with separately built wheels.

It also changed llama.cpp prebuilt selection, which we did not notice at the time. No gfx1152 bundle is published:

gfx103X  mapped_targets=['gfx1030', 'gfx1031', 'gfx1032', 'gfx1034']
gfx110X  mapped_targets=['gfx1100', 'gfx1101', 'gfx1102', 'gfx1103']
gfx1150  mapped_targets=['gfx1150']
gfx1151  mapped_targets=['gfx1151']
gfx120X  mapped_targets=['gfx1200', 'gfx1201']
gfx908   mapped_targets=['gfx908']
gfx90a   mapped_targets=['gfx90a']

published_rocm_choice_for_host deliberately refuses to serve a sibling-family bundle, so a Krackan host now falls back to a HIP source build where it previously downloaded the gfx1150 prebuilt.

Why this is not a revert

The source build is the correct outcome. The gfx1150 binary was being handed to gfx1152 hardware before, and these bundles carry the ROCm runtime inside them (rocblas.dll, hipblas.dll, amdhip64_7.dll), whose Tensile kernels are arch-specific. That is the same failure mode as the gfx906 breakage in #7354: a wrong-ISA binary dies at the first BLAS call rather than merely installing slowly. Trading a fast broken install for a slow working one is the right direction.

What was wrong is that nothing recorded the gap and nothing would have caught it. TestPublishedRocmGfxSelection builds its release from a hardcoded family list, so it can only assert about arches someone already thought to add.

What this adds

TestPublishedRocmBundleCoverage:

  • PUBLISHED mirrors the mapped_targets in llama-prebuilt-manifest.json.
  • KNOWN_GAPS lists the arches _GFX_TO_AMD_INDEX_ARCH routes torch for that no bundle covers: gfx1033/1035/1036 (RDNA 2, never built) and gfx1152, each with the reason and, for gfx1152, how to close it.
  • test_known_gaps_fall_back_to_source_build pins each gap to None.
  • test_every_torch_routed_arch_is_covered_or_a_known_gap compares the torch-routed set against bundle coverage, so adding an arch for torch without a bundle has to be a deliberate KNOWN_GAPS entry rather than an unnoticed drop to source builds.

The invariant fires in both directions. Simulating a new routed arch:

AssertionError: llama.cpp bundle coverage drifted: ['gfx1153'] newly uncovered, [] no longer a gap

Simulating a published gfx1152 bundle:

AssertionError: gfx1152 is in KNOWN_GAPS but a bundle now matches it; drop it from the set
AssertionError: llama.cpp bundle coverage drifted: [] newly uncovered, ['gfx1152'] no longer a gap

So closing the gap cannot leave the list stale.

On whether to publish a gfx1152 bundle

I looked at how common this hardware is before deciding. Per-arch ROCm bundle download counts, unsloth's last three releases next to lemonade's:

arch product unsloth lemonade
gfx110X RX 7000 30.0% 21.3%
gfx120X RX 9000 27.4% 21.7%
gfx1151 Strix Halo 24.1% 36.6%
gfx103X RX 6000 11.8% 12.6%
gfx1150 Strix Point 5.9% 5.3%

Two independently maintained repos agreeing at 5.9 and 5.3 percent makes gfx1150 a trustworthy number, and ROCm is only about 4 percent of platform binary downloads overall. Krackan sits below Strix Point in the stack and, before #7431, was being counted inside that gfx1150 bucket, so the affected population is a minority of an already small slice.

Worth noting AMD's own lemonade has the same gap on its nightly channel, and fails harder: rocm_asset_families does not list gfx1152, unlisted ISAs are used verbatim, so it requests an asset that does not exist and 404s. Its default stable channel sidesteps this entirely by shipping one arch-agnostic binary keyed by ROCm version and injecting per-arch runtime libraries from TheRock, which is why it can claim gfx1152 support without building for it.

So I would not add a bundle just for this. Recording the gap is the proportionate step, and if a Krackan user reports the slow install we have the entry to point at. The near-zero-cost alternative, if we want it sooner, is checking whether the gfx1150 build already lists gfx1152 in its HIP_ARCHITECTURES; if it does, adding gfx1152 to that bundle's mapped_targets closes this with no new artifact, and these tests will tell us to update KNOWN_GAPS when it lands.

Verification

Windows 11, Strix Halo (gfx1151). Install suite 1355 passed with no new failures against a clean main baseline.

danielhanchen and others added 2 commits July 27, 2026 02:41
… silent

#7431 made gfx1152 (Krackan Point, Radeon 860M/840M) a first-class arch, which
fixed torch wheel selection: those laptops were pulling gfx1150 wheels built for
a different LLVM target. It also changed llama.cpp prebuilt selection, because
no gfx1152 bundle is published. published_rocm_choice_for_host deliberately
refuses to serve a sibling-family bundle, so those hosts now fall back to a HIP
source build.

That is the right outcome, a wrong-ISA binary fails at the first BLAS call
rather than merely installing slowly, but nothing recorded it and nothing would
have caught it. TestPublishedRocmGfxSelection builds its release from a
hardcoded family list, so it can only assert about arches someone already
thought to add.

Adds TestPublishedRocmBundleCoverage:

- PUBLISHED mirrors the mapped_targets in llama-prebuilt-manifest.json.
- KNOWN_GAPS lists arches _GFX_TO_AMD_INDEX_ARCH routes torch for that no bundle
  covers: gfx1033/1035/1036 (RDNA 2, never built) and gfx1152.
- test_known_gaps_fall_back_to_source_build pins each to None.
- test_every_torch_routed_arch_is_covered_or_a_known_gap compares the routed set
  against bundle coverage, so adding an arch for torch without a bundle has to
  be a deliberate KNOWN_GAPS entry.

The invariant fires both ways. Simulating a new routed arch fails with
"coverage drifted: ['gfx1153'] newly uncovered"; simulating a published gfx1152
bundle fails with "gfx1152 is in KNOWN_GAPS but a bundle now matches it; drop it
from the set", so closing the gap cannot leave the list stale.

Reads _GFX_TO_AMD_INDEX_ARCH from source instead of importing
install_python_stack, which this suite does not otherwise depend on.

No production code changes. Install suite 1355 passed, no new failures.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 513c9a5691

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


# mapped_targets of each published ROCm bundle, mirroring
# unslothai/llama.cpp's llama-prebuilt-manifest.json.
PUBLISHED = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read coverage from the published manifest

When unslothai/llama.cpp publishes a new bundle or adds gfx1152 to an existing bundle's mapped_targets without modifying this repository, this hardcoded snapshot remains unchanged. _release() therefore continues constructing the old synthetic release, so both new tests still pass and keep asserting that gfx1152 is a gap even though production consumes the updated remote manifest. This defeats the claimed reverse drift guard; derive or generate this coverage from the artifact publishing source (or a synchronized checked-in manifest) instead.

Useful? React with 👍 / 👎.

@danielhanchen
danielhanchen merged commit ef97f3c into main Jul 27, 2026
20 of 21 checks passed
@danielhanchen
danielhanchen deleted the gfx1152-llamacpp-bundle-gap branch July 27, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant