[perf] Harden Ulysses agreement and tune bounded H3 transfers - #1807
Open
shaoxiongduan wants to merge 7 commits into
Open
[perf] Harden Ulysses agreement and tune bounded H3 transfers#1807shaoxiongduan wants to merge 7 commits into
shaoxiongduan wants to merge 7 commits into
Conversation
…er call Two defects measured on 4x GB200, MiniMax-H3 geometry, per attention layer (NCCL baseline 2421us at sp=4, 1295us at sp=8 across two trays): as shipped sp=4 2035us (1.19x) sp=8 3102us (2.4x SLOWER than NCCL) with these sp=4 1590us (1.52x) sp=8 declines, 1300us ncclTeamLsa answers "addressable", not "fast". NCCL 2.29 extends the LSA team across a multi-node NVLink domain, so on a GB200 rack the gate passes for ranks on different trays and the kernel arms. Its fine-grained 16B remote stores are far slower there than NCCL's bulk transfers. Require a single host, which is the regime the slab decomposition was tuned for, and which matches flashinfer's own gate. torch 2.12 (the pin) bundles NCCL 2.29.7, so this is reachable today. _can_attempt now computes its local verdict without collectives and then runs one unconditional all_gather_object carrying (hostname, local_ok). A collective behind a rank-local early return hangs the group whenever ranks disagree -- exactly the case this gate exists to detect. Verified: with one rank reporting the kernel unavailable, the earlier ordering timed out at 180s while this completes with correct results on every rank. The per-call agreement cost a flat ~227us regardless of operand size -- a host-side gloo all_gather before every collective. The signature is architectural: two distinct values (scatter and gather shapes) across 50 layers x 4 steps. Cache the verdict so the collective runs twice per generation instead of ~400 times. The cache trades one property: a rank whose signature diverges mid-run now misses the cache and calls the collective alone, hanging rather than falling back. Re-voting every N calls would bound that if wanted.
Contributor
Merge Protections🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI
🔴 PR merge requirementsWaiting for
This rule is failing.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
Rank-local construction branches and cached call verdicts could leave peers in different collectives and hang Ulysses. The helper now agrees on construction capability and hostname collectively, then exchanges the complete current call contract on every call using reusable CPU vote buffers.
For contiguous BF16 H3 operands on four GB200 GPUs (56 global heads, D128), the helper additionally uses a 144-CTA launch and transfers one batch plane at a time. Packed QKV/QKVG at 250k tokens can use a 896,000,000-byte registered window instead of exceeding the 1 GiB cap. Outputs retain independent storage, and backward reuses the plan saved by its forward.
Implementation
FASTVIDEO_ULYSSES_A2A_LONG_TRAINING=chunkedenables long-training chunks after the activation-memory budget has been validated. No-grad inference uses tuned chunks directly.Review and validation
Reviewed head:
1568d3d1f7f2399dafa236df2341beaa985367dc. No blocking production-code findings remain. The review fixed two test gaps: numerical parity could pass without the tuned path running, and default-policy tests depended on the caller's environment. The native gate now asserts actual forward/backward execution plans; a negative control deliberately disables tuning and must fail those assertions.Fresh validation on four GB200 GPUs, PyTorch 2.12.0+cu130, NCCL 2.29.7, Slurm 6629:
autoandchunked; three GPU pytest cases deliberately deselected for separate execution).The production Python and CUDA code is byte-identical to the full-model benchmark source
89836e8a98aad2b2b0c173d085950fbbb8602685; the review commit changes tests only. Native library SHA-256:ccc4b3f3d6610bfb29b14aca41eddafdaaa225dcc679babfd02c49e98a89ad79.Earlier validation retained from this PR: SP2/SP4 construction, capture, lifecycle and recovery coverage (55 passed, one eight-GPU skip, plus six final capture/recovery cases; Slurm 6464/6468). Six selected lifecycle/fault scenarios were also rerun against the new native build in Slurm 6541. Multi-node topology rejection was fault-injected; multi-node performance was not measured.
H3 full-model performance
Complete DiT measurements on four GB200 GPUs, SP4/FSDP4, FP32 masters, mixed BF16 compute, full activation checkpointing, native VSA at 90% sparsity and resident AdamW. Synthetic inputs use real H3 packing and SFT loss; LR and weight decay are zero to keep weights identical across routes. Reported times are medians of three rotated rank-max wall-time trials. Baseline is the corrected PR helper at
a06e63827, using its original 36-CTA path.At 250k, no-grad inference improved 7.4343 → 7.0460 s (+5.51% throughput). Training exposed activation-allocation pressure, so automatic long-training tuning remains conservative. A separate H3 integration offloads saved activations to pinned CPU memory at 200k packed tokens; with expandable allocator segments, its comparison was:
The combined +67.16% training-throughput result requires the separate H3 activation-offload integration, which is outside this public PR. Tuned transport adds 9.87% throughput relative to the offload-only control. Merely enabling long-training chunks does not establish that combined gain.
All full-model outputs and actual fused transports matched NCCL exactly. Whole-model gradient variation passed a threshold calibrated from two repeated NCCL controls; gradients were not bitwise identical. There are 54 timing records and 26 parity records across the short/long phases (Slurm 6546/6547). These are relative step-throughput measurements, not MFU, full PDD rollout results, compiled-training results or complete video-generation times.
Reproduction and evidence
After rebuilding
fastvideo-kernelwith NCCL 2.29+ device headers:Runtime receipts, pinned source archives, configs, raw metrics, traces and checksums are retained under:
/mnt/lustre/vlm-wlsaidhi/fastvideo/ulysses_pr1807_review_20260907— final review validation, run20260907T014553Z-ulysses-pr1807-review./mnt/lustre/vlm-wlsaidhi/fastvideo/h3_ulysses_production_20260906— full-model results, methods, plot and source equivalence proof./mnt/lustre/vlm-wlsaidhi/fastvideo/ulysses_pr1807_20260906— original agreement/fault tests and collective microbenchmarks.