-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Avoid grad_fn getting garbage collected in multihooks #102175
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
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/102175
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8c789e3: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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 makes sense to me! Feel free to wait for @albanD's review.
self.handles = handles | ||
self.grad_fns: Optional[Tuple] = grad_fns |
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.
Regarding Optional[Tuple]
typing, when can grad_fns
be None
?
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.
Whoops I meant to set it to None in remove
, good catch
[ghstack-poisoned]
@awgu this is probably correct, but from discussion with Alban, we probably just want to fix the underlying issue (should be a one line fix). I added a comment on the issue. |
Oh okay, so will we still land this PR or will there be a separate PR with the proper fix? |
Yeah separate PR, closing this one |
Stack from ghstack (oldest at bottom):
Workaround for #102174