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

-j vs --cpu/--gpu in ddp #737

Open
godfrey-cw opened this issue Jul 5, 2023 · 1 comment
Open

-j vs --cpu/--gpu in ddp #737

godfrey-cw opened this issue Jul 5, 2023 · 1 comment

Comments

@godfrey-cw
Copy link

📚 Documentation

Link

https://pytorch.org/torchx/latest/components/distributed.html

What does it currently say?

Not clear whether --cpu, --gpu arguments are overrided by -j arguments, although in my testing (launch then run top, etc.) it seems they are?

What should it say?

Both the docs and the --help output for dist.ddp could be more clear on this front. More generally, I am wondering if there exists a torchx equivalent of torchrun --standalone --nnodes=1 --nproc_per_node=auto ....

Why?

Clearly I wouldn't want --gpu=0 with -j 1x2, right? As such the listed defaults in docs --help are a little confusing.

@kiukchung
Copy link
Collaborator

You could try torchx run dist.spmd -j $NNODES (without specifying the $NPROC_PER_NODE part). See: https://github.com/pytorch/torchx/blob/main/torchx/components/dist.py#L130

This will autoset nproc_per_node to the number of GPUs specified in -h (named host). If you are running on an AWS instance you can use any of these named resources as the -h argument (https://github.com/pytorch/torchx/blob/main/torchx/specs/named_resources_aws.py#L191).
Otherwise there are some generic ones mapped here: https://github.com/pytorch/torchx/blob/main/torchx/specs/named_resources_generic.py#L47-L50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants