-
Notifications
You must be signed in to change notification settings - Fork 281
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
Implement _compute_intra_grad_corr_mean for gradient computation #1095
Conversation
Add ``is_scaled_loss`` flag to support both scaled / unscaled loss Fix ``test_grad_accum`` and``test_set_num_gradients_to_accumulate``
- Revert the changes in `step` method - Add a method `scale_grad_by_num_grads_to_accum`to handle gradient accumulation using unscaled loss more explicitly - Add gradient tests
Use ubuntu-20.04 to fix the `arch x64 not found` issue [Version 3.10 with arch x64 not found actions/setup-python#401](actions/setup-python#401)
Flake8 was moved to Github See discussions https://www.reddit.com/r/Python/comments/yvfww8/flake8_took_down_the_gitlab_repository_in_favor/
fairscale/optim/adascale.py
Outdated
@@ -449,6 +487,9 @@ def _final_callback(self) -> None: | |||
return | |||
|
|||
# Since self._local_grad_sqr is FP32, sum shouldn't overflow. | |||
|
|||
# TODO: Hongbo says param.grad might be FP16 should do this before converting to FP32. |
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.
this is a bit too sparse. Maybe you can expand this and provide more context?
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.
Thanks for working on this! I left some comments. If you need help on the CI errors, let me know. The code is in general very clean.
What does this PR do?
Implement
_compute_intra_grad_corr_mean
and testsThis utility function can be helpful for analyzing learning behavior.
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.