Skip to content

[inductor] Add return types to functions named (_?)(is|has)_.* #155928

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 15 commits into
base: gh/rec/154/base
Choose a base branch
from

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jun 13, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 7de7764 with merge base ff0d56d (image):

NEW FAILURE - The following job has failed:

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

@facebook-github-bot facebook-github-bot added the module: rocm AMD GPU support for Pytorch label Jun 13, 2025
@rec rec added module: typing Related to mypy type annotations better-engineering Relatively self-contained tasks for better engineering contributors topic: not user facing topic category labels Jun 13, 2025
[ghstack-poisoned]
[ghstack-poisoned]
rec added a commit that referenced this pull request Jun 13, 2025
@ezyang
Copy link
Contributor

ezyang commented Jun 14, 2025

unsubbing as it is not correct

@rec
Copy link
Collaborator Author

rec commented Jun 14, 2025

Ah, sorry, @ezyang, I left it in draft, this was just to see how well an automatic script could do this... though I intend to clean it up and send it for review.

@@ -19,7 +19,7 @@
log = logging.getLogger(__name__)


def is_static_int(number):
def is_static_int(number) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

@@ -1592,7 +1592,7 @@ def unwrap_tensor(x: Union[TensorBox, ir.StorageBox]) -> ir.IRNode:

return x

def is_reduction(t):
def is_reduction(t) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def is_reduction(t) -> bool:
def is_reduction(t) -> TypeGuard[ir.ComputedBuffer]:

[ghstack-poisoned]
[ghstack-poisoned]
@rec
Copy link
Collaborator Author

rec commented Jun 15, 2025

@Skylion007 Took every suggestion!

[ghstack-poisoned]
rec added a commit that referenced this pull request Jun 16, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Jun 16, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Jun 17, 2025
@rec rec marked this pull request as ready for review June 17, 2025 13:57
@rec
Copy link
Collaborator Author

rec commented Jul 4, 2025

@Skylion007 Updated!

[ghstack-poisoned]
rec added a commit that referenced this pull request Jul 29, 2025
[ghstack-poisoned]
@rec rec changed the title [inductor] Add -> bool to functions named is_* or _is_* [inductor] Add return types to functions named (_?)(is|has)_.* Jul 29, 2025
rec added a commit that referenced this pull request Jul 29, 2025
@rec
Copy link
Collaborator Author

rec commented Jul 30, 2025

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/rec/154/orig onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/155928)

pytorchmergebot pushed a commit that referenced this pull request Jul 30, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Jul 30, 2025
@rec
Copy link
Collaborator Author

rec commented Aug 5, 2025

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot
Copy link
Collaborator

Rebase failed due to Command git -C /home/runner/work/pytorch/pytorch rebase refs/remotes/origin/viable/strict gh/rec/154/orig returned non-zero exit code 1

Rebasing (1/1)
Auto-merging torch/_inductor/codegen/cpp.py
Auto-merging torch/_inductor/codegen/simd.py
Auto-merging torch/_inductor/codegen/triton.py
Auto-merging torch/_inductor/codegen/wrapper.py
Auto-merging torch/_inductor/fx_passes/post_grad.py
Auto-merging torch/_inductor/kernel/flex/flex_attention.py
CONFLICT (content): Merge conflict in torch/_inductor/kernel/flex/flex_attention.py
Auto-merging torch/_inductor/kernel/mm.py
Auto-merging torch/_inductor/lowering.py
Auto-merging torch/_inductor/runtime/triton_helpers.py
Auto-merging torch/_inductor/runtime/triton_heuristics.py
error: could not apply 26f30848892... [inductor] Add return types to functions named (_?)(is|has)_.*
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Could not apply 26f30848892... # [inductor] Add return types to functions named (_?)(is|has)_.*

Raised by https://github.com/pytorch/pytorch/actions/runs/16750203924

[ghstack-poisoned]
rec added a commit that referenced this pull request Aug 5, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Aug 6, 2025
[ghstack-poisoned]
rec added a commit that referenced this pull request Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better-engineering Relatively self-contained tasks for better engineering contributors ciflow/inductor module: inductor module: rocm AMD GPU support for Pytorch module: typing Related to mypy type annotations open source topic: not user facing topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants