Skip to content

xe: fix strided destination handling - #5691

Open
rjoursler wants to merge 2 commits into
mainfrom
rjoursle/fix_strides
Open

xe: fix strided destination handling#5691
rjoursler wants to merge 2 commits into
mainfrom
rjoursle/fix_strides

Conversation

@rjoursler

Copy link
Copy Markdown
Contributor

Fixes MFDNN-15352.

Several GPU implementations operate on temporary buffers with the same layout as
the destination. These implementations relied on destination element count for
memory size calculations resulting in a GPU segfaults for strided destinations.

For testing, the matmul implementation will be covered by the upcoming generated
suite. This patch does not add any regression tests for the reference version as
the optimized implementations already pass.

Add a helper function to simplify size calculations for memory buffers with a
different types, but the same layout.
Several GPU implementations operate on temporary buffers with the same layout as
the destination. These implementations relied on destination element count for
memory size calculations resulting in a GPU segfaults for strided destinations.

For testing, the matmul implementation will be covered by the upcoming generated
suite. This patch does not add any regression tests for the reference version as
the optimized implementations already pass.
@rjoursler
rjoursler requested review from a team as code owners July 27, 2026 17:54
@github-actions github-actions Bot added platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel component:common labels Jul 27, 2026
@rjoursler

Copy link
Copy Markdown
Contributor Author

make test
disable test_device_cpu
enable test_device_gpu

@atkassen

Copy link
Copy Markdown
Contributor

While this fixes the segfaults, subbyte_pack now overwrites the strided region...

@rjoursler

Copy link
Copy Markdown
Contributor Author

While this fixes the segfaults, subbyte_pack now overwrites the strided region...

Agreed, it's not really clear to me what our requirements are in regards to this. I can't say I have ever seen a use case where there are partial updates to a buffer applied via strides, and we aren't exactly testing that these regions are maintained correctly, hence going with the "easy" solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:common platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants