Skip to content

[BE][inductor] Apply PEP 604 type annotations (part 2/3)#175676

Closed
Lucaskabela wants to merge 2 commits intomainfrom
pep604-inductor-part2
Closed

[BE][inductor] Apply PEP 604 type annotations (part 2/3)#175676
Lucaskabela wants to merge 2 commits intomainfrom
pep604-inductor-part2

Conversation

@Lucaskabela
Copy link
Copy Markdown
Contributor

@Lucaskabela Lucaskabela commented Feb 24, 2026

Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from codegen/nv_universal_gemm/ through fx_passes/joint_graph.

Split branch with Claude.

See also #175675

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 24, 2026

🔗 Helpful Links

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

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

❌ 2 New Failures, 4 Unrelated Failures

As of commit 95d982f with merge base 319af8c (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 24, 2026

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@Lucaskabela
Copy link
Copy Markdown
Contributor Author

Quick note for reviewers:

  1. Usages of "Optional" and "Union" may still exist in some files after this change - we need to import future annotaiton to remove those. That will be handled in a later PR as this PR is already quite large

  2. We used ruff for this PR - claude was used to split a branch with all inductor changes into these 3 PRs which are more manageable

@Lucaskabela
Copy link
Copy Markdown
Contributor Author

@pytorchbot label "topic: not user facing"

@Lucaskabela
Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 26, 2026
@pytorchmergebot
Copy link
Copy Markdown
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

pytorchmergebot pushed a commit that referenced this pull request Feb 26, 2026
Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from fx_passes/misc_patterns through wrapper_benchmark.

Split with Claude.

See also #175675 and #175676

Pull Request resolved: #175677
Approved by: https://github.com/v0i0
@albanD
Copy link
Copy Markdown
Collaborator

albanD commented Feb 26, 2026

@pytorchbot revert -m "Breaks lint in trunk" -c nosignal

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

pytorchmergebot added a commit that referenced this pull request Feb 26, 2026
…5676)"

This reverts commit 282eca2.

Reverted #175676 on behalf of https://github.com/albanD due to Breaks lint in trunk ([comment](#175676 (comment)))
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@Lucaskabela your PR has been successfully reverted.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Feb 26, 2026
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

pytorchmergebot added a commit that referenced this pull request Feb 27, 2026
…5676)"

This reverts commit fa1ac62.

Reverted #175676 on behalf of https://github.com/jeanschmidt due to Need to revert in order to revert #175555 - see [D94699653](https://www.internalfb.com/diff/D94699653) ([comment](#175676 (comment)))
@pytorchmergebot
Copy link
Copy Markdown
Collaborator

@Lucaskabela your PR has been successfully reverted.

@Lucaskabela
Copy link
Copy Markdown
Contributor Author

@pytorchmergebot merge

@pytorchmergebot
Copy link
Copy Markdown
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

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (distributed, 1, 3, lf.linux.g4dn.12xlarge.nvidia.gpu)

Details for Dev Infra team Raised by workflow job

@Lucaskabela
Copy link
Copy Markdown
Contributor Author

@pytorchmergebot merge -i

@pytorchmergebot
Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-rocm-py3.10 / test (distributed, 1, 3, linux.rocm.gpu.gfx950.4)

Details for Dev Infra team Raised by workflow job

@Lucaskabela
Copy link
Copy Markdown
Contributor Author

@pytorchmergebot merge -i

pytorchmergebot pushed a commit that referenced this pull request Mar 2, 2026
Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from fx_passes/misc_patterns through wrapper_benchmark.

Split with Claude.

See also #175675 and #175676

Pull Request resolved: #175677
Approved by: https://github.com/v0i0
postmath pushed a commit to postmath/pytorch that referenced this pull request Mar 3, 2026
)

Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from fx_passes/misc_patterns through wrapper_benchmark.

Split with Claude.

See also pytorch#175675 and pytorch#175676

Pull Request resolved: pytorch#175677
Approved by: https://github.com/v0i0
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
)

Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from fx_passes/misc_patterns through wrapper_benchmark.

Split with Claude.

See also pytorch#175675 and pytorch#175676

Pull Request resolved: pytorch#175677
Approved by: https://github.com/v0i0
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
)

Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from codegen/nv_universal_gemm/ through fx_passes/joint_graph.

Split branch with Claude.

See also pytorch#175675

Pull Request resolved: pytorch#175676
Approved by: https://github.com/v0i0
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
)

Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from codegen/nv_universal_gemm/ through fx_passes/joint_graph.

Split branch with Claude.

See also pytorch#175675

Pull Request resolved: pytorch#175676
Approved by: https://github.com/v0i0, https://github.com/fxdawnn
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
)

Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from codegen/nv_universal_gemm/ through fx_passes/joint_graph.

Split branch with Claude.

See also pytorch#175675

Pull Request resolved: pytorch#175676
Approved by: https://github.com/v0i0, https://github.com/fxdawnn
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
)

Convert Union[X, Y] to X | Y and Optional[X] to X | None using ruff rules UP007 and UP045 in torch/_inductor. This covers files from fx_passes/misc_patterns through wrapper_benchmark.

Split with Claude.

See also pytorch#175675 and pytorch#175676

Pull Request resolved: pytorch#175677
Approved by: https://github.com/v0i0
@github-actions github-actions Bot deleted the pep604-inductor-part2 branch March 31, 2026 02:23
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.

6 participants