code wiki / (root) / nx_fabric_collective.nx

nx_fabric_collective.nx

buildroot/runtime/nx_fabric_collective.nx

7699 B183 linesdepth 2pulls 2 transitivereach 5 importersview sourcekind tooltopic fabric
docsdependenciesstructsconstsfunctions

about

nx_fabric_collective.nx -- R4 of the SkyHammer fabric exceed ladder: COLLECTIVE COMMUNICATION (the actual AI-training workload the fabric exists to accelerate). Ladder R4, the last MISSING axis F. SkyHammer is "AI-native ... for GPU-era COLLECTIVE workloads" (fab_collective.raw: All-Reduce/All-Gather/ Broadcast). All-reduce = element-wise sum of N processes' vectors, delivered to ALL. The naive way routes everything through a root -> the root moves O(N)*data = a bottleneck that grows with N. RING all-reduce (NCCL's bandwidth-optimal algorithm) moves a CONSTANT ~2*data per process regardless of N: a reduce-scatter phase (N-1 steps) then an all-gather phase (N-1 steps), each process touching only data/N per step. This rung performs the REAL reduction (integer, no-float) on N in-memory process vectors and PROVES the result is byte-exact the true sum on every process, while measuring the per-process communication (the bottleneck) -- the honest software expression of "collective acceleration at scale". No external organ to compose (pure algorithm). expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 5 importers

nx_syscalls.nx nx_fabric_collective.nx nx_blockfloat_ddp_gate.nx nx_distributed_train_gate.nx nx_exceed_scoreboard_gate.nx nx_fabric_collective_gate.nx nx_nofloat_autograd_ddp_gate.nx

imports: nx_syscalls.nx

imported by: nx_blockfloat_ddp_gate.nxnx_distributed_train_gate.nxnx_exceed_scoreboard_gate.nxnx_fabric_collective_gate.nxnx_nofloat_autograd_ddp_gate.nx

structs

20struct ColMetrics

consts

16const COL_RING: i64 = 0 // bandwidth-optimal ring all-reduce
17const COL_NAIVE: i64 = 1 // root-gather + broadcast (O(N) at the root)
18const COL_RING_NOSUM: i64 = 2 // NC1: ring DATA MOVEMENT but the reduction (add) disabled -> wrong result

functions

26func col_mod(a: i64, n: i64) -> i64 { var r: i64 = a % n; if r < 0 { r = r + n } return r }
30func col_run(algo: i64, N: i64, V: i64, mo: *ColMetrics, out: *i64) -> i64
called by 1: main calls 2: sys_mmapcol_mod
144func ring_allreduce(src: *i64, N: i64, V: i64, out: *i64) -> i64
183func main() -> i64 { return 0 }