Implement evaluate_preemption(num_tokens_list, kv_cache_bytes_per_token, swap_bandwidth_gbps, base_flops_per_token, attn_flops_per_token_pair, compute_tflops), which decides for each preempted request whether to swap its KV cache to CPU or recompute it.
For a request with tokens (an entry of num_tokens_list), let = kv_cache_bytes_per_token, = swap_bandwidth_gbps (GB/s, bytes), = base_flops_per_token, = attn_flops_per_token_pair and = compute_tflops ( FLOPs).
'swap' if (compared before rounding; ties go to swapping), otherwise 'recompute'.Return a dict with keys:
'strategies': list of 'swap' / 'recompute', one per request, in input order'swap_costs_ms' and 'recompute_costs_ms': per-request costs, each rounded to 4 decimal places'total_cost_ms': sum of the chosen rounded costs, rounded to 4 decimal places