Fix spec filter batch when target extend (#10991)

This commit is contained in:
Ke Bao
2025-09-30 14:44:02 +08:00
committed by GitHub
parent d1676cd483
commit 424591d53d
2 changed files with 9 additions and 2 deletions

View File

@@ -1736,7 +1736,14 @@ class ScheduleBatch(ScheduleBatchDisaggregationDecodeMixin):
self.sampling_info.filter_batch(keep_indices, keep_indices_device)
if self.spec_info:
self.spec_info.filter_batch(keep_indices_device)
if chunked_req_to_exclude is not None and len(chunked_req_to_exclude) > 0:
has_been_filtered = False
else:
has_been_filtered = True
self.spec_info.filter_batch(
new_indices=keep_indices_device,
has_been_filtered=has_been_filtered,
)
def merge_batch(self, other: "ScheduleBatch"):
# Penalizer orchestrator must be merged before Batch.reqs is merged. This is because

View File

@@ -405,7 +405,7 @@ class NgramVerifyInput:
return logits_output, self.verified_id, self.accept_length.sum().item()
def filter_batch(self, new_indices: torch.Tensor):
def filter_batch(self, new_indices: torch.Tensor, has_been_filtered: bool = True):
pass
def merge_batch(self, spec_info: NgramVerifyInput):