[ET-VK] Tag tensors in list args that mix None entries - #22664
Open
Sanjays2402 wants to merge 1 commit into
Open
[ET-VK] Tag tensors in list args that mix None entries#22664Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22664
Note: Links to docs will display an error until the docs builds have been completed.
|
|
|
Author
|
@pytorchbot label "release notes: none" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #22510
Summary
TagMemoryMetaPassskipped any list argument that was not composed entirely of tensor nodes.aten.index.Tensorreaches the edge dialect asindex.Tensor(x, [None, idx]), so the index tensor never received a storage/memory-layout representation, and any op implementation asserting on the layout of that tensor would fail.Changes
backends/vulkan/utils.py: addedtensor_nodes_in_arg(), which returns the tensor nodes of an argument while skippingNoneentries.backends/vulkan/_passes/tag_memory_meta_pass.py: use the helper everywhere the pass walks a list argument —set_arg_node_repr_or_transitionskipsNoneentries when tagging list args,is_non_constant_tensor_nodeaccepts lists whose non-Noneentries are all non-constant tensor nodes,get_arg_tensor_source_repset/constrain_op_arg_repsetuse the first tensor node of a list as the representative instead ofarg[0](which could beNone),constrain_op_repsetsnow constrains args that contain at least one tensor node.Lists composed entirely of tensors behave exactly as before.
backends/vulkan/test/test_vulkan_passes.py: regression test exportingx[:, idx](withidxa graph input) and asserting the pass tags the index tensor node.Test evidence
main(897fc8e): afterTagMemoryMetaPass, theidxnode inindex.Tensor(x, [None, idx])had nonode_repr. With this fix it is tagged (BUFFER/TENSOR_WIDTH_PACKED, matching the index op's storage requirement for higher-rankself).python -m unittest executorch.backends.vulkan.test.test_vulkan_passes: 12 tests, all pass, including the newtest_tag_memory_meta_pass_tags_tensor_in_mixed_none_list(verified it fails on unmodified code).black --checkandflake8 --select=E9,Fclean on all touched files.This PR was authored with AI assistance (Muse).