fix(gemma4): enable lowered 26B-A4B generation with row-safe HFQ4-G128 and rollover-safe bounded Q8 KV - #667
fix(gemma4): enable lowered 26B-A4B generation with row-safe HFQ4-G128 and rollover-safe bounded Q8 KV#667HUSRCF wants to merge 10 commits into
Conversation
|
We've noticed a serious issue introduced by b482d95, which lead to:
A third commit would be added to solved this issue! |
|
The issue had been resolved |
Kaden-Schutt
left a comment
There was a problem hiding this comment.
The source/host-side blockers are fixed and final-head CI is green at ff368ab63, but this cannot merge without final-head GPU proof. The review fixes changed the HFQ4-G128 row-tail producer, Gemma scratch sizing, and the hd512 slot-descriptor kernel ABI; the PR body's earlier run predates those changes.
Please rerun on gemma-4-26b-a4b-it.hfq4g128-tailfix.hf4 (SHA-256 45da... fixture from the PR):
scripts/redline_daemon_harness.pyfor the kernel/dispatch path, preserving the JSON report and HIP/PM4 parity.scripts/serve_harness.py batteryon the same artifact/settings, with decoded text inspected.- Include the full artifact digest, final commit, GPU/ROCm identity, and reports in the PR.
I checked the available hipx and hiptrx model stores; that fixture is not present, so I cannot honestly produce this proof from the maintainer hardware pool.
|
Got it, PR would reopen once full GPU test done! : ) |
Only hold AwaitingThought while the decoded prefix can still become the canonical thought header. Otherwise route the stream as answer content and strip only an orphan channel control token, preserving its payload. Also narrow marker-prefix detection so marker-plus-content is never discarded as a unit, and add chunk-boundary and EOS regression coverage. Fixes warpfront#678
Keep conservative dependency acquires on gfx12 and use a system-scoped PM4-IB vendor packet boundary so retained VMEM producers are visible to their consumers. Extend the Gemma4 shadow oracle across logits, sliding/full KV, recurrent state, scratch, and captured blobs, and retain the indexed HFQ4-G128 MoE down path used by the validated lowered graph.
Let the Gemma-specific evaluation harness request thinking_enabled=false so the model template emits its native empty thought channel. Keep --closed-think as a compatibility alias and record any unexpected reasoning event as a no-think violation.
fff3466 to
17abd04
Compare
|
Thank you for the precise validation checklist. I rebased the follow-up work onto current The additional fix is correctness-critical for retained replay. On gfx1201, the first PM4 divergence occurred at the reverse Validation fixture:
Final-head build identity:
Final-head no-GPU checks completed on the rebased tree:
Final-head retained-replay validation on the exact binary and artifact above:
Final-head user-facing validation used
User-facing long-context coverage on the same artifact:
The complete JSON and logs are preserved locally under This closes the requested final-head GPU rerun. The manual shadow timings remain labelled diagnostic evidence rather than a complete product timed-arm route-proof claim. |
|
Small final-head correction: CI's dispatch-bypass ratchet identified two newly introduced direct HFQ4/HFQ6 indexed MoE gate/up calls in the Gemma4 architecture crate. I moved those calls through the existing The relevant gates now pass locally with I rebuilt release artifacts at
Thus the preserved two-GPU reports are final-binary evidence for the current PR head as well: the source-level routing cleanup did not change either executable. |
|
Final-head update (supersedes the binary-identity note immediately above): the release binaries embed commit identity, so the crate-map-only commit changed their digests. I therefore rebuilt and reran both requested GPU routes on the actual final executable rather than relying on the earlier reports. Current PR head: Final artifacts:
The final small source correction teaches the shared uniform-MoE dispatcher that native Final-head results:
Structural checks at this head pass locally: full crate-map check (42/42), dispatch-bypass ratchet ( Durable report filenames are |
|
Thanks for pushing this through. We're promoting
Crate maps ( Once rebased, the GPU proof needs re-running on the rebased tip (your current evidence is against |
|
Got it, all conflicts should be resolved in a day. And the Gemma Model information should also be added! |
|
@Kaden-Schutt, while completing the requested final-head dual-architecture E2E and retained-replay validation for this PR, we found a shared-kernel correctness prerequisite that might be important to land before or together with #667: #734. The indexed HFQ4-G256 MoE gate/up kernel retained an A3B-specific A direct runtime-tail fix restored the math but introduced 16 bytes of compiler-generated private scratch on both gfx1100 and gfx1201, which retained PM4 correctly rejected. #734 instead adds uniquely named, compile-time K2816 variants, preserves the gfx1100 GLC/SLC/DLC policy selection, keeps the A3B K2048 route unchanged, and registers the new symbols with replay metadata. The pinned Gemma4-26B-A4B artifact ( Would you be open to merging #734 first, or cherry-picking it into whichever integration branch is used for #667? Since #667 enables the lowered Gemma4 path that reaches this shared kernel, merging only this PR without the tail fix might expose a severe correctness failure. No model artifact re-upload is needed. |
Summary
This enables the lowered Gemma4-26B-A4B generation path with the mixed expert formats produced by the current quantizer, while fixing two correctness boundaries required by that model:
K=704expert down-projection rows do not share a partial quantization group;The rollover fix is correctness-critical. Before it, the lowered opcode path selected
AttnFlashQ8_0atpos=1927for a cache withphysical_cap=1024, so the ordinary Q8 writer used the absolute position and raised HIP illegal-memory-access. The fixed path remainsAttnFlashQ8_0Windowedand completed a 29,788-token prompt.Artifact provenance
The validation artifact was generated from
google/gemma-4-26B-A4B-it, downloaded from ModelScope on DiamondHill, then quantized with Hipfire's current quantizer after the HFQ4-G128 row-tail correction. It is a locally produced validation artifact, not yet an official Hipfire model-repository artifact.gemma-4-26b-a4b-it.hfq4g128-tailfix.hf415,632,064,572bytes45da530b43e0e8ea2cffd77fe17c69bfb8dce3ec4dde2a26a9b68ad428d01f1cIf this route is accepted, the corresponding converted artifact may need to be published in the Hipfire model repository before the model can be pulled through the normal registry flow.
Validation
Local GPU: W7900 gfx1100, GPU0, HIP 7.14. Tests used the artifact above.
cargo test -p hipfire-quantize --bin hipfire-quantize hfq4g128_row_tests: 2 passedcargo test -p hipfire-dispatch kv_tier: 42 passedcargo build --release --workspace --features deltanet: passedtarget/release/examples/test_kernels: 16 passed, 0 failed, 0 skipped51156095f76ddd012929d547eb3ea912Binary hashes for the final validation build:
97a5742796368c8a3b33a06adac42d24d8b7429ed46444b6a282d8f24b25bb2edeccac587ed4d3cbffc43cbd1ceace486f26a267498f68dabc56a8daae34cc70Known gate noise / incomplete routes
scripts/no-gpu-ci.shpassed Rust and 836/841 Python tests. The five failures are all in the unchangedtests/test_mq4c_repack.py; currentorigin/mastertests requireHfqmError,main, andparse_hfqm_index, while the current upstream tool does not expose those APIs.The selected speed gate compares against a stale gfx1100 decode floor: this branch measured 141.2 tok/s, while a clean
origin/master@61633693worktree measured 141.1 tok/s with the same model and GPU. This is no branch regression (+0.07% relative), although both are below the checked-in 178 tok/s floor.The change gate's generated Qwen serve command was rejected in preflight because it combined
thinking=med(2,048-token thinking cap) withmax_tokens=180. The valid thinking-off battery described above was run separately.The full 30-row LongBench and complete long-decode matrices will continue after PR creation; this initial PR evidence intentionally includes one long-decode case and one full-length rollover case first.