Apply torchfix (#15532)

Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
cyyever
2025-03-26 12:09:06 +00:00
committed by GitHub
parent cf5c8f1686
commit 1aa162e030
5 changed files with 15 additions and 11 deletions
+2 -3
View File
@@ -884,9 +884,8 @@ def _sdpa_attention(
for i, seq_len in enumerate(seq_lens):
end = start + seq_len
with torch.backends.cuda.sdp_kernel(enable_math=True,
enable_flash=False,
enable_mem_efficient=False):
with torch.nn.attention.sdpa_kernel(
torch.nn.attention.SDPBackend.MATH):
sub_out = torch.nn.functional.scaled_dot_product_attention(
query[:, start:end, :],
key[:, start:end, :],