"vscode:/vscode.git/clone" did not exist on "dd4a35cf9f0a2e93edc698956d4f7fa355ad2a9a"
Unverified Commit aea98512 authored by Qingquan Song's avatar Qingquan Song Committed by GitHub
Browse files

Fix fa3 window size setup (#5316)

parent e4155e96
......@@ -523,7 +523,7 @@ class FlashAttentionBackend(AttentionBackend):
# here is two side inclusive
window_size = (
(layer.sliding_window_size, 0)
if layer.sliding_window_size is not None
if layer.sliding_window_size is not None and layer.sliding_window_size > -1
else (-1, -1)
)
k_descale, v_descale = None, None
......@@ -664,7 +664,7 @@ class FlashAttentionBackend(AttentionBackend):
# here is two side inclusive
window_size = (
(layer.sliding_window_size, 0)
if layer.sliding_window_size is not None
if layer.sliding_window_size is not None and layer.sliding_window_size > -1
else (-1, -1)
)
causal = not layer.is_cross_attention
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment