Skip to content

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]
Copy link

pytorch-bot bot commented Apr 21, 2025

🔗 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 Pending

As of commit 414c33e with merge base 6d28d61 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

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]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D73376717

Copy link
Contributor

@malfet malfet left a 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

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Apr 21, 2025
@malfet malfet added the topic: bc breaking topic category label Apr 21, 2025
@swolchok
Copy link
Contributor Author

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.

@swolchok swolchok added topic: not user facing topic category and removed topic: bc breaking topic category labels Apr 21, 2025
getBaseType() actually returns a reference. This was causing shared_ptr copies.

Differential Revision: [D73376717](https://our.internmc.facebook.com/intern/diff/D73376717/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D73376717

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #151805

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #151807

Divigroup-RAP pushed a commit to Divigroup-RAP/PYTORCH that referenced this pull request Apr 22, 2025
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]
@facebook-github-bot
Copy link
Contributor

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]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D73376717

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #151810

pytorchmergebot pushed a commit that referenced this pull request Apr 24, 2025
…()) (#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
pytorchmergebot pushed a commit that referenced this pull request Apr 24, 2025
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
pytorchmergebot pushed a commit that referenced this pull request Apr 24, 2025
…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
pytorchmergebot pushed a commit that referenced this pull request Apr 24, 2025
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
pytorchmergebot pushed a commit that referenced this pull request Apr 24, 2025
)

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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D73376717

pytorchmergebot pushed a commit that referenced this pull request Apr 25, 2025
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
pytorchmergebot pushed a commit that referenced this pull request Apr 25, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants