nx_fabric_collective.nx
buildroot/runtime/nx_fabric_collective.nx
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
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
| 20 | struct ColMetrics |
consts
| 16 | const COL_RING: i64 = 0 // bandwidth-optimal ring all-reduce |
| 17 | const COL_NAIVE: i64 = 1 // root-gather + broadcast (O(N) at the root) |
| 18 | const COL_RING_NOSUM: i64 = 2 // NC1: ring DATA MOVEMENT but the reduction (add) disabled -> wrong result |
functions
| 26 | func col_mod(a: i64, n: i64) -> i64 { var r: i64 = a % n; if r < 0 { r = r + n } return r } |
| 30 | func col_run(algo: i64, N: i64, V: i64, mo: *ColMetrics, out: *i64) -> i64 |
| 144 | func ring_allreduce(src: *i64, N: i64, V: i64, out: *i64) -> i64 |
| 183 | func main() -> i64 { return 0 } |