transformers
transformers copied to clipboard
Replace `-m torch.distributed.run` by `torchrun`
What does this PR do?
This PR replaces occurrences of -m torch.distributed.launch
(deprecated) and -m torch.distributed.run
(equivalent) by torchrun
. More information here.
Before submitting
- [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the contributor guideline, Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
- [ ] Did you write any new necessary tests?
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.
Just for reference, is there a reason why the previous occurence is deprecated? (not familiar with it!)
torchrun
is equivalent to python -m torch.distributed.run
while python -m torch.distributed.launch
is deprecated. I think the reason why it is deprecated is just that torchrun
does the same but also provides more functionalities.
I improved the description of this PR accordingly.
However torchrun
has only been available since the release of torch
1.10. I guess we want to keep compatibility with some previous versions of torch
right? @sgugger @ArthurZucker
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.