-
Notifications
You must be signed in to change notification settings - Fork 827
[ET-VK] Add alignment fields to PackedDimInfo for padded size calculation #17170
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
base: gh/SS-JIA/405/base
Are you sure you want to change the base?
Conversation
…tion This change introduces separate alignment fields to PackedDimInfo, decoupling the alignment used for padding tensor dimensions from the block size used for packing. Previously, `calculate_padded_sizes` used `packed_dim_block_size` and `outer_packed_dim_block_size` directly to determine how much to pad tensor dimensions. This works but limits flexibility - there are scenarios where we want to pad dimensions to a larger alignment than the block size for performance reasons, such as ensuring loads are aligned to cache lines or removing the need for bounds checking in shaders. The new fields `packed_dim_align` and `outer_packed_dim_align` allow specifying the alignment independently. For now, these are initialized to match the corresponding block sizes, preserving existing behavior. Future changes can set larger alignment values when beneficial for performance. Authored with Claude. Differential Revision: [D92196649](https://our.internmc.facebook.com/intern/diff/D92196649/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17170
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 2 PendingAs of commit 121a290 with merge base 477867a ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
…ize calculation" This change introduces separate alignment fields to PackedDimInfo, decoupling the alignment used for padding tensor dimensions from the block size used for packing. Previously, `calculate_padded_sizes` used `packed_dim_block_size` and `outer_packed_dim_block_size` directly to determine how much to pad tensor dimensions. This works but limits flexibility - there are scenarios where we want to pad dimensions to a larger alignment than the block size for performance reasons, such as ensuring loads are aligned to cache lines or removing the need for bounds checking in shaders. The new fields `packed_dim_align` and `outer_packed_dim_align` allow specifying the alignment independently. For now, these are initialized to match the corresponding block sizes, preserving existing behavior. Future changes can set larger alignment values when beneficial for performance. Authored with Claude. Differential Revision: [D92196649](https://our.internmc.facebook.com/intern/diff/D92196649/) [ghstack-poisoned]
Stack from ghstack (oldest at bottom):
This change introduces separate alignment fields to PackedDimInfo, decoupling
the alignment used for padding tensor dimensions from the block size used for
packing.
Previously,
calculate_padded_sizesusedpacked_dim_block_sizeandouter_packed_dim_block_sizedirectly to determine how much to pad tensordimensions. This works but limits flexibility - there are scenarios where we
want to pad dimensions to a larger alignment than the block size for
performance reasons, such as ensuring loads are aligned to cache lines or
removing the need for bounds checking in shaders.
The new fields
packed_dim_alignandouter_packed_dim_alignallow specifyingthe alignment independently. For now, these are initialized to match the
corresponding block sizes, preserving existing behavior. Future changes can
set larger alignment values when beneficial for performance.
Authored with Claude.
Differential Revision: D92196649