Skip to content

Increase Megatron-FSDP overlap test dim to 8192 for reliable overlap - #5770

Merged
wujingyue merged 1 commit into
NVIDIA:mainfrom
wujingyue:mfsdp-overlap-test-dim
Jul 14, 2026
Merged

Increase Megatron-FSDP overlap test dim to 8192 for reliable overlap#5770
wujingyue merged 1 commit into
NVIDIA:mainfrom
wujingyue:mfsdp-overlap-test-dim

Conversation

@wujingyue

@wujingyue wujingyue commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

test_overlaps_all_gather_and_compute asserts that at least num_children - 1
forward all-gathers overlap GEMM compute. At dim = 4096 the GEMM kernels are
short enough that kernel launch/dispatch latency dominates, so the independent
all-gather and GEMM kernels do not reliably co-reside on the GPU. On a single
DGX H100 node (8×H100) with default NCCL settings the test fails nearly
every run — any one of the eight ranks missing an overlap fails the whole test.
Raising the GEMM size to dim = 8192 makes each kernel long enough to amortize
launch latency so the forward all-gathers reliably overlap the preceding
child's GEMM.

Validation (8×H100, default NCCL)

dim ALLPASS
4096 (before) 0 / 12
8192 (this PR) 25 / 25

Why the flakiness doesn't show up in CI

The unit-test harness tests/unit_tests/run_ci_test.sh exports
NCCL_MAX_NCHANNELS=1 (to reduce NCCL memory). That serializes the all-gather
onto a single channel, producing a longer, lighter-weight all-gather kernel
that happens to overlap even the small dim = 4096 GEMM. Isolated on 8×H100:

NCCL env (dim=4096) ALLPASS
default 0 / 12
NCCL_MAX_NCHANNELS=1 only 10 / 10

So the test was implicitly relying on a memory-reduction env var unrelated to
the feature under test. Bumping dim removes that hidden dependency so it
passes under both default and CI NCCL configs.

🤖 Generated with Claude Code

test_overlaps_all_gather_and_compute asserts that at least num_children - 1
forward all-gathers overlap GEMM compute. At dim = 4096 the GEMM kernels are
short enough that kernel launch and dispatch latency dominate, so the
independent all-gather and GEMM kernels do not reliably co-reside on the GPU.
On a single DGX H100 node (8xH100) with default NCCL settings the test fails
nearly every run, because any one of the eight ranks missing an overlap fails
the whole test.

Raising the GEMM size to dim = 8192 makes each kernel long enough to amortize
launch latency, so the forward all-gathers reliably overlap the preceding
child's GEMM. Verified on 8xH100 under default NCCL: 25/25 runs pass, versus
0/12 at dim = 4096.

The flakiness does not surface in CI because tests/unit_tests/run_ci_test.sh
exports NCCL_MAX_NCHANNELS=1 to reduce NCCL memory. That serializes the
all-gather onto a single channel, producing a longer, lighter-weight
all-gather kernel that happens to overlap the small dim = 4096 GEMM. Isolated
on 8xH100: NCCL_MAX_NCHANNELS=1 alone passes 10/10, while default NCCL fails
0/12. The test was therefore implicitly depending on a memory-reduction
environment variable unrelated to the feature under test. Increasing dim
removes that hidden dependency so the test passes under both default and CI
NCCL configurations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@wujingyue
wujingyue added this pull request to the merge queue Jul 13, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/29263458844

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/29287044324

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 14, 2026
@wujingyue
wujingyue added this pull request to the merge queue Jul 14, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/29310102013

Merged via the queue into NVIDIA:main with commit 3005e9c Jul 14, 2026
186 checks passed
@wujingyue
wujingyue deleted the mfsdp-overlap-test-dim branch July 14, 2026 08:17
chochowski pushed a commit to chochowski/Megatron-LM that referenced this pull request Jul 20, 2026
…VIDIA#5770)

Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: mchochowski <mchochowski@nvidia.com>
terminator123 pushed a commit to 021ai/Megatron-LM that referenced this pull request Aug 3, 2026
…VIDIA#5770)

Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
svcnvidia-nemo-ci pushed a commit to dimapihtar/Megatron-LM that referenced this pull request Aug 4, 2026
…VIDIA#5770)

Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Dmytro Pykhtar <dpykhtar@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants