nx_reasoning_paged.nx
buildroot/runtime/nx_reasoning_paged.nx
about
nx_reasoning_paged.nx -- PREFIX-SHARED self-consistency: the paged-KV
promotion of nx_reason_selfconsist. Prefill the ChatML prompt ONCE on a
root sequence, then FORK per sample (refcounted page-table copy; the
fork's first append copy-on-writes at most one tail block). MEASURED
1.48x vs the reset-loop at N=3 (nx_paged_fwd_gate, real model, bytes
BIT-IDENTICAL per sample); the win grows with N since N-1 chunked
prefills are eliminated.
genealogy_id: wang_2023_self_consistency + kwon_2023_pagedattention
lineage_id: substrate_reasoning_paged_v1
dependencies 12 imports · 1 importers
diagram shows first 10 each side; +2 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_tier.nxnx_prng.nxnx_bpe.nxnx_f32_llm.nxnx_f32_llm_v4.nxnx_f32_sampler.nxnx_reasoning.nxnx_kvcache.nxnx_f32_attn_paged.nxnx_f32_llama_v4p.nxnx_f32_llama_v4b.nx
imported by: nx_reason_paged_probe.nx
structs
| none |
consts
| none |
functions
| 26 | func _nxrp_sample_loop(rc: *NxReasonCfg, seq: *NxPagedSeq, logits: *i64, |
| 60 | func nx_reason_selfconsist_paged(rc: *NxReasonCfg, pool: *NxPagedPool, |
| 114 | func nx_reason_selfconsist_batched(rc: *NxReasonCfg, pool: *NxPagedPool, called by 1: main calls 13: sys_mmapnx_reason_build_chat_toksnx_pkv_seq_newnx_f32_llm_forward_v4psys_munmapnx_pkv_seq_fork+7 |