vllm icon indicating copy to clipboard operation
vllm copied to clipboard

[Bug]: Is the logic order correct during the scheduler procedure?

Open Natelu opened this issue 11 months ago • 1 comments

Your current environment

The output of `python collect_env.py`
none 

🐛 Describe the bug

Hi @WoosukKwon, is the order of these two lines of code correct? Why is self.append(request) called before updating the request attribute in the update section during the scheduling?

def schedule(self) -> SchedulerOutput:
......
       self.running.append(request)
.....
.....
       request.num_computed_tokens = num_computed_tokens

https://github.com/vllm-project/vllm/blame/0e237f00357c968a4f7ae25accd533e924baceff/vllm/v1/core/sched/scheduler.py#L384 https://github.com/vllm-project/vllm/blame/0e237f00357c968a4f7ae25accd533e924baceff/vllm/v1/core/sched/scheduler.py#L405C3-L405C3

Before submitting a new issue...

  • [x] Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Natelu avatar Apr 22 '25 11:04 Natelu

When creating scheduler_output, there must be RequestData that reflects the num_computed_tokens of the scheduled request.

So after creating scheduler_output, update request.num_computed_tokens for the next scheduling.

juncheoll avatar Jun 19 '25 08:06 juncheoll

This issue has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this issue should remain open. Thank you!

github-actions[bot] avatar Sep 18 '25 02:09 github-actions[bot]

This issue has been automatically closed due to inactivity. Please feel free to reopen if you feel it is still relevant. Thank you!

github-actions[bot] avatar Oct 19 '25 02:10 github-actions[bot]