A2Optimizer: Accelerating Time-to-Efficiency of LLM Serving with Agents
Lee et al. in Inference & systems
AI agents write serving code; GPU benchmarks slow the search
A2Optimizer: Accelerating Time-to-Efficiency of LLM Serving with Agents
Serving has two goals, not one

Axes are tokens/s/GPU (throughput) and tokens/s/user (interactivity). Each cN marks N simultaneous requests; more concurrency can raise throughput but slow each user's stream.
Setup can take longer than measurement

Across 14 five-level GLM-5.3-Flash sweeps on 8×H100, a candidate sweep averaged ~1.3 h; setup averaged 44.5 min versus 25.6 min spent measuring. GPU benchmarking consumed 18.8 h of the 24 h baseline.
GPU queues stall the optimization loop
The loop diagnoses on GPUs, chooses configuration/code changes, correctness-tests code, then benchmarks every candidate; rounds wait for all verdicts before re-diagnosing.
It refills a slot after each verdict, but GPU diagnosis after every acceptance competes with candidate benchmark sweeps queued for the same server.
Without simulation, async moves the wait from the round barrier to GPU diagnosis.
Candidate slots spend most of the run idle

Panel (b): in the synchronous 24-hour GLM-5.3-Flash run with eight slots on 8×H100, each slot averaged 36 min implementing and 21 min testing, versus 449 idle (89% of slot time).
A2Optimizer's simulator evolves with serving code
- 1
Profile kernels offline
Measure target-GPU kernel latencies offline across batch sizes and sequence lengths; store profiles by input shape.
- 2
Replay the engine
Replay request traces on CPUs with matching scheduler and KV-cache rules; combine kernel times into performance metrics and diagnosis.
- 3
Reflect code edits
Unlike fixed-implementation simulators, A2Optimizer adds latency profiles or mirrors changed kernel graphs and engine rules.
- 4
Check engine changes
For engine edits, the modified engine and simulator replay identical traces on CPUs; their scheduling and KV-cache decisions must match before use.
Simulation moves routine decisions off GPUs
- 1
Pick a starting configuration
Screen each knob, then combine useful values in simulation before code optimization.
- 2
Judge the whole system
Compare throughput and interactivity across levels; require >0.5% gain without >0.5% loss anywhere; mixed cases favor target concurrency.
- 3
Refill slots asynchronously
Every verdict frees its slot; after acceptance, diagnose in simulation and refill without waiting on GPU batches or other coders.
- 4
Batch GPU ground-truth checks
Escalate unmodeled edits; after K=8 accepted/escalated candidates, GPU-benchmark current system for calibration, test escalations individually, then diagnose in background.
A2Optimizer reaches the target sooner

Target: baseline loop's best per-GPU throughput at concurrency 32 within 24h. Across four 8×H100 workloads (p50 TTFT ≤10 s), A2Optimizer reached it 1.1–15.1× sooner (3.9× geometric mean).
Asynchrony helps when GPU time is freed
On GLM-5.3-Flash with eight slots, baseline async reached target in 14.8 h, later than sync at 12.8 h; both baseline variants used about 1.2 GPU h/candidate.
With N=8 and K=8, A2Optimizer async reached target 2.1× sooner than sync and accepted 41 vs 17 candidates; both used 0.23–0.26 GPU h/candidate.
The ablation links the gain to less GPU time per candidate, not asynchrony alone.
A2Optimizer forms the frontier at every concurrency

At concurrency 32 after 24 hours on 8×H100, the final system delivered 1.06–1.11× baseline-loop throughput and 1.04–1.38× interactivity across four models; p50 TTFT stayed ≤10 s, and interactivity uses p50 TPOT.
Accuracy scores shifted by at most 0.23 percentage points
The initial configuration was the reference; GSM8K used five-shot prompting and greedy decoding, while MMLU used five-shot log-likelihood scoring.
Across all 1,319 GSM8K test problems and 14,042 MMLU questions, scores differed from the initial configuration by at most 0.23 percentage points.
The simulator still misses host-side work
Host-side blind spot
Kernel launches, host-GPU synchronization, request scheduling, and offloading-software overhead are unmodeled; periodic GPU diagnosis exposes these costs.
Batch size can hide wins
In GLM, K=8 accepted four of six escalations, together accounting for 42% of per-GPU throughput gain; K=16 had three escalations and accepted none.
Evaluation scope
Four models under AgentX or ShareGPT were tested with vLLM 0.32.0 on one 8×H100 server; other engines and hardware were not tested here.
Why it matters
- Repeated GPU benchmarks and diagnosis, rather than agent coding, set time-to-efficiency in this serving search.
- Keep the simulator current with code changes; save target-server sweeps for calibration and changes it cannot model.
- Will this loop stay reliable on different hardware, workloads, and serving engines?
13 slides, 3 min
1 day ago