Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
print(f'Python {sys.version_info.major}.{sys.version_info.minor} detected.')
if sys.version_info[:2] < (3, 11):
import pkg_resources
# setuptools 66+ no longer supports Python 3.7, newer runtimes work with any recent version.
setuptools_req = 'setuptools>=45, <66' if sys.version_info[:2] < (3, 8) else 'setuptools>=45'
try:
pkg_resources.require(['pip>=18', 'setuptools>=45, <66'])
pkg_resources.require(['pip>=18', setuptools_req])
except (pkg_resources.VersionConflict, pkg_resources.DistributionNotFound):
print(
'\033[93mTry update pip/setuptools versions, for example, '
Expand Down
5 changes: 4 additions & 1 deletion superbench/runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ def __get_mode_command(self, benchmark_name, mode, timeout=None):
elif mode.name == 'torch.distributed':
# TODO: replace with torch.distributed.run in v1.9
# TODO: only supports node_num=1 and node_num=all currently
# For single-node runs use torchrun's standalone rendezvous, which binds a random free
# port instead of the fixed default (29500). This avoids transient EADDRINUSE failures
# when consecutive distributed benchmarks reuse the same rendezvous port.
torch_dist_params = (
'' if 'node_num' in mode and mode.node_num == 1 else
'--standalone ' if 'node_num' in mode and mode.node_num == 1 else
'--nnodes=$NNODES --node_rank=$NODE_RANK --master_addr=$MASTER_ADDR --master_port=$MASTER_PORT '
)

Expand Down
1 change: 1 addition & 0 deletions tests/runner/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def test_get_mode_command(self):
'expected_command': (
'torchrun '
'--no_python --nproc_per_node=8 '
'--standalone '
f'sb exec --output-dir {self.sb_output_dir} -c sb.config.yaml -C superbench.enable=foo '
'superbench.benchmarks.foo.parameters.distributed_impl=ddp '
'superbench.benchmarks.foo.parameters.distributed_backend=nccl'
Expand Down
Loading