Skip to content

Commit

Permalink
fix: dmlrun
Browse files Browse the repository at this point in the history
  • Loading branch information
sehoffmann committed Dec 16, 2024
1 parent 6e6f6d0 commit 8cde987
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pip install git+https://github.com/tangentlabs/django-oscar-paypal.git@issue/34/
See [examples/barebone_mnist.py](https://github.com/sehoffmann/dmlcloud/blob/develop/examples/barebone_mnist.py) for a minimal and barebone example on how to distributely train MNIST.
To run it on a single node with 4 GPUs, use
```
dmlrun -n 4 examples/barebone_mnist.py
dmlrun -n 4 python examples/barebone_mnist.py
```

`dmlrun` is a thin wrapper around `torchrun` that makes development work on a single node easier.
Expand Down
3 changes: 2 additions & 1 deletion dmlcloud/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def main():

args = parser.parse_args()

if args.gpus and args.num_gpus:
if args.gpus and args.nprocs:
raise ValueError('Only one of --gpus or --num-gpus can be specified.')

if args.gpus:
Expand All @@ -63,6 +63,7 @@ def main():
'--standalone',
'--nproc_per_node',
f'{nprocs}',
'--no-python',
]

cmdline += [args.script] + args.args
Expand Down

0 comments on commit 8cde987

Please sign in to comment.