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
6ffb6bd4
Unverified
Commit
6ffb6bd4
authored
Mar 28, 2025
by
Qingquan Song
Committed by
GitHub
Mar 28, 2025
Browse files
Fix fa3 cuda graph page_size > 1 precision and page_size=1 speed (#4855)
parent
47e6628a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
python/sglang/srt/layers/attention/flashattention_backend.py
python/sglang/srt/layers/attention/flashattention_backend.py
+6
-3
No files found.
python/sglang/srt/layers/attention/flashattention_backend.py
View file @
6ffb6bd4
...
...
@@ -322,10 +322,13 @@ class FlashAttentionBackend(AttentionBackend):
torch
.
cumsum
(
seq_lens_in_batch
,
dim
=
0
,
dtype
=
torch
.
int32
),
(
1
,
0
)
)
metadata
.
page_table
=
self
.
req_to_token
[
:,
self
.
decode_cuda_graph_metadata
[
"strided_indices"
]
max_seq_pages
=
(
metadata
.
max_seq_len_k
+
self
.
page_size
-
1
)
//
self
.
page_size
page_indices
=
self
.
req_to_token
[
:,
self
.
decode_cuda_graph_metadata
[
"strided_indices"
][:
max_seq_pages
]
]
metadata
.
page_table
=
metadata
.
page_table
[
req_pool_indices
[:
bs
]]
page_indices
=
page_indices
[
req_pool_indices
[:
bs
]]
//
self
.
page_size
metadata
.
page_table
[:,
:
max_seq_pages
].
copy_
(
page_indices
)
metadata
.
page_table
[:,
max_seq_pages
:].
fill_
(
0
)
self
.
forward_metadata
=
metadata
def
get_cuda_graph_seq_len_fill_value
(
self
):
...
...
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