bug: PriorityRouter always picks the first engine when several engines have the same lowest load
Maintainers usually reply within 5 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- backend, distributed-systems
Research direction
Read the PriorityRouter implementation and compare its tie handling with PrefixAwareRouter, which the issue says already uses random choice. Run the tests in src/tests/test_priority_router.py and add coverage for multiple engines sharing the lowest load. Done means equally loaded engines can all be selected instead of always favoring the URL that sorts first.
Written by the indexing model from the issue text.
Description
Describe the bug
PriorityRouter sends a request whose priority is below the priority_threshold to the least-loaded engine.
But it picks the first engine URLs because of the sorted() and min() function.
When it comes to the several engines have the same lowest load, it always picks the engine whose URL sorts first.
For example, when all engines are idle or every engine has N request, the first engine gets more requests than the other engines.
To Reproduce
Router version: lmcache/lmstack-router:v0.1.14 and the same code on main branch(405a2fa).
-
Please start the router with
--routing-logic priority --priority-default 0 --priority-threshold 1in front of the several engines that serve the same model. -
Send requests without a priority to make every request uses the least-loaded path.
-
Count the requests that each engine receives
(In our setup, 4 vLLM engines, 30 minutes of VLM requests), the engines got 298, 276, 256 and 252 requests, in the order of their URLs.)
Expected behavior
I hope the router spreads the reuqests over all engiens that have the same lowest load.
Additional context
In my point of view, there are two simple ways to break the tie.
- Round-robin approach
random.choice(PrefixAwareRouteralready does this)
I will open a PR with option 2 to follow the existing concept with several tests in src/tests/test_priority_router.py
- Dominant language
- Python
- Stars
- 2.7k
- Forks
- 558
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vllm-project/production-stack
-
bug: router reports prefix cache stats as 0 on current vLLM (gpu_prefix_cache_ renamed)*Possibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
vllm-project/production-stack#1140 · 4 comments ·
Maintainers usually reply within 5 days
-
bug: helm-chart uses "_" instead of "-" for "--gpu-memory-utilization"Possibly taken @rahulssv-ibm claimed this 23 days ago. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vllm-project/production-stack#1116 · 1 comment ·
Maintainers usually reply within 5 days
-
Router doesn't proxy /reset_prefix_cache, unlike /sleep//wake_up//is_sleepingPossibly taken @AyushKashyapII claimed this 49 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/production-stack#1105 ·
Maintainers usually reply within 5 days
-
bug: DisaggregatedPrefillRouter raises IndexError (500) when no endpoint matches the prefill or decode labelPossibly taken @dundysm claimed this today. Open
vllm-project/production-stack#1214 ·
Maintainers usually reply within 5 days
-
bug: sleep mode is not detected when --enable-sleep-mode is in the container args (operator and helm command+args), so sleeping engines keep getting trafficPossibly taken @dundysm claimed this today. Open
vllm-project/production-stack#1212 ·
Maintainers usually reply within 5 days
All issues in vllm-project/production-stack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
AI bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AUTO-MAS-Project/AUTO-MAS#1960 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
btclib-org/btclib-wallet#872 ·
Maintainers usually reply within 1 day
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme loadPossibly taken A pull request linked to this issue is open or already merged. Openbug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
saltstack/salt#70789 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
btclib-org/btclib#3093 ·
Maintainers usually reply within 1 day