Skip to content

[BE][inductor] Apply PEP 604 type annotations (part 1/3)#175675

Closed
Lucaskabela wants to merge 1 commit intomainfrom
pep604-inductor-part1
Closed

[BE][inductor] Apply PEP 604 type annotations (part 1/3)#175675
Lucaskabela wants to merge 1 commit intomainfrom
pep604-inductor-part1

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 analysis/ through codegen/nv_universal_gemm/.

Split branch with Claude.

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/175675

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 1403202 with merge base 2931704 (image):

BROKEN TRUNK - The following job 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.

@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

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
analysis/ through codegen/nv_universal_gemm/.

Authored with Claude.
@Lucaskabela Lucaskabela force-pushed the pep604-inductor-part1 branch from 382bf7c to 1403202 Compare February 25, 2026 17:40
@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 25, 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

postmath pushed a commit to postmath/pytorch 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 analysis/ through codegen/nv_universal_gemm/.

Split branch with Claude.

Pull Request resolved: pytorch#175675
Approved by: https://github.com/PaulZhang12, https://github.com/karthickai
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
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 codegen/nv_universal_gemm/ through fx_passes/joint_graph.

Split branch with Claude.

See also #175675

Pull Request resolved: #175676
Approved by: https://github.com/v0i0
pytorchmergebot pushed a commit that referenced this pull request Feb 27, 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

Pull Request resolved: #175676
Approved by: https://github.com/v0i0, https://github.com/fxdawnn
pytorchmergebot pushed a commit that referenced this pull request Feb 28, 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

Pull Request resolved: #175676
Approved by: https://github.com/v0i0, https://github.com/fxdawnn
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
@github-actions github-actions Bot deleted the pep604-inductor-part1 branch March 28, 2026 02:23
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 analysis/ through codegen/nv_universal_gemm/.

Split branch with Claude.

Pull Request resolved: pytorch#175675
Approved by: https://github.com/PaulZhang12, https://github.com/karthickai
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
)

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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants