Skip to content

Conversation

…s.cache

In addition to being more code, the manual cache was doing an extra dictionary lookup on each cache hit.

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 22, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161286

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit fe95fdf with merge base ffa1ce7 (image):
💚 Looks good so far! There are no failures yet. 💚

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

swolchok added a commit that referenced this pull request Aug 22, 2025
…s.cache

In addition to being more code, the manual cache was doing an extra dictionary lookup on each cache hit.

ghstack-source-id: 20c6572
Pull Request resolved: #161286
…th functools.cache"

In addition to being more code, the manual cache was doing an extra dictionary lookup on each cache hit.

[ghstack-poisoned]
…th functools.cache"

In addition to being more code, the manual cache was doing an extra dictionary lookup on each cache hit.

[ghstack-poisoned]

# Given an OpOverload, returns schema information on it.
# This is cached for efficiency, since it can involve running torchgen
@functools.cache
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for my education- is this purely a "its more idiomatic this way" thing or is this faster too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for my education- is this purely a "its more idiomatic this way" thing or is this faster too?

both -- functools.cache does only one lookup. It's pretty neat, check it out

…th functools.cache"

In addition to being more code, the manual cache was doing an extra dictionary lookup on each cache hit.

[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 26, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pdesupinski pushed a commit that referenced this pull request Aug 27, 2025
…s.cache (#161286)

In addition to being more code, the manual cache was doing an extra dictionary lookup on each cache hit.
Pull Request resolved: #161286
Approved by: https://github.com/wconstab
pytorchmergebot pushed a commit that referenced this pull request Aug 29, 2025
…161300)

Shouldn't be any generated code impact, just fixing bad practice.

Pull Request resolved: #161300
Approved by: https://github.com/wconstab, https://github.com/malfet
ghstack dependencies: #161286
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…s.cache (pytorch#161286)

In addition to being more code, the manual cache was doing an extra dictionary lookup on each cache hit.
Pull Request resolved: pytorch#161286
Approved by: https://github.com/wconstab
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…ytorch#161300)

Shouldn't be any generated code impact, just fixing bad practice.

Pull Request resolved: pytorch#161300
Approved by: https://github.com/wconstab, https://github.com/malfet
ghstack dependencies: pytorch#161286
mansiag05 pushed a commit to mansiag05/pytorch that referenced this pull request Sep 22, 2025
…ytorch#161300)

Shouldn't be any generated code impact, just fixing bad practice.

Pull Request resolved: pytorch#161300
Approved by: https://github.com/wconstab, https://github.com/malfet
ghstack dependencies: pytorch#161286
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 Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants