[Dev] Add zero-CTA all-gather policy for Megatron-FSDP#5657
Draft
bobboli wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
Signed-off-by: Bo Li <22713281+bobboli@users.noreply.github.com>
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.
Summary
--megatron-fsdp-zero-sm-all-gatherto requestNCCL_CTA_POLICY_ZEROon dedicated dense and expert Megatron-FSDP parameter all-gather communicators.0.6.0as unavailable during optional capability detection; explicit NVRX selection still raises a clear error. This compatibility fix was required by the available OCI image and is kept as a separate commit.Functional validation
On one 4x GB200 OCI node with PyTorch
2.12.0a0and NCCL2.29.7, an order-balanced 1 MiB/rank probe randefault, zero, zero, defaultwith 2,000 timed calls per run:ncclSymkDevKernel_AllGather_STMCkernels for five profiled callsAll runs were numerically correct and the communicator reported policy values
0and2respectively. The isolated zero-CTA collective was 2.23x slower, which matches NCCL's documented policy tradeoff: it preserves CTAs for compute and may sacrifice communication latency.Qwen3.5 performance
Qwen3.5-35B proxy, Megatron-FSDP EP4, four GB200 GPUs, sequence length 4096, 20 iterations, eight warmup iterations skipped:
2901.6 msversus2849.9 msmedian (1.78%faster).2971.15 msversus baseline2957.0 ms(0.48%slower).5.947 msto6.949 msacross 26 calls (+16.8%). The apparent whole-step speedup came from unrelated GPU-idle variance.There is no end-to-end throughput claim in this PR. The code exposes a verified zero-CTA path for eligible buffers; heterogeneous Qwen FSDP buffer eligibility remains follow-up allocator work.
Test plan
20 passed,227 deselected.2.29.7.2.30.6+and the available OCI image contains2.29.7.References: NCCL zero-CTA requirements, NCCL CTA policy semantics.