[Cleanup] Remove unused BatchMultimodalOutput and BatchMultimodalDecodeReq (#21640)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1d9c8e8c9e
commit
f3970b17ef
@@ -1008,38 +1008,6 @@ class BatchTokenIDOutput(BaseBatchReq, SpeculativeDecodingMetricsMixin):
|
|||||||
time_stats: Optional[List[SchedulerReqTimeStats]] = None
|
time_stats: Optional[List[SchedulerReqTimeStats]] = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class BatchMultimodalDecodeReq(BaseBatchReq):
|
|
||||||
decoded_ids: List[int]
|
|
||||||
input_token_logprobs_val: List[float]
|
|
||||||
input_token_logprobs_idx: List[int]
|
|
||||||
output_token_logprobs_val: List[float]
|
|
||||||
output_token_logprobs_idx: List[int]
|
|
||||||
read_offsets: List[int]
|
|
||||||
skip_special_tokens: List[bool]
|
|
||||||
spaces_between_special_tokens: List[bool]
|
|
||||||
image_resolutions: List[List[int]]
|
|
||||||
resize_image_resolutions: List[List[int]]
|
|
||||||
|
|
||||||
finished_reasons: List[BaseFinishReason]
|
|
||||||
|
|
||||||
# Token counts
|
|
||||||
prompt_tokens: List[int]
|
|
||||||
completion_tokens: List[int]
|
|
||||||
cached_tokens: List[int]
|
|
||||||
|
|
||||||
# The information of placeholder tokens (e.g., image token)
|
|
||||||
# idx is the index of the token in the prompt after expansion.
|
|
||||||
# val is the length of padded tokens after expansion.
|
|
||||||
placeholder_tokens_idx: List[Optional[List[int]]]
|
|
||||||
placeholder_tokens_val: List[Optional[List[int]]]
|
|
||||||
|
|
||||||
return_bytes: List[bool]
|
|
||||||
|
|
||||||
# The trainer step id. Used to know which step's weights are used for sampling.
|
|
||||||
token_steps: List[List[int]] = None
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class BatchStrOutput(BaseBatchReq, SpeculativeDecodingMetricsMixin):
|
class BatchStrOutput(BaseBatchReq, SpeculativeDecodingMetricsMixin):
|
||||||
# The finish reason
|
# The finish reason
|
||||||
@@ -1102,36 +1070,6 @@ class BatchStrOutput(BaseBatchReq, SpeculativeDecodingMetricsMixin):
|
|||||||
time_stats: Optional[List[SchedulerReqTimeStats]] = None
|
time_stats: Optional[List[SchedulerReqTimeStats]] = None
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class BatchMultimodalOutput(BaseBatchReq):
|
|
||||||
# The finish reason
|
|
||||||
finished_reasons: List[dict]
|
|
||||||
decoded_ids: List[List[int]]
|
|
||||||
# The outputs
|
|
||||||
outputs: Union[List[str | bytes], List[List[Dict]]]
|
|
||||||
|
|
||||||
# probability values for input tokens and output tokens
|
|
||||||
input_token_logprobs_val: List[List[float]]
|
|
||||||
input_token_logprobs_idx: List[List[int]]
|
|
||||||
output_token_logprobs_val: List[List[float]]
|
|
||||||
output_token_logprobs_idx: List[List[int]]
|
|
||||||
|
|
||||||
# Token counts
|
|
||||||
prompt_tokens: List[int]
|
|
||||||
completion_tokens: List[int]
|
|
||||||
cached_tokens: List[int]
|
|
||||||
|
|
||||||
placeholder_tokens_idx: List[Optional[List[int]]]
|
|
||||||
placeholder_tokens_val: List[Optional[List[int]]]
|
|
||||||
|
|
||||||
return_bytes: List[bool]
|
|
||||||
# Detailed breakdown of cached tokens by source (device/host/storage)
|
|
||||||
cached_tokens_details: Optional[List[Optional[Dict[str, Any]]]] = None
|
|
||||||
|
|
||||||
# For observability
|
|
||||||
time_stats: Optional[List[SchedulerReqTimeStats]] = None
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class BatchEmbeddingOutput(BaseBatchReq):
|
class BatchEmbeddingOutput(BaseBatchReq):
|
||||||
# The finish reason
|
# The finish reason
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ from sglang.srt.managers.io_struct import (
|
|||||||
BaseBatchReq,
|
BaseBatchReq,
|
||||||
BaseReq,
|
BaseReq,
|
||||||
BatchEmbeddingOutput,
|
BatchEmbeddingOutput,
|
||||||
BatchMultimodalOutput,
|
|
||||||
BatchStrOutput,
|
BatchStrOutput,
|
||||||
BatchTokenIDOutput,
|
BatchTokenIDOutput,
|
||||||
)
|
)
|
||||||
@@ -282,17 +281,6 @@ def _handle_output_by_index(output, i):
|
|||||||
output, "token_steps", i, check_length=False
|
output, "token_steps", i, check_length=False
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
elif isinstance(output, BatchMultimodalOutput):
|
|
||||||
new_output = BatchMultimodalOutput(
|
|
||||||
rids=[output.rids[i]],
|
|
||||||
finished_reasons=_extract_field_by_index(output, "finished_reasons", i),
|
|
||||||
outputs=_extract_field_by_index(output, "outputs", i),
|
|
||||||
prompt_tokens=_extract_field_by_index(output, "prompt_tokens", i),
|
|
||||||
completion_tokens=_extract_field_by_index(output, "completion_tokens", i),
|
|
||||||
cached_tokens=_extract_field_by_index(output, "cached_tokens", i),
|
|
||||||
placeholder_tokens_idx=None,
|
|
||||||
placeholder_tokens_val=None,
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
new_output = output
|
new_output = output
|
||||||
return new_output
|
return new_output
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ from sglang.srt.managers.io_struct import (
|
|||||||
AbortReq,
|
AbortReq,
|
||||||
ActiveRanksOutput,
|
ActiveRanksOutput,
|
||||||
BatchEmbeddingOutput,
|
BatchEmbeddingOutput,
|
||||||
BatchMultimodalOutput,
|
|
||||||
BatchStrOutput,
|
BatchStrOutput,
|
||||||
BatchTokenIDOutput,
|
BatchTokenIDOutput,
|
||||||
BatchTokenizedEmbeddingReqInput,
|
BatchTokenizedEmbeddingReqInput,
|
||||||
@@ -462,7 +461,6 @@ class TokenizerManager(TokenizerCommunicatorMixin, TokenizerManagerMultiItemMixi
|
|||||||
BatchStrOutput,
|
BatchStrOutput,
|
||||||
BatchEmbeddingOutput,
|
BatchEmbeddingOutput,
|
||||||
BatchTokenIDOutput,
|
BatchTokenIDOutput,
|
||||||
BatchMultimodalOutput,
|
|
||||||
),
|
),
|
||||||
self._handle_batch_output,
|
self._handle_batch_output,
|
||||||
),
|
),
|
||||||
@@ -1541,7 +1539,6 @@ class TokenizerManager(TokenizerCommunicatorMixin, TokenizerManagerMultiItemMixi
|
|||||||
recv_obj: Union[
|
recv_obj: Union[
|
||||||
BatchStrOutput,
|
BatchStrOutput,
|
||||||
BatchEmbeddingOutput,
|
BatchEmbeddingOutput,
|
||||||
BatchMultimodalOutput,
|
|
||||||
BatchTokenIDOutput,
|
BatchTokenIDOutput,
|
||||||
],
|
],
|
||||||
):
|
):
|
||||||
@@ -1644,8 +1641,6 @@ class TokenizerManager(TokenizerCommunicatorMixin, TokenizerManagerMultiItemMixi
|
|||||||
"output_ids": output_token_ids,
|
"output_ids": output_token_ids,
|
||||||
"meta_info": meta_info,
|
"meta_info": meta_info,
|
||||||
}
|
}
|
||||||
elif isinstance(recv_obj, BatchMultimodalOutput):
|
|
||||||
raise NotImplementedError("BatchMultimodalOut not implemented")
|
|
||||||
else:
|
else:
|
||||||
assert isinstance(recv_obj, BatchEmbeddingOutput)
|
assert isinstance(recv_obj, BatchEmbeddingOutput)
|
||||||
out_dict = {
|
out_dict = {
|
||||||
@@ -1914,7 +1909,6 @@ class TokenizerManager(TokenizerCommunicatorMixin, TokenizerManagerMultiItemMixi
|
|||||||
recv_obj: Union[
|
recv_obj: Union[
|
||||||
BatchStrOutput,
|
BatchStrOutput,
|
||||||
BatchEmbeddingOutput,
|
BatchEmbeddingOutput,
|
||||||
BatchMultimodalOutput,
|
|
||||||
BatchTokenIDOutput,
|
BatchTokenIDOutput,
|
||||||
],
|
],
|
||||||
i: int,
|
i: int,
|
||||||
@@ -2424,7 +2418,6 @@ class TokenizerManager(TokenizerCommunicatorMixin, TokenizerManagerMultiItemMixi
|
|||||||
recv_obj: Union[
|
recv_obj: Union[
|
||||||
BatchStrOutput,
|
BatchStrOutput,
|
||||||
BatchEmbeddingOutput,
|
BatchEmbeddingOutput,
|
||||||
BatchMultimodalOutput,
|
|
||||||
BatchTokenIDOutput,
|
BatchTokenIDOutput,
|
||||||
],
|
],
|
||||||
i: int,
|
i: int,
|
||||||
|
|||||||
Reference in New Issue
Block a user