maybe fix flash attention
This commit is contained in:
@@ -151,11 +151,12 @@ def attention(
|
||||
deterministic=False,
|
||||
dtype=torch.bfloat16,
|
||||
attention_mode='sdpa',
|
||||
):
|
||||
if attention_mode == 'flash_attention_2':
|
||||
fa_version = 2
|
||||
elif attention_mode == 'flash_attention_3':
|
||||
fa_version = 3
|
||||
):
|
||||
if "flash" in attention_mode:
|
||||
if attention_mode == 'flash_attention_2':
|
||||
fa_version = 2
|
||||
elif attention_mode == 'flash_attention_3':
|
||||
fa_version = 3
|
||||
return flash_attention(
|
||||
q=q,
|
||||
k=k,
|
||||
|
||||
Reference in New Issue
Block a user