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
b3c1f2e4
Unverified
Commit
b3c1f2e4
authored
Aug 18, 2025
by
fzyzcjy
Committed by
GitHub
Aug 17, 2025
Browse files
Fix memory pool leak error (#9271)
parent
be1a3cd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
python/sglang/srt/mem_cache/allocator.py
python/sglang/srt/mem_cache/allocator.py
+5
-0
No files found.
python/sglang/srt/mem_cache/allocator.py
View file @
b3c1f2e4
...
@@ -486,6 +486,11 @@ class PagedTokenToKVPoolAllocator(BaseTokenToKVPoolAllocator):
...
@@ -486,6 +486,11 @@ class PagedTokenToKVPoolAllocator(BaseTokenToKVPoolAllocator):
):
):
self
.
merge_and_sort_free
()
self
.
merge_and_sort_free
()
assert
self
.
max_num_extend_tokens_next_power_of_2
>=
extend_num_tokens
,
(
f
"
{
self
.
max_num_extend_tokens_next_power_of_2
=
}
>=
{
extend_num_tokens
=
}
does not hold. "
f
"If this happens in PD, consider letting chunked_prefill_size in D be as large as in P"
)
out_indices
=
torch
.
empty
(
out_indices
=
torch
.
empty
(
(
extend_num_tokens
,),
dtype
=
torch
.
int64
,
device
=
self
.
device
(
extend_num_tokens
,),
dtype
=
torch
.
int64
,
device
=
self
.
device
)
)
...
...
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