Repository navigation
Engine patches 0107/0108: the RoCE all-gather at any world and the drafter MLP split, MESH_ROCE for TP=4 on a switch (round 36.4 -> 33.0 ms) - #5
Conversation
…les or NCCL_ALGO=Ring, PREFILL_REDUCE auto (split on a switch, gather on a ring)
…uses PREFILL_REDUCE=split before the start
…ts, the ring's hashes reproduced, prefill +30% with split)
…ompt cache / retention trade at 1M vs 768k windows
…rompt cache is under 8 GiB; README memory and incast notes for four Sparks
…d, mesh only) and 0108 (DFlash2 drafter MLP split across every rank); notes with the microbench and gates (unbuilt, untested)
… 0107 is in the image (MESH_ROCE=auto|on|off); TF_ROCE_HCA per rank
…LTS: microbench and model boots, hashes unchanged, round 36.4 -> 33.0 ms)
…/33/33 registers on sm_80/86/89/120/121), not df_sum2's carried figures
|
Pushed one more commit: 0108's |
|
Thank you for the work and the measured evidence. This PR cannot merge into |
|
Closing: patches 0107/0108 are not needed at world 2, and the engine changes continue upstream as ashhart/TensorFold#2205 (RoCE gather at any world, now opt-in at 3+ ranks, and the drafter MLP split). Thanks for the review. |
…on this tree Owner asked to pull the prompt-cache-starvation fix from MiaAI-Lab/GLM-5.3-Flash-DGX-Sparks-1104 main (605c6a1, issue 7): CACHE_FIRST=1 (TF_PROMPT_CACHE_FIRST) sets PROMPT_CACHE_GIB aside before the page pool is sized in whole windows, instead of only capping the remainder. Upstream measured a 380k-token conversation resuming 99% cached (3.0s vs 234s) with eight ~31k ones also resuming, at PARALLEL=8 / 1M window / PROMPT_CACHE_GIB=12. Real collision found and resolved: upstream main independently reused the number 0108 for this patch, which on this tree already names our own DFlash2 drafter MLP split (part of PR MiaAI-Lab#5/MiaAI-Lab#10). Two files both prefixed 0108- would have landed in patches/engine/ (upstream issue 15 tracks this exact numbering mess across main, MiaAI-Lab#10 and MiaAI-Lab#11). Renumbered the pulled patch file and every reference to it (start.sh, scripts/config.sh, README, CHANGELOG) to 0110, the next free slot on this branch. Also wrote an accurate patch-count line and table row for this tree (110 patches, 0001-0110) -- neither sides prose was correct for our actual history, which already includes 0106-0109 unconflicted. Scope: cache-first only. Did NOT pull TOOL_CALL_GUARD (0107 upstream), WITH_VIDEO, LEARN_GIB (disk persistence) or KV_SHARD from the same upstream range -- out of scope for this ask, and pulling them would have meant documenting features this tree does not have. docker/Dockerfile and scripts/config.sh and scripts/prepare.sh wiring for CACHE_FIRST are real (auto-merged clean, no conflict). Not built, not run, not served -- this is a docs+scripts+patch-file change on the tp4-mesh-roce-engine branch only; production is unaffected (still the separate GLM-5.3-Flash-TensorFold-tp4-main Python recipe).
Depends on #4 (this branch is #4 plus four commits). Four DGX Sparks behind one switch, TP=4.
What
Two engine patches and one launcher switch, so the decode-sized all-gathers go over RoCE at four as they do on the pair:
cuda/roce: the one-shot RoCE all-gather at any world.zig/src/cuda/roce.zigandroce_gather.cugeneralised from two ranks: one RC queue pair per peer per HCA, a receive region[slot][world-1]with a flag per peer per HCA, the shard written to every peer, the kernel waiting for(world-1) × n_hcaflags and copying each peer's stripes into rank-ordered slots (the same slotshcPostsums, so the bytes are NCCL's). A connect-time probe writes a token to every peer and refuses (PeerUnreachable) when one cannot be written to, so a ring never opens the path. World 2 keeps the old layout bit for bit (a test pins it).tf-cuda-test roce-gather <rank> [world]compares every size withncclAllGatherand times a call.glm/cuda: the DFlash2 drafter MLP split across every rank (ff = FF / worldwhen 256-aligned; rank-ordered fp32df_sumn, world 2 bit-identical todf_sum2). Exact; on its own it does not move the round (its block overlaps other work) and is kept as lighter.start-tp4.sh:MESH_ROCE=auto|on|off— on a switch,TF_ROCE=1when 0107 is in the image,TF_ROCE_HCAper rank; a ring stays on NCCL. README "4 Sparks", CHANGELOG and RESULTS.md ("Engine patches 0107 and 0108") updated.Evidence (four GB10s, CRS804, one 200G cable each, image
d46e73d4e405= f350cd3e + 108 patches; compiled first try)split, 768k × 8, greedy, your acc.py): the per-layer gathers 2.58 + 2.19 → 1.76 + 1.55 ms a verify call (TF_GLM_PROF), drafter block 5.5 → 3.5 ms a round, decode round 36.4 → 33.0 ms. One stream 53.8 / 83.0 → 59.4 / 90.8 tok/s (prose / code), four streams 118 → 131.5. Greedy hashes unchanged in every boot (fab1d3b6894b/e71492bf766b), with RoCE on and off, acceptance unchanged (53% / 72%).RoCE all-gather: 4 ranks, 2 HCA(s), shards up to 4096 KiB by RDMA writes.Not verified
The host spin proxy's CPU at eight streams;
TF_ROCE_MAX_KBstays 4096 (prefill-sized exchanges stay on NCCL); the engine change has not been ported to TensorFoldmain(1,125 commits past the pin) — that is a separate upstream PR we are preparing.