[ET-VK] Add alignment fields to PackedDimInfo for padded size calculation #17170
+116
−126
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.
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