fix new_page_count_next_decode (#6671)

This commit is contained in:
pansicheng
2025-06-03 13:48:52 +08:00
committed by GitHub
parent ff00895c46
commit 27e327b415

View File

@@ -1333,7 +1333,9 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
page_size = self.token_to_kv_pool_allocator.page_size
if page_size == 1:
return len(self.reqs)
return sum(1 for req in self.reqs if req.seqlen % page_size == 0)
# In the decoding phase, the length of a request's KV cache should be
# the total length of the request minus 1
return sum(1 for req in self.reqs if (req.seqlen - 1) % page_size == 0)
def check_decode_mem(self, buf_multiplier=1):
tokens_required = (