[Bugfix] Fix tqdm progress bar when SamplingParams.n > 1 #12428
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This issue occurs when
SamplingParams.n > 1
. In the recent changes to vLLM, thetotal
of the progress bar was modified toself.llm_engine.get_num_unfinished_requests()
, which seems to be the number of prompts multiplied bySamplingParams.n
. However, the progress bar still only updates by 1 step at a time, causing it to display incorrectly. For example, if run vllm on a dataset consisting of 1000 examples and set n = 5, tqdm displays as 0-5000, while it actually finishes when tqdm is loaded to 1000. (From #10949)This PR resolves the issue by updating the progress bar by the number of outputs for each step, ensuring that the progress bar reaches its end when the model finishes generating.
We would like to mention that perhaps changing the
total
variable to reflect the actual number of prompts would be a better solution. However, we are concerned about causing unintended side effects, so we implemented the current modification instead.FIX #11519
FIX #10949