Skip to content

Pin the working HRX backend for GLM-4.7-Flash - #344

Closed
bong-water-water-bong with Copilot wants to merge 4 commits into
mainfrom
copilot/hrx-glm-47-flash-fix-memory-fault
Closed

bong-water-water-bong with Copilot wants to merge 4 commits into
mainfrom
copilot/hrx-glm-47-flash-fix-memory-fault

Conversation

Copilot AI commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

GLM-4.7-Flash produced NaN logits and HRX op-test failures with AMD’s synced ggml-hrx. The reported working configuration pairs AMD’s core with our ggml-hrx subtree.

  • Submodule pin: Update third_party/llama.cpp to f2099e9 (AMD core + our backend); retain third_party/hrx-system at 98d05d9.

Co-authored-by: bong-water-water-bong <[email protected]>
Copilot AI changed the title [WIP] Fix intermittent HSA memory fault in HRX: GLM-4.7-Flash Pin the working HRX backend for GLM-4.7-Flash Oct 6, 2026
@bong-water-water-bong
bong-water-water-bong marked this pull request as ready for review October 6, 2026 22:52
@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) October 6, 2026 22:52
@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) October 6, 2026 22:52
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit d9e3807)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

315 - Partially compliant

Compliant requirements:

  • Fix intermittent HSA memory fault / NaN logits with GLM-4.7-Flash on HRX
  • Pin the working HRX backend configuration for GLM-4.7-Flash
  • Ensure the fix is applied to the correct submodule versions

Non-compliant requirements:

  • Reproduce the issue with varied-length requests (this is a fix for an existing issue, not a new reproduction)

Requires further human verification:

  • Verification that the pinned submodule indeed resolves the NaN logits and memory fault issues under varied-length requests
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Submodule Pinning

The PR updates the third_party/llama.cpp submodule to a specific commit (f2099e9) to address memory faults and NaN logits with GLM-4.7-Flash on HRX. While this resolves the issue by reverting to a known working configuration, it's important to ensure that this specific commit is indeed the correct one for the fix and that no other changes in the newer commits might reintroduce the problem. The change itself is a simple pinning, but the correctness of the pinned commit must be validated.

Subproject commit f2099e9b75a58b4489da013fa5dbe267c4034f51

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit d753e0e

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 4b59b1c

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit d9e3807

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Closing this as superseded — it would move the pin backwards and revert the fix for the very defect it names.

The pin it asks for is older than what main already has

main (621d25296) records third_party/llama.cpp = cf4dfd801e, not f2099e9b75:

main commit third_party/llama.cpp third_party/hrx-system
c18b31941 (#336) f2099e9b75 98d05d94a9
56624cbdb (#341) f2099e9b75 98d05d94a9
beec5e6bf (#342) cf4dfd801e 98d05d94a9
621d25296 (#345, current) cf4dfd801e 98d05d94a9

Measured with git ls-tree <commit> third_party/llama.cpp.

cf4dfd801e is a descendant of f2099e9b7 (git merge-base --is-ancestor f2099e9b7 cf4dfd801e → true) and is exactly one commit on top of it:

cf4dfd801 ggml-hrx: decode-split FA always-stage fallback (engine#314)
 .../loom-libs/ops/flash_attention_decode_split_f32_f16_wmma.loom | 7 +++++--

That is #342's fix for the decode-split flash-attention defect. This PR sets the pin to f2099e9, i.e. the commit before that fix — landing it would delete the kernel fix from the release pin and reintroduce the failure class this PR says it is fixing.

Why it looks correct: stale base

The branch was cut before #342 merged (this PR was created 22:47:17Z; #342 merged 22:46:23Z), so the diff reads like a legitimate pin bump while actually being a revert. Same stale-base trap as #328 ("merge AMD's pin into our line instead of rebasing 159 commits") and #329 (closed as superseded for pinning the wrong side).

The stated goal is already satisfied on main

"AMD's core with our ggml-hrx subtree" is exactly what #336 landed — f2099e9b75 = 56c3c8a3's core + 522dab47's backend, verified by tree hash (ggml/src/ggml-hrx = 919cd999f… at both 522dab47 and f2099e9b7, and 0 files differ from 56c3c8a3 outside it). #342 adds one kernel commit on top and changes nothing else about the backend composition.

#315 is not affected by this PR

The #315 mitigation is in the pinned line (llama.cpp#94 merged 2026-10-06T07:42:52Z, common/sampling.cpp), and the pin decision was made on the runtime measurement: test-backend-ops -b HRX0 1073/1073, 0 FAIL, 0 NaN on our ggml-hrx vs 54 FAIL / 18 NaN on AMD's synced ggml-hrx (which is why #329 was closed). This PR does not touch either side of that.

What to do instead

Nothing: main is already the corrected configuration. If a GLM-4.7-Flash NaN is still reproducible on cf4dfd801e + hrx-system 98d05d94, it needs a fresh issue with the run's evidence — note that GLM-4.7-Flash is a DeepSeek2-style MLA model (head_count 20, head_count_kv 1, qk/value_head_size 256) and never takes the decode-split FA path (TARGET/059 rejects 20:1 earlier), so the decode-split kernel is not the suspect for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HRX: GLM-4.7-Flash intermittent HSA memory fault / NaN logits under varied-length requests (base fork tip too)

2 participants