[compiler] Guard write linearization#1095
Merged
willghatch merged 2 commits intomainfrom Mar 24, 2026
Merged
Conversation
harsh-nod
reviewed
Mar 11, 2026
…l layout Fixes the xfail tests for streamk. Commit 3865d26 introduced unconditional linearization of global-memory writes, but the linearized offsets are computed from symbolic strides (strides_from_symbolic_shape) which can differ from the physical layout strides. Memories with an explicit MemoryLayout -- such as the streamK partial_buffer with symbolic shape (38912, M=2048, N=2048) but physical shape (38912, 128, 256) -- got incorrect linear offsets, causing out-of-bounds writes and data corruption on larger shapes. Add _symbolic_strides_match_physical() to skip write linearization when the memory's physical_layout shape differs from its symbolic shape, falling back to correct multi-dimensional stores. Signed-off-by: William G Hatch <william@hatch.uno>
Signed-off-by: William G Hatch <william@hatch.uno>
81ac23b to
428a5c9
Compare
Contributor
Author
|
@harsh-nod ping, I resolved the review issue. |
harsh-nod
approved these changes
Mar 24, 2026
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 the xfail tests for streamk.
Commit 3865d26 introduced unconditional linearization of global-memory writes, but the linearized offsets are computed from symbolic strides (strides_from_symbolic_shape) which can differ from the physical layout strides. Memories with an explicit MemoryLayout -- such as the streamK partial_buffer with symbolic shape (38912, M=2048, N=2048) but physical shape (38912, 128, 256) -- got incorrect linear offsets, causing out-of-bounds writes and data corruption on larger shapes. Add _symbolic_strides_match_physical() to skip write linearization when the memory's physical_layout shape differs from its symbolic shape, falling back to correct multi-dimensional stores.