Skip to content

ggml-hrx: fix concat and recurrent snapshots for multi-token MTP - #155

Merged
AaronStGeorge merged 1 commit into
hrx-graph-develop-v2from
users/astgeorg/fix-hrx-multitoken-mtp
Oct 28, 2026
Merged

AaronStGeorge merged 1 commit into
hrx-graph-develop-v2from
users/astgeorg/fix-hrx-multitoken-mtp

Conversation

@AaronStGeorge

Copy link
Copy Markdown
Collaborator

Overview

Fix two HRX failures encountered while running Qwen3.5-35B-A3B-MTP-GGUF with multi-token drafting:

  • Give the dim-0 concat launch count an explicit range so Loom can compile the 2048+2048 hidden-state concat used by MTP. Add dynamic executable-reuse coverage for 1 and 128 rows.
  • Compute recurrent snapshot decay ratios as exp(log_decay_j - log_decay_i) in both fused Gated DeltaNet snapshot publication paths. Dividing cumulative exponentials could produce 0/0 after underflow, corrupting saved states used for speculative rejection/rollback.

Add CPU-reference regressions for attention and every saved state with 2 through 5 verification tokens, ordinary and underflowing decay, fused dispatch, and repeated graph execution. The snapshot regression fails with NaNs for 3 through 5 tokens before the fix.

Additional information

Prior validation on gfx1100 (RX 7900 XTX):

  • Focused HRX ops: 5/5 pass, including all four snapshot cases and dynamic generic ops.
  • Loom JIT suite passes, including the new concat workloads.
  • Full-model drafting lengths 2, 3 and 4 pass repeated requests and a 477-token prefill. Default length 3 matches all three non-MTP baseline texts; traces cover full, partial and zero acceptance with recurrent rollback and no checkpoint fallback. Lengths 2/4 match counting and arithmetic; open-ended chat has minor wording differences.

Rebased onto hrx-graph-develop-v2 at 7fd4e51 with an identical patch; whitespace checks pass. GPU tests have not been rerun after this rebase. gfx1151 validation remains outstanding.

Follows the MoE-routing fix in #153, already on the target branch. Lemonade automatic MTP enablement and ROCm/ggml-staging-automation#109 are separate changes; this PR contains only the backend kernels and their regressions.

Requirements

  • Contributor confirmation: I have read and agree with the contributing guidelines.
  • AI usage disclosure: YES. Codex assisted with investigation, implementation, regression tests, validation and preparation of this draft at the contributor's request.

AaronStGeorge added a commit that referenced this pull request Oct 26, 2026
## Overview

The packaged HRX suites fail 16 cases at the current backend pin. This fixes concat launch-bound compilation and updates stale dispatch expectations while retaining numerical comparisons and negative coverage.

- Reuse the concat bound fix and dynamic-reuse regression from #155; the existing element limit guarantees at most 4,194,304 workgroups.
- Check the current RoPE capacity class, aligned publication kernels, IQ2_S specialization, and low-token RMSNorm selection.
- Explicitly verify rejection of in-place RMSNorm, matching the kernels' no-alias contract.
- Verify supported Gemma Add-before-Add fusion parameters and add CPU-reference coverage.

## Additional information

Validated on gfx1100 with HRX `5f4dfc8731a1b37fdd380c566c7babf7ae3548cd`: **436 passed, 0 failed** across buffer (5), backend (99), JIT (6), and ops (326). CTest wall time was 62.09 seconds with two concurrent suites and internal worker counts 1/4/2/4. Three standard backend CONCAT CPU-comparison cases also passed. Numerical tolerances were unchanged.

gfx1151 CI qualification **passed: 436 cases, 0 failures, 59.03 seconds CTest wall time**: [workflow run 40393012701](https://github.com/ROCm/ggml-staging-automation/actions/runs/40393012701), testing this PR's exact backend commit `0230f1b29ee2d009602a7b2c6cbce64f1b1290d2` through the packaged test workflow. The separate packaging integration is ROCm/ggml-staging-automation#110. This PR overlaps only the concat fix/regression in #155; it does not include that PR's recurrent-state changes.

## Requirements

- [ ] I have read and agree with the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md) (contributor confirmation).
- AI usage disclosure: YES. Codex investigated the 16 failing cases through sequential subagents, reviewed the changes, and ran focused and full-suite validation. The user requested this submission.
@AaronStGeorge
AaronStGeorge force-pushed the users/astgeorg/fix-hrx-multitoken-mtp branch from ff2dba0 to d6a5606 Compare October 27, 2026 14:17
@AaronStGeorge
AaronStGeorge marked this pull request as ready for review October 28, 2026 03:16
@AaronStGeorge
AaronStGeorge merged commit 44ee571 into hrx-graph-develop-v2 Oct 28, 2026
1 of 14 checks passed
@AaronStGeorge
AaronStGeorge deleted the users/astgeorg/fix-hrx-multitoken-mtp branch October 28, 2026 03:17
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