-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Frontend] run-batch
supports V1
#21541
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
Conversation
Signed-off-by: DarkLight1337 <[email protected]>
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run 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 either: Add 🚀 |
There was a problem hiding this 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 run_batch.py
to support the V1 engine by reusing the build_async_engine_client
function from the API server. The changes are well-structured and enable V1 support as intended. I've identified one potential issue regarding a change in behavior for V0 runs that could impact performance, and I've provided a suggestion to address it.
async with build_async_engine_client( | ||
args, | ||
usage_context=UsageContext.OPENAI_BATCH_RUNNER, | ||
disable_frontend_multiprocessing=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change introduces multiprocessing for V0 batch runs by setting disable_frontend_multiprocessing=False
. The previous implementation ran the engine in the same process.
For a batch script like run-batch
, using a separate process for the engine might introduce unnecessary overhead from inter-process communication and data serialization/deserialization, potentially degrading performance. The in-process engine is generally more suitable for batch jobs.
To maintain the previous behavior for V0 and likely improve performance for batch jobs, I suggest setting this to True
. This will not affect V1 runs, as this flag is ignored for the V1 engine.
disable_frontend_multiprocessing=False, | |
disable_frontend_multiprocessing=True, |
disable_frontend_multiprocessing = bool( | ||
args.disable_frontend_multiprocessing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to work around run-batch
not having a CLI argument for disable_frontend_multiprocessing
. Should we support this for run-batch
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is not much point to this since we're deprecating V0 anyways and this argument is only applicable to V0
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: x22x22 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: Jinzhen Lin <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: Paul Pak <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]> Signed-off-by: Diego-Castan <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
Refactor
run_batch.py
to support V1 by usingbuild_async_engine_client
fromapi_server.py
Test Plan
Updated the test for
run-batch
to run on V1 as well.Test Result
(Optional) Documentation Update