Skip to content

[ROCm] Enable several distributed UTs - #164390

Closed
pragupta wants to merge 2 commits into
pytorch:mainfrom
pragupta:pg-ut-parity
Closed

pragupta wants to merge 2 commits into
pytorch:mainfrom
pragupta:pg-ut-parity

Conversation

@pragupta

@pragupta pragupta commented Oct 1, 2025 •

Copy link
Copy Markdown
Collaborator

Increase the tolerance for the following UTs as there was a slight mismatch seen on MI200.
- test_data_parallel.py:test_strided_grad_layout
- test_c10d_nccl.py:test_grad_layout_1devicemodule_1replicaperprocess

Skip for MI200:
- test_fully_shard_training.py:test_2d_mlp_with_nd_mesh
- test_2d_composability.py:test_train_parity_2d_mlp
- test_fully_shard_overlap.py:test_fully_shard_training_overlap

Fixes #159489
Fixes #159488
Fixes #152700
Fixes #125555
Fixes #134139

Working as is on both MI200 and MI300:
Fixes #125991
Fixes #125918

cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @msaroufim @dcci @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 1, 2025 •

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

@pytorch-bot

pytorch-bot Bot commented Oct 1, 2025 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/164390

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 17 Unrelated Failures

As of commit 4e08c95 with merge base 39c340e (image):

NEW FAILURE - The following job has failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot Bot added module: rocm AMD GPU support for Pytorch oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (fsdp) release notes category labels Oct 1, 2025
@jeffdaily jeffdaily added ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/periodic-rocm-mi300 Trigger "distributed" config CI on ROCm MI300/MI325 labels Oct 1, 2025
@pytorch-bot pytorch-bot Bot removed ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/rocm ciflow/periodic-rocm-mi300 Trigger "distributed" config CI on ROCm MI300/MI325 labels Oct 1, 2025
@jeffdaily jeffdaily added ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/periodic-rocm-mi300 Trigger "distributed" config CI on ROCm MI300/MI325 labels Oct 1, 2025
@pragupta

pragupta commented Oct 2, 2025

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

Increase the tolerance for the following UTs as there was a slight
mismatch seen on MI200.
    - test_data_parallel.py:test_strided_grad_layout
    - test_c10d_nccl.py:test_grad_layout_1devicemodule_1replicaperprocess
Skip for MI200:
    - test_fully_shard_training.py:test_2d_mlp_with_nd_mesh
    - test_2d_composability.py:test_train_parity_2d_mlp
    - test_fully_shard_overlap.py:test_fully_shard_training_overlap

Fixes pytorch#159489
Fixes pytorch#159488
Fixes pytorch#152700
Fixes pytorch#125555
Fixes pytorch#134139

Working as is on both MI200 and MI300:
Fixes pytorch#125991
Fixes pytorch#125918
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased pg-ut-parity onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout pg-ut-parity && git pull --rebase)

@pytorch-bot pytorch-bot Bot removed ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/periodic-rocm-mi300 Trigger "distributed" config CI on ROCm MI300/MI325 labels Oct 2, 2025
@jeffdaily jeffdaily added ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR ciflow/periodic-rocm-mi300 Trigger "distributed" config CI on ROCm MI300/MI325 labels Oct 2, 2025
@pytorch-bot

pytorch-bot Bot commented Oct 2, 2025

Copy link
Copy Markdown

To add the ciflow label ciflow/periodic please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@pytorch-bot pytorch-bot Bot removed the ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR label Oct 2, 2025
@jeffdaily jeffdaily added the ciflow/periodic Trigger jobs ran periodically on master (periodic.yml) on the PR label Oct 2, 2025
@jeffdaily

Copy link
Copy Markdown
Collaborator

@pytorchbot merge -f "unrelated CI failures, ROCm fully passing for this ROCm-only change"

@pragupta
pragupta marked this pull request as ready for review October 3, 2025 19:51
@pragupta
pragupta requested a review from a team as a code owner October 3, 2025 19:51
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

cyyever pushed a commit to cyyever/pytorch that referenced this pull request Oct 4, 2025
Increase the tolerance for the following UTs as there was a slight mismatch seen on MI200.
    - test_data_parallel.py:test_strided_grad_layout
    - test_c10d_nccl.py:test_grad_layout_1devicemodule_1replicaperprocess

