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] EngineArgs for better config handling for v1 #10382

Merged
merged 7 commits into from
Nov 26, 2024

Conversation

rickyyx
Copy link
Contributor

@rickyyx rickyyx commented Nov 15, 2024

This allows:

  1. Users to use v0/v1 transparently with the simple flag change VLLM_USE_V1
  2. When VLLM_USE_V1 sets, v1-specific defaults will be automatically used if users don't provide them.
  3. This also allows easier migration in the future where we would simply replace the old EngineArgs with the V1's EngineArgs

This PRs:

  • updates create_engine_config to include usage context, which is currently needed for v1 arg's update.
  • It adds _override_v1_args to override some of the EngineArg's value before creation of engine config
  • It adds _override_v1_configs to override the generated engine config.

Copy link

👋 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 ci/build label Nov 15, 2024
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.

It's pretty clean to me!
@WoosukKwon please review to see if this format is desired to you. Also what's the current best practice to test this in v1?

Comment on lines 1234 to 1236
assert (
usage_context is not None
), "usage_context must be provided for V1EngineArgs"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@WoosukKwon We need to pass usage_context because the default value depends on it, but this argument looks a bit weird to me. Do you have a better way to decide the default max_num_batched_tokens?

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. cc @WoosukKwon @robertgshaw2-neuralmagic

@comaniac
Copy link
Collaborator

@rickyyx could you rebase and see if the errors go away?

@mergify mergify bot added documentation Improvements or additions to documentation frontend labels Nov 20, 2024
Copy link

mergify bot commented Nov 20, 2024

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @rickyyx.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 20, 2024
Signed-off-by: rickyx <[email protected]>
@mergify mergify bot removed the needs-rebase label Nov 20, 2024
@comaniac comaniac added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 20, 2024
@rickyyx
Copy link
Contributor Author

rickyyx commented Nov 21, 2024

Test failures look related - taking a look

Signed-off-by: rickyx <[email protected]>
@rickyyx rickyyx changed the title [v1] V1EngineArgs for better config handling [v1] EngineArgsV1 for better config handling Nov 22, 2024
Signed-off-by: rickyx <[email protected]>
@rickyyx
Copy link
Contributor Author

rickyyx commented Nov 23, 2024

Test failures look unrelated

@rickyyx rickyyx marked this pull request as draft November 24, 2024 00:44
Signed-off-by: rickyx <[email protected]>
@rickyyx rickyyx changed the title [v1] EngineArgsV1 for better config handling [v1] EngineArgs for better config handling for v1 Nov 24, 2024
@rickyyx rickyyx marked this pull request as ready for review November 24, 2024 01:07
@rickyyx
Copy link
Contributor Author

rickyyx commented Nov 24, 2024

Remove the dynamic override of EngineArg class. cc @youkaichao

Thanks for the suggestion.

Signed-off-by: rickyx <[email protected]>
@rickyyx rickyyx requested a review from comaniac November 24, 2024 01:11
Signed-off-by: rickyx <[email protected]>
@rickyyx
Copy link
Contributor Author

rickyyx commented Nov 24, 2024

Test failures should be unrelated.

@comaniac
Copy link
Collaborator

Hand over to @youkaichao for final review and force merge.

@youkaichao
Copy link
Member

can you merge main to see if these errors disappear?

Copy link

mergify bot commented Nov 25, 2024

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @rickyyx.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 25, 2024
Signed-off-by: rickyx <[email protected]>
@mergify mergify bot removed the needs-rebase label Nov 25, 2024
@rickyyx
Copy link
Contributor Author

rickyyx commented Nov 26, 2024

Failures look unrelated - but I can rebase again. cc @youkaichao

@youkaichao youkaichao merged commit 519e8e4 into vllm-project:main Nov 26, 2024
69 of 71 checks passed
@youkaichao
Copy link
Member

@rickyyx thanks for the great work!

afeldman-nm pushed a commit to neuralmagic/vllm that referenced this pull request Dec 2, 2024
sleepwalker2017 pushed a commit to sleepwalker2017/vllm that referenced this pull request Dec 13, 2024
BKitor pushed a commit to BKitor/vllm that referenced this pull request Dec 30, 2024
anko-intel pushed a commit to HabanaAI/vllm-fork that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build documentation Improvements or additions to documentation frontend ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants