Repository navigation
perf(fabric/tp): eager half-forwarding in 4-rank RoCE ring relay - #4798
Conversation
|
Thanks, @GrgaPalcic. The eager forwarding and longest-path-first send order are confirmed in the source. The flag/payload ordering, per-segment completion accounting, two-slot custody and fixed reduction order preserve the existing byte contract, including when ranks progress at different speeds. The alternated receipt also supports the reported fixed-size speedups; the averages match your table. Before landing, please retain per-rank evidence that the relay stayed active without fallback in every alternated run. The remaining four-rank checks are payload verification for the timed graph window, variable-length gathers including zero and unequal lengths, and gathers through the raised 1 MiB relay ceiling with sustained graph and slot-reuse activity. The current suite's large operations otherwise use NCCL, and its timed window checks timing rather than payload bytes. No source change is requested from this review. These are the remaining device qualification cells.
|
|
Completed all requested 4-rank device qualification cells on exact PR head 1. Per-rank no-fallback evidence across alternated A/B/A/B (
|
Case (graph_us / window_us) |
origin/main 0300dfbfe (A1 / A2) |
PR #4798 6e00fc784 (B1 / B2) |
Delta |
|---|---|---|---|
all_gather 4 KiB |
20.70 / 20.65 us (0.59 / 0.60 GB/s) |
14.10 / 14.15 us (0.87 / 0.87 GB/s) |
-31.7% |
all_gather 8 KiB |
22.23 / 22.10 us (1.11 / 1.11 GB/s) |
17.74 / 17.01 us (1.39 / 1.44 GB/s) |
-21.6% |
all_gather 16 KiB |
25.17 / 25.52 us (1.95 / 1.93 GB/s) |
21.46 / 20.88 us (2.29 / 2.35 GB/s) |
-16.5% |
all_gather 32 KiB |
32.00 / 32.06 us (3.07 / 3.07 GB/s) |
26.27 / 26.58 us (3.74 / 3.70 GB/s) |
-17.5% |
all_gather 64 KiB |
40.84 / 41.47 us (4.81 / 4.74 GB/s) |
35.37 / 34.64 us (5.56 / 5.68 GB/s) |
-14.9% |
decode_window (86 × 8 KiB) |
22.46 / 22.25 us (1931.8 / 1913.1 us) |
17.79 / 17.35 us (1530.0 / 1492.2 us) |
-21.3% (-411 us) |
2. Raised 1 MiB relay ceiling (TF_TP_ROCE_RELAY_MAX_KB=1024) tf-tp-test suite on 6e00fc784
All 4 ranks (rank 0..3) reported backend roce, relay active, 0 fallbacks, and SUMMARY rank {0..3}: 328 passed, 0 failed (covering all_gather and captured graphs through 256 KiB, 256 KiB + 16 B, 512 KiB, and 1 MiB over the relay):
RESULT {"backend":"roce","world":4,"op":"all_gather","bytes":262144,"eager_us":86.43,"graph_us":82.48,"busbw_GBps":9.54}
RESULT {"backend":"roce","world":4,"op":"all_gather","bytes":524288,"eager_us":146.87,"graph_us":145.43,"busbw_GBps":10.82}
RESULT {"backend":"roce","world":4,"op":"all_gather","bytes":1048576,"eager_us":278.22,"graph_us":270.78,"busbw_GBps":11.62}
3. Dedicated 4-rank GPU qualification on unmodified 6e00fc784 (TF_TP_ROCE_RELAY_MAX_KB=1024, TF_TP_ROCE_FALLBACK=error)
Verified on all 4 ranks at startup (backend roce, relay=true, relay_max_bytes=1048576, slot_bytes=1048576, varFits(1 MiB)=true, seq_start=1; ring-only HCA pairs confirmed with empty opposite-rank pairs on every rank):
- Timed
86 × 8 KiBgraph window with byte-exact payload verification:20replays with 20 distinct per-rank payloads +20back-to-back timed replays (per_us=17.55–17.56,window_us=1509.7–1509.9), all32,768output bytes verified bit-for-bit against host reference on all 4 ranks after every replay (relay_ops=3440,86 × 40, exact on all 4 ranks). - Variable-length GPU gathers (
comm.allGatherV) — zero, unequal, unaligned, and1 MiBceiling:12eager cases ({0,0,0,0},{0,17,0,4096},{8192,0,33,0},{0,0,0,65536},{65536,0,0,0},{1,15,16,17},{65520,65535,65536,32768},{16,4096,131072,262144},{524288,0,262145,127},{1048576,524288,0,12345},{0,1048576,1048575,1},{1048576,1048576,1048576,1048576}) +8CUDA-graphed1 MiBreplays with changing devicelensvectors (including{0,0,0,0}, single-rank/mixed zero, unequal, ceiling) — every rank'slens[r]bytes verified bit-for-bit on all 4 ranks (relay_ops=20, exact on all 4 ranks). - Sustained
1 MiBgraph & slot-reuse activity:20replays of a16-op back-to-back1 MiBallGatherCUDA graph (320consecutive 2-slot turnovers) interleaved with20eager1 MiBallGatherops (3401 MiBrelay ops =1.36 GiBgathered through the 2-slot relay), all4,194,304output bytes verified bit-for-bit on all 4 ranks after every replay and every eager op (relay_ops=340, exact on all 4 ranks).
Per-rank summaries and RDMA drain receipts (3801 total relay ops × 3 RDMA posts/op = 11,403 per HCA per rank, 0 dropped, 0 flushed):
QUAL_SUMMARY rank 0: 84 passed, 0 failed, total_relay_seq=3801 (HCA 0 posted/completed 11403/11403; HCA 1 11403/11403; still posted 0)
QUAL_SUMMARY rank 1: 84 passed, 0 failed, total_relay_seq=3801 (HCA 0 posted/completed 11403/11403; HCA 1 11403/11403; still posted 0)
QUAL_SUMMARY rank 2: 84 passed, 0 failed, total_relay_seq=3801 (HCA 0 posted/completed 11403/11403; HCA 1 11403/11403; still posted 0)
QUAL_SUMMARY rank 3: 84 passed, 0 failed, total_relay_seq=3801 (HCA 0 posted/completed 11403/11403; HCA 1 11403/11403; still posted 0)
|
Thanks, @GrgaPalcic. The new receipt covers the requested relay-active, timed payload, variable-length and sustained 1 MiB checks. Together with the source review, this looks safe to land after CI. Two small receipt clarifications: the listed cells add to 3,800 operations, while the counters imply 3,801; please identify the extra setup operation or counter convention. Also, 340 four-rank 1 MiB gathers total 1,360 MiB (1.328125 GiB) per gathered output. The speed results support transport latency improvements, rather than model tokens/s.
|
|
Thanks — confirming both clarifications:
|
6e00fc7 to
4b40add
Compare
|
Thank you @GrgaPalcic. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
What this changes
Switches the 4-rank switchless RoCE ring relay (
zig/src/fabric/tp/roce_relay.zig) from alternating completed half-forwards to eager half-forwarding: each half is forwarded as soon as its flag lands independently of the opposite direction, and initial sends post the longest-path halves (direction == d) first. Sequences+1still waits forwire.idle(),consumedofs-2, and every rank'ss-1, preserving exact two-slot custody and identical reduction order.TF_TP_ROCE_RELAY=14-rank ring path (Refs #4795); changes no model family, public API, or arithmetic order.main(0300dfbfe2b3ed3c395fa511f53201f93303a72c), 1 commit (6e00fc784).atc overlap --json: run on 2026-11-23T21:15Z againstorigin/main— 5 PR overlaps (#3041,#3075,#3076,#3102,#3103, all onREADME.md), every single one"conflict": "clean"(conflictFiles: 0;complete: falsedue topullRequestsLimit/pullFilesUnavailable).Checks on this head
6e00fc784python3 tools/zig/lean_check.py, on the base and on this head:165on base (0300dfbfe),165on head (6e00fc784),0new findings (python3 tools/pr_check.py --base origin/main:0 error(s), 1 warning(s)— advisoryCHANGELOG.mdUnreleased reminder).zig build test-roce-multi-host—57 pass, 1 fail (58 total)(newrelay eager: half 1 forwards immediately when half 0 has not landed yetfails as expected onorigin/main).zig build test-roce-multi-host—58 pass, 0 fail (58 total).zig build test-roce-relay-controls-host—9 pass, 0 fail (9 total).zig build test-roce-integration-host—5 pass, 0 fail (5 total).zig build test-tp-suite-host—1 pass, 0 fail (1 total).zig fmt --check zig/src/fabric/tp/roce_relay.zig zig/src/fabric/tp/roce_relay_test.zig— pass (exit0).git diff --check— pass (exit0).roce_relay.zig).Receipt
tf-tp-test suiteon the exact same 4× NVIDIA GB10 (sm_121) switchless ConnectX-7 ring (TF_TP_ROCE_RELAY=1,TF_TP_ROCE_FAST=1,TF_TP_MAILBOX_MAX_KB=1024), built from0300dfbfe(origin/main) vs6e00fc784(PR head):world = 4,roce)origin/main0300dfbfe(A1 / A2)6e00fc784(B1 / B2)all_gather4 KB(graph_us)20.64/20.72 us(0.60 GB/s)14.11/14.10 us(0.87 GB/s)-31.8%all_gather8 KB(graph_us)22.21/22.24 us(1.11 GB/s)17.09/17.13 us(1.44 GB/s)-23.0%all_gather16 KB(graph_us)24.95/24.99 us(1.97 GB/s)20.42/20.47 us(2.41 GB/s)-18.1%all_gather64 KB(graph_us)41.78/41.99 us(4.71 GB/s)34.85/34.95 us(5.64 GB/s)-16.7%decode_window(86 × 8 KB)22.17/22.20 us(1906.7/1909.0 us)17.42/17.04 us(1498.0/1465.7 us)-22.3%SUMMARY(every run)328 passed, 0 failed328 passed, 0 failed0diffsTP=4Linux CUDA hosts withTF_TP_ROCE_RELAY=1(switchless 4-rank ConnectX-7 ring).TF_TP_ROCE_RELAYremains off by default.0300dfbfe, head6e00fc784, Zig0.17.0,nvcc 13.0.88, 4× NVIDIA DGX Spark (GB10sm_121, 128 GB unified memory each, dual-port ConnectX-7 200GbE ring), Linux aarch64.TF_TP_ROCE_RELAY=1proxy path only; 2-rank, 3-rank, and full-mesh paths are untouched. Ran host suites on Linux x86_64 and alternated A/B/A/Btf-tp-test suiteon 4× GB10; did not run Metal, HIP, Windows, or app targets.tf-tp-test suite328/328byte-exact payload, graph-capture, and sequence/custody checks pass on all 4 runs (A1, B1, A2, B2).-16.7%to-31.8%lowerall_gatherlatency from4 KBto64 KB,-22.3%ondecode_window(-426 usper 86-exchange window), andall_reduceunchanged within noise (50.7 -> 51.0 usat4 KB,67.1 -> 66.2 usat64 KB).~4.8–5.1 usper8 KBexchange (-426 usper 86-exchangedecode_windowontf-tp-test).roce_relay.zighandles messages up toTF_TP_ROCE_RELAY_MAX_KB(decode/draft windows); large prompt collectives stay on ring NCCL.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled.