← Back to events
ActiveAIRelease

trunk/8b802259223ccdc4df77e910dfa081441ae98aa7: [c10d] Set local rank in backend test workers (#195103)

Photo: PyTorch Releases

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

Why it's spreading

Sources