NVIDIA / NVIDIA/apex

There is no option to select different GPU ids here

Open
#1,016 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.5k
Avg merge
2d 4h
Merged PRs (30d)
3

Description

https://github.com/NVIDIA/apex/blob/154c6336aa7aedd40d3b3583fb5e1328f9cdf387/examples/imagenet/main_amp.py#L123

When we run the code for a single node-multiple gpu case, as soon as torch.distributed.init_process_group(backend='nccl', init_method='env://') is executed, Pytorch spawns n processes on n gpus as the following argument makes it to do so torch.distributed.launch --nproc_per_node=n. All these processes started from the 0-th index up to n-1 gpu and there is no way to change the indices of gpus and starting them from anything else rather than zero. Although, later we can change the indices of the gpus for the model and data but those initialized processes on the n gpus at the beginning will remain.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at examples/imagenet/main_amp.py around line 123 and inspect how torch.distributed.init_process_group is reached when launched with torch.distributed.launch. Trace the handling of GPU and process indices, then verify that a run can initialize the requested nonzero GPU range without leaving processes on the default devices.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.