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

Bug: Fix Bug - Add barrier before 'destroy_process_group' in model benchmarks #198

Merged
merged 3 commits into from
Sep 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions superbench/runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __get_mode_command(self, benchmark_name, mode):
'--use_env --no_python --nproc_per_node={proc_num} '
'--nnodes={node_num} --node_rank=$NODE_RANK '
'--master_addr=$MASTER_ADDR --master_port=$MASTER_PORT '
'{command} {torch_distributed_suffix}'
'{command} {torch_distributed_suffix} {model_name}'
).format(
proc_num=mode.proc_num,
node_num=1 if mode.node_num == 1 else '$NNODES',
Expand All @@ -137,6 +137,8 @@ def __get_mode_command(self, benchmark_name, mode):
'superbench.benchmarks.{name}.parameters.distributed_impl=ddp '
'superbench.benchmarks.{name}.parameters.distributed_backend=nccl'
).format(name=benchmark_name),
model_name=('superbench.benchmarks.{name}.models=[{model}]'
).format(name=benchmark_name, model=mode.model_name)
)
elif mode.name == 'mpi':
mode_command = (
Expand Down Expand Up @@ -341,7 +343,10 @@ def run(self):
'proc_rank': proc_rank
}) for proc_rank in range(mode.proc_num)
)
elif mode.name == 'torch.distributed' or mode.name == 'mpi':
elif mode.name == 'torch.distributed':
for m in self._sb_benchmarks[benchmark_name].models:
self._run_proc(benchmark_name, mode, {'proc_rank': 0, 'model_name': m})
elif mode.name == 'mpi':
self._run_proc(benchmark_name, mode, {'proc_rank': 0})
else:
logger.warning('Unknown mode %s.', mode.name)
Expand Down