Expand description
Qwen3-Next SSM (Gated Delta Net) layer implementing TransformerLayer.
Corrected pipeline matching the HuggingFace reference implementation:
- QKVZ projection (interleaved output)
- Deinterleave QKVZ → sequential [Q | K | V | Z]
- BA projection (interleaved output)
- Compute GDN gates: gate = exp(-A * softplus(alpha + dt_bias)), beta = sigmoid(b)
- Conv1d update on [Q | K | V] concatenated (d_inner=8192)
- Split conv output → Q’, K’, V’
- GDN decode (Q’, K’, V’, gate, beta) — kernel handles GQA internally
- Gated RMS norm (GDN output, Z gate)
- Output projection [value_dim → hidden_size]
- MoE FFN
Re-exports§
pub use gdn_flags::GdnFlags;pub use gdn_flags::MAX_F16_TWIN_DFLASH_GAMMA;pub use gdn_flags::MAX_F16_TWIN_K;pub use gdn_flags::default_dflash_gamma;pub use gdn_flags::gdn_fused_norm_enabled;pub use gdn_flags::ssm_batched_recurrent_enabled;pub use gdn_flags::ssm_h_dtype_bits;pub use gdn_flags::ssm_h_f16_pool_enabled;pub use gdn_flags::ssm_h_fp16_enabled;pub use gdn_flags::verify_exact_enabled;
Modules§
- gdn_
flags - GDN / SSM decode-path flags, resolved ONCE from the serve command line.
Structs§
- Qwen3
SsmLayer - Qwen3-Next SSM/GDN layer (36 of 48 layers).