PD 分离 D 端(Decode)内存瓶颈
社区论坛 / GitHub Issue / 博客评论区 技术调研

📅 调研日期:2026-07-15 🔍 搜索源:6 主搜 + 8 深度 Issue 📄 本地存档:18 文件 / 82 KB ⏱ 预算:8 min
核心结论速览:PD 分离后 Decode 侧 KV 容量(HBM)是主导瓶颈,即使 compute 仍有空闲。社区已形成明确分类:Decode-KV-bound(vLLM RFC #43470 正式命名)。三大症状:①长 context 下 KV pool 耗尽 OOM ②高并发 batch 下 CUDA graph + KV pool 死锁 ③异构 P/D 间 KV 格式/所有权不一致导致容量浪费。

1. 瓶颈定性:Decode-KV-bound 成为独立瓶颈类

1.1 vLLM RFC #43470 — 首次正式定义 "Decode-KV-bound"

vLLM 社区 RFC #43470 "Bottleneck-aware expansion for PD disaggregation"(2026-05-22, author: zsn6493)将 PD 运行时的压力明确分为三类:

瓶颈类定义扩展动作
Prefill-boundPrefill 侧 compute/memory 压力主导加 prefill 容量
Decode-boundDecode 侧 token 吞吐/调度压力主导加 decode 容量
Decode-KV-boundDecode 侧 KV holding capacity 主导,即使 compute 未饱和加 decode 侧 KV capacity / tier

关键原文:"decode-side KV capacity becomes the dominant bottleneck even when compute is still available; remote KV transfer backlog creates hidden stalls between the two pools"

协作方 robertgshaw2-redhat(llm-d)回应:该能力应放在编排层(llm-d flow-control / Dynamo 路由),vLLM 作为执行层暴露压力信号即可。

源:github.com/vllm-project/vllm/issues/43470

1.2 Google AI Overview 双重确认

Google 搜索 sglang decode side memory pressure PD disaggregation long context 的 AI 摘要:

"In Prefill-Decode (PD) disaggregated serving, long-context requests place massive Key-Value (KV) cache burdens on the decode side. Managing this requires preventing Out-Of-Memory (OOM) lockups without sacrificing generation speed."

搜索 vllm decode worker HBM PD disaggregation capacity bottleneck 的 AI 摘要:

"the system often faces a decode worker bottleneck caused by HBM (High Bandwidth Memory) capacity and PD disaggregation bandwidth limitations"
源:Google Search AI Overviews(2026-07-15 抓取)

2. 实际部署数据:D 端内存不够的具体案例

2.1 SGLang #24523 — PD 部署 input length 被硬限 18,432 Tokens(H200 140GB)

DeepSeek-V4-Pro FP8 + H200 GPU(total_gpu_memory=138.17 GB),PD 分离 prefill 节点因 is_hybrid_swa=true 错误地把 token 容量钳制到 swa_max_total_num_tokens = 18,432,而实际硬件 KV pool 可支撑 186,368 tokens:

Memory profiling: available_gpu_memory=17.94 GB, total_gpu_memory=138.17 GB, mem_fraction_static=0.90, rest_memory=4.13 GB
DSv4 memory calculation: bytes_per_full_token=23749.84, available_bytes=4.13 GB, full_token=186368
DSv4 pool sizes: full=186368, swa=18432, c4=46592, c128=1456, c4_state=1152, c128_state=18432

错误信息:"Request ... exceeds the maximum number of tokens: 100804 > 18432"

根因:SWA allocator 在 prefill 时分配了全量 KV cache,但运行时仍用 SWA 上界卡 max_total_num_tokens。Commenter CloudRipple 反馈 swa=91904 同样 "severely unusable"。

维护者 weireweire 建议:应把 swa_max_total_num_tokens 与 估计峰值 SWA 需求(chunk size + sliding window margin)比较,而非与全量 prompt 比较。

源:github.com/sgl-project/sglang/issues/24523(2026-05-06, 14 comments, open)

3.2 SGLang #30010 — 高并发 batch 下 Decode 死锁(GB300 / Kimi-K2.5-NVFP4)

GB300 节点(4 GPU/node, MNNVL fabric),Kimi-K2.5-NVFP4,mooncake transfer backend。per-DP-rank running requests > ~450 时,decode worker 在 4–8 分钟内卡死(6/6 复现):

场景CUDA graphsPer-rank occupancy结果
PD disagg serving (mooncake)on450–790deadlock 6/6, 4–8 min
PD disagg serving--disable-cuda-graph512 (slot cap)stable 26 min
Single-node agg, fixed-bson512stable
Single-node agg, dynamicon730–790stable 16 min

关键配置:--mem-fraction-static 0.85 --context-length 9216 --max-running-requests 4096 --cuda-graph-max-bs 2048,decode TP8 跨 node0+node1。

故障需要 PD disaggregation + CUDA graphs + 高 per-rank batch size 三者同时成立。

Workaround:① 限制 decode admission 使 per-rank ≤ ~400(--max-running-requests 3200 for DP8)② --disable-cuda-graph(稳定但慢)。

怀疑方向:KV cache 从 mooncake custom mem pool 分配(cuMemCreate/fabric memory)与普通 allocator 行为不同;并发 mooncake NVLink writes into KV pool 与 captured graph replay 竞争。

源:github.com/sgl-project/sglang/issues/30010(2026-07, yhyang201, open)

2.3 SGLang #31252 — HiCache draft KV pool backup 在 PD 模式 crash

#31252:HiCache 的 draft KV pool backup 在 PD disaggregation 下触发 cudaMemcpyBatchAsync invalid argument。显示 D 端多级 KV pool(HiCache 的 full/draft 分层)在 PD 模式下的内存管理仍不成熟。

源:github.com/sgl-project/sglang/issues/31252(open)

2.4 SGLang #23022 — 多模态 + DP > 1 + PD 共享内存过早释放

#23022:ShmPointerMMData shared memory 在 multimodal + dp_size > 1 + PD disaggregation 组合下被过早 unlinked。显示 PD 模式下 host-memory 共享元数据层的生命周期管理缺陷。

源:github.com/sgl-project/sglang/issues/23022(open, 3 comments)

3. 学术前沿:异构 PD 设计空间(arXiv 2606.29708, 2026-06-30)

论文 "Demystifying the Design Space and Best Practices for Heterogeneous LLM Inference and Serving"(arXiv 2606.29708, 2026-06-30)系统化了异构 PD 的设计空间,提出 4 个设计轴 + 3 个边界决策:

四设计轴

三边界决策(与 D 端内存直接相关)

  1. KV Representation & Layout Compatibility:不同 runtime(vLLM vs TensorRT-LLM)的 page size、memory layout、padding、attention variant 不同 → 不兼容时 decode 端浪费周期重构。最佳实践:KV transfer engine 应只是 byte-mover,layout compatibility 作为显式边界问题嵌入 transfer 层 metadata。
  2. KV Ownership & Lifecycle Management:分割推理产生分布式状态管理 — memory reservation / cache release / node failure recovery。最佳实践:统一跨阶段生命周期协议,显式分配 KV ownership,保证可预测内存分配与快速清理。
  3. Compute Placement & Precision Policy:低比特量化在 decode 端缓解内存压力,但可能在 prefill 加速器上无 kernel 路径。最佳实践:precision policy 属于 runtime role 而非全局设置。
源:arxiv.org/abs/2606.29708(2026-06-30)

4. 工业实践:D 端 KV pool 规划与容量扩展

4.1 vLLM 单节点 PD — MORI-IO 解决 ITL 尖峰(2026-04-07 博客)

vLLM 官方博客 "Next-Level Inference: Why Your Single-Node vLLM Setup Needs Prefill-Decode Disaggregation"(22 min read)核心论点:

源:vllm.ai/blog/2026-04-07-mori-io(Apr 7, 2026)

4.2 vLLM × Mooncake — 分布式 KV cache pool via MultiConnector(2026-05-06)

博客 "Serving Agentic Workloads at Scale with vLLM x Mooncake":

"PD disaggregation combined with the distributed KV cache pool via MultiConnector. Prefill: The prefill instance prepares KV blocks..."

通过 Mooncake Store 作为分布式 KV cache,跨 turn / 跨 instance 复用 shared prefix,解耦 KV capacity 与本地 HBM。

源:vllm.ai/blog/2026-05-06-mooncake-agentic(May 6, 2026)

4.3 vLLM #46107 — MoRIIO 异构 TP↔DP 并行(MI300X 实测数据)

#46107 实测 DeepSeek-R1 8K-in/1K-out on MI300X(gfx942),512 concurrency:

配置Total throughput (tok/s)Mean TTFT (ms)Benchmark dur (s)
2P_TP8 : 1D_TP8(同质 TP8)38,40755,1791,106
2P_DP8EP : 1D_DP8EP(同质 DP8EP)34,93577,1551,216
2P_TP8 : 1D_DP8EP(MIXED)42,34946,0521,003

混合并行(TP prefill + DP/EP decode)在最高并发下吞吐最高、TTFT 最低。核心机制:KV transfer connector 需支持跨不同 (dp_size, tp_size) 的 read routing,引入 per-(dp,tp) session keying + flexible prefill-TP read(round-robin 分散 read load 到多个 prefill TP ranks)。

源:github.com/vllm-project/vllm/issues/46107(2026-05, edwinlim0919, open)

4.4 SGLang Uni-PD — Memory-semantic PD 范式(#35263, 2025-12-09)

SGLang "Memory-semantic PD-disaggregation paradigm"(Uni-PD):

这是对"D 端内存不够"的另一种解题思路:不是扩大 pool,而是让 KV 产生即落地到 D 端 HBM,消除 transfer backlog 造成的 hidden stall。

源:github.com/sgl-project/sglang/issues/35263(2025-12-09)

5. KV pool sizing 方法论

Google AI Overview 给出的单 sequence KV cache HBM 空间估算公式:

"The formula to estimate the HBM space (S) in gigabytes needed for a single sequence's KV cache is: ... You must balance how much HBM is dedicated to holding active tokens versus generating new ones. HBM is expensive and limited, so managing its size properly determines how many users an LLM can serve at once."

关键策略:

源:Google Search AI Overview + llm-d v0.5 blog(2026-02-04)

6. 其他关键 Issue 索引

Issue系统主题状态
#43470vLLMBottleneck-aware expansion(定义 Decode-KV-bound)open
#46107vLLMMoRIIO 异构 TP/DP PD 并行open
#45749vLLMMoRI/MoRIIO READ-mode hangs (AMD)open
#44300vLLMMooncakeConnector KV corruption under concurrent PD transfersopen
#45036vLLMMooncake Store Connector Roadmapopen
#44238vLLMKV cache pruning featureopen
#47722vLLMKV cache init shape mismatch EP+DP on MoEopen
#24523SGLangPD input length hard-cap 18432 (SWA bug)open
#30010SGLangDecode deadlock high batch + CUDA graphopen
#31252SGLangHiCache draft KV pool backup crash PDopen
#23022SGLangShmPointerMMData PD shared mem unlinkopen
#30242SGLangDeepseek V4 NVFP4 Disagg Decode node failureclosed
#23499SGLangNIXL UCX segfault in disaggregated KV transferclosed

7. 社区讨论(SGLang Discussions)

源:github.com/sgl-project/sglang/discussions

8. 研判总结(模型设计者视角)

  1. D 端内存瓶颈是 PD 分离的"第二类问题":第一类是 P/D 干扰(已解决),第二类是 D 端 KV capacity 与 compute 解耦后暴露的 HBM 墙。vLLM 已正式分类为 Decode-KV-bound。
  2. 长 context 是放大器:SWA(sliding window attention)在 PD 模式下的 pool 分配 bug(#24523)让 140GB H200 只能跑 18k tokens,利用率 < 14%。KV pool sizing 必须与 attention 语义(full / SWA / sliding window margin)联合建模。
  3. 高并发 batch 与 CUDA graph 的耦合隐患:#30010 显示 mooncake custom mem pool + CUDA graph replay + 高 batch 三者组合会死锁,说明 D 端 KV pool 的内存分配器在 PD 模式下需要专门验证路径。
  4. 解耦 capacity 是产业方向:llm-d 0.5 共享文件系统、Mooncake 分布式 KV pool、vLLM Multi-tier offloading — 都在把 KV capacity 从本地 HBM 解耦出去。
  5. Memory-semantic 路线(Uni-PD):从"传 KV"改为"直接写 D 端 HBM",消除 transfer backlog hidden stall,是 SuperPod-native 的最优解,但依赖 fabric RDMA 能力。
  6. 异构 PD 成为标配:arXiv 2606.29708 + vLLM MoRIIO 实测都证明 P/D 用不同并行策略(TP prefill + DP/EP decode)在高压下最优,KV transfer 层必须支持跨 (dp,tp) 的 byte-mover 语义。

附录 A:全部抓取来源 URL

主搜索(6 项)

  1. github.com/sgl-project/sglang/issues?q=is%3Aissue+disagg+memory+decode
  2. github.com/vllm-project/vllm/issues?q=is%3Aissue+disaggregated+memory
  3. github.com/sgl-project/sglang/discussions
  4. Google: sglang decode side memory pressure PD
  5. Google: vllm decode worker HBM PD
  6. Google: PD disaggregation decode KVcache pool sizing HBM

深度 Issue / 博客(8 项)

  1. vllm#43470 — Bottleneck-aware expansion RFC
  2. sglang#24523 — PD input length hard-cap 18432
  3. sglang#30010 — Decode deadlock high batch CUDA graph
  4. sglang#23022 — ShmPointerMMData PD shared mem
  5. sglang#31252 — HiCache draft KV pool crash PD
  6. vllm#46107 — MoRIIO heterogeneous TP/DP
  7. vllm.ai/blog/2026-04-07-mori-io — Single-node PD(SPA 404,内容来自 Google AI Overview)
  8. arXiv 2606.29708 — Heterogeneous PD Design Space

访问失败