Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new Prometheus metric, routing_decisions_total, to track routing decisions across all router implementations. It adds logic to record these decisions with labels for server, model, algorithm, and outcome. Feedback suggests that the KvawareRouter should specifically record a fallback outcome upon a KV cache miss when a session ID is present, and that the test suite should be updated accordingly.
cf970c4 to
16df357
Compare
ruizhang0101
left a comment
There was a problem hiding this comment.
I am wondering what is the use case for this metrics? IIUC, each request will go through routing decision. So if we don't consider retry or fail, they should be the same?
16df357 to
cfd20ea
Compare
|
Hi @ruizhang0101, good to see you again. Sorry I left this hanging for so long. You’re right. In the simple case this mostly duplicates the request counter. The useful part is seeing where traffic goes and when routing falls back or retries. I checked current main and this PR is too stale to revive as is, so I’d rather rework it around those cases. What do you think? |
cfd20ea to
3bbe398
Compare
|
Reworked this around the gap you pointed out. The counter now records bounded |
|
@ruizhang0101 any feedback on the revised routing counter? It now covers routing choices and fallbacks rather than request volume. |
|
#1079 is waiting for review too. @Shaoting-Feng could you take a look at the routing counter changes here? |
|
The routing counter changes here and the resource requests and limits in #1079 are still awaiting review. @YuhanLiu11 could you look at them? |
f70aa03 to
c1c3803
Compare
Add vllm:routing_fallbacks_total{routing_logic,reason}, counted when the
session, kvaware, loadaware or prefixaware router leaves its primary
policy. Every request is routed, so the request counter cannot show how
often a router fell back, e.g. KV-aware routing missing the cache.
Signed-off-by: Mikhail Basov <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
c1c3803 to
0c40288
Compare
|
@ruizhang0101 you were right that counting every routing decision mostly repeats the request counter. I cut this PR down to the part the request counter can't show: |
|
@Shaoting-Feng could you take a look at this reworked fallback counter? It is now about 25 lines of router code plus tests, and CI is green. |
The request counter shows how many requests were routed, but not how often a routing logic left its primary policy. KV-aware routing that keeps missing the cache still routes every request, so the miss does not show up in metrics (#1062 documents how silent this is today).
This adds one counter,
vllm:routing_fallbacks_total{routing_logic, reason}, incremented only when a router takes its fallback path:routing_logicreasonsessionno_session_idkvawareno_cache_hit,no_live_holder,below_thresholdloadawarelookup_failed,no_cache_hitprefixawarebelow_thresholdRouting behavior does not change. Both labels take fixed values, so the counter has at most 7 series.
Tests add one case per reason, plus a primary-path hit that must not be counted, in the existing per-router test files.
pytest src/testspasses (283), and pre-commit passes on the changed files.Refs #474