code wiki / (root) / nx_f32_llama_layer_load.nx

nx_f32_llama_layer_load.nx

buildroot/runtime/nx_f32_llama_layer_load.nx

8085 B192 linesdepth 9pulls 30 transitivereach 6 importersview sourcekind librarytopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_llama_layer_load.nx -- bind one layer's 9 GGUF tensors into NxF32LlamaLayer. Composes nx_gguf_load_tensor_to_f32 nine times with the canonical Llama tensor names ("blk.{N}.attn_norm.weight" etc.) and stores the resulting f32 raw-bit pointers into the layer struct. Per ggml docs (Gerganov 2024) -- clean-room from public spec; no copied code. Tensor naming: blk.{N}.attn_norm.weight -> gamma_attn blk.{N}.attn_q.weight -> W_q blk.{N}.attn_k.weight -> W_k blk.{N}.attn_v.weight -> W_v blk.{N}.attn_output.weight -> W_o blk.{N}.ffn_norm.weight -> gamma_ffn blk.{N}.ffn_gate.weight -> W_gate blk.{N}.ffn_up.weight -> W_up blk.{N}.ffn_down.weight -> W_down genealogy_id: llama_gguf_naming_gerganov_2024 + standard_layer_binding lineage_id: substrate_f32_llama_layer_load_v1

dependencies 6 imports · 6 importers

nx_syscalls.nx nx_tier.nx nx_dec_emit.nx nx_gguf.nx nx_gguf_load_f32.nx nx_f32_llama_block.nx nx_f32_llama_layer_load.nx nx_f32_llama_layer_load_test.nx nx_f32_llm_e2e_test.nx nx_f32_llm_load.nx nx_f32_llm_load_test.nx nx_f32_llm_run_test.nx nx_f32_llm_run_v2_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_dec_emit.nxnx_gguf.nxnx_gguf_load_f32.nxnx_f32_llama_block.nx

imported by: nx_f32_llama_layer_load_test.nxnx_f32_llm_e2e_test.nxnx_f32_llm_load.nxnx_f32_llm_load_test.nxnx_f32_llm_run_test.nxnx_f32_llm_run_v2_test.nx

structs

none

consts

29const NX_FLL_OK: nx_int = 0
30const NX_FLL_ERR_BAD_LAYER: nx_int = 1
31const NX_FLL_ERR_NOT_FOUND: nx_int = 2
32const NX_FLL_ERR_NULL: nx_int = 3
33const NX_FLL_N_VERDICTS: nx_int = 4

functions

35func nx_fll_verdict_is_valid(v: nx_int) -> nx_int
called by 1: main
44func _fll_fmt_name(layer_idx: nx_int, suffix: *u8, suffix_len: nx_int,
called by 1: _fll_load_one calls 1: nx_dec_emit_u63
63func _fll_load_one(buf: *u8, hdr: *NxGgufHeader,
82func nx_f32_llama_layer_load_from_gguf(buf: *u8, hdr: *NxGgufHeader,