Skip to content

[Cleanup] Move scheduler get_routed_experts logic to separate method#32706

Merged
yewentao256 merged 1 commit intovllm-project:mainfrom
njhill:scheduler-simplify
Jan 22, 2026
Merged

[Cleanup] Move scheduler get_routed_experts logic to separate method#32706
yewentao256 merged 1 commit intovllm-project:mainfrom
njhill:scheduler-simplify

Conversation

@njhill
Copy link
Copy Markdown
Member

@njhill njhill commented Jan 20, 2026

Follow-on from #28284 which I didn't get time to fully review.

It harms readability to have all of this special-case logic in the main scheduler flow, better to move it to a separate method.

Also includes small change to ensure that we always return the final output for a request, even if otherwise empty.

Also ensure that we always return the final output for a request, even if otherwise empty.

Signed-off-by: Nick Hill <nickhill123@gmail.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the logic for retrieving routed experts into a dedicated private method, _get_routed_experts, improving the readability and modularity of the update_from_output method. Additionally, it includes a small but important change to ensure that EngineCoreOutput is always generated for stopped requests, even if no new tokens or other outputs are present, which enhances the completeness of the final output.

Comment thread vllm/v1/core/sched/scheduler.py
@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 20, 2026
Copy link
Copy Markdown
Member

@yewentao256 yewentao256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the work!

@yewentao256 yewentao256 merged commit bc14663 into vllm-project:main Jan 22, 2026
51 checks passed
monajafi-amd pushed a commit to monajafi-amd/vllm that referenced this pull request Jan 23, 2026
vllm-project#32706)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
Signed-off-by: mohammad najafi <mohammad.najafi@amd.com>
@njhill njhill deleted the scheduler-simplify branch January 23, 2026 17:01
cwazai pushed a commit to cwazai/vllm that referenced this pull request Jan 25, 2026
vllm-project#32706)

Signed-off-by: Nick Hill <nickhill123@gmail.com>
Signed-off-by: 陈建华 <1647430658@qq.com>
lapy pushed a commit to lapy/vllm that referenced this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants