-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[Bugfix] Update run_batch.py to handle larger numbers of batches #5774
base: main
Are you sure you want to change the base?
Conversation
vllm engine appears to error out somewhere between 20k-100k async requests. Refactor to only allow a maximum of 10k concurrent requests with Semaphore
@w013nad do you mind sharing the error you got without this PR? I think we should definitely support this many requests, but wonder if there's an underlying issue that we should fix. |
# Read file contents asynchronously | ||
file_contents = (await read_file(input_file)).strip().split("\n") | ||
total_lines = len(file_contents) | ||
|
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.
Let's figure out whether the engine queuing should be fixed instead, but if we decide to limit the requests we submit, I wonder if we should just not create the asyncio requests instead.
Something like
finished_requests = []
response_futures: List[Awaitable[BatchRequestOutput]] = []
for request_json in tqdm(file_contents, total=total_lines, desc="Running requests"):
request = BatchRequestInput.model_validate_json(request_json.strip())
response_futures.append(run_request_with_semaphore(request))
if len(response_futures) >= MAX_CONCURRENT_REQUESTS:
recently_finished, response_futures = await asyncio.wait(response_futures)
finished_requests.extend(recently_finished)
finished_requests.extend(await asyncio.gather(*response_futures))
This way we can more accurately track the progress of the job.
FYI there are ongoing refactors to move engine/api server/worker into own processes. This should enable much higher QPS. |
@wuisawesome I'm doing a RAG test running 4500 questions through with a variety of k chunks. The total file size is 1.2GB and 95k requests. I did another test which also had 95k requests, but the queries were much shorter with a total file size of ~200MB, and it worked fine. This indicates it's not the number of requests but the amount of text I'm sending in.
After this, I get 95k lines of
and then it just shuts itself down. Note that the job launching process takes ~20 minutes to launch 95k jobs. Container was launched with
|
gotcha, this makes sense. @w013nad do you mind making the change to the streaming approach and let's just get this merged in the front end? |
This pull request 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 pull request should remain open. Thank you! |
vllm engine appears to error out somewhere between 20k-100k async requests. Refactor to only allow a maximum of 10k concurrent requests with Semaphore. Also added in a tqdm progress bar. Note that this was created under 0.5.0.post1, I am unable to test integration with some of the newer changes, but it should work.
It would be nice to suppress the request output as well and just have the option to have tqdm only but I was unable to figure out how to make that work.
Note that this is my first PR for this project so I'm not entirely sure how all of this works.
FIX #6154
PR Checklist (Click to Expand)
Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]
for bug fixes.[CI/Build]
for build or continuous integration improvements.[Doc]
for documentation fixes and improvements.[Model]
for adding a new model or improving an existing model. Model name should appear in the title.[Frontend]
For changes on the vLLM frontend (e.g., OpenAI API server,LLM
class, etc.)[Kernel]
for changes affecting CUDA kernels or other compute kernels.[Core]
for changes in the core vLLM logic (e.g.,LLMEngine
,AsyncLLMEngine
,Scheduler
, etc.)[Hardware][Vendor]
for hardware-specific changes. Vendor name should appear in the prefix (e.g.,[Hardware][AMD]
).[Misc]
for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
format.sh
to format your code.docs/source/
if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.Notes for Large Changes
Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with
rfc-required
and might not go through the PR.What to Expect for the Reviews
The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:
action-required
label on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.Thank You
Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!