mimo26-chunked-admission.diff 1.1 KB

123456789101112131415161718
  1. diff --git a/python/sglang/srt/managers/scheduler.py b/python/sglang/srt/managers/scheduler.py
  2. index b57c93299a..c0b0571c8a 100644
  3. --- a/python/sglang/srt/managers/scheduler.py
  4. +++ b/python/sglang/srt/managers/scheduler.py
  5. @@ -3944,7 +3944,12 @@ class Scheduler(
  6. candidate_beam_width = (
  7. req.beam_group.beam_width if req.beam_group is not None else None
  8. )
  9. - if len(adder.can_run_list) >= self.get_num_allocatable_reqs(
  10. + # mimo26: a continuing chunked request already holds its req slot; only
  11. + # requests that still need one count against the free slots. Counting it
  12. + # set batch_is_full with a slot free, and that flag stays set until a
  13. + # request finishes, so the next waiting request sat out the whole decode.
  14. + new_slot_reqs = sum(1 for r in adder.can_run_list if not r.kv.holds_kv)
  15. + if new_slot_reqs >= self.get_num_allocatable_reqs(
  16. running_bs,
  17. candidate_beam_width,
  18. running_batch=running_batch,