nx_f32_llama_layer_load.nx
buildroot/runtime/nx_f32_llama_layer_load.nx
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
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
| 29 | const NX_FLL_OK: nx_int = 0 |
| 30 | const NX_FLL_ERR_BAD_LAYER: nx_int = 1 |
| 31 | const NX_FLL_ERR_NOT_FOUND: nx_int = 2 |
| 32 | const NX_FLL_ERR_NULL: nx_int = 3 |
| 33 | const NX_FLL_N_VERDICTS: nx_int = 4 |
functions
| 35 | func nx_fll_verdict_is_valid(v: nx_int) -> nx_int called by 1: main |
| 44 | func _fll_fmt_name(layer_idx: nx_int, suffix: *u8, suffix_len: nx_int, |
| 63 | func _fll_load_one(buf: *u8, hdr: *NxGgufHeader, called by 1: nx_f32_llama_layer_load_from_gguf calls 3: sys_mmap_fll_fmt_namenx_gguf_load_tensor_to_f32 |
| 82 | func nx_f32_llama_layer_load_from_gguf(buf: *u8, hdr: *NxGgufHeader, |