-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[distributed_launch] Add --no_python flag #29144
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
Conversation
Allows you to use a bash script wrapper in-between launch and your
training script. e.g.
```
python -m torch.distributed.launch --nproc_per_node=8 --no_python --use_env \
bash -c 'exec numactl --cpunodebind=$(( LOCAL_RANK / 4 )) "$@"' -- \
python train.py ...
```
|
Thanks, @lukeyeager. Looks good to me. It's unfortunate that the tool is becoming a pile of backward compat hacks, though. I think a next version of this thing would 1) never prepend Python, and 2) always use the environment. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pietern is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Temporary workaround 😁 python -m torch.distributed.launch --nproc_per_node=8 --use_env -- -c \
"import os, sys, subprocess; \
ret = subprocess.run(['numactl', '--cpunodebind={}'.format(int(int(os.environ['LOCAL_RANK'])/4)), *sys.argv[1:]]); \
sys.exit(ret.returncode)" python train.py ...@pietern Thoughts on the more serious proposals above? |
|
Thanks for investigating, @lukeyeager. Unfortunate that we can't have a bool option in argparse... I like the second option best: a Regarding a v2, we could create a parallel tool called |
Great! Done.
I don't really have any feelings about that. I haven't been using pytorch much so I don't have much context. I do know there's already |
They are complementary. You might be thinking of
We could have some kind of Thanks for updating the PR. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pietern is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Allows you to use a bash script wrapper in-between launch and your
training script. e.g.