Skip to content

Conversation

@ElaineBao
Copy link
Contributor

Description

MFDNN-14395 reported a correctness issue for SDPA when the mask add is having a non-contiguous strides (shape: 1x1x1024x1024, strides:1049600x1049600x1025x1). Currently benchdnn graph doesn't support such case's validation (segfault). This PR aims to fix this.

@ElaineBao ElaineBao self-assigned this Dec 1, 2025
@ElaineBao ElaineBao requested a review from a team as a code owner December 1, 2025 08:27
@ElaineBao ElaineBao added the component:graph-api Codeowner: @oneapi-src/onednn-graph label Dec 1, 2025
@ElaineBao ElaineBao requested a review from a team as a code owner December 1, 2025 08:27
@github-actions github-actions bot added the component:tests Codeowner: @oneapi-src/onednn-arch label Dec 1, 2025
, ctx_exe(ctx_exe)
, impl_filter(impl_filter) {
repro = set_repro_line(); // must be last in ctor to collect right info
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extend the existing one instead, it will require just one modification with it.

It would be also nice if binary driver gets this capability, too, through its interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, updated! Could you pls take another look?

@ElaineBao ElaineBao force-pushed the yixin/support_non_dense_strides branch from 0bb3060 to 9902832 Compare December 3, 2025 08:59
@ElaineBao ElaineBao requested review from a team as code owners December 3, 2025 08:59
@github-actions github-actions bot added the documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc label Dec 3, 2025

logical_tensor::dims src_strides = base_op_ref.in_lts_[0].stride_;
logical_tensor::dims wei_strides = base_op_ref.in_lts_[1].stride_;
const logical_tensor::dims &dst_strides = base_op_ref.out_lts_[0].stride_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it on purpose to only have dst_strides in const ref, while copy for src_strides and wei_strides?

--reset --op-attrs=0:transpose_b:1 --case=complex_fusion/mha/gemma2-bf16-f32.json

# sdpa with non-contiguous strides in mask add
--reset --in-shapes=5:1x1x384x384*147840x147840x385x1 --case=complex_fusion/mha/sdpa-plain-simplified-f16-f32.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my curiosity, could you please paste here the verbose logs of this case? Thanks.

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

Labels

component:graph-api Codeowner: @oneapi-src/onednn-graph component:tests Codeowner: @oneapi-src/onednn-arch documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants