Commit 6a6d047
Leverage __call__ impl of nn Module instead of calling forward on attention
Summary:
In the current llama transformer definition we explicitly invoke forward method on various attention impls. This prevents us from leveraging register_forward_hook which explicitly gets called only via __call__ override here https://github.com/pytorch/pytorch/blob/main/torch/nn/modules/module.py#L1781.
By removing explicit call to forward we enable hooks to appropriately execute
Created from CodeHub with https://fburl.com/edit-in-codehub
Differential Revision: D831560991 parent e252353 commit 6a6d047
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
0 commit comments