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

bugfix: correct node rank #19437

Merged
merged 5 commits into from
Feb 9, 2024
Merged

bugfix: correct node rank #19437

merged 5 commits into from
Feb 9, 2024

Conversation

cauyxy
Copy link
Contributor

@cauyxy cauyxy commented Feb 8, 2024

What does this PR do?

Corrected the logic of calculating rank from dividing by num_nodes to num_gpu_per_meachine

Fixes #19436

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • [ yes ] Is this pull request ready for review? (if not, please submit in draft mode)
  • [ yes ] Check that all items from Before submitting are resolved
  • [ yes ] Make sure the title is self-explanatory and the description concisely explains the PR
  • [ yes ] Add labels and milestones (and optionally projects) to the PR so it can be classified

📚 Documentation preview 📚: https://pytorch-lightning--19437.org.readthedocs.build/en/19437/

@cauyxy cauyxy requested a review from tchaton as a code owner February 8, 2024 18:01
@github-actions github-actions bot added the data (external) litdata package label Feb 8, 2024
@cauyxy
Copy link
Contributor Author

cauyxy commented Feb 8, 2024

I think this is a common problem that almost everyone who uses multiple machines and multiple cards for training will encounter. Should a quick fix be released?

@cauyxy cauyxy changed the title correct node rank bugfix: correct node rank Feb 8, 2024
@tchaton
Copy link
Contributor

tchaton commented Feb 9, 2024

Hey @cauyxy, great catch !

Would you mind adding a test ?

Best,
T.C

@cauyxy
Copy link
Contributor Author

cauyxy commented Feb 9, 2024

Hey @cauyxy, great catch !

Would you mind adding a test ?

Best, T.C

Just like the previous one, it might take me some time if I were to do it myself. Can you help me out?😊

@cauyxy
Copy link
Contributor Author

cauyxy commented Feb 9, 2024

i have added test for dist training when gpu_per_node > node_num

Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cauyxy. This is perfect ! This test fails on master and the fix is correct ! Thanks for your contribution !

Screenshot 2024-02-09 at 14 36 16

@mergify mergify bot added the ready PRs ready to be merged label Feb 9, 2024
@tchaton tchaton merged commit 7b867c7 into Lightning-AI:master Feb 9, 2024
56 checks passed
Borda pushed a commit that referenced this pull request Feb 12, 2024
(cherry picked from commit 7b867c7)
lexierule pushed a commit that referenced this pull request Feb 12, 2024
(cherry picked from commit 7b867c7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data (external) litdata package ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong node_rank caused index error
3 participants