Repository navigation
Conversation
…rank fails When one rank raises, its peers may still be blocked in a collective it will never join (e.g. the per-step check_stop broadcast), so destroy_process_group() in the finally block hangs, the failed rank never exits, and the job waits for the NCCL watchdog timeout. Only destroy the process group after a successful request; on failure let the process exit so torchrun reports the error and stops the peers. Signed-off-by: Lin, KuanTing <Kuanting.Lin@amd.com>
klin-amd
marked this pull request as draft
November 14, 2026 13:48
klin-amd
marked this pull request as ready for review
November 14, 2026 13:54
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
When one rank raises during
torchrun ... -m lightx2v.infer(for example an OOM, or acusolverDnCreatefailure in the UniPC corrector),main()still callsdist.destroy_process_group()in itsfinallyblock. The other ranks are still waiting in a collective that the failed rank will never join, such as the per-stepcheck_stopbroadcast. Sodestroy_process_group()blocks, the failed rank never exits, and torchrun cannot detect the failure. The job hangs until the NCCL watchdog timeout (10 min by default), and the original traceback does not appear until then.Fix
Call
destroy_process_group()only when the request succeeded. On failure, let the exception propagate and the process exit. Under torchrun, the launcher then reports the failing rank and terminates its peers.This complements #1685, which covers restart-required device errors. This change covers ordinary exceptions (OOM, etc.) in the CLI entry point.
Test
Wan2.1-T2V-1.3B, 4-GPU ring sequence parallel, with GPU memory constrained so that one rank fails in step 3:
A successful 4-GPU Ulysses run still destroys the process group on every rank and exits with code 0.
pre-commit run --all-filespasses.