Skip to content

Conversation

larryliu0820
Copy link
Contributor

@larryliu0820 larryliu0820 commented Oct 14, 2025

This pull request refactors and centralizes the logic for replacing "view_copy" operations with "view" operations in the graph transformation passes for both the AOTInductor and CUDA backends. The main change is the creation of a unified pass in backends/aoti/passes/replace_view_copy_with_view.py, which replaces the previous backend-specific implementations and expands support to additional ops. The backend code is updated to use this new shared pass, and redundant files are removed.

Pass refactoring and centralization:

  • Created a new unified pass replace_view_copy_with_view.py in backends/aoti/passes that replaces "view_copy" type ops (including slice_copy and select_copy) with their corresponding "view" ops for use in AOTInductor and CUDA backends. [1] [2] [3]
  • Removed the old backend-specific pass files (replace_slice_copy_with_slice.py) from both backends/apple/metal and backends/cuda. [1] [2]

Backend integration and API updates:

  • Updated both metal_backend.py and cuda_backend.py to import and use the new ReplaceViewCopyWithViewPass instead of the previous backend-specific implementations. [1] [2]
  • Modified the preprocessing step in both backends to apply the new pass, which now handles both slice_copy and select_copy ops. [1] [2]

Copy link

pytorch-bot bot commented Oct 14, 2025

🔗 Helpful Links

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

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

❌ 1 Cancelled Job

As of commit 30bb879 with merge base bb4f7ae (image):

CANCELLED JOB - The following job was cancelled. Please retry:

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

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 14, 2025
Copy link
Contributor

@Gasoonjia Gasoonjia left a comment

Choose a reason for hiding this comment

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

LGTM! Thansk for the work!

@larryliu0820 larryliu0820 added the release notes: desktop for desktop/laptop workstream label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: desktop for desktop/laptop workstream

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants