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
zhaoyu6
sglang
Commits
24eaebeb
"vscode:/vscode.git/clone" did not exist on "498a186d777414f429a557b8ad6d8eff8b664011"
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
Show 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,6 +1372,13 @@ def fast_decode_plan(
...
@@ -1372,6 +1372,13 @@ 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
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
()
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