A decode GPU is full when it runs out of batch slots or when it runs out of KV memory, and a request can be heavy in one and light in the other. Route each request to the GPU where it has the most headroom in units of itself.
route_decode(requests, gpus, bytes_per_token, t0, alpha, beta)
requests is a list of (prompt_tokens, max_new_tokens) in arrival order. gpus is a list of dicts with "slots", "kv_bytes", "used_slots", "used_kv".(prompt_tokens + max_new_tokens) * bytes_per_token bytes of KV. A GPU is feasible if it has a free slot and enough free KV bytes. Its headroom is min(free_slots, free_kv // need), the number of copies of this request it could still take.-1 and do not reserve anything. Reservations persist across requests.used_kv / bytes_per_token), rounded to 4 decimals.{"assignment": [...], "used_slots": [...], "used_kv": [...], "step_times": [...]}; used_kv as integers.