From 1d2148cf65d057d99a7921feb75910757aca9398 Mon Sep 17 00:00:00 2001 From: Gahow Wang Date: Mon, 25 May 2026 00:42:31 +0800 Subject: [PATCH] Remove second push_new gate that caused downgrade-to-cold-LOCAL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After _push_allowed was relaxed, the cost model correctly chose push for high-cache sessions on overloaded instances. But a second gate at execution time (push_new < heavy_threshold) blocked the actual offload, downgrading to LOCAL on the target instance — which had no cache. Worse, session affinity was already updated to the target, so all subsequent turns also hit cold prefill. This was the root cause of relaxed gate's performance regression: affinity broken + push blocked = worst of both worlds. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/cache_aware_proxy.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/scripts/cache_aware_proxy.py b/scripts/cache_aware_proxy.py index 1dead20..58c00dc 100644 --- a/scripts/cache_aware_proxy.py +++ b/scripts/cache_aware_proxy.py @@ -613,16 +613,6 @@ async def _handle_combined(api, req_data, token_ids, input_length, session_id, h return await _handle_local_request( api, req_data, headers, token_ids, input_length, chosen, estimated_new, breakdown) - if push_new < SETTINGS.heavy_threshold: - breakdown["push_downgraded"] = "below_heavy_threshold" - return await _handle_local_request( - api, req_data, headers, token_ids, input_length, - chosen, estimated_new, breakdown) - if SETTINGS.cache_gate_ratio > 0 and cache_ratio < SETTINGS.cache_gate_ratio: - breakdown["push_downgraded"] = "cache_gate" - return await _handle_local_request( - api, req_data, headers, token_ids, input_length, - chosen, estimated_new, breakdown) offload_mode = getattr(global_args, 'offload_mode', 'cached_prefill') breakdown["c_inst"] = c_inst.url