code wiki / (root) / nx_nofloat_autograd_ddp_gate.nx

nx_nofloat_autograd_ddp_gate.nx

buildroot/runtime/nx_nofloat_autograd_ddp_gate.nx

7944 B170 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic nofloat
docsdependenciesstructsconstsfunctions

about

nx_nofloat_autograd_ddp_gate.nx -- DEEPER R4->LLM: bit-reproducible data-parallel training driven by the REAL no-float autograd tape (vs the linear/SGD stand-in in nx_nofloat_ddp_train_gate). (knowledge/research/2026-06-23-fabric-applies-to-room-and-elsewhere.md ยง4.) Each of D workers builds the SAME SSE loss graph on its OWN sample shard via the general Q16 autograd (nfa_leaf/nfa_matvec/nfa_mse/nfa_vadd -> one nfa_backward reverse sweep -> nfa_grad), extracts its W gradient, then R4's `ring_allreduce` sums the per-worker gradients and `nfa_sgd` applies the update. THE EXCEED: the updated weights are BYTE-IDENTICAL across D in {1,2,4,8} AND equal to a single-process full-batch step -- because the autograd is exact integer (associative) AND the all-reduce is order- independent. Real trainer components, not a stand-in. Float DDP/NCCL cannot guarantee this. Composes the verified nx_nofloat_autograd (gate B/C pattern) + nx_fabric_collective.ring_allreduce. HONEST SCOPE: a linear W[1x8] model trained by the GENERAL tape (same engine the Q16 transformer uses); N logical workers in one box. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_nofloat_autograd.nx nx_fabric_collective.nx nx_nofloat_autograd_ddp_gate.n

imports: nx_nofloat_autograd.nxnx_fabric_collective.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ap dda_step dda_build nfa_leaf nfa_new nfa_matvec nfa_new ↻ nfa_mse nfa_new ↻ nfa_vadd nfa_new ↻ nfa_backward nfa_qmul nfa_silud nfa_sigmoid nfa_fxexp nfa_qmul ↻ nfa_isqrt nfa_fxexp ↻ nfa_cosf nfa_reduce2pi nfa_cosq nfa_qmul ↻ nfa_sinf nfa_reduce2pi ↻ nfa_sinq nfa_qmul ↻ nfa_grad ring_allreduce sys_mmap col_mod nfa_sgd dda_single dda_build ↻ nfa_backward ↻ nfa_grad ↻ nfa_sgd ↻ an aeq

structs

none

consts

none

functions

20func dda_build(tape: *i64, vals: *i64, st: *i64, Wp: *i64, X: *i64, Y: *i64, s0: i64, s1: i64, V: i64, outW: *i64) -> i64
38func dda_step(D: i64, S: i64, V: i64, Wp: *i64, X: *i64, Y: *i64, tape: *i64, vals: *i64, grads: *i64, st: *i64, lr: i64, outWp: *i64) -> i64
61func dda_single(S: i64, V: i64, Wp: *i64, X: *i64, Y: *i64, tape: *i64, vals: *i64, grads: *i64, st: *i64, lr: i64, outWp: *i64) -> i64
74func ap(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: achkmain
75func an(v: i64) -> i64
called by 1: main
85func achk(name: *u8, ok: i64) -> i64
called by 1: main calls 1: ap
89func aeq(a: *i64, b: *i64, V: i64) -> i64 { var i: i64 = 0; while i < V { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
91func main() -> i64