[ModelRunner V2] Fix cross-attention block table sizing (#46753)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Nick Hill
2026-06-26 16:34:21 -07:00
committed by GitHub
parent b94f212e37
commit 1d41009e81
+3 -2
View File
@@ -409,10 +409,11 @@ class GPUModelRunner(LoRAModelRunnerMixin):
block_table_max_model_len = self.max_model_len
if self.is_encoder_decoder:
# Cross-attention block tables need to index encoder tokens
# (e.g., Whisper ~1500), which can exceed decoder max_model_len.
# Cross-attention block tables need to index encoder tokens, which
# can exceed the decoder's max_model_len.
block_table_max_model_len = max(
block_table_max_model_len,
self.scheduler_config.max_num_encoder_input_tokens,
getattr(self.model_config.hf_config, "max_source_positions", 0),
)