nx_qwen_hybrid_attn.nx
buildroot/runtime/nx_qwen_hybrid_attn.nx
about
nx_qwen_hybrid_attn.nx -- the hybrid attention SUB-LAYER on real Qwen weights, gated vs the f32 path.
sd-server -> Nishi migration (task#19). Wires the proven bricks into a real attention sub-layer:
x -> RMSNorm(attn_norm F32) -> [Q,K integer Q4_K via nx_q4k_linear ; V f32 Q5_K] -> GQA attention (f32)
-> O (attn_output Q5_K f32) -> residual.
Gate: the hybrid output (integer Q/K) vs a pure-f32 reference (f32 Q/K), 2 tokens so attention actually
mixes -> they must agree within 2% (the only difference is the Q/K quantization). Real blk.0, ggml-correct
dequant throughout. Confirms the ASSEMBLY (conversions + flow), the pieces being individually verified.
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_gqa_attention.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
| 32 | func ha_f32linear(w: *i64, od: i64, id: i64, act: *i64, nt: i64, out: *i64) -> i64 |
| 48 | func ha_emit(fd: i64, key: *u8, kl: i64, v: i64) -> i64 |
| 62 | func main() -> i64 |