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
a01ddd96
Unverified
Commit
a01ddd96
authored
Aug 07, 2024
by
Liangsheng Yin
Committed by
GitHub
Aug 07, 2024
Browse files
misc: fix the req_to_token member change (#967)
parent
7fa54a1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
python/sglang/srt/managers/tp_worker.py
python/sglang/srt/managers/tp_worker.py
+2
-2
python/sglang/srt/mem_cache/memory_pool.py
python/sglang/srt/mem_cache/memory_pool.py
+0
-1
No files found.
python/sglang/srt/managers/tp_worker.py
View file @
a01ddd96
...
...
@@ -289,10 +289,10 @@ class ModelTpServer:
"KV cache pool leak detected!"
)
if
self
.
req_to_token_pool
.
can_use_mem_size
!=
self
.
req_to_token_pool
.
size
:
if
len
(
self
.
req_to_token_pool
.
free_slots
)
!=
self
.
req_to_token_pool
.
size
:
warnings
.
warn
(
"Warning: "
f
"available req slots=
{
self
.
req_to_token_pool
.
can_use_mem_size
}
, "
f
"available req slots=
{
len
(
self
.
req_to_token_pool
.
free_slots
)
}
, "
f
"total slots=
{
self
.
req_to_token_pool
.
size
}
\n
"
"Memory pool leak detected!"
)
...
...
python/sglang/srt/mem_cache/memory_pool.py
View file @
a01ddd96
...
...
@@ -32,7 +32,6 @@ class ReqToTokenPool:
self
.
req_to_token
=
torch
.
empty
(
(
size
,
max_context_len
),
dtype
=
torch
.
int32
,
device
=
"cuda"
)
self
.
can_use_mem_size
=
size
def
alloc
(
self
,
need_size
:
int
)
->
List
[
int
]:
if
need_size
>
len
(
self
.
free_slots
):
...
...
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