Skip to content

feat: dynamic pass-through vLLM inference metrics to W&B - #3240

Open
mikasenghaas wants to merge 5 commits into
mainfrom
feat/vllm-metrics-passthrough
Open

feat: dynamic pass-through vLLM inference metrics to W&B#3240
mikasenghaas wants to merge 5 commits into
mainfrom
feat/vllm-metrics-passthrough

Conversation

@mikasenghaas

@mikasenghaas mikasenghaas commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace the hand-curated inference-metric allowlist with a dynamic pass-through: every vllm:* Prometheus family the engines emit is logged to W&B automatically.
  • Keys follow inference/{scope}/{metric}/{stat}, with the vllm: prefix stripped. Scopes: agg (all engines), prefill/decode (disaggregated only), and one scope per engine id (server0.0, ...).
  • Gauges and counters pass through verbatim; counters add a derived :rate. Histograms log _sum/_count plus :rate/:mean, and scope-level /p50|p90|p99 from pooled bucket deltas. prefix_cache_hit_rate logs /pooled (Δhits/Δqueries over the scope) plus per-engine aggregations (/min, /max, ...).
  • Engine identity is {endpoint}.{engine_label}, so DP engines behind one endpoint get separate scopes. One code path covers all deployment types.
  • The auto-generated W&B overview gains an inference section: 7 panels pairing the fleet aggregate (mean/sum) with the cross-engine tail that flags a single sick engine (max for pressure, min for health) — KV usage, preemption rate, requests running/waiting, prefix hit rate, generation and prompt token rates.
  • Config surface unchanged: collect_inference_metrics toggles collection; inference_metrics_roles is still auto-derived for disaggregated runs.

Breaking

  • All inference metric keys are renamed; saved dashboards need updating. Old inference/engine/{id}/vllm:* and the curated names are gone.
  • Raw samples are logged each poll instead of a trailing 20-sample mean. Use W&B UI smoothing. This also stops stale metrics from re-logging at their last window average forever.
  • running_imbalance/waiting_imbalance are dropped — read max vs mean/min of num_requests_running|waiting. The combined throughput alias is dropped — read prompt|generation_tokens_total:rate/sum.

Verification

E2E on a SLURM H200 cluster (Qwen3-30B-A3B, alphabet-sort, 3 steps per deployment type, W&B project inference-metrics-smoke):

  • single-node, dp2 behind one endpoint: engine-label split into server0.0/server0.1 — run afe1a971
  • multi-node, 2 replicas × tp4: server0.0server3.0 — run 6926f621
  • disaggregated P/D (NIXL, llm-d router): prefill*/decode* scopes with exact scope-sum consistency (322 prefill prompt tokens = 226 + 96) — run e9098978; the 3-step loop is blocked by pre-existing PD serving issues

Per-run API checks: all five aggregations per metric, per-engine counters sum to the agg sum, rates/quantiles/hit rate non-degenerate under live traffic.

Schema e2e after the key rename: reverse-text RL, 20/20 steps, reward 0.16 → 0.71 — run vllm-metrics-schema-e2e. API-verified: 628 inference/* keys, zero vllm: prefixes, flattened engine scopes, quantiles as /p99, hit rate /pooled + /min, no legacy keys.


Note

Medium Risk
Large refactor of orchestrator metrics logging with breaking W&B key renames and behavior change (no smoothing), but limited to observability—not training or inference serving logic.

Overview
Replaces the hand-curated vLLM Prometheus allowlist with dynamic pass-through of every vllm:* family. Scrapes are parsed into per-engine snapshots (EngineSnapshot), logged per engine as inference/{endpoint.engine}/{metric}, and rolled up to inference/agg|prefill|decode/{metric}/{min|max|sum|mean|median} (plus histogram p50/p90/p99 from pooled bucket deltas and :rate / :mean derived from poll-interval deltas).

Breaking observability changes: metric key names change entirely; the 20-sample smoothing window is removed (raw values each poll); curated aliases like throughput, running_imbalance, and fixed-scope counters are dropped in favor of the generic naming scheme.

The W&B overview workspace adds a dedicated inference section with multi-series panels (fleet aggregate vs min/max tail) for KV usage, preemptions, queue depth, prefix cache hit rate, and token rates; legacy inference keys are removed from the performance section.

Reviewed by Cursor Bugbot for commit d7b9084. Bugbot is set up for automated code reviews on this repo. Configure here.

mikasenghaas and others added 2 commits August 11, 2026 17:35
Replace the hand-curated inference metric allowlist with a dynamic
pass-through collector: every vllm:* Prometheus family is logged,
per-engine under inference/engine/{id}/ and cross-engine aggregations
(min/max/mean/median/sum) under inference/{agg|prefill|decode}/.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… flag

Hardcode poll interval, aggregations, and per-engine logging in the
collector; config surface is unchanged from main (collect_inference_metrics
+ inference_metrics_roles).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mikasenghaas and others added 3 commits August 12, 2026 22:23
Seven panels, each pairing the fleet aggregate (mean/sum) with the
cross-engine tail that flags a single sick engine - max for pressure
(KV usage, preemptions, waiting, prompt-token recompute), min for
health (prefix hit rate, generation throughput). A saturated engine
thrashing its KV cache hides inside fleet means; the tails surface it.

Also compute the prefix-cache hit-rate ratio per engine (not only
pooled over the fleet) so the min/max aggregations exist for it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drop the vllm: family prefix (the collector only admits vllm:* families,
so it carries no information), flatten per-engine series from
inference/engine/{id}/... to inference/{id}/..., and move scope-level
quantiles (:p50 -> /p50) and the pooled ratio (-> /pooled) into the
stat segment so every key reads inference/{scope}/{metric}/{stat}.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mikasenghaas
mikasenghaas marked this pull request as ready for review August 13, 2026 03:43
@mikasenghaas
mikasenghaas requested review from S1ro1 and samsja August 13, 2026 03:45

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d7b9084. Configure here.

"inference/agg/num_requests_waiting/max",
],
["inference/agg/prefix_cache_hit_rate/pooled", "inference/agg/prefix_cache_hit_rate/min"],
["inference/agg/generation_tokens_total:rate/sum", "inference/agg/generation_tokens_total:rate/min"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agg generation min hides decode stalls

Medium Severity

The overview pairs fleet generation_tokens_total:rate/sum with /min on the agg scope. In disaggregated runs agg includes prefill engines whose generation rate stays at zero, so the min series is pinned at 0 and cannot flag a stalled decode engine. Decode-scoped min/sum series are logged but this panel does not use them.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d7b9084. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant