nx_f32_llama_v4p.nx
buildroot/runtime/nx_f32_llama_v4p.nx
about
nx_f32_llama_v4p.nx -- PAGED-KV twins of the v4 forward chain: block /
stack / model-forward over *NxPagedSeq instead of the contiguous
*NxF32KVCache. FAITHFUL copies of nx_f32_llama_block_v4 /
nx_f32_llama_stack_v4 / nx_f32_llm_forward_v4 with EXACTLY these
substitutions (the codebase twin convention -- v2/v3/v4 precedent):
block: cache -> pseq; RoPE cache_before = pseq.seq_len;
nx_f32_attn_with_cache -> nx_f32_attn_with_paged
stack: nx_pkv_ensure_append ONCE before the layer loop (blocks +
copy-on-append privatization must precede ALL layers'
appends); nx_f32_kv_cache_advance -> nx_pkv_advance
forward: cache -> pseq; stack_v4 -> stack_v4p (embed/rmsnorm/lm_head
identical)
Debug dumps (blk4_dump8/ffnmax "log2mag" stdout spam) omitted --
numerically irrelevant. bp_* phase profiling kept (parity with the
contiguous profiler). Bit-exactness vs the contiguous chain is gated
end-to-end by nx_paged_fwd_gate on the REAL model.
This is what makes the paged pool PAY: prefill a prompt ONCE, fork N
sequences (refcounted, copy-on-append) -- the prefix-shared
self-consistency / best-of-N serving pattern.
genealogy_id: kwon_2023_pagedattention + standard_transformer_stack
lineage_id: substrate_f32_llama_v4p_v1
dependencies 17 imports · 9 importers
diagram shows first 10 each side; +7 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_tier.nxnx_f32.nxnx_f32_rmsnorm.nxnx_f32_matmul.nxnx_f32_activations.nxnx_f32_rope.nxnx_f32_attn_multi.nxnx_f32_lazy_weight.nxnx_thread_pool.nxnx_f32_llama_block.nxnx_f32_llama_block_v4.nxnx_f32_llama_stack_v4.nxnx_f32_llm.nxnx_f32_llm_v4.nxnx_kvcache.nxnx_f32_attn_paged.nx
imported by: nx_batched_gate.nxnx_batched_tput.nxnx_f32_llama_v4b.nxnx_llm_batch_serve.nxnx_llm_sched.nxnx_llm_sched_gate.nxnx_paged_fwd_gate.nxnx_reason_paged_probe.nxnx_reasoning_paged.nx
structs
| none |
consts
| none |
functions
| 45 | func nx_f32_llama_block_forward_v4p( called by 1: nx_f32_llama_stack_forward_v4p calls 11: bp_tsys_mmapbp_addnx_f32_rmsnormnx_f32_lazy_matmulnx_f32_add+5 |
| 209 | func nx_f32_llama_stack_forward_v4p( |
| 285 | func nx_f32_llm_forward_v4p( |