Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V1] Remove constraints on partial requests #12674

Merged
merged 9 commits into from
Feb 4, 2025
Merged

[V1] Remove constraints on partial requests #12674

merged 9 commits into from
Feb 4, 2025

Conversation

WoosukKwon
Copy link
Collaborator

@WoosukKwon WoosukKwon commented Feb 3, 2025

This PR enhances the scheduler's flexibility by removing constraints on partial request handling.

Key Changes

  • Removes the requirement that all requests in the RUNNING queue must be either scheduled or preempted
  • Enables the scheduler to selectively schedule the requests in the RUNNING queue while keeping others unscheduled without preemption

Performance Considerations

While the scheduler now supports more flexible request handling, frequent changes to scheduled requests can impact performance. The model runner removes unscheduled requests from InputBatch and adds them back when scheduled again. Therefore, highly dynamic scheduling patterns may reduce the effectiveness of persistent batching and increase input preparation overhead.

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
Copy link

github-actions bot commented Feb 3, 2025

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@mergify mergify bot added the v1 label Feb 3, 2025
@WoosukKwon WoosukKwon marked this pull request as draft February 3, 2025 05:43
@comaniac comaniac self-assigned this Feb 3, 2025
Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
@WoosukKwon WoosukKwon marked this pull request as ready for review February 3, 2025 08:59
@WoosukKwon
Copy link
Collaborator Author

@comaniac The PR is ready for review, except for tests. Please feel free to take a look.

Copy link
Collaborator

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Should be good to go once unit tests are in place.

Comment on lines +421 to +424
if num_tokens_scheduled == 0:
# The request was not scheduled in this step.
new_running.append(request)
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note: Later on when making the scheduler to support PP, I plan to introduce another queue like self.scheduled (or other naming) for the actually list of requests being scheduled. The logic here can also be simplified a bit accordingly.

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
@WoosukKwon WoosukKwon added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 4, 2025
@WoosukKwon WoosukKwon requested a review from comaniac February 4, 2025 05:43
@WoosukKwon
Copy link
Collaborator Author

@comaniac I've added some tests. PTAL.

Copy link
Collaborator

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
@WoosukKwon WoosukKwon merged commit 18a88fc into main Feb 4, 2025
34 of 36 checks passed
@WoosukKwon WoosukKwon deleted the v1-sched-flex branch February 4, 2025 10:44
fxmarty-amd pushed a commit to fxmarty-amd/vllm that referenced this pull request Feb 7, 2025
…2674)

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
Signed-off-by: Felix Marty <felmarty@amd.com>
ShangmingCai pushed a commit to ShangmingCai/vllm that referenced this pull request Feb 10, 2025
…2674)

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
panf2333 pushed a commit to yottalabsai/vllm that referenced this pull request Feb 18, 2025
…2674)

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
kerthcet pushed a commit to kerthcet/vllm that referenced this pull request Feb 21, 2025
…2674)

Signed-off-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
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