Skip to content

Commit 5793dd7

Browse files
LuFinchpytorchmergebot
authored andcommitted
[Intel GPU] Integrate OneDNN SDPA training forward and backward (pytorch#161058)
This PR is the first split PR of pytorch#156272, only contains the OneDNN code. Please help review. Pending on OneDNN v3.9 commit update. Don't merge. Pull Request resolved: pytorch#161058 Approved by: https://github.com/guangyey, https://github.com/EikanWang
1 parent 49c446c commit 5793dd7

File tree

4 files changed

+688
-94
lines changed

4 files changed

+688
-94
lines changed

aten/src/ATen/native/mkldnn/xpu/Attention.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ _scaled_dot_product_fused_attention_overrideable_xpu(
260260
alloc_with_matching_layout(query, output, output_shape);
261261
at::Tensor logsumexp, debug_attn_mask; // not supported
262262

263-
at::native::onednn::gpu_float_sdpa(
263+
at::native::onednn::sdpa(
264264
batch_size,
265265
seq_len_q,
266266
seq_len_kv,
@@ -274,7 +274,9 @@ _scaled_dot_product_fused_attention_overrideable_xpu(
274274
attn_bias,
275275
is_causal,
276276
scale.has_value() ? scale.value() : (1.0 / std::sqrt(head_dim_qk)),
277-
output);
277+
output,
278+
false,
279+
logsumexp);
278280

279281
// rng not used
280282
auto philox_seed = at::empty({}, at::dtype(at::kLong));

0 commit comments

Comments
 (0)