Skip to content

Commit

Permalink
[Enhance] Support CPU-only train and test in slurm cluster (open-mmla…
Browse files Browse the repository at this point in the history
  • Loading branch information
GhaSiKey committed Jan 4, 2023
1 parent ff137cc commit 706e5ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions mim/commands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,8 @@ def test(

# If launcher == "slurm", must have following args
if launcher == 'slurm':
msg = ('If launcher is slurm, '
'gpus, gpus-per-node and partition should not be None')
flag = (gpus_per_node
is not None) and (partition is not None) and (gpus is not None)
msg = 'If launcher is slurm, partition should not be None'
flag = partition is not None
assert flag, msg

if not is_installed(package):
Expand Down
5 changes: 2 additions & 3 deletions mim/commands/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ def train(

# If launcher == "slurm", must have following args
if launcher == 'slurm':
msg = ('If launcher is slurm, '
'gpus-per-node and partition should not be None')
flag = (gpus_per_node is not None) and (partition is not None)
msg = 'If launcher is slurm, partition should not be None'
flag = partition is not None
assert flag, msg

if port is None:
Expand Down

0 comments on commit 706e5ee

Please sign in to comment.