code wiki / (root) / nx_f32_llama_v4p.nx

nx_f32_llama_v4p.nx

buildroot/runtime/nx_f32_llama_v4p.nx

13678 B348 linesdepth 13pulls 54 transitivereach 9 importersview sourcekind librarytopic f32
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_f32.nx nx_f32_rmsnorm.nx nx_f32_matmul.nx nx_f32_activations.nx nx_f32_rope.nx nx_f32_attn_multi.nx nx_f32_lazy_weight.nx nx_thread_pool.nx nx_f32_llama_v4p.nx nx_batched_gate.nx nx_batched_tput.nx nx_f32_llama_v4b.nx nx_llm_batch_serve.nx nx_llm_sched.nx nx_llm_sched_gate.nx nx_paged_fwd_gate.nx nx_reason_paged_probe.nx nx_reasoning_paged.nx

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

45func nx_f32_llama_block_forward_v4p(
209func nx_f32_llama_stack_forward_v4p(
285func nx_f32_llm_forward_v4p(