Skip to content

ggml-hrx: size fused router launch for target expert tiles - #146

Merged
AaronStGeorge merged 1 commit into
AMD-Ecosystem:hrx-graph-develop-v2from
AaronStGeorge:fix/qwen3-moe-router-gfx1151
Oct 14, 2026
Merged

AaronStGeorge merged 1 commit into
AMD-Ecosystem:hrx-graph-develop-v2from
AaronStGeorge:fix/qwen3-moe-router-gfx1151

Conversation

@AaronStGeorge

@AaronStGeorge AaronStGeorge commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Qwen3 MoE decode-like perplexity is wrong on gfx1151 while prefill-like is right, and the same binaries are right for both on gfx1100. In https://github.com/ROCm/ggml-staging-automation/actions/runs/38275322264, Qwen3-30B-A3B-Instruct-2507 Q4_K_M measured HRX decode-like PPL 20503 against Vulkan 6.7573 on gfx1151 (-c 512 --chunks 2 -b 512 -ub 1); on gfx1100 the CI binaries give 6.7431.

The fused decode router (qwen3_moe_router_projection_top8_fused_decode_f32) hard-coded four experts per wave when sizing its launch, but the gfx1151 projection template handles two experts per wave. On gfx1151 the kernel therefore launched half the expert tiles it needed. The launch now reads experts-per-wave from the same template the projection uses, so the workgroup count follows the target's tile width. Every other wave64 target resolves to the previous constant of four.

This path only runs when the token count is exactly one, so it affects single-token decode and nothing else. It became reachable on 2026-10-12 when #140 let the graph matcher accept these microbatches; before that the regime did not execute on HRX at all.

Testing

gfx1151, staging CI. A perplexity-only run of Qwen3-30B-A3B-Instruct-2507 alone, with llama.cpp pinned at this PR's head and hrx-system at the current staging pin 7696b5b3c02a, and the model's perplexity: fail relaxation removed so a pass is a strict PASS: https://github.com/ROCm/ggml-staging-automation/actions/runs/38580145237 (branch ppl/qwen3-30b-router-fix-gfx1151, dispatched with skip_benchmarks=["lemonade-benchmark"], model_tier=full). Result: strict PASS.

Regime HRX gfx1151, before (run 38275322264) HRX gfx1151, this PR Vulkan
decode-like, -ub 1, 2 chunks 20503.1356 6.7431 6.7573
prefill-like, -ub 512, 32 chunks 6.0732 6.0732 6.0628

gfx1100, regression. Built against hrx-system 7696b5b3c02a. Qwen3-30B-A3B-Instruct-2507 Q4_K_M on wiki.test.raw, RX 7900 XTX, before and after this commit, four runs each, identical per-chunk values:

Regime Before After Vulkan
decode-like, -ub 1, 2 chunks 6.7431 6.7431 6.7573
prefill-like, -ub 512, 32 chunks 6.0732 6.0732 6.0760

gfx1100 is unchanged by construction: the default template returns the old constant, and the measured values agree to the last digit. The 182 kernel specializations from the CI failure logs also compile with this corpus against hrx-system main (2a13b0bc) via loom-check.

No HRX dependency changes; the minimum HRX commit is unchanged.

Requirements

  • I have read and agree with the contributing guidelines.
  • AI usage disclosure: YES. Codex produced the fix; Claude Code performed the gfx1100 regression validation, set up the gfx1151 CI run, and prepared this PR under human review.

🤖 Generated with Claude Code

https://claude.ai/code/session_015v3UH99xxQnyzuJhhVnemd

@AaronStGeorge
AaronStGeorge merged commit 1bdb972 into AMD-Ecosystem:hrx-graph-develop-v2 Oct 14, 2026
AaronStGeorge added a commit to ROCm/ggml-staging-automation that referenced this pull request Oct 14, 2026
The repoint moved llama.cpp to dbe1d6e1a27e, which includes
AMD-Ecosystem/llama.cpp#146: the fused Qwen3 MoE
decode router now launches enough expert tiles on gfx1151, so this
model's decode-like perplexity matches Vulkan instead of blowing up.
With the fix in the pin the `fail` expectation would report an XPASS and
turn CI red. Drop it together with the lemonade-benchmark report-only
relaxation that stood only while perplexity failed, so the benchmark is
enforced again. That empties the block, so the whole hrx block goes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_017uqTUQu8qXDdX2yuPVfVwS
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