Repository navigation
Commit 82a2bf4
committed
fix(pytorch): disable FlashAttention 2 for softcap with dropout
flash-attn rejects a nonzero softcap combined with nonzero dropout at
dispatch: "Softcapping does not support dropout for now" in
csrc/flash_attn/flash_api.cpp, present in mha_fwd and mha_varlen_fwd
from v2.6.0 (the earliest version TE allows softcap on) onwards. Backend
selection did not model this, so a softcap + attention-dropout config
passed selection, routed to FA2, and crashed inside flash-attn.
Dropout only reaches the kernel while training, since backends.py passes
`self.attention_dropout if self.training else 0.0`, so the gate is on
`attention_dropout != 0.0 and is_training` to avoid blocking valid
inference configs. UnfusedDotProductAttention supports both softcap and
dropout and stays available, so this steers rather than hard-fails.
Signed-off-by: Nitin Vegesna <nvegesna@nvidia.com>1 parent a9d27ce commit 82a2bf4
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
814 | 820 | | |
815 | 821 | | |
816 | 822 | | |
| |||
0 commit comments