You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(models): dense Qwen3.5 hybrid architecture (GDN + attention, no MoE) for Bonsai-27B #157
Depends on #151 (PQ2_0 quant type, merging via PR #153). PrismML's Bonsai-27B (general.architecture = qwen35, dense — no MoE experts) currently fails to load: GgufModelConfigExtractor.ParseArchitecture only recognizes "qwen35moe", and the existing Qwen3MoeHybrid architecture is MoE-hardcoded (required MoeLayerWeights field, unconditional expert-tensor lookups) with no dense fallback.
Confirmed via real GGUF metadata + existing code: Bonsai's GDN config (state_size=128, conv_kernel=4, group_count=16, inner_size=6144, time_step_rank=48, full_attention_interval=4) maps exactly onto the existing GatedDeltaNetConfig/TryExtractGdnConfig extraction already used by Qwen3MoeHybrid — the token-mixing recurrence is identical, only the FFN body (dense SwiGLU vs MoE routing) differs.
Scope (this issue)
CPU: config extraction (Architecture.Qwen3HybridDense, ParseArchitecture arm for "qwen35"), new model class family (Qwen3HybridDenseTransformerModel/LayerWeights/ForwardState) adapted from Qwen3MoeHybridTransformerModel — GDN/attention/RoPE lift near-verbatim, MoE FFN body replaced with dense SwiGLU (gate/up/down), PQ2_0 dispatch arm added alongside I2_S.
CUDA: forward-pass implementation mirroring the CPU model, for real end-to-end benchmarking on the RTX 3060 (Bonsai's PQ2_0 weights are ~7.2GB, fits in 12GB VRAM).
Vulkan: explicitly out of scope for this issue — follow-up once CPU+CUDA are validated.
Acceptance criteria
Config-extraction unit tests: general.architecture=qwen35 routes to Architecture.Qwen3HybridDense, GDN config values match Bonsai's real metadata exactly.
CPU construction test: model loads from the real Ternary-Bonsai-27B-Q2_0.gguf without throwing (weights allocate, layer count/dims match).
CUDA real-weight forward-pass smoke test: short deterministic prompt, no NaN/Inf through all layers.
Baseline benchmark: tok/s (prefill + decode) on the RTX 3060, real Bonsai weights.
Verify pre-FFN norm tensor name (ffn_norm.weight vs post_attention_norm.weight) against the actual GGUF before assuming either convention.
Shipped end-to-end via PR #158 (merged to dev, merge commit a57dcac) — Architecture.Qwen3HybridDense (qwen35) runs CPU + CUDA against real PrismML Bonsai-27B weights. Follow-on decode-occupancy work continued as #159 (PR #160).
Activity
perf(cuda): apply the same warp-cooperative fix to I2_S prefill dequant
perf(cuda): fuse GDN decay+sigmoid decode step (#157)
docs: consolidate decode-fusion follow-up in README News entry (#157)
perf(cuda): stage PQ2_0 GEMV output writes for block-coalesced stores (…
perf(cuda): PQ2_0 weight repack for unconditionally aligned GEMV/dequ…
perf(cuda): vectorize PQ2_0 GEMV activation staging to cut prologue l…
perf(cuda): document PQ2_0 GEMV scale-read broadcast finding, no func…
perf(cuda): small-K PQ2_0 GEMV kernel variant to raise occupancy ceil…
Merge pull request #158 from jamesburton/issue/157-qwen35-dense-hybrid
jamesburton commentedon Jul 22, 2026
Shipped end-to-end via PR #158 (merged to
dev, merge commita57dcac) — Architecture.Qwen3HybridDense (qwen35) runs CPU + CUDA against real PrismML Bonsai-27B weights. Follow-on decode-occupancy work continued as #159 (PR #160).cuda(infra): address review — portable MSVC discovery, SM floor gate (#…