Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,13 @@ def _is_fa3_supported(num_heads, num_gqa_groups, head_dim_qk, head_dim_v, qkv_dt
if use_flash_attention_4 and FlashAttentionUtils.v4_is_installed:
logger.debug("Disabling FlashAttention 4 for dropout")
use_flash_attention_4 = False
if use_fused_attention and qkv_format == "thd":
# Dropout keeps thd off cuDNN's unified engine, so it falls to the much slower
# composite one. Nothing else reports this.
logger.debug(
"FusedAttention with dropout and qkv_format = thd uses the composite cuDNN"
" engine, which is much slower than the unified engine"
)
Comment on lines +1085 to +1091

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Advisory precedes backend selection

The advisory runs before later filters can reject FusedAttention, so configurations such as thd with dropout and an arbitrary mask log that the composite cuDNN engine is in use even though another backend is ultimately selected. This sends users toward the wrong performance diagnosis; emit the advisory only after final FusedAttention selection.

Knowledge Base Used: PyTorch Attention Stack

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


# Filter: Softmax type
# context_parallel | softmax_type | supported backends
Expand Down