code wiki / (root) / nx_f32_llm_live_load_test.nx

nx_f32_llm_live_load_test.nx

buildroot/runtime/nx_f32_llm_live_load_test.nx

5545 B145 linesdepth 13pulls 54 transitivereach 0 importersview sourcekind gate/prooftopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_llm_live_load_test.nx -- LIVE-FIRE structural proof. Loads the FULL real Qwen2.5-0.5B-Instruct Q4_K_M GGUF + runs ONE forward pass with a 2-token prompt + verifies the resulting logits are finite (not NaN, not inf) and non-degenerate. Verifies that EVERY layer of the bits-up substrate works on real production data: sys_read_file -> 491 MB read nx_gguf_parse -> 291 tensors + 26 metadata entries nx_f32_llm_read_dims_from_gguf -> all 7 dims match Qwen2.5-0.5B spec nx_f32_llm_load_weights_v4_from_gguf -> 24 layers bound (with lazy Q4_K + eager Q5_0/Q6_K/Q8_0/F32 dispatch) nx_f32_kv_cache_alloc -> cache for real dims nx_f32_llm_forward_v4 -> ONE prefill pass through 24 transformer blocks (each with RMSNorm + attn + cache + FFN-SwiGLU) logits sanity check Skips the full autoregressive loop (which would take ~50 min in qemu due to 151936-column LM head matmul × 32 decode steps). This is the "loads + runs forward" structural proof, NOT a production tokens/sec bench.

dependencies 15 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_f32.nx nx_f32_kv_cache.nx nx_f32_lazy_weight.nx nx_f32_llama_block.nx nx_f32_llama_block_v4.nx nx_f32_llm_live_load_test.nx

diagram shows first 10 each side; +5 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_f32.nxnx_f32_kv_cache.nxnx_f32_lazy_weight.nxnx_f32_llama_block.nxnx_f32_llama_block_v4.nxnx_f32_llama_stack_v4.nxnx_f32_llama_layer_lazy_load.nxnx_f32_llm.nxnx_f32_llm_v4.nxnx_f32_llm_read_dims.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 sys_read_file sys_openat_rd sys_lseek 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_f32_llama_model_alloc sys_mmap ↻ nx_f32_llm_read_dims_from_ sys_mmap ↻ nx_gguf_meta_find nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gmeta_bytes_equal nx_gguf_skip_value _gguf_skip_value ↻ nx_gguf_meta_read_string_l nx_le_read_u64 ↻ nx_gguf_meta_read_string_p _fld_read_arch_u32 sys_mmap ↻ _fld_concat_key nx_gguf_meta_find ↻ nx_gguf_meta_read_u32 nx_le_read_u32 ↻ _fld_read_vocab_size_from_ sys_mmap ↻ nx_gguf_find_tensor nx_gguf_tensor_at

structs

none

consts

none

functions

40func main() -> i64