[Auto Sync] Update schedule_batch.py, common.py, eagle_info... (20260105) (#16519)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: cctry <shiyang@x.ai>
This commit is contained in:
Lianmin Zheng
2026-01-08 02:35:46 -08:00
committed by GitHub
co-authored by github-actions[bot] <github-actions[bot]@users.noreply.github.com> cctry
parent 1e5de05e35
commit fb04e7e3c8
3 changed files with 18 additions and 20 deletions
+5 -6
View File
@@ -394,9 +394,11 @@ class EagleVerifyInput(SpecInput, EagleVerifyInputV2Mixin):
# Iterate every accepted token and check if req has finished after append the token
# should be checked BEFORE free kv cache slots
for i, (req, accept_index_row) in enumerate(zip(batch.reqs, accept_index_cpu)):
num_accepted = 0
for j, idx in enumerate(accept_index_row):
if idx == -1:
break
num_accepted += 1
id = predict_cpu[idx]
req.output_ids.append(id)
req.check_finished()
@@ -414,6 +416,9 @@ class EagleVerifyInput(SpecInput, EagleVerifyInputV2Mixin):
f"{i=}, {req=}\n" f"{accept_index=}\n" f"{predict=}\n"
)
raise e
# Update KV cache tracking for the accepted tokens
req.kv_committed_len += num_accepted
req.kv_allocated_len = req.kv_committed_len
if not req.finished():
unfinished_index.append(i)
if idx == -1:
@@ -442,9 +447,6 @@ class EagleVerifyInput(SpecInput, EagleVerifyInputV2Mixin):
if page_size == 1:
# TODO: boolean array index leads to a device sync. Remove it.
token_to_kv_pool_allocator.free(batch.out_cache_loc[evict_mask])
for i, req in enumerate(batch.reqs):
req.kv_committed_len += accept_length_list[i] + 1
req.kv_allocated_len = req.kv_committed_len
else:
if self.topk == 1:
# Only evict full empty page. Do not evict partial empty page
@@ -456,9 +458,6 @@ class EagleVerifyInput(SpecInput, EagleVerifyInputV2Mixin):
next_power_of_2(self.draft_token_num),
)
token_to_kv_pool_allocator.free(batch.out_cache_loc[evict_mask])
for i, req in enumerate(batch.reqs):
req.kv_committed_len += accept_length_list[i] + 1
req.kv_allocated_len = req.kv_committed_len
else:
# Shift the accepted tokens to the beginning.
# Only evict the last part