@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / c85be1f6dd
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

optimize: eliminate duplicate split_enc_dec_inputs calls (#25573)

Signed-off-by: nicole-lihui <nicole.li@daocloud.io>

Nicole LiHui 🥜 committed Sep 25, 2025 at 13:03 UTC c85be1f6dd3e20d9b42cd68ff54b328ffeb6cb4b
1 file changed +4 -5
vllm/v1/engine/processor.py
+4 -5
@@ -388,9 +388,9 @@ class Processor:
388
389 eos_token_id = self.input_preprocessor.get_eos_token_id()
390
391 - self._validate_model_inputs(processed_inputs)
392 -
391 encoder_inputs, decoder_inputs = split_enc_dec_inputs(processed_inputs)
392 + self._validate_model_inputs(encoder_inputs, decoder_inputs)
393 +
394 # Mypy does not always properly infer the types of some elements of
395 # discriminated unions of TypedDicts, because of how it handles
396 # inheritance of TypedDict. If we explicitly extract the items we want
@@ -458,9 +458,8 @@ class Processor:
458 trace_headers=trace_headers,
459 )
460
461 - def _validate_model_inputs(self, inputs: ProcessorInputs):
462 - encoder_inputs, decoder_inputs = split_enc_dec_inputs(inputs)
463 -
461 + def _validate_model_inputs(self, encoder_inputs: Optional[SingletonInputs],
462 + decoder_inputs: SingletonInputs):
463 if encoder_inputs is not None:
464 self._validate_model_input(encoder_inputs, prompt_type="encoder")
465