[train] group consecutive workers by IP #38490
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Some libraries (e.g. Deepspeed) may have expectations that consecutive global rank workers will have the same ordering of local ranks.
In general, this should also make debugging things slightly easier.
Logic
For now, I did the simplest implementation which is to retain the original sequencing of IPs (i.e. node rank), and group the IPs together.
This extends existing logic which moves existing logic which moves workers from the Driver IP to the front of the list. Based on this existing, I assuming that moving workers around here is generally safe. The
"LOCAL_RANK"
and (world)"RANK"
will be calculated from the final list.Note: This logic can be extended in the future if new requirements come up, e.g. if the IPs need to be sorted by a certain order.
Related issue number
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.