update sdnq atten min sizes

This commit is contained in:
Disty0
2026-06-27 14:51:56 +03:00
parent 718e24c50d
commit 3fed183564
+1 -1
View File
@@ -24,7 +24,7 @@ def set_sdnq_attention():
sdpa_pre_sdnq_atten = torch.nn.functional.scaled_dot_product_attention
@wraps(sdpa_pre_sdnq_atten)
def sdpa_sdnq_atten(query: torch.FloatTensor, key: torch.FloatTensor, value: torch.FloatTensor, attn_mask: torch.Tensor | None = None, dropout_p: float = 0.0, is_causal: bool = False, scale: float | None = None, enable_gqa: bool = False, **kwargs) -> torch.FloatTensor:
if not is_causal and query.shape[-1] >= 32 and query.shape[-2] >= 256 and query.shape[-3] > 1:
if not is_causal and (query.shape[-1] >= 32 and key.shape[-1] >= 32 and value.shape[-1] >= 32) and (query.shape[-2] >= 512 or key.shape[-2] >= 512) and query.shape[-3] > 1:
return sdnq_triton_atten(
query=query, key=key, value=value,
attn_mask=attn_mask, scale=scale, enable_gqa=enable_gqa,