vllm
vllm copied to clipboard
[Metrics] add more metrics
metrics
- time_queue_requests
- time_inference_requests
- time_prefill_requests
- time_decode_requests
- max_num_generation_tokens_requests
max_num_generation_tokens_requests.append(
max(seq.get_output_len() for seq in seq_group.get_seqs())
)
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:
- We adhere to Google Python style guide and Google C++ style guide.
- Pass all linter checks. Please use
format.sh
to format your code. - The code need to be well-documented to ensure future contributors can easily understand the code.
- Include sufficient tests to ensure the project to stay correct and robust. This includes both unit tests and integration tests.
- Please add documentation to
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:
- After the PR is submitted, the PR will be assigned to a reviewer. Every reviewer will pick up the PRs based on their expertise and availability.
- After the PR is assigned, the reviewer will provide status update every 2-3 days. If the PR is not reviewed within 7 days, please feel free to ping the reviewer or the vLLM team.
- After the review, the reviewer will put an
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. - Please respond to all comments within a reasonable time frame. If a comment isn't clear or you disagree with a suggestion, feel free to ask for clarification or discuss the suggestion.
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!
@robertgshaw2-neuralmagic I just replicating the new metrics that were added here. should I add some automated tests, or just visually look at the metrics?Thanks!
@robertgshaw2-neuralmagic I just replicating the new metrics that were added here. should I add some automated tests, or just visually look at the metrics?Thanks!
This one will be tricky to test given its a timing flow
Also, looks like you are missing the number of tokens in the batch for each iteration of the LLMEngine
Also, see https://github.com/vllm-project/vllm/issues/3616 for some more ideas
Also, looks like you are missing the number of tokens in the batch for each iteration of the LLMEngine
you mean num_generation_tokens_iter
? It already exists.
https://github.com/vllm-project/vllm/issues/3616#issuecomment-2030858781
@robertgshaw2-neuralmagic BTW, Should some metrics be recorded with a periodic bypass process/thread, such as every 1 second.
@robertgshaw2-neuralmagic BTW, Should some metrics be recorded with a periodic bypass process/thread, such as every 1 second.
We have this functionality already in the StatLogger
, but I don't think any of these metrics should go through that pathway
Also, looks like you are missing the number of tokens in the batch for each iteration of the LLMEngine
you mean
num_generation_tokens_iter
? It already exists.
For chunked prefill, we can have prefill and generation tokens in the same batch
So I was looking for num_tokens_iter
which would be num_generation_tokens_iter + num_prompt_tokens_iter
@HarryWu99 can you update the grafana dashboard and turn this into a real PR and not draft? would like to merge before friday (so it can be the release)
To run grafana, checkout examples/production_monitoring
- I set up a docker compose to spin it up easily
@robertgshaw2-neuralmagic Thanks for attention!
I made some changes to the dashboard. Categorize the charts. But I'm not sure I'm showing some metrics the right way, such as:
- request_params_n
- request_best_of
- request_max_num_generation_tokens
ok will try it out today
@robertgshaw2-neuralmagic Hi, will it still be merged before friday?
@robertgshaw2-neuralmagic Hi, will it still be merged before friday?
Working on merging this week
@robertgshaw2-neuralmagic ping~
sorry - traveling this week. back to PR review.
Ill fix conflict + merge tom
@robertgshaw2-neuralmagic Hello~ I see it's been approved for a while, but it is not merged yet. Anything wrong?
@HarryWu99 thanks for putting this PR together, Im interested in some of the metrics here too, it looks like it was approved with auto-merge enabled which means it will merge once the CI test go green, it appears however there are some bugs the CI is catching:
https://buildkite.com/vllm/ci/builds/8274#018fbcae-fbed-4edb-aad3-86d0aae11fad/51-695
I have made some changes, but the CI still fails. I get a bit confused, the problem reported by the CI seems to have nothing to do with this PR. @LucasWilkinson by the way, CI takes a long time, how should I debug?
@HarryWu99 thanks for updating the PR, a lot the tests can be flaky, I re-ran some of them to see if its just flakiness, although Im not familiar with the tool use test @robertgshaw2-neuralmagic may know more
you are rebased off latest main correct?
@LucasWilkinson Yes, I rebased my branch onto the main
branch.