[ModelRunner V2] Fix cross-attention block table sizing (#46753)
Signed-off-by: Nick Hill <nickhill123@gmail.com>
Nick Hill committed
Jun 26, 2026 at 16:34 UTC
1d41009e81eb6493f2c19e9d2a0d472564764e62
1 file changed
+3
-2
vllm/v1/worker/gpu/model_runner.py
+3
-2
@@ -409,10 +409,11 @@ class GPUModelRunner(LoRAModelRunnerMixin):
409
410
block_table_max_model_len = self.max_model_len
411
if self.is_encoder_decoder:
412
- # Cross-attention block tables need to index encoder tokens
413
- # (e.g., Whisper ~1500), which can exceed decoder max_model_len.
412
+ # Cross-attention block tables need to index encoder tokens, which
413
+ # can exceed the decoder's max_model_len.
414
block_table_max_model_len = max(
415
block_table_max_model_len,
416
+ self.scheduler_config.max_num_encoder_input_tokens,
417
getattr(self.model_config.hf_config, "max_source_positions", 0),
418
)
419