-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
[Misc] Have AsyncLLM custom_stat_loggers extend default logger list
#20952
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
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
485bfed
Add add_logger API to AsyncLLM
eicherseiji ba96afc
Simplify by avoiding duplicate logger checks
eicherseiji dda13e3
Merge upstream
eicherseiji 82a3a09
Adapt to #21257
eicherseiji 8274b5c
Merge upstream
eicherseiji c5aa929
Clean revert to main
eicherseiji 75254ec
disable_log_stats=True disables default loggers only
eicherseiji d217624
Revert excess changes to async_llm.py and loggers.py
eicherseiji 95b9811
Apply suggestions from code review
eicherseiji 04caee2
Apply suggestions from code review
eicherseiji 716f713
Restore self.prometheus_logger
eicherseiji f4661dc
Remove remaining reference to dp_shared_loggers and update tests
eicherseiji 7afbbaa
Merge branch 'main' into v1-add-logger
njhill 95eae5d
Update test_customize_loggers with new behavior
eicherseiji a4546b2
Merge branch 'main' into v1-add-logger
njhill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
| import pytest | ||
|
|
||
| from vllm.v1.engine.async_llm import AsyncEngineArgs, AsyncLLM | ||
| from vllm.v1.metrics.ray_wrappers import RayPrometheusStatLogger | ||
|
|
||
| DEFAULT_ENGINE_ARGS = AsyncEngineArgs( | ||
| model="distilbert/distilgpt2", | ||
| dtype="half", | ||
| disable_log_stats=False, | ||
| enforce_eager=True, | ||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_async_llm_replace_default_loggers(): | ||
| # Empty stat_loggers removes default loggers | ||
| engine = AsyncLLM.from_engine_args(DEFAULT_ENGINE_ARGS, stat_loggers=[]) | ||
| await engine.add_logger(RayPrometheusStatLogger) | ||
|
|
||
| # Verify that only this logger is present in shared loggers | ||
| assert len(engine.logger_manager.shared_loggers) == 1 | ||
| assert isinstance(engine.logger_manager.shared_loggers[0], | ||
| RayPrometheusStatLogger) | ||
|
|
||
|
|
||
| @pytest.mark.asyncio | ||
| async def test_async_llm_add_to_default_loggers(): | ||
| # Start with default loggers, including PrometheusStatLogger | ||
| engine = AsyncLLM.from_engine_args(DEFAULT_ENGINE_ARGS) | ||
|
|
||
| # Add another PrometheusStatLogger subclass | ||
| await engine.add_logger(RayPrometheusStatLogger) | ||
|
|
||
| assert len(engine.logger_manager.shared_loggers) == 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.