-
Notifications
You must be signed in to change notification settings - Fork 715
[Pytorch] Add get_backward_dw_params api for TE module #2614
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
Changes from all commits
5dfe8c1
5c37536
49a9e2f
d5fe8a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1526,8 +1526,14 @@ def backward_dw(self): | |
| bias_tensor.grad = bgrad.to(bias_tensor.dtype) | ||
| del wgrad | ||
| del bgrad | ||
| for wgrad_accumulation_and_reduce_hook in self.wgrad_accumulation_and_reduce_hooks: | ||
| wgrad_accumulation_and_reduce_hook() | ||
| self._trigger_wgrad_accumulation_and_reduce_hooks() | ||
|
|
||
| def _trigger_wgrad_accumulation_and_reduce_hooks(self): | ||
| """ | ||
| Trigger the wgrad accumulation and reduce hooks. | ||
| """ | ||
| for wgrad_accumulation_and_reduce_hook in self.wgrad_accumulation_and_reduce_hooks: | ||
| wgrad_accumulation_and_reduce_hook() | ||
|
Comment on lines
+1531
to
+1536
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unconditional hook trigger
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These hooks are specific to Megatron-LM. They are delicate interfaces for expert users. |
||
|
|
||
| def is_debug_iter(self) -> bool: | ||
| """ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.