Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
1f30c05d
Unverified
Commit
1f30c05d
authored
May 19, 2025
by
JieXin Liang
Committed by
GitHub
May 18, 2025
Browse files
[fix] fix fa3 forward_decode with spec_decode (#6395)
Co-authored-by:
Stefan He
<
hebiaobuaa@gmail.com
>
parent
5dd62c3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
python/sglang/srt/layers/attention/flashattention_backend.py
python/sglang/srt/layers/attention/flashattention_backend.py
+5
-2
No files found.
python/sglang/srt/layers/attention/flashattention_backend.py
View file @
1f30c05d
...
@@ -918,8 +918,11 @@ class FlashAttentionBackend(AttentionBackend):
...
@@ -918,8 +918,11 @@ class FlashAttentionBackend(AttentionBackend):
and
local_attn_metadata
is
not
None
and
local_attn_metadata
is
not
None
and
(
hasattr
(
layer
,
"use_irope"
)
and
layer
.
use_irope
)
and
(
hasattr
(
layer
,
"use_irope"
)
and
layer
.
use_irope
)
)
)
# We do cascade attention for Draft Decode with topk > 1
use_cascade_attn
=
self
.
topk
>
1
# When Spec Decode enabled, forward_decode would be called with two mode:
# 1. DRAFT_DECODE: we enable cascade attention when top_k > 1
# 2. IDLE: we don’t need cascade attention, spec_info will be none in this case
use_cascade_attn
=
forward_batch
.
spec_info
is
not
None
and
self
.
topk
>
1
# Calculate window size (can be moved to metadata if layer properties don't change)
# Calculate window size (can be moved to metadata if layer properties don't change)
# we don't do layer.sliding_window_size - 1 since in model.get_attention_sliding_window_size() we already - 1
# we don't do layer.sliding_window_size - 1 since in model.get_attention_sliding_window_size() we already - 1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment