Skip to content

[compiler] Guard write linearization#1095

Merged
willghatch merged 2 commits intomainfrom
users/willghatch/streamk-xfail-fix
Mar 24, 2026
Merged

[compiler] Guard write linearization#1095
willghatch merged 2 commits intomainfrom
users/willghatch/streamk-xfail-fix

Conversation

@willghatch
Copy link
Contributor

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.

…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>
@willghatch willghatch force-pushed the users/willghatch/streamk-xfail-fix branch from 81ac23b to 428a5c9 Compare March 16, 2026 16:43
@willghatch
Copy link
Contributor Author

@harsh-nod ping, I resolved the review issue.

@willghatch willghatch merged commit 583f4b1 into main Mar 24, 2026
19 checks passed
@willghatch willghatch deleted the users/willghatch/streamk-xfail-fix branch March 24, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants