8000 [inductor] Clean typing in codegen/common.py and codecache.py by rec · Pull Request #150767 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[inductor] Clean typing in codegen/common.py and codecache.py #150767

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

Open
wants to merge 17 commits into
base: gh/rec/144/base
Choose a base branch
from

Conversation

[ghstack-poisoned]
Copy link
pytorch-bot bot commented Apr 7, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 862065e with merge base 1a722f6 (image):
💚 Looks good so far! There are no failures yet. 💚

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

rec added a commit that referenced this pull request Apr 7, 2025
ghstack-source-id: c2230ee
Pull Request resolved: #150767
@rec rec added the topic: not user facing topic category label Apr 7, 2025
rec added a commit to rec/pytorch that referenced this pull request Apr 7, 2025
ghstack-source-id: c2230ee
Pull Request resolved: pytorch#150767
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 7, 2025
ghstack-source-id: 185ec45
Pull Request resolved: #150767
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 7, 2025
ghstack-source-id: 983cc09
Pull Request resolved: #150767
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 7, 2025
@rec rec changed the title [inductor] Clean typing in codegen/common.py [inductor] Clean typing in codegen/common.py and codecache.py Apr 7, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 7, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 8, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 8, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 8, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 9, 2025
rec added a commit to rec/pytorch that referenced this pull request Apr 9, 2025
rec added a commit to rec/pytorch that referenced this pull request Apr 9, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 10, 2025
@rec rec marked this pull request as ready for review April 10, 2025 13:07
rec added a commit to rec/pytorch that referenced this pull request Apr 16, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 17, 2025
rec added a commit to rec/pytorch that referenced this pull request Apr 17, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 17, 2025
rec added a commit to rec/pytorch that referenced this pull request Apr 24, 2025
rec added a commit to rec/pytorch that referenced this pull request Apr 24, 2025
rec added a commit to rec/pytorch that referenced this pull request Apr 24, 2025
rec added a commit to rec/pytorch that referenced this pull request Apr 24, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 24, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Apr 28, 2025
@rec
Copy link
685C
Collaborator Author
rec commented May 12, 2025

@eellison oops, I realize I didn't have a reviewer for this, any suggestions?

[ghstack-poisoned]
rec added a commit that referenced this pull request May 12, 2025
@rec rec requested a review from aorenste May 14, 2025 09:52
Copy link
Contributor
@aorenste aorenste left a comment

Choose a reason for hiding this comment

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

What's the purpose for removing the "from future import annotations"? Is it "nice" or "necessary"?

I was kind of hoping we could avoid too much churning the code with this until we can drop support for 3.9 (likely end of this year) and officially support the new syntax (which would then revert a bunch of the changes in this PR).

@rec
Copy link
Collaborator Author
rec commented May 15, 2025

I was a bit ambiguous about this myself - I read this issue #117449 not too long after I started on pytorch, because someone dinged me for using from __future__ import annotations, so removing both those and top-level type ignores became my MO for fixing typing. (Also, Inductor at the time had trouble with | for Union, if I recall correctly.)

It would be the work of a moment to undo it! Let me know what you think and and I'll follow your lead. 🙂

@aorenste
Copy link
Contributor

I was a bit ambiguous about this myself - I read this issue #117449 not too long after I started on pytorch, because someone dinged me for using from __future__ import annotations, so removing both those and top-level type ignores became my MO for fixing typing. (Also, Inductor at the time had trouble with | for Union, if I recall correctly.)

It would be the work of a moment to undo it! Let me know what you think and and I'll follow your lead. 🙂

My current thinking is to not add any new ones, but not remove it unless it's necessary to avoid code churn (under the expectation that the "new" style will be preferred/required when we drop support for 3.9 later this year).

If you don't mind backing out those bits I think it would be better...

rec added a commit to rec/pytorch that referenced this pull request May 16, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request May 16, 2025
@rec
Copy link
Collaborator Author
rec commented May 16, 2025

@aorenste Not a trouble at all, done (and tests passing)! 🙂

86A9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0