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
e6692bf4
Unverified
Commit
e6692bf4
authored
Sep 24, 2024
by
luzengxiangcn
Committed by
GitHub
Sep 24, 2024
Browse files
debug radixcache stack_overflow (#1499)
parent
28b4d8e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
python/sglang/srt/mem_cache/radix_cache.py
python/sglang/srt/mem_cache/radix_cache.py
+5
-5
No files found.
python/sglang/srt/mem_cache/radix_cache.py
View file @
e6692bf4
...
@@ -291,15 +291,15 @@ class RadixCache(BasePrefixCache):
...
@@ -291,15 +291,15 @@ class RadixCache(BasePrefixCache):
def
_collect_leaves
(
self
):
def
_collect_leaves
(
self
):
ret_list
=
[]
ret_list
=
[]
stack
=
[
self
.
root_node
]
def
dfs_
(
cur_node
):
while
stack
:
cur_node
=
stack
.
pop
()
if
len
(
cur_node
.
children
)
==
0
:
if
len
(
cur_node
.
children
)
==
0
:
ret_list
.
append
(
cur_node
)
ret_list
.
append
(
cur_node
)
else
:
stack
.
extend
(
cur_node
.
children
.
values
())
for
x
in
cur_node
.
children
.
values
():
dfs_
(
x
)
dfs_
(
self
.
root_node
)
return
ret_list
return
ret_list
...
...
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