Skip to content

Conversation

@markmc
Copy link
Member

@markmc markmc commented Jan 28, 2025

Follow on from #12478, part of #10582

Observe these values as requests are finished.

Requires keeping track of generated tokens per-request to handle streaming delta updates.

Observe these values as requests are finished.

Requires keeping track of generated tokens per-request to handle
streaming delta updates.

Signed-off-by: Mark McLoughlin <[email protected]>
@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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 do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

iteration_stats.num_generation_tokens)

for finished_request in iteration_stats.finished_requests:
self.histogram_num_prompt_tokens_request.observe(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QQ, in V0, we did:

histogram.labels(**self.labels).observe(datum)

histogram.labels(**self.labels).observe(datum)

Do you know why this is or is not needed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ill hit automerge to unblock you

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

labels() is a pretty expensive factory method and our labels aren't ever changing, so I'm building these labelled metrics in the PrometheusStatLogger constructor

self.histogram_num_generation_tokens_request = \
            prometheus_client.Histogram(
                name="vllm:request_generation_tokens",
                documentation="Number of generation tokens processed.",
                buckets=build_1_2_5_buckets(max_model_len),
                labelnames=labelnames).labels(*labelvalues)

Not so easy to spot it though!

@robertgshaw2-redhat robertgshaw2-redhat added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 28, 2025
@robertgshaw2-redhat robertgshaw2-redhat enabled auto-merge (squash) January 28, 2025 19:55
@robertgshaw2-redhat robertgshaw2-redhat merged commit c386c43 into vllm-project:main Jan 28, 2025
60 checks passed
rasmith pushed a commit to rasmith/vllm that referenced this pull request Jan 30, 2025
Isotr0py pushed a commit to Isotr0py/vllm that referenced this pull request Feb 2, 2025
@markmc markmc deleted the metrics-v1-prometheus-logger-3 branch February 5, 2025 11:52
NickLucche pushed a commit to NickLucche/vllm that referenced this pull request Feb 7, 2025
GWS0428 pushed a commit to GWS0428/VARserve that referenced this pull request Feb 12, 2025
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.

2 participants