code wiki / (root) / nx_q5k_dot_row_col.nx

nx_q5k_dot_row_col.nx

buildroot/runtime/nx_q5k_dot_row_col.nx

6701 B149 linesdepth 7pulls 16 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_q5k_dot_row_col.nx -- fused dequant + integer dot for Q5_K (the integer speed path for Q5_K weights). sd-server -> Nishi migration (task#21). Analogue of nx_q4k_dot_row_col for Q5_K, so attn_v/attn_output/ ffn_down (Q5_K in the real Q4_K_M model) can use the fast integer path too. Fuses the ggml-correct Q5_K dequant (Q24 super-scales via _gguf_f16_to_q24, 4-group layout, qh 5th bit; value = d*sc*q5 - dmin*m in Q24) with the dot against a Q10 activation, accumulating in Q34. Verified vs nx_q5_k_to_f32 + the ggml golden dot on the real blk.0.attn_v block. license_tier: ORIGINAL

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_strconv.nx nx_gguf.nx nx_gguf_load.nx nx_q5_k_to_f32.nx nx_f32.nx nx_f32_cvt.nx nx_f32_div.nx nx_q5k_dot_row_col.nx

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_strconv.nxnx_gguf.nxnx_gguf_load.nxnx_q5_k_to_f32.nxnx_f32.nxnx_f32_cvt.nxnx_f32_div.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap kd_hexval nx_q5k_dot_row_col _gguf_f16_to_q24 nx_le_read_u16 nx_le_read_u8 nx_q10_to_f32 nx_i32_to_f32 nx_q5_k_to_f32 nx_q5k_block_to_f32 nx_le_read_u16 ↻ nx_f16_to_f32 nx_le_read_u8 ↻ nx_i32_to_f32 ↻ nx_f32_add nx_f32_classify nx_f32_exp_field nx_f32_mant_field nx_f32_sign nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_f32_mul nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_i32_to_f32 ↻ sys_openat_wr nx_strconv_format_i64 sys_write sys_close nx_f32_div nx_f32_classify ↻ nx_f32_sign ↻ nx_f32_mant_field ↻ nx_f32_exp_field ↻ nx_f32_sub nx_f32_add ↻ nx_f32_neg

structs

none

consts

none

functions

21func nx_q5k_dot_row_col(buf: *u8, base_off: i64, n_blocks: i64, col_q10: *i64) -> i64
84func kd_hexval(c: i64) -> i64
called by 1: main
90func main() -> i64