Add worker telemetry for key metrics (KV Cache Utilization, queue depth) at a configurable interval - #28
Open
jamesyan2028 wants to merge 2 commits into
Open
Conversation
added 2 commits
August 9, 2026 17:52
…th) at a configurable interval Signed-off-by: James Yan <james.yan2028@gmail.com>
Signed-off-by: James Yan <james.yan2028@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently Opal does not have a global view of per worker metrics for KVC utilization and queue depth. These metrics are important since they are consumed by other services (such as autoscaling) to make decisions. This pull starts and extends and implements _periodic_infra_updates() in vllm_worker.py so each worker periodically reports its KVC utilization and queue depth to the router. In addition, this pull request also adds computing and storing pluggable p90/p95/p99 TTFT and ITL over a sliding window of most recent requests in the router at the same interval that KVC utilization and queue depth metrics are pushed, to be used for future autoscaling decisions,
To simulate telemetry reporting in a distributed inference environment, each worker pushes their per-worker statistics to the router every self.periodic_infra_update_time virtual seconds as a SystemEvent dataclass. This configurable parameter is to simulate telemetry program (e.g. Prometheus) scrape/push intervals. The router gathers these per-worker SystemEvents and aggregates them into a MetricsSnapshot dataclass.
Previously in the router, a router process would be responsible for polling and draining the event_queue() of incoming events from workers. If the queue was empty, the router process would sleep for periodic_infra_update_collection_time number of seconds before waking up again to check the queue. This pull requests removes periodic_infra_update_collection_time, and instead choses to have the workers push their own telemetry every self.periodic_infra_update_time virtual seconds.
The router then stores the most recent MetricsSnapshot in self._latest_metrics, which can be queried by other services. A log of all past MetricsSnapshots taken during the simulation is also added to stage_statistics.py.