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
6579cd7d
"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "5646826a792ce07bbf4989210841d26b86f0de44"
Unverified
Commit
6579cd7d
authored
May 03, 2025
by
Ke Bao
Committed by
GitHub
May 02, 2025
Browse files
Fix set kv cache multi-stream (#5975)
parent
97ac42b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
python/sglang/srt/mem_cache/memory_pool.py
python/sglang/srt/mem_cache/memory_pool.py
+2
-2
No files found.
python/sglang/srt/mem_cache/memory_pool.py
View file @
6579cd7d
...
@@ -374,9 +374,9 @@ class MHATokenToKVPool(KVCache):
...
@@ -374,9 +374,9 @@ class MHATokenToKVPool(KVCache):
# Overlap the copy of K and V cache for small batch size
# Overlap the copy of K and V cache for small batch size
current_stream
=
self
.
device_module
.
current_stream
()
current_stream
=
self
.
device_module
.
current_stream
()
self
.
alt_stream
.
wait_stream
(
current_stream
)
self
.
alt_stream
.
wait_stream
(
current_stream
)
self
.
k_buffer
[
layer_id
-
self
.
start_layer
][
loc
]
=
cache_k
with
self
.
device_module
.
stream
(
self
.
alt_stream
):
with
self
.
device_module
.
stream
(
self
.
alt_stream
):
self
.
k_buffer
[
layer_id
-
self
.
start_layer
][
loc
]
=
cache_k
self
.
v_buffer
[
layer_id
-
self
.
start_layer
][
loc
]
=
cache_v
self
.
v_buffer
[
layer_id
-
self
.
start_layer
][
loc
]
=
cache_v
current_stream
.
wait_stream
(
self
.
alt_stream
)
current_stream
.
wait_stream
(
self
.
alt_stream
)
else
:
else
:
self
.
k_buffer
[
layer_id
-
self
.
start_layer
][
loc
]
=
cache_k
self
.
k_buffer
[
layer_id
-
self
.
start_layer
][
loc
]
=
cache_k
...
...
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