Skip to content

pins: llama.cpp c6c654c3 -> e0e7c8d3, the decode q8 publish sees a routed consumer through a reshape alias (llama.cpp#504; engine#3384) - #3477

Merged
bong-water-water-bong merged 1 commit into
mainfrom
bump-hrx/e0e7c8d3
Nov 24, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
bump-hrx/e0e7c8d3

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Carries llama.cpp#504 into the engine pin: the decode q8 publish now sees a routed consumer that reads the
rmsnorm-mul output through a reshape alias. This is the engine-side half of #3384.

What moves

  • third_party/llama.cpp c6c654c3 -> e0e7c8d3 (llama.cpp#504)
  • registry/architectures.json: regenerated by scripts/registry-regen.sh (llama.cpp source sha; 354
    architectures, no architecture change)
  • config/gpu-kernels.config does not move.

Why

has_qualified_q8_consumer() walked only direct consumers, so a routed gate/up reading the rmsnorm-mul output
through a ggml_reshape_2d was invisible: qwen3_moe_rmsnorm_f32_quantize_q8_1_x4 declined and the plan fell back
to ggml_rmsnorm_binary_f32 + f32 gate/up (engine#3384). llama.cpp#504 visits every consumer of the value and of
each layout alias over it, handing the consumer the value it actually reads, and accepts an alias only when it is a
contiguous full ordered value range -- the same rule find_alternate_value uses for the alternate (llama.cpp#503).
Transposed/partial views are still refused; the dense helper's walk is untouched.

Control (add-on build, fork's own -DGGML_HRX=ON tests; these rows schedule and execute no kernels)

before, decode_routed_moe.q6_k.alias_gate_input: exit 134, plan has loom_libs:ggml_rmsnorm_binary_f32 (no q8 publish)
before, routed_moe_decode.q6_k.true            : exit 134 (gate_up_routed requirement)
after : both exit 0
after : GGML_HRX_LOG_DISPATCH=1 -> qwen.decode_rmsnorm_f32_quantize_q8_1_x4 (fused),
        llm.moe_router.projection_top8_fused_decode (fused), llm.routed_ffn.decode_gate_up_swiglu_q4k_q8 (fused)
after : --hrx-test-filter '^decode_routed_moe\.q6_k(\.alias_gate_input)?$'  -> 2 passed, 0 failed, 0 known-fail
        --hrx-ops-test-test-filter '^routed_moe_decode\.q6_k(\.true)?$'    -> 2 passed, 0 failed, 0 known-fail
check_stale_expectations.py --check: 490 expectation literal(s), every one selectable; --self-test ok

The two known_fail annotations are removed in the same fork commit, so no row becomes an unexpected pass.

Host-side (this branch)

  • cmake --build build --target onebit: clean.
  • ctest -R 'pin|registry|template': 23/23 passed.
  • scripts/pre-pr-checks.sh --tree-only --base origin/main: green; skips are hip_f16_audit and kernel_id_selftest
    (no gpu-kernels tree here -- their own environment reason).

hw_gate label added; the hw_gate/hrx_build runners are still offline (same state #3424/#3407/#3462/#3475 merged
under), and the changed code is covered by the fork's own GGML_HRX=ON build and the scheduling control above.

Not measured here: the alias graph's decode tok/s win on gfx1151, which is engine#3384's own gate and stays open on
the issue.

Closes #3384.

…uted consumer through a reshape alias (llama.cpp#504; engine#3384)

has_qualified_q8_consumer() walked only DIRECT consumers, so a routed gate/up reading the rmsnorm-mul output
through a ggml_reshape_2d was invisible: qwen3_moe_rmsnorm_f32_quantize_q8_1_x4 declined and the plan fell back
to ggml_rmsnorm_binary_f32 + f32 gate/up (engine#3384).

llama.cpp#504 visits every consumer of the value and of each layout alias over it, handing the consumer the value
it actually reads, and accepts an alias only when it is a contiguous full ordered value range -- the same rule
find_alternate_value uses for the alternate. Transposed/partial views are still refused; the dense helper's walk is
untouched.

Control (add-on build, fork's own -DGGML_HRX=ON tests; the rows schedule and execute no kernels):
  before: decode_routed_moe.q6_k.alias_gate_input exit 134 (f32 rmsnorm in the plan)
          routed_moe_decode.q6_k.true            exit 134 (gate_up_routed requirement)
  after : both exit 0; the alias row's plan chooses qwen.decode_rmsnorm_f32_quantize_q8_1_x4 (fused) and
          llm.routed_ffn.decode_gate_up_swiglu_q4k_q8 (fused); 2 passed / 0 failed on each filtered pair.
check_stale_expectations.py --check: 490 expectation literal(s), every one selectable. The two known-fail
annotations are removed in the same commit, so no row becomes an unexpected pass.

Not measured here: the alias graph's decode tok/s win on gfx1151 (engine#3384's own gate). This pin carries the
scheduling fix; the measurement stays open on the issue.

registry/architectures.json is regenerated by scripts/registry-regen.sh (llama.cpp source sha).
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

3384 - Fully compliant

Compliant requirements:

  • Fix the issue where the decode q8 publish declines when the routed gate/up reads its input through a reshape alias
  • Ensure that the qwen3_moe_rmsnorm_f32_quantize_q8_1_x4 kernel is scheduled instead of ggml_rmsnorm_binary_f32 + f32 gate/up
  • Update llama.cpp to version e0e7c8d3 to include the fix for has_qualified_q8_consumer()
  • Regenerate registry/architectures.json to reflect the new llama.cpp commit
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect Consumer Detection

The change in llama.cpp updates the has_qualified_q8_consumer() function to walk through all consumers of a value and its layout aliases, instead of only direct consumers. This is necessary to correctly detect when a routed gate/up reads through a reshape alias, which was previously invisible to the function. This change ensures that the q8 publish is not declined incorrectly.

Subproject commit e0e7c8d365ec5d5bf90329dcabfb3fbe6428dd06

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

Labels

hw-gate Run the HRX hardware gate on Strix Halo (docs/hw-gate.md) Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hrx: the decode q8 publish (qwen3_moe_rmsnorm_f32_quantize_q8_1_x4) declines when the routed gate/up reads its input through a reshape alias

1 participant