code wiki / (root) / nx_zimage_real_proj.nx

nx_zimage_real_proj.nx

buildroot/runtime/nx_zimage_real_proj.nx

4508 B105 linesdepth 8pulls 18 transitivereach 0 importersview sourcekind tooltopic zimage
docsdependenciesstructsconstsfunctions

about

nx_zimage_real_proj.nx -- a REAL Qwen transformer projection on REAL weights, sovereignly. sd-server -> Nishi migration: the first genuine transformer-forward computation on the actual model. Dequantizes token-0's real embedding (token_embd row, 2560 Q6_K) AND the first 4 output-neuron rows of blk.0.attn_q.weight (the real Q-projection matrix, in=2560->out=4096, Q6_K, at file offset ~335MB), then computes the attention Q projection Q[o] = sum_i embed[i] * Wq[o][i] with our own f32 mul/add. Real Qwen weights -> our sovereign matmul -> real Q values. This is the same Qwen that Z-Image uses to encode image prompts AND (in the elder fork) to chat -> the shared-LLM reuse, now flowing through OUR code. Read is a bounded 384MB prefix (covers metadata + token_embd + the start of blk.0); we only dequant the slices we need (embed row + 4 Wq rows), not the full multi-GB tensors. 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_proj.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)

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

main sys_openat_rd sys_mmap sys_read sys_close nx_gguf_parse nx_le_read_u32 nx_le_read_u64 nx_le_read_u32 ↻ _gguf_skip_value nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gguf_skip_value ↻ sys_mmap ↻ nx_gguf_find_tensor nx_gguf_tensor_at nx_gguf_name_equals nx_gguf_tensor_at ↻ nx_q6_k_to_f32 _nx_q6_k_block_to_f32 nx_le_read_u16 nx_f16_to_f32 nx_le_read_u8 _q6k_emit 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 ↻ sys_openat_wr rp_emit sys_mmap ↻ nx_strconv_format_i64

structs

none

consts

none

functions

27func rp_emit(fd: i64, key: *u8, key_len: i64, value: i64) -> i64
41func main() -> i64