[Cherry-Pick][BugFix] Add prefill restrictions for chunked_prefill+VL (#2984)

This commit is contained in:
Zero Rains
2025-07-23 16:53:26 +08:00
committed by GitHub
parent e5804b1d98
commit abd238fc12
2 changed files with 21 additions and 16 deletions

View File

@@ -140,10 +140,17 @@ class GPUModelRunner(ModelRunnerBase):
"""
Check whether prefill stage finished
"""
if int(paddle.max(self.share_inputs['seq_lens_encoder'])) != 0:
return 1
if self.enable_mm:
# VL only support 1 batch to prefill
prefill_statue = (self.share_inputs["seq_lens_this_time"] != 0) & (
self.share_inputs["seq_lens_this_time"] != 1
)
return not paddle.any(prefill_statue).numpy()
else:
return 0
if int(paddle.max(self.share_inputs["seq_lens_encoder"])) != 0:
return 1
else:
return 0
def _init_speculative_proposer(self):
"""