-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
[Enhancement] New Callback event, before and after backward #3644
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
ci failed unrelated to the current notebook |
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.
Looks like you need to re-run this after fixing your cuda env
Could you update the Callback documentation to mention
|
@warner-benjamin |
That strikes me as an important thing to mention. |
This PR introduces a new Callback event:
after_backward
. This is designed so custom backward pass implementations can be used (such as accelerate).after_backwards
is the same asbefore_step
, but I opted to keep both because there isn't a clean way to combine the two into one without introducing too many changes.If a callback implements their own backward pass, they just need to attach a
RaiseBackwardException
in the implementation.cc @jph00