Skip for MI200:
    - test_fully_shard_training.py:test_2d_mlp_with_nd_mesh
    - test_2d_composability.py:test_train_parity_2d_mlp
    - test_fully_shard_overlap.py:test_fully_shard_training_overlap

Fixes pytorch#159489
Fixes pytorch#159488
Fixes pytorch#152700
Fixes pytorch#125555
Fixes pytorch#134139

Working as is on both MI200 and MI300:
Fixes pytorch#125991
Fixes pytorch#125918

Pull Request resolved: pytorch#164390
Approved by: https://github.com/jeffdaily
Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Oct 21, 2025
Increase the tolerance for the following UTs as there was a slight mismatch seen on MI200.
    - test_data_parallel.py:test_strided_grad_layout
    - test_c10d_nccl.py:test_grad_layout_1devicemodule_1replicaperprocess

Skip for MI200:
    - test_fully_shard_training.py:test_2d_mlp_with_nd_mesh
    - test_2d_composability.py:test_train_parity_2d_mlp
    - test_fully_shard_overlap.py:test_fully_shard_training_overlap

Fixes pytorch#159489
Fixes pytorch#159488
Fixes pytorch#152700
Fixes pytorch#125555
Fixes pytorch#134139

Working as is on both MI200 and MI300:
Fixes pytorch#125991
Fixes pytorch#125918

Pull Request resolved: pytorch#164390
Approved by: https://github.com/jeffdaily
pytorchmergebot pushed a commit that referenced this pull request Nov 19, 2026
## Linked issue or supporting maintainer

Fixes #168404
Fixes #168405
Fixes #168406
Fixes #168407

## BC-breaking?

No

## Summary (human written only)

The MI200 skips on `test_2d_mlp_with_nd_mesh` and `test_train_parity_2d_mlp` (added in #164390)
were covering a GPU-side RCCL deadlock in the ROCm 10.0 user-space stack, not a PyTorch bug
(ROCm/rccl#2191). With ROCm 10.1, which trunk CI now uses (#196753), both tests pass on gfx90a,
so this removes the skips. `test_fully_shard_training_overlap` is unchanged: its ROCm >= 10.1 skip
is still needed because of the reduced hardware-queue count, not because of this hang.

## Agent details (if applicable)

> AI-generated (Claude, via Cursor), reviewed by the submitter.
>
> - **Root cause:** the hang is on the GPU with the ROCm 10.0 user-space stack. RCCL kernels run concurrently on several communicators (FSDP2's `priority=-1` streams plus TP on the current stream) and deadlock. All GPUs stay 100% busy while the host threads, including RCCL's proxy threads, sit idle. It matches ROCm/rccl#2191.
> - **Not PyTorch:** torch 2.15 and 2.16 behave identically on ROCm 10.0, and the same stream pattern without RCCL never stalls.
> - **Fixed in ROCm 10.1:** trunk already runs ROCm 10.1 (#196753). The fix holds with `DEBUG_HIP_IGNORE_STREAM_PRIORITY=0` or `DEBUG_CLR_AQL_BARRIER_OPT=0`, so neither of those 10.1 default changes is the fix. ROCr 10.1 alone does not fix it, which leaves CLR and/or RCCL. The exact commit was not isolated.
> - **Test plan (8x MI250X, with the skips removed):**
>   - ROCm 10.1: `test_2d_mlp_with_nd_mesh` 7/7 pass, plus 3/3 with `DEBUG_HIP_IGNORE_STREAM_PRIORITY=0`; `test_train_parity_2d_mlp` 3/3 pass.
>   - ROCm 10.0: `test_2d_mlp_with_nd_mesh` fails 5/5 at the 300s timeout.
> - **Rejected workarounds:** forcing normal priority in FSDP2 on ROCm, or setting `DEBUG_HIP_IGNORE_STREAM_PRIORITY=1` or `GPU_MAX_HW_QUEUES=16`.
> - **Lint:** not run locally (no `spin`/`lintrunner` in the environment).

Pull Request resolved: #205508
Approved by: https://github.com/jeffdaily

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Jeff Daily <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment