nx_qwen_hybrid_ffn.nx
buildroot/runtime/nx_qwen_hybrid_ffn.nx
about
nx_qwen_hybrid_ffn.nx -- the hybrid FFN (SwiGLU) sub-layer on real Qwen weights, gated vs the f32 path.
sd-server -> Nishi migration (task#19, FFN half). Mirrors the verified attention sub-layer:
x -> RMSNorm(ffn_norm F32) -> [gate,up integer Q4_K via nx_q4k_linear] -> SwiGLU (SiLU(gate)*up, f32)
-> down (ffn_down Q5_K f32) -> residual.
Gate: hybrid (integer gate/up) vs pure-f32 ref (f32 gate/up), 2 tokens, first 256 down outputs -> agree
within 2%. Weights dequantized on-the-fly (12288-wide) to bound memory. Real blk.0, ggml-correct dequant.
license_tier: ORIGINAL
dependencies 20 imports · 0 importers
diagram shows first 10 each side; +10 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_strconv.nxnx_tensor.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_placement.nxnx_gguf_load_lazy.nxnx_q4k_matmul.nxnx_dequant_iter.nxnx_q4k_linear.nxnx_q4k_to_f32.nxnx_q5_k_to_f32.nxnx_f32.nxnx_f32_cvt.nxnx_f32_div.nxnx_f32_rmsnorm.nxnx_f32_activations.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 31 | func fn_q4kf32(buf: *u8, w_off: i64, od: i64, id: i64, act: *i64, nt: i64, out: *i64, rowbuf: *i64) -> i64 |
| 49 | func fn_emit(fd: i64, key: *u8, kl: i64, v: i64) -> i64 |
| 63 | func main() -> i64 |