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

[V1][Core][1/n] Logging and Metrics #11962

Merged

Conversation

robertgshaw2-neuralmagic
Copy link
Collaborator

@robertgshaw2-neuralmagic robertgshaw2-neuralmagic commented Jan 11, 2025

SUMMARY

  • Add logging to VLLM V1. For V1, we want to avoid doing work in EngineCore and doing full loops over Request data.
  • Architecture will work as follows:
    • For SchedulerStats, EngineCore will create in each step() and send EngineCoreOutput.
    • For RequestStats, EngineCore marks the state of each request in update_from_output and adds the metadata to EngineCoreOutput while it is being created (no additional loop).
    • AsyncLLM then handles computing the Stats and logging.

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.

🚀

@robertgshaw2-neuralmagic robertgshaw2-neuralmagic changed the title added code [V1][Core][1/n] Logging and Metrics Jan 11, 2025
@robertgshaw2-neuralmagic robertgshaw2-neuralmagic added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 11, 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


# 3) Put the RequestOutputs into the per-request queues.
self._process_request_outputs(request_outputs)

# 4) Abort any requests that finished due to stop strings.
await self.engine_core.abort_requests_async(reqs_to_abort)

# 5) Log any stats.
await self._log_stats(scheduler_stats=outputs.scheduler_stats)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we going to improve the metric system later to remove it from the critical path? Or its overhead is acceptable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is not in the EngineCore process, so it is overlapped with GPU execution (and therefore is not in the critical path). If this becomes a bottleneck for latency we can offload to a 3rd process but I don’t except this to be needed.

Comment on lines 217 to 219
# Break out the loops so we can log_stats via step().
if self.log_stats:
break
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move after the logger.debug?

@@ -42,6 +42,7 @@ def __init__(
use_cached_outputs: bool = False,
multiprocess_mode: bool = False,
) -> None:
assert log_stats is False
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add note?

self.stat_loggers = stat_loggers
self.stat_loggers: List[StatLoggerBase] = [
LoggingStatLogger(),
# PrometheusStatLogger(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add TODO?

@robertgshaw2-neuralmagic robertgshaw2-neuralmagic enabled auto-merge (squash) January 12, 2025 14:15
@robertgshaw2-neuralmagic robertgshaw2-neuralmagic merged commit 9597a09 into vllm-project:main Jan 12, 2025
50 checks passed
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