[2026春季][T2-1-2] CearX#502
Conversation
复测实验矩阵与结论一句话结论单卡 RTX 5090 的复测表明,优化收益具有明显的负载选择性:SSE 合并发送在 13 个直接 A/B 点中 12 胜 1 负(总体 +3.36%、C64 +6.36%、代表点最高 +9.37%),而 chunked prefill 与 KV safety 将完整矩阵成功率从 27/30 提升到 30/30,但当前静态及隐式 KV admission headroom 会牺牲部分高并发吞吐。 GPU 与 CUDA
官方测试矩阵
共测试三套完整配置:基线、完整优化、SSE-only,即 3 × 30 = 90 个矩阵点;另完成 13 组同代码 SSE 直接 A/B。 矩阵结果对比
分组分析优化收益并非均匀分布,而是集中在 SSE 事件处理开销占比较高的多并发场景。为避免仅依赖全矩阵平均值,我们对同一最终代码、仅切换
代表性高并发点:
13 个直接配对点中有 12 点提升、1 点回退。低并发场景基本持平,而高并发场景收益更明显,符合 SSE 合并发送减少序列化、队列操作和 HTTP 事件发送开销的设计目标。+9.37% 为单点最高收益,13 点整体几何平均为 +3.36%。 SSE-only 最终版与父提交在 26 个共同成功点上取得 +2.14% 的 output-throughput 几何平均提升,其中 24 点提升、2 点回退。全矩阵平均收益较低,主要因为矩阵同时包含大量计算受限、SSE 开销占比较低的小并发点,以及 C64/I256/O1024 的 -18.78% admission 限流回退。 完整 chunked prefill + KV safety + SSE 配置解决了三个 C4/I4096 长输入失败点,使成功率由 27/30 提升至 30/30。固定 KV safety 8/64 同时在部分高并发场景限制请求入场,形成可服务性与吞吐之间的权衡。 回退与失败点原因
这些点分别反映三类瓶颈:scheduler admission headroom、固定 KV safety 水位,以及连续多 shape 下的 CUDA Graph 状态。SSE 的独立影响由同代码 interval 1/16 A/B 表示。 完整逐点矩阵SSE-only 最终版与父提交展开全部 30 个测试点
完整配置与父提交展开全部 30 个测试点
结论实验结果显示两项相互独立的收益:
综合结果表明,SSE 优化主要作用于事件发送开销明显的高并发负载;chunked prefill 提升长输入可服务性;KV admission 参数需要随并发、输入长度和可用 KV blocks 动态调整。
|
Summary
通过 Chunked Prefill、KV Cache 准入水位与请求/SSE 热路径优化,显著提升了单卡 8B 在高并发、长输出场景下的服务吞吐,同时保持小规模性能基本不变。
Motivation
T2-1-2 赛题需求多并发、长文本服务场景下的输出吞吐和总 token 吞吐,同时要求小规模性能无明显下降。
在单张 NVIDIA GeForce RTX 5090 32 GiB、Qwen3-8B BF16、TP=1 环境中,最终实现完成官方 8B 的 30 个测试点,所有请求均成功,输出长度严格命中,errors=0。在基线与最终实现共同有效的 27 个测试点上:
附件赛题报告包含完整 30 点最终矩阵与 27 点基线对比,包括所有负收益点。
Type of Change
feat— new configurable service and benchmark entry pointsfix— exact LENGTH termination and OpenAI-compatible field handlingperf— performance improvementrefactor— code restructuring without behavior changetest— reproducible official-style benchmark clientdocs— documentation onlybuild/ci— build system or CI configurationchore— tooling, formatting, or other non-code changesTest Results of Involved Models on Supported Platforms (Please attach screenshots)
Benchmark / Performance Impact
/v1/chat/completions,streaming SSE。request_rate=inf,num_prompts=max_concurrency。ignore_eos=true,客户端校验输出长度精确命中。0。Notes for Reviewers
stream_interval保证首 token 立即发送,之后只合并 SSE 事件,不丢失模型 token。PR 附件:
赛题报告.pdf
HONOR_CODE.md
REFERENCE.md
CI / ChatOps
Checklist
Title, Branch, and Commits
feat(nvidia): …,fix(cuda/gemm): …).<type>/xxx-yyyy-zzzzwhere<type>matches the PR title's Conventional Commits type and words are joined with hyphens (seeCONTRIBUTING.md§Branches).CONTRIBUTING.md§Pull Requests).main— the branch is rebased cleanly on top of the auditedmain.fixup!/squash!/wipcommits remain.Scope and Design
CONTRIBUTING.md§Code/General).printf/std::cout/print(...)left behind, orTODOwithout an owner and issue link.General Code Hygiene (applies to all languages)
CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General).the `seqlens_k` tensor) (CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General).CONTRIBUTING.md§Code/General; §Python).C++ Specific (if C++ files changed)
CONTRIBUTING.md§C++).CONTRIBUTING.md§C++).new/delete; RAII / smart pointers / existing allocators are used.scripts/format.py.csrc/models/llama_legacy/.Python Specific (if Python files changed)
CONTRIBUTING.md§Python).CONTRIBUTING.md§Python).scripts/format.py.python/infinilm/auto_config.py.Testing
examples/test_infer.py), or specify the reason for skipping.examples/bench.py), or specify the reason for skipping.test/bench/test_benchmark.py), or specify the reason for skipping.python/infinilm/server/inference_server.py+scripts/test_perf.py), or specify the reason for usingscripts/competition/official_client_bench.py: the competition requires the official burst service matrix and exact output-length validation.Build, CI, and Tooling
/retestwas requested.Documentation
README.md,CONTRIBUTING.md, or inline docs updated when behavior, build flags, or developer workflow changed.!orBREAKING CHANGE:footer.Security and Safety