polish code for prefill restrictions (#2991)

This commit is contained in:
Zero Rains
2025-07-23 20:10:14 +08:00
committed by GitHub
parent 172e69fe17
commit ca0f71bd39
2 changed files with 5 additions and 13 deletions

View File

@@ -150,17 +150,10 @@ class GPUModelRunner(ModelRunnerBase):
"""
Check whether prefill stage finished
"""
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()
if int(paddle.max(self.share_inputs["seq_lens_encoder"])) != 0:
return 1
else:
if int(paddle.max(self.share_inputs["seq_lens_encoder"])) != 0:
return 1
else:
return 0
return 0
def _init_speculative_proposer(self):
"""