code wiki / (root) / nx_zimage_real_qkv.nx

nx_zimage_real_qkv.nx

buildroot/runtime/nx_zimage_real_qkv.nx

4612 B114 linesdepth 8pulls 18 transitivereach 0 importersview sourcekind orphan librarytopic zimage
docsdependenciesstructsconstsfunctions

about

nx_zimage_real_qkv.nx -- REAL Qwen layer-0 Q/K/V projections on REAL weights, sovereignly. sd-server -> Nishi migration: extends the real forward from Q to the FULL attention input -- computes Q, K and V projections of token-0's real embedding against blk.0.attn_{q,k,v}.weight (all Q6_K, ~335MB into the file) with our own f32 matmul, and records the out-dims (confirming GQA: q_out=4096 > kv_out). Real Qwen weights -> our sovereign matmuls -> the real attention inputs. Bounded 384MB prefix; only the slices we need are dequantized. license_tier: ORIGINAL

dependencies 13 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_strconv.nx nx_tensor.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_placement.nx nx_gguf_load_lazy.nx nx_zimage_real_qkv.nx

diagram shows first 10 each side; +3 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_q6_k_to_f32.nxnx_f32.nxnx_f32_cvt.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

23func qkv_emit(fd: i64, key: *u8, key_len: i64, value: i64) -> i64
39func qkv_proj4(buf: *u8, w_off: i64, HID: i64, embed: *i64, out: *i64) -> i64
54func main() -> i64