Skip to content

Commit 95ce7f4

Browse files
qingquansongjimoosciuc
authored andcommitted
Fix fa3 window size setup (sgl-project#5316)
1 parent b200261 commit 95ce7f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/sglang/srt/layers/attention/flashattention_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def forward_extend(
523523
# here is two side inclusive
524524
window_size = (
525525
(layer.sliding_window_size, 0)
526-
if layer.sliding_window_size is not None
526+
if layer.sliding_window_size is not None and layer.sliding_window_size > -1
527527
else (-1, -1)
528528
)
529529
k_descale, v_descale = None, None
@@ -664,7 +664,7 @@ def forward_decode(
664664
# here is two side inclusive
665665
window_size = (
666666
(layer.sliding_window_size, 0)
667-
if layer.sliding_window_size is not None
667+
if layer.sliding_window_size is not None and layer.sliding_window_size > -1
668668
else (-1, -1)
669669
)
670670
causal = not layer.is_cross_attention

0 commit comments

Comments
 (0)