fix(mm_schedule): port _item_overlap from upstream for vision-CP span collect
fd86688428 (vision CP single-owner encoding) cherry-pick used
_item_overlap in _collect_image_span_requests without the definition;
first multimodal prefill request killed every scheduler with NameError.
This commit is contained in:
@@ -431,6 +431,18 @@ def _batch_encode_per_image_misses(
|
||||
return hash_to_embedding
|
||||
|
||||
|
||||
def _item_overlap(
|
||||
item: MultimodalDataItem, chunk_start: int, chunk_end: int
|
||||
) -> Optional[int]:
|
||||
"""Token count of an item with several runs, or None if none intersects the chunk."""
|
||||
if len(item.offsets) == 1:
|
||||
start, end = item.offsets[0]
|
||||
return end - start + 1 if end >= chunk_start and start < chunk_end else None
|
||||
if any(end >= chunk_start and start < chunk_end for start, end in item.offsets):
|
||||
return sum(end - start + 1 for start, end in item.offsets)
|
||||
return None
|
||||
|
||||
|
||||
def _collect_image_span_requests(
|
||||
per_image_requests: List[PerImageRequestInfo],
|
||||
) -> List[ImageSpanRequest]:
|
||||
|
||||
Reference in New Issue
Block a user