NVIDIA Developer ★ 101 7 min

How SWE-Serve Exposes the Gap Between Local Tests and Live Serving

Agentic AI / Generative AIData ScienceDeveloper Tools & TechniquesAI AgentLLM BenchmarkingMachine Learning & Artificial IntelligenceOpen Source

🔗 https://developer.nvidia.com/blog/how-swe-serve-exposes-the-gap-between-local-tests-and-live-serving/

📌 通過單元測試不代表能上線:SWE-Serve 揪出的 serving 落差

TL;DR:NVIDIA 與 SGLang 團隊推出的 SWE-Serve benchmark 顯示,近三分之一通過一般測試的 patch,在真實 serving 下會失敗。

你的 coding agent 寫的 patch,單元測試全綠,結果一接上真正的推理伺服器就掛了——這不是個案,而是 SWE-Serve 想量化的系統性落差。

🤔 背景:沒人測過「serving 本身」改對了沒

既有的 repo-level benchmark 評估一般軟體工程任務,inference benchmark 又多聚焦在 kernel 生成或效能最佳化,兩者都沒有測試「inference-serving stack 本身的變更」是否真的能跑起來、回傳正確結果。SWE-Serve 想補上這一塊:評估模型啟用、decoding、caching、scheduling、serving API 與 runtime 效能等真實 serving 路徑上的正確性。

🧩 方法:83 個 merged PR,變成 53 個可執行任務

SWE-Serve 是與 SGLang 團隊合作開發,把 83 個 merged 到 SGLang(一套開源 LLM serving 系統)的 pull request,轉成 53 個可執行任務,分成六大 inference-engineering 家族:

工程家族任務數
Speculative 與進階 decoding14
模型與 backend 啟用12
Kernel、量化與效能8
Serving API 與 runtime 正確性8
Caching 與 runtime 狀態7
分散式執行與 scheduling4

12 個任務跑在 CPU,41 個用單張 H100;這一版尚不評估其他 inference engine、多 GPU 或多節點 serving。每個任務給 agent 一段指令,以及一份目標變更之前的 containerized SGLang checkout,agent 的 patch 只要通過該任務的 hidden verifier 就算過,不會與 reference implementation 直接比對。中位數的 reference solution 修改 553 行、涉及 7 個檔案;典型 verifier 有 7 個新行為測試加 10 個 regression 測試。19 個任務會啟動真正的 server,3 個在 H100 上設有校準過的效能門檻。

舉例來說,其中一個任務要求 agent 為 Qwen3.5 的 dense 與 mixture-of-experts(MoE)版本加上 serving 支援:要讓 0.8B dense 模型與 35B-A3B MoE 模型都能在單張 H100 上,透過 SGLang 標準介面載入與 serving。verifier 會檢查 model registration、設定與權重載入、圖片與影片輸入、OpenAI 相容請求、native batched generation、log probabilities,以及 MoE 路由的執行正確性。

📊 數據:拿掉 live serving 測試,通過率從 45.9% 跳到 69.4%

在 19 個含 live-serving 檢查的任務中,同一批 627 個 patch,若拿掉 live serving 測試,通過率是 69.4%;套用完整 verifier 後只剩 45.9%,等於 147 個 patch 從「過」變成「沒過」。這 19 個任務共有 276 個 live serving 測試,其中 242 個來自或改自 SGLang 本身,其餘 34 個是為對應變更新寫的。

以 Gemma 4 MoE 任務為例,33 個 patch 裡有 16 個通過了所有其他檢查,卻至少在一項 live serving 測試上失敗,這些測試涵蓋 model loading、expert routing、文字與圖片 serving,以及有正確順序與 log probabilities 的 batched generation。

文章把 request-to-output 路徑拆成四個 runtime domain:request handling 與 I/O、scheduling 與請求生命週期、model execution、KV-cache 與 runtime 資源管理。只涉及單一 domain 的 26 個任務通過率是 69.0%,跨多個 domain 的 27 個任務只有 47.7%,差距 21.3 個百分點,而且每一種模型設定都呈現同樣方向的落差。

評測涵蓋 11 個模型、31 種 model-effort 組合,用只靠 Bash 的 mini-swe-agent,在 closed-book 條件下跑完整 53 題 benchmark 三次,每個 session 上限 210 分鐘、350 步:

模型Reasoning 設定pass@1平均成本/任務平均耗時
Claude Opus 5max75% ± 3%$17.4057.5 分
GPT-5.6 Solmax75% ± 6%$12.2629.5 分
Claude Sonnet 5xhigh64% ± 3%$6.6140.6 分
Kimi K3max64% ± 5%$7.2499.9 分
GPT-5.6 Lunamax64% ± 4%$0.9528.9 分
DeepSeek V4 Flash (0731)max55% ± 4%$0.6936.4 分

