Skip to content

fix(tests): synchronize GTP process-group teardown - #7656

Merged
balasaajay merged 2 commits into
NVIDIA:mainfrom
balasaajay:abalasa/fix-gtp-test-group-teardown
Sep 26, 2026
Merged

balasaajay merged 2 commits into
NVIDIA:mainfrom
balasaajay:abalasa/fix-gtp-test-group-teardown

Conversation

@balasaajay

@balasaajay balasaajay commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

The four-rank GTP/DDP tests intermittently fail while restoring process groups between cases: a faster rank can start the next case and destroy Gloo groups before peers finish connecting. The resulting rank divergence causes long communication waits and one-hour CI timeouts, as in this job.

Synchronize ranks before both teardown points in _gtp_env(). Before cleanup, also synchronize CUDA work: the grouped-expert test can leave a prefetch outstanding on a separate all-gather stream. This drains that work before destroying groups and clearing the cache. The entry barrier needs no additional CUDA synchronization because previous cleanup already drained GPU work. The change is confined to six added lines in the existing test helper.

Validation

  • Passed the repository formatter/linter check (CHECK_ONLY=true bash tools/autoformat.sh): Black, isort, pylint, and Ruff.
  • Passed Python syntax and git diff --check.
  • The formatter's optional mypy step reports missing local torch stubs; this machine has no CUDA GPUs, so distributed execution has not been validated locally.
  • GPU validation pending: repeat the existing four tests with four H100 ranks, then run the full GTP bucket. Check that the first attempts complete without Gloo errors or automatic retries.

@copy-pr-bot

copy-pr-bot Bot commented Sep 25, 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.

@balasaajay
balasaajay marked this pull request as ready for review September 25, 2026 20:53
@svcnvidia-nemo-ci
svcnvidia-nemo-ci requested a review from a team September 25, 2026 20:53
@balasaajay

Copy link
Copy Markdown
Contributor Author

/ok to test 0e91132

@ko3n1g ko3n1g left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls double check with @NVIDIA/mcore-oncall

Signed-off-by: Ajay Balasa <abalasa@nvidia.com>
@balasaajay
balasaajay force-pushed the abalasa/fix-gtp-test-group-teardown branch from 0e91132 to c6a12ba Compare September 26, 2026 04:06
@balasaajay

Copy link
Copy Markdown
Contributor Author

/ok to test c6a12ba

Signed-off-by: Ajay Balasa <abalasa@nvidia.com>
@nemo-automation-bot

Copy link
Copy Markdown

🔄 Merge queue validation started!

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

Merged via the queue into NVIDIA:main with commit d113016 Sep 26, 2026
105 checks passed
@balasaajay
balasaajay deleted the abalasa/fix-gtp-test-group-teardown branch September 26, 2026 06:55
xuwchen pushed a commit to xuwchen/Megatron-LM that referenced this pull request Oct 14, 2026
Signed-off-by: Ajay Balasa <abalasa@nvidia.com>
(cherry picked from commit d113016)
Signed-off-by: xuwenc <xuwenc@nvidia.com>
xuwchen pushed a commit to xuwchen/Megatron-LM that referenced this pull request Oct 14, 2026
Signed-off-by: Ajay Balasa <abalasa@nvidia.com>
(cherry picked from commit d113016)
Signed-off-by: xuwenc <xuwenc@nvidia.com>

This branch was previously deployed

2 inactive deployments
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