Skip to content

[ET-VK] Adding repeat support to add_copy_packed_dim_offset_node function. #9414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 27, 2025

Conversation

trivedivivek
Copy link
Contributor

@trivedivivek trivedivivek commented Mar 19, 2025

Stack from ghstack (oldest at bottom):

This diff adds support for the repeat operation in add_copy_packed_dim_offset_node function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

copy_packed_dim_offset shader now has 2 functions repeat_copy and no_repeat_copy which are chosen based on specialization constant parameter.
no_repeat_copy function has the legacy copy code.
repeat_copy function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants src_offset and dst_offset contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.

Differential Revision: D71477552

…tion.

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)

[ghstack-poisoned]
@trivedivivek trivedivivek requested a review from SS-JIA as a code owner March 19, 2025 22:48
Copy link

pytorch-bot bot commented Mar 19, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit baa239b with merge base 976fe48 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71477552

…t_node function."

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71477552

…t_node function."

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71477552

…t_node function."

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)

[ghstack-poisoned]
trivedivivek added a commit that referenced this pull request Mar 25, 2025
…tion.

Pull Request resolved: #9414

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.
ghstack-source-id: 274029961
@exported-using-ghexport

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71477552

…t_node function."

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)

[ghstack-poisoned]
trivedivivek added a commit that referenced this pull request Mar 26, 2025
…tion.

Pull Request resolved: #9414

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.
ghstack-source-id: 274311810
@exported-using-ghexport

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71477552

…t_node function."

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)

[ghstack-poisoned]
trivedivivek added a commit that referenced this pull request Mar 27, 2025
…tion.

Pull Request resolved: #9414

This diff adds support for the repeat operation in `add_copy_packed_dim_offset_node` function in the Vulkan backend for Executorch. The function now takes an additional boolean parameter, "repeat", which indicates whether the copy should wrap around the tensor dimension.

`copy_packed_dim_offset` shader now has 2 functions `repeat_copy` and `no_repeat_copy` which are chosen based on specialization constant parameter.
`no_repeat_copy` function has the legacy copy code.
`repeat_copy` function reads input tensor's dim based on output pos and wraps it according to WHCB repetitions.

Push constants `src_offset` and `dst_offset` contains source and destination's WHCB dimensions (and not copy offsets) respectively, when calling repeat function.
ghstack-source-id: 274452675
@exported-using-ghexport

Differential Revision: [D71477552](https://our.internmc.facebook.com/intern/diff/D71477552/)
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71477552

@facebook-github-bot facebook-github-bot merged commit 7c41a5b into gh/trivedivivek/67/base Mar 27, 2025
83 checks passed
@facebook-github-bot facebook-github-bot deleted the gh/trivedivivek/67/head branch March 27, 2025 16:23
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. fb-exported topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants