Extend reinplace pass to select_copy.int #15136
Open
+37
−138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
replace_view_copy_with_view.py
inbackends/aoti/passes
that replaces "view_copy" type ops (includingslice_copy
andselect_copy
) with their corresponding "view" ops for use in AOTInductor and CUDA backends. [1] [2] [3]replace_slice_copy_with_slice.py
) from bothbackends/apple/metal
andbackends/cuda
. [1] [2]Backend integration and API updates:
metal_backend.py
andcuda_backend.py
to import and use the newReplaceViewCopyWithViewPass
instead of the previous backend-specific implementations. [1] [2]slice_copy
andselect_copy
ops. [1] [2]