Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove multi processing spawn process to avoid conflict with torch.dist.launch #1675

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pcdet/utils/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,13 @@ def init_dist_slurm(tcp_port, local_rank, backend='nccl'):


def init_dist_pytorch(tcp_port, local_rank, backend='nccl'):
if mp.get_start_method(allow_none=True) is None:
mp.set_start_method('spawn')
# Un-commenting mp spawn below will lead to high variance in GPU usage across devices
# Also, dataloader initialization will lead to huge GPU:0 usage
# Because only one of torch.distributed.launch OR torch.multiprocessing
# is needed for correctly scheduling multi-gpu training. dist_train.sh already uses the former
# if mp.get_start_method(allow_none=True) is None:
# mp.set_start_method('spawn')

# os.environ['MASTER_PORT'] = str(tcp_port)
# os.environ['MASTER_ADDR'] = 'localhost'
num_gpus = torch.cuda.device_count()
Expand Down