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.
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
[Gradient Compression] Implement the original layerwise PowerSGD #49417
[Gradient Compression] Implement the original layerwise PowerSGD #49417
Changes from all commits
38ac665
8ea4faf
452ced1
9e60718
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Would it be reasonable to dedupe other use cases of this forking in grad compression to a helper function?
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.
Had the same feeling. However, in the first implementation, it has a loop in it:
for q in qs:
, between setting the manual seed and filling random values. It can be a bit tricky. Let me try to do it in a separate refactoring PR.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.
Is there a reason this isn't
fut.wait()
? Other calls seem to usefut.wait()
.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.
Good question!
wait()
is already called once in the precursor callback, in the return statement, and it should only be called once.value()
means just reading the value without blocking, and it's user's responsibility to ensure proper wait before retrieving the value.There is a recent PR that changed the semantics of value and wait. See: https://github.com/pytorch/pytorch/pull/48505/files#r532577873
I think I should change more
wait()
intovalue()
in the original PowerSGD implementation. Previously, these two functions are kind of equivalent on NCCL backend.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.
Should we test with the process_group being the entire world as well?
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.
I just followed some examples like
test_ddp_uneven_inputs_replicated_error
in the same file, and I didn't see it's necessary to testing both cases here.I can change
torch.distributed.new_group([0, 1])
tolist(range(0, dist.get_world_size()))
, or just usegroup, _, rank = self._init_global_test()
.I plan to rewrite the unit test in a separate PR, as mentioned in some other comments.