code wiki / (root) / nx_gguf_load_f32.nx

nx_gguf_load_f32.nx

buildroot/runtime/nx_gguf_load_f32.nx

3645 B110 linesdepth 7pulls 15 transitivereach 55 importersview sourcekind librarytopic gguf
docsdependenciesstructsconstsfunctions

about

nx_gguf_load_f32.nx -- load a GGUF tensor and dequantize to f32 bits. Composes nx_gguf_find_tensor + nx_gguf_tensor_at + the source-type specific dequant primitives: F32 -> read 4 bytes per value, store as i64-extended raw bits F16 -> nx_f16_to_f32 per value (composes nx_f32_cvt) Q4_K -> nx_q4k_to_f32 (composes nx_q4k_to_f32 brick) Returns a freshly-allocated *i64 buffer holding n_values f32-raw-bit values (one per logical tensor element). Caller owns the buffer. This is the bridge between the L4.5 quant-aware GGUF loader and the L8 f32-only forward-pass substrate. The new NxF32LlamaModel consumes *i64 buffers of f32 raw bits; this function produces them. genealogy_id: standard_gguf_tensor_load_and_dequant lineage_id: substrate_gguf_load_f32_v1

dependencies 10 imports · 10 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_gguf.nx nx_gguf_load.nx nx_f32_cvt.nx nx_q4k_to_f32.nx nx_q5_0_to_f32.nx nx_q6_k_to_f32.nx nx_q8_0_to_f32.nx nx_gguf_load_f32.nx nx_f32_llama_layer_lazy_load.nx nx_f32_llama_layer_lazy_load_test. nx_f32_llama_layer_load.nx nx_f32_llama_layer_load_test.nx nx_f32_llm_load.nx nx_f32_llm_load_test.nx nx_f32_llm_v4.nx nx_f32_llm_v4_test.nx nx_gguf_load_f32_test.nx nx_lowrank_weight_spectrum.nx

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_gguf.nxnx_gguf_load.nxnx_f32_cvt.nxnx_q4k_to_f32.nxnx_q5_0_to_f32.nxnx_q6_k_to_f32.nxnx_q8_0_to_f32.nx

imported by: nx_f32_llama_layer_lazy_load.nxnx_f32_llama_layer_lazy_load_test.nxnx_f32_llama_layer_load.nxnx_f32_llama_layer_load_test.nxnx_f32_llm_load.nxnx_f32_llm_load_test.nxnx_f32_llm_v4.nxnx_f32_llm_v4_test.nxnx_gguf_load_f32_test.nxnx_lowrank_weight_spectrum.nx

structs

none

consts

30const NX_GLF_OK: nx_int = 0
31const NX_GLF_ERR_NOT_FOUND:nx_int = 1
32const NX_GLF_ERR_BAD_TYPE: nx_int = 2
33const NX_GLF_ERR_BAD_SHAPE:nx_int = 3
34const NX_GLF_ERR_OOM: nx_int = 4
35const NX_GLF_N_VERDICTS: nx_int = 5

functions

37func nx_glf_verdict_is_valid(v: nx_int) -> nx_int
called by 1: main
47func nx_gguf_load_tensor_to_f32(buf: *u8, hdr: *NxGgufHeader,