mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5517] [Engine] qwen3next family: geometry-derived trunk + GDN grouped-head support (Groot lane byte-identical) #5492
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5492
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5517
Author: @archadrian
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:qwen3-next-family📝 Commits (6)
b3494c0[Engine] qwen3next family: enum + geometry factory + read_geometry prefix + CPU kernel constants derived from kCompiledGeometry (one build, one shape via STRATA_GEOMETRY_QWEN3NEXT)1fbe27c[Engine] qwen3next: fused GDN projections in the layout table (ssm_in/ssm_ba, widths derived from geometry) + dense-kernel names; parity load-check 0 failures80254f2qwen3next: dense attention decode path (identity selection via qsa_dense_ids, indexer sites family-gated) + block-division guards across kv_plan/verify/prefill/snapshot; engine loads, session comes up on the 309000c5763qwen3next: Prefill/prompt path ported from qwen4exp literals to compiled-geometry-derived shapesc02b10dqwen3next: plain-residual trunk (residual_streams, gr_plain_read, verify-window + Prefill plain paths) + GDN family traits (SiLU output gate, grouped->tiled head gather via gdn_tile_heads, fused ssm_in/ssm_ba split in decode/verify/prefill); engine builds and serves, forward still wrong1f07e7dqwen3next: GDN v-head retile VPV divisor + grouped-column y for ssm_out on ALL paths (verify fused/split, prefill fused/split, session fused) — end-to-end 'The capital of France is -> Paris.' now correct; debug instruments STRATA_DEBUG_GDN/LOGITS/RESID in verify.cpp📊 Changes
56 files changed (+3733 additions, -383 deletions)
View changed files
➕
bench/results/.deferred-vii-leftover/README.md(+60 -0)➕
bench/results/.deferred-vii-leftover/results.json(+928 -0)➕
bench/results/2026-11-05-community-vii-qwen3-8-flash-next-iq3-s-vii/README.md(+60 -0)➕
bench/results/2026-11-05-community-vii-qwen3-8-flash-next-iq3-s-vii/results.json(+928 -0)➕
data/expert-profile-q3next.bin(+0 -0)📝
include/strata/artifact/gguf_reader.hpp(+9 -4)📝
include/strata/artifact/model_family.hpp(+9 -1)📝
include/strata/core/family_layout.hpp(+22 -9)📝
include/strata/core/geometry.hpp(+53 -1)📝
include/strata/core/layer.hpp(+6 -1)📝
include/strata/core/verify.hpp(+1 -0)📝
include/strata/kernels/cpu/expert.hpp(+3 -3)📝
include/strata/kernels/gr.hpp(+7 -0)📝
include/strata/kernels/qsa.hpp(+5 -0)📝
include/strata/platform/hip_compat/strata_hip.h(+2 -0)📝
include/strata/prefill/kernels.hpp(+11 -0)➕
serve-fn-gyro-abl.sh(+4 -0)➕
serve-gcoder-pair.sh(+9 -0)➕
serve-gcoder-single.sh(+6 -0)➕
serve-gcoder.sh(+14 -0)...and 36 more files
📄 Description
What this adds
Support for the qwen3next family (Qwen3-Next-80B-A3B: hybrid GDN linear-attention + full-attention MoE) in one build, one shape via
STRATA_GEOMETRY_QWEN3NEXT.kCompiledGeometry).residual_streams,gr_plain_read) gated onhas_hyper_connections()— HC families compile exactly as before.kGdnGroupedHeads(grouped→tiled head gather), SiLU output gate, fusedssm_in/ssm_basplit.qsa_dense_ids); indexer sites family-gated.The two families bracket each other: qwen4exp = maximal (HC + PLE + indexer), qwen3next = minimal (plain residual, dense attention, grouped GDN heads). Every future family lands between.
Safety: Groot lane byte-identical
Pre-PR binary (
main@146df3c4) vs this branch, same Groot run: 20/20--window-hasheslines match (per-window residual hashes + argmaxes). The profile files are indata/; we ran it with our TQ2_T Groot pack (same one the merged native-expert work uses — happy to share it; any Groot model that runs on main works for this comparison). Reproduce:Functional proof
Qwen3-Next-80B-A3B-GyroM (TQ2_T pack, same format as the merged native-expert work) runs end-to-end:
(build with
-DSTRATA_GEOMETRY_QWEN3NEXT; the pack is in the Files section below)Verified layer-by-layer against an fp8 HF oracle (residual / router-input / attn-out / moe-out / GDN-state dumps all match). Serve smoke: ~105 tok/s decode on one 3090.
These are bring-up checks, not a benchmark suite — proper evals and multi-hardware numbers follow once engine support lands.
The pack is private for now: https://huggingface.co/BoxyFit/Qwen3-Next-80B-A3B-GyroM — happy to invite you for access so you can run the smoke test directly.
The one non-obvious invariant
ssm_out.weightships with HF-grouped value-head columns while the recurrence runs tiled — so the GDN step writesy/y16in grouped order on every path (verify fused/split, prefill fused/split, session fused). Groot's GGUF is natively tiled and takes the untouched path; that is whatkGdnGroupedHeadsgates. Two bugs hid here for a while: a v-head retile divisor (VPVmust divide byHK, notqk_heads) and a missed split-path norm write in prefill. Debug instrumentsSTRATA_DEBUG_GDN/LOGITS/RESIDinverify.cppare included — env-gated, zero cost when unset — they made the bisection mechanical and may be useful for the next family port.Notes
main@146df3c4(2026-11-07): upstream's manifest notes, group scratch, HC sizing, fused rms+rope and two-pass selection are all kept, with the geometry generalization applied on top.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.