[Session] Skip the KV free when page alignment empties a streaming-session rewind (#43183)
Co-authored-by: Hanming Lu <69857889+hanming-lu@users.noreply.github.com> Co-authored-by: Joshua Deng <91448271+joshuadeng@users.noreply.github.com>
This commit is contained in:
co-authored by
Hanming Lu
Joshua Deng
parent
4e3eaba619
commit
4ee3f0f370
@@ -280,9 +280,9 @@ class StreamingSession:
|
||||
def _free_kv_aligned(self, kv: ReqKvInfo, target: int, end: int) -> None:
|
||||
"""Free [ceil_align(target), end): paged free returns whole pages, so
|
||||
the partial page stays until release_session."""
|
||||
if end <= target:
|
||||
return
|
||||
start = target
|
||||
if self.cache.page_size > 1:
|
||||
start = ceil_align(start, self.cache.page_size)
|
||||
if end <= start:
|
||||
return
|
||||
self.cache.free_kv_row(kv, [(start, end)])
|
||||
|
||||
Reference in New Issue
Block a user