Skip to content

[Misc] Add Ray Prometheus logger to V1 #17925

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

Merged
merged 10 commits into from
May 16, 2025

Conversation

eicherseiji
Copy link
Contributor

@eicherseiji eicherseiji commented May 9, 2025

Implements the following item from #10582:

  • [P1] Allow users to define their own prometheus client and other arbitrary loggers.

Tested with V1 as follows (with ray-project/ray#52719):

VLLM_USE_V1=1 python serve.py

#serve.py
import ray
from ray import serve
from ray.serve.llm import LLMConfig, build_openai_app

llm_config = LLMConfig(
    model_loading_config=dict(
        model_id="qwen-0.5b",
        model_source="Qwen/Qwen2.5-0.5B-Instruct",
    ),
    deployment_config=dict(
        autoscaling_config=dict(
            min_replicas=1, max_replicas=1,
        )
    ),
    log_engine_metrics=True
)

ray.init(num_cpus=3, num_gpus=1)
app = build_openai_app({"llm_configs": [llm_config]})
serve.run(app, blocking=True)

Ray dashboard output:
Screenshot 2025-05-09 at 1 48 31 PM

Copy link

github-actions bot commented May 9, 2025

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

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 either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the v1 label May 9, 2025
@eicherseiji eicherseiji marked this pull request as ready for review May 9, 2025 23:35
@eicherseiji eicherseiji marked this pull request as draft May 9, 2025 23:36
@eicherseiji eicherseiji changed the title [Misc] Add Ray Prometheus logger to V1 [WIP][Misc] Add Ray Prometheus logger to V1 May 9, 2025
@eicherseiji eicherseiji marked this pull request as ready for review May 11, 2025 02:03
@eicherseiji eicherseiji changed the title [WIP][Misc] Add Ray Prometheus logger to V1 [Misc] Add Ray Prometheus logger to V1 May 12, 2025
Copy link
Collaborator

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

Overall LGTM. Mainly coding style and structure discussions.

Also cc @markmc

Copy link

mergify bot commented May 12, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @eicherseiji.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label May 12, 2025
@eicherseiji eicherseiji force-pushed the ray_prometheus_logger branch from 05b63be to 1c773e2 Compare May 12, 2025 21:45
@mergify mergify bot removed the needs-rebase label May 12, 2025
@eicherseiji eicherseiji force-pushed the ray_prometheus_logger branch 2 times, most recently from fc1838a to b793da4 Compare May 12, 2025 22:13
Copy link
Member

@markmc markmc left a comment

Choose a reason for hiding this comment

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

No fundamental objection to adding a vllm.v1.metrics.ray.RayPrometheusStatLogger custom logger

I'd prefer not to add the extra PrometheusMetrics indirection

And ~90% of the diff is unnecessary reformatting of code which makes it more difficult to review

@eicherseiji
Copy link
Contributor Author

Thanks for the review @markmc! Apologies for reformatting changes. My pre-commit hook may have been configured incorrectly.

@eicherseiji eicherseiji force-pushed the ray_prometheus_logger branch 2 times, most recently from a923f87 to a41f879 Compare May 13, 2025 17:26
@kouroshHakha
Copy link
Contributor

Hey @eicherseiji I made some changes to the interface of PrometheusStatLogger that I think will conflict your stuff, but at the same time it will make this PR easier to write and review if you incorporate those changes. for easier review https://github.com/njhill/vllm/pull/6/files but this one is actually against master (which includes other stuff) #18053

@eicherseiji eicherseiji marked this pull request as draft May 13, 2025 22:03
@eicherseiji eicherseiji marked this pull request as ready for review May 13, 2025 22:22
@eicherseiji
Copy link
Contributor Author

Done. Thanks @kouroshHakha

@eicherseiji eicherseiji force-pushed the ray_prometheus_logger branch from ece396d to 3079a87 Compare May 14, 2025 14:15
@eicherseiji
Copy link
Contributor Author

Starting with a rebase due to test failure:

[2025-05-14T01:44:26Z] �[36m�[1m=========================== short test summary info ============================�[0m
[2025-05-14T01:44:26Z] �[31mFAILED�[0m entrypoints/openai/test_audio.py::�[1mtest_chat_streaming_audio[https://vllm-public-assets.s3.us-west-2.amazonaws.com/multimodal_asset/mary_had_lamb.ogg-fixie-ai/ultravox-v0_5-llama-3_2-1b]�[0m - AssertionError: assert 'This audio a...t from a poem' == 'This audio a...a traditional'
[2025-05-14T01:44:26Z]   
[2025-05-14T01:44:26Z]   - This audio appears to be a snippet from a traditional
[2025-05-14T01:44:26Z]   ?                                           ^^^^^^^ ^^^
[2025-05-14T01:44:26Z]   + This audio appears to be a snippet from a poem
[2025-05-14T01:44:26Z]   ?                                           ^ ^^
[2025-05-14T01:44:26Z] �[31m====== �[31m�[1m1 failed�[0m, �[32m426 passed�[0m, �[33m2 skipped�[0m, �[33m36 warnings�[0m�[31m in 3825.08s (1:03:45)�[0m�[31m ======�[0m
�[0m^^^ +++
[2025-05-14T01:44:29Z] �[31m🚨 Error: The command exited with status 1�[0m]

Copy link
Member

@markmc markmc left a comment

Choose a reason for hiding this comment

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

Pretty happy to merge the ray stuff, but there's still a lot of unrelated changes I'd like to see removed

Copy link
Contributor Author

@eicherseiji eicherseiji left a comment

Choose a reason for hiding this comment

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

Thanks again @markmc for the review! Going to remove mentions to multiprocess_mode and unnecessary type hint changes for now.

Let me know what the recommendation is for Ray wrapper class injection (should we prefer static class variables for now?)

@markmc
Copy link
Member

markmc commented May 14, 2025

Let me know what the recommendation is for Ray wrapper class injection (should we prefer static class variables for now?)

What you had the first time around with the static class variables was fine - I just asked to remove the extra Metrics class

@eicherseiji eicherseiji force-pushed the ray_prometheus_logger branch from 858f20b to a0f1b00 Compare May 14, 2025 21:25
Copy link
Member

@markmc markmc left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for your patience. Just some questions on the test you added


# Create the actor and call the async method
actor = EngineTestActor.remote() # type: ignore[attr-defined]
ray.get(actor.run.remote())
Copy link
Member

Choose a reason for hiding this comment

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

You're not actually verifying metrics behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a smoke test for now; added a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the future it would be helpful to verify output to avoid regressions. But setting up a ray cluster in the test environment could be non-trivial.

So I think that ROI is okay with this to start, given the current design (class injection with a wrapper that's verified in ray-project).

Copy link
Contributor Author

@eicherseiji eicherseiji left a comment

Choose a reason for hiding this comment

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

Responded to comments @markmc! 🙏


# Create the actor and call the async method
actor = EngineTestActor.remote() # type: ignore[attr-defined]
ray.get(actor.run.remote())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a smoke test for now; added a comment.


# Create the actor and call the async method
actor = EngineTestActor.remote() # type: ignore[attr-defined]
ray.get(actor.run.remote())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the future it would be helpful to verify output to avoid regressions. But setting up a ray cluster in the test environment could be non-trivial.

So I think that ROI is okay with this to start, given the current design (class injection with a wrapper that's verified in ray-project).

Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
@eicherseiji eicherseiji force-pushed the ray_prometheus_logger branch from 4af2dd1 to ffc3331 Compare May 15, 2025 14:32
Copy link
Member

@markmc markmc left a comment

Choose a reason for hiding this comment

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

Thanks again for your patience!

Copy link
Collaborator

@simon-mo simon-mo left a comment

Choose a reason for hiding this comment

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

stamp

@simon-mo simon-mo enabled auto-merge (squash) May 15, 2025 22:46
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label May 15, 2025
@vllm-bot vllm-bot merged commit 5418176 into vllm-project:main May 16, 2025
65 of 67 checks passed
huachenheli pushed a commit to huachenheli/vllm that referenced this pull request May 22, 2025
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Chenheli Hua <huachenheli@outlook.com>
zzzyq pushed a commit to zzzyq/vllm that referenced this pull request May 24, 2025
Signed-off-by: Seiji Eicher <seiji@anyscale.com>
Signed-off-by: Yuqi Zhang <yuqizhang@google.com>
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 v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy