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
24eaebeb
Unverified
Commit
24eaebeb
authored
Aug 20, 2025
by
Nathan Wang
Committed by
GitHub
Aug 20, 2025
Browse files
Fix FlashInfer GPU <-> CPU sync (#9409)
parent
a91e90d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
python/sglang/srt/layers/attention/flashinfer_backend.py
python/sglang/srt/layers/attention/flashinfer_backend.py
+8
-1
No files found.
python/sglang/srt/layers/attention/flashinfer_backend.py
View file @
24eaebeb
...
@@ -1372,7 +1372,14 @@ def fast_decode_plan(
...
@@ -1372,7 +1372,14 @@ def fast_decode_plan(
if
self
.
use_tensor_cores
:
if
self
.
use_tensor_cores
:
# ALSO convert last_page_len to CPU
# ALSO convert last_page_len to CPU
last_page_len_host
=
last_page_len
.
cpu
()
if
page_size
==
1
:
# When page size is 1, last_page_len is always 1.
# Directly construct the host tensor rather than executing a device-to-host copy.
last_page_len_host
=
torch
.
ones
(
(
batch_size
,),
dtype
=
torch
.
int32
,
device
=
"cpu"
)
else
:
last_page_len_host
=
last_page_len
.
cpu
()
kv_lens_arr_host
=
get_seq_lens
(
indptr_host
,
last_page_len_host
,
page_size
)
kv_lens_arr_host
=
get_seq_lens
(
indptr_host
,
last_page_len_host
,
page_size
)
...
...
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