-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix return type of TypeFactoryBase<c10::DynamicType>::get #151803
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
getBaseType() actually returns a reference. This was causing shared_ptr copies. Differential Revision: [D73376717](https://our.internmc.facebook.com/intern/diff/D73376717/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/151803
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 1 PendingAs of commit 414c33e with merge base 6d28d61 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D73376717 |
getBaseType() actually returns a reference. This was causing shared_ptr copies. Differential Revision: [D73376717](https://our.internmc.facebook.com/intern/diff/D73376717/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D73376717 |
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.
Sure, though I wonder if any of those should be technically BC-breaking
This is specifically changing from a copy of a singleton shared_ptr to a reference to said singleton shared_ptr, so I don't think so. |
getBaseType() actually returns a reference. This was causing shared_ptr copies. Differential Revision: [D73376717](https://our.internmc.facebook.com/intern/diff/D73376717/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D73376717 |
Starting merge as part of PR stack under #151805 |
Starting merge as part of PR stack under #151807 |
Pull Request resolved: pytorch/pytorch#151803 getBaseType() actually returns a reference. This was causing shared_ptr copies. ghstack-source-id: 279425431 @exported-using-ghexport Differential Revision: [D73376717](https://our.internmc.facebook.com/intern/diff/D73376717/)
…yBase<c10::DynamicType>::get" getBaseType() actually returns a reference. This was causing shared_ptr copies. Differential Revision: [D73376717](https://our.internmc.facebook.com/intern/diff/D73376717/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D73376717 |
getBaseType() actually returns a reference. This was causing shared_ptr copies. Differential Revision: [D73376717](https://our.internmc.facebook.com/intern/diff/D73376717/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D73376717 |
Starting merge as part of PR stack under #151810 |
…()) (#151804) Sadly, I can't just fix text() because that might cause lifetime issues in somebody's code. Differential Revision: [D73376715](https://our.internmc.facebook.com/intern/diff/D73376715/) Pull Request resolved: #151804 Approved by: https://github.com/zou3519, https://github.com/cyyever, https://github.com/Skylion007, https://github.com/malfet ghstack dependencies: #151801, #151802, #151803
Just some straightforward not-moving-upon-return. Differential Revision: [D73376718](https://our.internmc.facebook.com/intern/diff/D73376718/) Pull Request resolved: #151805 Approved by: https://github.com/malfet, https://github.com/cyyever ghstack dependencies: #151801, #151802, #151803, #151804
…151806) Looks like we are supposed to be using TypeFactory instead of direct creation everywhere that might run on mobile. Differential Revision: [D73376716](https://our.internmc.facebook.com/intern/diff/D73376716/) Pull Request resolved: #151806 Approved by: https://github.com/Skylion007, https://github.com/iseeyuan ghstack dependencies: #151801, #151802, #151803, #151804, #151805
Was seeing a small amount of shared_ptr traffic from these. The std::move(text) at the top is just a piggyback. Differential Revision: [D73376720](https://our.internmc.facebook.com/intern/diff/D73376720/) Pull Request resolved: #151807 Approved by: https://github.com/zou3519, https://github.com/cyyever, https://github.com/Skylion007 ghstack dependencies: #151801, #151802, #151803, #151804, #151805, #151806
) This makes the StringCordView iterator a variant holding either the existing implementation (when there is more than one piece) or a simple `std::string_view::iterator` (when there is only one piece). The latter seems to be significantly cheaper. Differential Revision: [D73379178](https://our.internmc.facebook.com/intern/diff/D73379178/) Pull Request resolved: #151810 Approved by: https://github.com/Skylion007 ghstack dependencies: #151801, #151802, #151803, #151804, #151805, #151806, #151807
This pull request was exported from Phabricator. Differential Revision: D73376717 |
We have test_jit.py, but given that I'm working on significant changes to the lexer, it seems nice to have direct C++ tests. (Also, writing the tests caught a pair of related bugs; see the two tests with "Bug" in their name. The rewrite will fix them.) Differential Revision: [D73402367](https://our.internmc.facebook.com/intern/diff/D73402367/) Pull Request resolved: #151849 Approved by: https://github.com/malfet ghstack dependencies: #151801, #151802, #151803, #151804, #151805, #151806, #151807, #151810
The trie-based approach was, apparently, not efficient. This incidentally fixes a bug where "not inp" and "is note" were lexed incorrectly; see test_lexer.cpp update. Differential Revision: [D73129443](https://our.internmc.facebook.com/intern/diff/D73129443/) Pull Request resolved: #151850 Approved by: https://github.com/Skylion007 ghstack dependencies: #151801, #151802, #151803, #151804, #151805, #151806, #151807, #151810, #151849
Stack from ghstack (oldest at bottom):
getBaseType() actually returns a reference. This was causing shared_ptr copies.
Differential Revision: D73376717