fix: heavy tier — Dense first for reasoning, MoE workhorse, VLM overflow
This commit is contained in:
+7
-6
@@ -119,7 +119,11 @@ def is_gpu_busy(model):
|
|||||||
return active >= max_c
|
return active >= max_c
|
||||||
|
|
||||||
def select_best_gpu(candidates, reason):
|
def select_best_gpu(candidates, reason):
|
||||||
"""Pick the best GPU from candidates, preferring least-loaded."""
|
"""Pick the best GPU from candidates IN ORDER — first non-busy one wins."""
|
||||||
|
for m in candidates:
|
||||||
|
if not is_gpu_busy(m):
|
||||||
|
return {"model": m, "reason": reason}
|
||||||
|
# All busy — pick least loaded
|
||||||
best = None
|
best = None
|
||||||
best_load = 999
|
best_load = 999
|
||||||
for m in candidates:
|
for m in candidates:
|
||||||
@@ -128,10 +132,7 @@ def select_best_gpu(candidates, reason):
|
|||||||
best_load = load
|
best_load = load
|
||||||
best = m
|
best = m
|
||||||
if best:
|
if best:
|
||||||
actual_reason = reason
|
return {"model": best, "reason": "load_balanced_" + reason}
|
||||||
if is_gpu_busy(best):
|
|
||||||
actual_reason = "load_balanced_" + reason
|
|
||||||
return {"model": best, "reason": actual_reason}
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def route(rd, tier):
|
def route(rd, tier):
|
||||||
@@ -182,7 +183,7 @@ def route(rd, tier):
|
|||||||
|
|
||||||
# TIER 3: Heavy reasoning — large context or very long conversations
|
# TIER 3: Heavy reasoning — large context or very long conversations
|
||||||
if t > 4000 or turns > 8:
|
if t > 4000 or turns > 8:
|
||||||
candidates = [m for m in ["qwen3.6-35B-A3B","qwen3.5-9b-vlm","qwen3.6-27B-code"] if m in avail]
|
candidates = [m for m in ["qwen3.6-27B-code","qwen3.6-35B-A3B","qwen3.5-9b-vlm"] if m in avail]
|
||||||
result = select_best_gpu(candidates, "heavy_reasoning")
|
result = select_best_gpu(candidates, "heavy_reasoning")
|
||||||
if result: return result
|
if result: return result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user