SGLang 与 Miles 为 Kimi K3 提供 Day-0 支持

SGLang 与 Miles 为 Kimi K3 提供 Day-0 支持

引言

SGLang 团队与 Miles 正式宣布为 Kimi K3 提供 Day-0 支持。K3 是首个开源 3 万亿参数级模型,其混合架构在多处打破传统 serving 栈假设。通过与 Moonshot AI 及 NVIDIA 合作,SGLang 负责推理,Miles 负责 RL 训练,完整覆盖发布日全场景。

bs=1 optimization-category waterfall

核心亮点

  • 全新混合架构:2.8T 参数,69 层 KDA 线性注意力与 24 层 MLA 交错,支持 LatentMoE 与 Attention Residuals。
  • 双状态内存管理:重建前缀缓存、overlap 调度与分页机制,采用统一内存池消除 sizing 猜测。
  • 内核梯队优化:batch-1 下达到约 113 tok/s。
  • DSpark 推测解码:引入专用 draft 模型,batch-1 decode 吞吐提升至约 423 tok/s。
  • 相位并行:chunked pipeline-parallel prefill 与 tensor-parallel decode 结合,实现每 GPU 2808 tok/s。
  • Miles 支持原生 MXFP4 检查点 LoRA RL 训练。
bs=1 decode throughput ladder

架构适配挑战

K3 与前代 K2.5 差异显著:参数规模扩大至 2.8T,注意力混合使用 KDA 与 MLA,引入 Attention Residuals 与 LatentMoE,激活函数改为 SiTU,视觉塔升级为 MoonViT3d。这些变化要求 SGLang 重构多处核心路径。

The three KDA state moves, copy-on-write, snapshot and donate, and where each sits relative to the serial forward stream.

混合 KDA 内存管理

KDA 状态可原地覆写,需通过 copy-on-write、snapshot 与 donate 三种显式状态移动实现安全复用。检查点仅放置于 radix tree 分支点,确保高命中率且无竞争。

Sparse KDA state checkpoints overlaid on the radix tree, and the branching point where a new request diverges from a cached prefix.

统一内存池

单一内存池同时容纳 KDA 状态块与 MLA KV 块,从两端相向增长,释放后自动整理碎片,实现按工作负载动态分配。

Unified memory: two static pools versus one pool holding both kinds of state, and the freeing sequence

DSpark 推测解码

专用 draft 模型配合 confidence-scheduled trim,仅验证值得验证的位置,ReplaySSM 将 KDA 状态内存开销降低约 32 倍。

Decode throughput vs batch size, verify-all vs confidence-scheduled trim, on a chat panel and a few-shot math panel.KDA ReplaySSM: the verify kernel reads the committed checkpoint and stores each draft step

并行与流水线优化

prefill 采用 chunked pipeline-parallel,decode 使用 tensor-parallel,二者通过 PD disaggregation 组合,显著提升吞吐并降低通信开销。

Chunked pipeline-parallel prefill: a long prompt cut into chunks streaming through pipeline stages, with P2P hand-off arrows running under the next chunkLeft: prefill throughput per GPU vs concurrency, TEP8 vs PP8xTP1. Right: cost decomposition per 1k tokens, compute plus exposed communication, for TP8 / PP4xTP2 / TEP8 / PP8xTP1.TP replicates the same token positions on every rank; DCP stripes them round-robin, so the same GPUs hold N times the logical context.

结语

完整启动命令与配置指南见 Kimi K3 cookbook。SGLang 与 Miles 的 Day-0 支持为超大规模混合架构模型的 serving 与训练树立新标杆。

本文来自 LMSYS 博客,赢政天下(winzheng.com)进行了全文翻译。 点击这里查看原文 如果转载中文,请注明出处,谢谢支持!