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

[Metrics] add more metrics #4464

Merged
merged 17 commits into from
Nov 11, 2024
Merged

[Metrics] add more metrics #4464

merged 17 commits into from
Nov 11, 2024

Conversation

HarryWu99
Copy link
Contributor

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!

@HarryWu99
Copy link
Contributor Author

@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!

@HarryWu99 HarryWu99 marked this pull request as draft April 30, 2024 02:04
vllm/engine/metrics.py Outdated Show resolved Hide resolved
@robertgshaw2-neuralmagic
Copy link
Collaborator

@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

@robertgshaw2-neuralmagic
Copy link
Collaborator

Also, looks like you are missing the number of tokens in the batch for each iteration of the LLMEngine

@robertgshaw2-neuralmagic
Copy link
Collaborator

Also, see #3616 for some more ideas

@HarryWu99
Copy link
Contributor Author

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.

@HarryWu99
Copy link
Contributor Author

#3616 (comment)

@robertgshaw2-neuralmagic BTW, Should some metrics be recorded with a periodic bypass process/thread, such as every 1 second.

@robertgshaw2-neuralmagic
Copy link
Collaborator

#3616 (comment)

@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

@robertgshaw2-neuralmagic
Copy link
Collaborator

robertgshaw2-neuralmagic commented May 1, 2024

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

@robertgshaw2-neuralmagic
Copy link
Collaborator

@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 robertgshaw2-neuralmagic marked this pull request as ready for review May 2, 2024 00:39
@HarryWu99 HarryWu99 changed the title [WIP][Metrics] add more metrics [Metrics] add more metrics May 2, 2024
@HarryWu99
Copy link
Contributor Author

@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

@robertgshaw2-neuralmagic
Copy link
Collaborator

ok will try it out today

@HarryWu99
Copy link
Contributor Author

@robertgshaw2-neuralmagic Hi, will it still be merged before friday?

@robertgshaw2-neuralmagic
Copy link
Collaborator

@robertgshaw2-neuralmagic Hi, will it still be merged before friday?

Working on merging this week

@HarryWu99
Copy link
Contributor Author

@robertgshaw2-neuralmagic ping~

@robertgshaw2-neuralmagic
Copy link
Collaborator

sorry - traveling this week. back to PR review.

Ill fix conflict + merge tom

@robertgshaw2-neuralmagic robertgshaw2-neuralmagic enabled auto-merge (squash) May 27, 2024 22:55
@HarryWu99
Copy link
Contributor Author

@robertgshaw2-neuralmagic Hello~ I see it's been approved for a while, but it is not merged yet. Anything wrong?

@LucasWilkinson
Copy link
Contributor

@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

auto-merge was automatically disabled September 7, 2024 16:01

Head branch was pushed to by a user without write access

@HarryWu99 HarryWu99 force-pushed the main branch 3 times, most recently from 6caccc2 to b61e51e Compare September 8, 2024 12:00
@comaniac comaniac added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 9, 2024
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337
Copy link
Member

I have updated this PR to be compatible with latest main, feel free to merge if you think it's still relevant.

@DarkLight1337 DarkLight1337 merged commit 874f551 into vllm-project:main Nov 11, 2024
51 checks passed
@vrdn-23
Copy link
Contributor

vrdn-23 commented Nov 12, 2024

@DarkLight1337 @HarryWu99 Just curious what exactly is the difference between time_queue_requests and the already existing vllm:time_in_queue_requests?

rickyyx pushed a commit to rickyyx/vllm that referenced this pull request Nov 13, 2024
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: Robert Shaw <rshaw@neuralmagic.com>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
omer-dayan pushed a commit to omer-dayan/vllm that referenced this pull request Nov 14, 2024
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: Robert Shaw <rshaw@neuralmagic.com>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: OmerD <omer@run.ai>
sumitd2 pushed a commit to sumitd2/vllm that referenced this pull request Nov 14, 2024
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: Robert Shaw <rshaw@neuralmagic.com>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Sumit Dubey <sumit.dubey2@ibm.com>
KuntaiDu pushed a commit to KuntaiDu/vllm that referenced this pull request Nov 20, 2024
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: Robert Shaw <rshaw@neuralmagic.com>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
mfournioux pushed a commit to mfournioux/vllm that referenced this pull request Nov 20, 2024
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: Robert Shaw <rshaw@neuralmagic.com>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Maxime Fournioux <55544262+mfournioux@users.noreply.github.com>
tlrmchlsmth pushed a commit to neuralmagic/vllm that referenced this pull request Nov 23, 2024
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: Robert Shaw <rshaw@neuralmagic.com>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
sleepwalker2017 pushed a commit to sleepwalker2017/vllm that referenced this pull request Dec 13, 2024
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Co-authored-by: Robert Shaw <rshaw@neuralmagic.com>
Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants