trunk/8b802259223ccdc4df77e910dfa081441ae98aa7: [c10d] Set local rank in backend test workers (#195103)
- PyTorch: 216 events in the last 90 days
- PyTorch: 213th Release in the last 90 days
- Previous: earlier the same day · trunk/43fbd95e2d1b009ddae803b4e760aa5ac5b41b59: [aoti] Build legacy and ABI-compatible AOTI DSOs (#191241) (#191241)
What happened
This change was prepared with AI assistance and reviewed by a human. MultiProcessTestCase workers inherit LOCAL_RANK from their parent process. A stale value can cause eager NCCL2 initialization to bind every worker to the same GPU despite _init_pg() selecting a device by rank. Set LOCAL_RANK from self.rank before process-group initialization so the environment and explicit device selection agree. Context: analysis…
Summary assembled by rule from the sources below