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
a3aee7c3
Unverified
Commit
a3aee7c3
authored
Aug 27, 2025
by
Pablo Iyu Guerrero
Committed by
GitHub
Aug 27, 2025
Browse files
fix: HiRadixCache: fix prefetch completion race (#9397)
parent
79e6a8a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
python/sglang/srt/mem_cache/hiradix_cache.py
python/sglang/srt/mem_cache/hiradix_cache.py
+6
-3
No files found.
python/sglang/srt/mem_cache/hiradix_cache.py
View file @
a3aee7c3
...
@@ -434,9 +434,12 @@ class HiRadixCache(RadixCache):
...
@@ -434,9 +434,12 @@ class HiRadixCache(RadixCache):
if
self
.
prefetch_stop_policy
==
"best_effort"
:
if
self
.
prefetch_stop_policy
==
"best_effort"
:
return
can_terminate
return
can_terminate
completed
=
(
if
len
(
operation
.
hash_value
)
==
0
:
operation
.
completed_tokens
==
len
(
operation
.
hash_value
)
*
self
.
page_size
completed
=
False
)
else
:
completed
=
(
operation
.
completed_tokens
==
len
(
operation
.
hash_value
)
*
self
.
page_size
)
if
self
.
prefetch_stop_policy
==
"wait_complete"
:
if
self
.
prefetch_stop_policy
==
"wait_complete"
:
can_terminate
=
completed
can_terminate
=
completed
...
...
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