-
Notifications
You must be signed in to change notification settings - Fork 24.7k
[PyTorch][JIT] Don't refcount Type singletons #69579
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
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 5eb65da (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slow For more information, please take a look at the CI Flow Wiki. |
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 145056617 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/)
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 145145357 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/)
Should I review? Tests look sadge |
you can still review for broad direction. blocking on tests slows down the process. |
Looks like there's some kind of CUDA build failure I don't understand (can we not do explicit destructor calls in CUDA? why is this code getting built for CUDA anyway?), and I have to patch the Python bridging stuff for the new classes. |
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 145671620 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/)
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 145771095 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/)
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 145793691 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/)
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 145813052 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/)
aten/src/ATen/core/type_ptr.h
Outdated
// Without SharedPtrWrapper, this line would read | ||
// `shared_.~shared_ptr()` and nvcc would complain with | ||
// "error: expected primary-expression before '>' token" | ||
// referring to the "t" in "shared_ptr". SharedPtrWrapper | ||
// exists to work around this compiler bug. | ||
shared_.~SharedPtrWrapper(); |
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.
CC @zasdfgbnm
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.
cc @ptrblck
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 145875239 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D32923880/)!
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 146468426 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D32923880/)!
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 146558363 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D32923880/)!
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) [ghstack-poisoned]
Pull Request resolved: #69579 This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem. ghstack-source-id: 146643993 Differential Revision: [D32923880](https://our.internmc.facebook.com/intern/diff/D32923880/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D32923880/)!
I've conservatively labeled this bc-breaking because it is possible for it to cause compile errors in downstream code that tried to use std::dynamic_pointer_cast on TypePtrs instead of going through the Type::cast API. I ran into one example of this internally and the fix was to just use Type::cast. |
Stack from ghstack:
This should help us avoid reference counting overhead on singleton Type subclasses without a major rewrite of the Type subsystem.
Differential Revision: D32923880
cc @ezyang @gchanan