用原生 harness(Codex、Claude Code)並沒有讓兩個領先者表現更好:GPT-5.6 Sol 在 Codex 裡拿 73.6%、Claude Opus 5 在 Claude Code 裡拿 69.8%,都低於用 mini-swe-agent 跑出的 75.5%。成本與表現也沒有明確對應關係:四個並列 64% 的模型裡,平均成本從 $0.95 到 $7.24 都有,耗時從 25.5 分到 99.9 分不等,且沒有一個模型在六大工程家族裡全部領先。

⚠️ 限制

SWE-Serve 的「通過」只代表滿足 benchmark 的 verifier,並不等於 SGLang 真正的 upstream review 流程,也不代表某個 patch 或 reference solution 可以合併、已獲 SGLang maintainer 認可。目前這一版也不涵蓋其他 inference engine、多 GPU 或多節點 serving。

🎯 實務啟示

若你在維護或評估與 inference-serving 相關的 coding agent,別只看單元測試綠燈——SWE-Serve 的資料顯示,大約三分之一「看起來過關」的 patch,會在真正啟動 server 之後才暴露問題,尤其是同時動到多個 runtime domain(例如同時碰 scheduling 又動 KV-cache)的變更,值得額外補上 live-serving 層級的驗證,不能只靠既有的單元測試與 regression 測試判定安全。

🔗 來源

#SWEServe #NVIDIA #SGLang #LLMServing #CodingAgents #Benchmark #InferenceEngineering #AIAgents #MachineLearning #SoftwareEngineering

原始資料 NVIDIA Developer · 收集於 2026-09-23
來源原標題
How SWE-Serve Exposes the Gap Between Local Tests and Live Serving
作者
Elizabeth Goodman
原始標籤
Agentic AI / Generative AI · Data Science · Developer Tools & Techniques · AI Agent · LLM Benchmarking · Machine Learning & Artificial Intelligence · Open Source
原始連結
https://developer.nvidia.com/blog/how-swe-serve-exposes-the-gap-between-local-tests-and-live-serving/

摘要原文

