-
Notifications
You must be signed in to change notification settings - Fork 564
[ET-VK] De vectorise all vectors in conv2d pw shader to improve perf. #11189
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
Conversation
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
Pull Request resolved: #11108 This diff optimizes the performance of the `conv2d_pw` shader by de-vectorizing its implementation. * The original vectorized implementation of the `conv2d_pw` shader has been replaced with a de-vectorized approach to improve performance. * The `sum` array has been redefined to hold `float` values instead of `vec4` to accommodate the de-vectorized computation. These changes seem to allow shader compiler to better optimize operations within the shader hence improving perf. ghstack-source-id: 286652100 @exported-using-ghexport Differential Revision: [D75307267](https://our.internmc.facebook.com/intern/diff/D75307267/)
Pull Request resolved: #11110 This diff removes the use of shared memory in the conv2d pw (pointwise) operation to improve performance. ghstack-source-id: 286652103 Differential Revision: [D75316188](https://our.internmc.facebook.com/intern/diff/D75316188/)
Pull Request resolved: #11112 This diff tunes the tile size for the conv 2d pw op to improve performance. The changes include updating the `TILE_SIZE_X` and `TILE_SIZE_Y` values in the `conv2d_pw.yaml` files and modifying the `Convolution.cpp` files to adjust the image extents calculation. The `TILE_SIZE_X` value is changed from 2 to 1, and the `TILE_SIZE_Y` value is changed from 2 to 4. ghstack-source-id: 286652109 Differential Revision: [D75317820](https://our.internmc.facebook.com/intern/diff/D75317820/)
Pull Request resolved: #11113 The diff introduces minor tuning for the Conv2d pointwise (PW) operation in the Vulkan backend to improve performance. Conv 2d pw now issues a 2D dispatch instead of 1D, where dispatch axis y is now sized based on output texture's batch size. ghstack-source-id: 286652099 Differential Revision: [D75251145](https://our.internmc.facebook.com/intern/diff/D75251145/)
Pull Request resolved: #11122 This improves the performance of the conv2d pw shader by de-vectorizing position storage. The optimization involved replacing the `ivec3 pos` array with a plain `int pos` array to store the position values. The `x` and `y` coordinates are now stored in separate elements of the array instead of being stored together in an `ivec3`. This change allows for more efficient memory access and computation. ghstack-source-id: 286652097 @exported-using-ghexport Differential Revision: [D75335802](https://our.internmc.facebook.com/intern/diff/D75335802/)
Pull Request resolved: #11134 This diff provides a minor unroll tuning to improve the performance of the conv2d pointwise (pw) operation in the Executorch Vulkan backend. ghstack-source-id: 286652101 @exported-using-ghexport Differential Revision: [D75420510](https://our.internmc.facebook.com/intern/diff/D75420510/)
…ove performance. Pull Request resolved: #11135 This diff adjusts the local workgroup size (`local_wg_size`) based on batch count (stored in `wg_size[1]`), to improve conv2d pw performance. * If `wg_size[1]` is a multiple of 8, `local_wg_size_y` is set to 8. * If `wg_size[1]` is a multiple of 4, `local_wg_size_y` is set to 4. * If `wg_size[1]` is a multiple of 2, `local_wg_size_y` is set to 2. * Otherwise, we default to `local_wg_size_y` = 1. The dispatch size in 2 dimensions is then calculate based on `{64 / local_wg_size_y, local_wg_size_y, 1}`. ghstack-source-id: 286652105 @exported-using-ghexport Differential Revision: [D75420517](https://our.internmc.facebook.com/intern/diff/D75420517/)
Pull Request resolved: #11136 This diff improves the performance of the conv2d pw shader by de-vectorizing all vectors. ghstack-source-id: 286652098 @exported-using-ghexport Differential Revision: [D75423245](https://our.internmc.facebook.com/intern/diff/D75423245/)
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11189
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3a5cf6e with merge base 11f8f4a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
trivedivivek
approved these changes
May 28, 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: vulkan
Changes to the Vulkan backend delegate
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 PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #11136 by @trivedivivek
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/trivedivivek/96/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/trivedivivek/96/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/trivedivivek/95/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/trivedivivek/96/orig
@diff-train-skip-merge