An AI coding agent’s patch can pass tests yet fail when the server loads a real model and handles requests. Evaluating changes to inference-serving software therefore requires checking the full serving path, including whether the system returns correct results through its public interface. Developed with input from the SGLang team, SWE-Serve evaluates this gap with 53 tasks derived from merged changes to SGLang, an open-source system for serving large language models. Across 19 tasks with live-serving checks, the same patches passed 69.4% of the time when those checks were excluded, but only 45.9% with the complete verifier. About one in three patches that passed the other checks failed live-serving tests. Quick links: Read the paper | Explore the leaderboard | Run SWE-Serve on GitHub What SWE-Serve tests Existing repository-level benchmarks evaluate coding agents across general software-engineering tasks, while inference benchmarks often concentrate on kernel generation or performance optimization. SWE-Serve instead tests repository-scale changes across the inference-serving stack, including model enablement, decoding, caching, scheduling, serving APIs, and runtime performance. To evaluate this broader engineering work, SWE-Serve turns 83 merged SGLang pull requests into 53 executable tasks across six inference-engineering families. Engineering family Tasks Speculative and advanced decoding 14 Model and backend enablement 12 Kernels, quantization, and performance 8 Serving APIs and runtime correctness 8 Caching and runtime state 7 Distributed execution and scheduling 4 Table 1. Distribution of SWE-Serve’s 53 tasks across six inference-engineering families Twelve tasks run on CPU, while 41 use a single NVIDIA H100. This first release doesn’t evaluate other inference engines, multi-GPU execution, or multi-node serving. Thirty-seven tasks come from a single upstream pull request. The other 16 combine two to six related changes. In total, the benchmark draws on 83 merged SGLang pull requests. The SGLang team, a launch partner for SWE-Serve, contributed ideas for identifying challenging tasks, suggested particularly demanding pull requests, and helped shape our approach to verifying correctness. Each task gives the agent an instruction and a containerized SGLang checkout from before the target change. The agent’s patch passes if it satisfies the task’s hidden verifier on the declared hardware. It is never compared with the reference implementation. These are substantial changes. The median reference solution modifies 553 lines across seven files. A typical verifier has seven tests for the new behavior and 10 regression tests. Nineteen tasks start a real server, and three enforce a calibrated performance gate on an H100. What one task looks like One task asks the agent to add serving support for dense and mixture-of-experts (MoE) Qwen3.5 models. Starting from a revision without Qwen3.5 support, the agent must make both the 0.8B dense model and the 35B-A3B MoE model load and serve through the normal SGLang interfaces on one H100. Its verifier checks model registration, configuration and weight loading, image and video inputs, OpenAI-compatible requests, native batched generation, log probabilities, and execution through the MoE model’s routed experts. What live serving tests catch Some failures only appear once a real server starts. The SGLang team contributed ideas for end-to-end verification, including recommendations for specific model-serving tests. SWE-Serve includes 19 tasks that load the required model and test the agent’s patch through a live serving interface. Across these tasks, the same 627 patches pass 45.9% of the time under the complete verifier. When the live serving tests are excluded, that rate rises to 69.4%. In other words, 147 patches changed from fail to pass when the live serving tests were excluded. The 19 tasks contain 276 live serving tests. Of those, 242 are sourced or adapted from SGLang. The remaining 34 cover behavior introduced by the corresponding merged changes when no suitable upstream test was available. The Gemma 4 MoE task makes the result concrete. Sixteen of 33 patches passed every other check but failed at least one live serving test. Those tests cover model loading, expert routing, text and image serving, and batched generation with correct ordering and log probabilities. Figure 1. Pass rates with and without live-serving tests (A) and by runtime-domain breadth (B) A SWE-Serve pass has a narrow meaning: the patch satisfies the benchmark verifier. SWE-Serve’s tests are not SGLang’s upstream review process. They don’t establish that an agent patch or benchmark reference solution is deployable, ready to merge, or endorsed by SGLang maintainers. Where agents score lower We divided the request-to-output path into four runtime domains: request handling and I/O, scheduling and request lifecycle, model execution, and KV-cache and runtime-resource management. Across the best setting for each of the 11 models, the 26 tasks confined to one runtime domain have a 69.0% pass rate. The 27 tasks spanning more than one runtime domain have a 47.7% pass rate, a difference of 21.3 percentage points. Every model setting shows the same direction of difference. Performance varies widely across models Model performance varies substantially. Across each model’s best tested configuration, mean pass@1 ranges from 34.6% to 75.5%. No model scores highest in every task category, and configurations with similar overall scores can have very different costs and runtimes. We evaluated 11 models and 31 model-effort configurations with mini-swe-agent , a minimal software-engineering agent that uses only Bash, under closed-book conditions. We tested the two Claude and three GPT-5.6 models at five effort levels; the other six models ran at one setting each. Each configuration ran the complete 53-task benchmark three times. Each agent session was capped at 210 minutes and 350 steps. A task counts as solved only when the agent’s patch passes the complete verifier on the task’s declared hardware. The table reports the highest-scoring effort setting for each model. Model Reasoning setting pass@1 (mean ± SD, 3 runs) Mean cost/task Mean wall time Claude Opus 5 max 75% ± 3% $17.40 57.5 min GPT-5.6 Sol max 75% ± 6% $12.26 29.5 min Claude Sonnet 5 xhigh 64% ± 3% $6.61 40.6 min Kimi K3 max 64% ± 5% $7.24 99.9 min GPT-5.6 Luna max 64% ± 4% $0.95 28.9 min GPT-5.6 Terra max 64% ± 4% $5.06 25.5 min DeepSeek V4 Flash (0731) max 55% ± 4% $0.69 36.4 min GLM-5.2 max 48% ± 2% $2.10 34.0 min Gemini 3.6 Flash high 48% ± 6% $4.84 37.3 min Laguna S 2.1 max 46% ± 5% $0.33 56.9 min Inkling S xhigh 35% ± 3% $0.44 17.6 min Table 2. Best-scoring reasoning setting for each model across three runs of all 53 SWE-Serve tasks. Pass@1 shows mean ± standard deviation; cost and wall time are means per task. API-model costs use recorded token usage and frozen prices; downloadable-model costs use hosted-rate estimates Native harnesses didn’t improve the two leaders: GPT-5.6 Sol scored 73.6% in Codex and Claude Opus 5 scored 69.8% in Claude Code, versus 75.5% each with mini-swe-agent . Cost doesn’t map cleanly to performance. Among the four models tied at 64%, mean cost ranges from $0.95 to $7.24 per task, while mean wall time ranges from 25.5 to 99.9 minutes. No model leads all six engineering families, and models with the same overall score can have different strengths. The top score shows that many SWE-Serve tasks are within reach of current agents; the spread shows that performance is far from uniform. How we validate the benchmark We screened 786 potential task sources, built 156 executable candidates, and admitted 53. Every admitted task was tested on its declared hardware. The unmodified repository had to fail the tests for the new behavior while continuing to pass regression tests. A reference patch had to pass the complete verifier.

由 claude-code/sonnet 自動生成