L3S1 · 商业 ROIS3 · 模型与编排S5 · 评测与观测S6 · 安全与成本Verified: 2026-11-30
vLLM / SGLang 投机解码、前缀缓存与 PD 分离推理压测平台(实战项目)
硬核 AI Infra 实战参考项目:搭建面向多轮 Agent 负载的可复现推理压测平台,定量对比 PagedAttention、自动前缀缓存(APC / RadixAttention)、投机解码与 Prefill-Decode 分离调度下的 TTFT、TPOT 与 Goodput 收益。
适用场景 (Best For)
AI Infra / ML Systems Engineer / Backend SDE 展示 GPU 显存算力瓶颈分析(Compute-Bound Prefill vs Memory-Bandwidth-Bound Decode)与真实压测优化能力。
人机边界 (Human-AI Boundary)
网关层对超长上下文突发请求实施按租户 TPM/并发熔断与模型降级路由,并将显存水位与 Goodput 异常暴露至 Prometheus/Grafana 运维值守面板。
常见反模式与避坑 (Anti-Patterns)
- Reporting raw offline aggregate tok/s throughput while ignoring P99 TTFT and inter-token latency (TPOT) collapse under mixed long-prefill workloads
- Enabling speculative decoding indiscriminately at high batch sizes where verification compute overhead worsens tail TPOT
延迟成本与评测门禁
Multi-turn cached TTFT <= 180ms P95; Decode TPOT <= 28ms/token under strict Goodput SLO · GPU HBM KV-cache occupancy + prefill FLOPs vs $/1M generated tokens at target Goodput
- SLO-Compliant Goodput & KV Prefix Cache Hit Rate: >= 80% prefix KV reuse on multi-turn agent traces; +2.1x Goodput under TTFT<300ms / TPOT<35ms SLO (Measured across OpenAI-compatible load generator replaying 8K-32K multi-turn tool-use traces)
- Speculative Decoding Acceptance & Effective Speedup: Mean acceptance length >= 2.8 tokens at low-to-medium concurrency with <= 0% output distribution drift (Sweeps concurrency 1..64 to identify exact batch crossover point where draft verification saturates FLOPs)
📦 工程交付清单与作品集产物
- Reproducible Docker/Compose serving harness comparing Vanilla Continuous Batching vs APC/RadixAttention vs Speculative Decoding vs PD-Disaggregation
- Async SSE load-testing suite simulating realistic multi-turn prefix-shared agentic traffic with P50/P95/P99 TTFT, TPOT, and Goodput plots
- FastAPI SSE gateway with per-tenant Redis TPM rate limiter, backpressure handling, and small-to-large cascading model router
- Roofline & $/1M-token FinOps trade-off report identifying exact concurrency crossover thresholds
🎤 面试高频追问与架构答辩题
- Why is LLM Prefill compute-bound while Decode is memory-bandwidth-bound, and how does mixing them in the same batch cause TPOT jitter?
- At what batch concurrency does speculative decoding stop accelerating throughput and actually hurt latency?
- How do you structure multi-turn agent prompts and KV-cache routing (sticky session hashing) to maximize Radix/Prefix cache hits?
⚡
想检验本题的肌肉记忆?进入 3 阶闪卡主动回忆盲测
隐藏答案遮罩,自测:审题锚点 ➔ 数理公式机理 ➔ 工业标杆代码与连环追问。3 分钟攻破认知盲区!
上下游关联知识链路
[HubB] 岗位能力透镜 · AI Infra / LLM Inference Systems Engineer[HubB] 岗位能力透镜 · 机器学习与大模型推理系统工程师 (ML Engineer)[HubB] 岗位能力透镜 · 后端 / 全栈工程师向 AI 系统迁移视图 (Software Engineer)[HubB] 岗位能力透镜 · AI 推理优化工程师 (AI Inference Engineer)[HubB] 岗位能力透镜 · AI 研究科学家 (Research Scientist)[L0 Card] vLLM PagedAttention 与连续批处理[L0 Card] Prompt Caching/RadixAttention[L0 Card] SSE 长连接流式传输与背压控制[L0] vLLM PagedAttention 与连续批处理推理引擎[L0] SGLang RadixAttention 自动前缀复用与零拷贝调度引擎[L0] 大模型 Token FinOps、前缀缓存与语义缓存网关原语[L0] 大小模型置信度级联路由与成本-质量帕累托网关原语[L1] Stage 1 · 闭源 API vs 开源微调(LoRA/vLLM)TCO 保本点决策模式[L1] Stage 6 · SaaS 多租户 Token 预算限流与渐进式降级熔断模式[L1] Stage 4 · 逐句内联溯源流式渲染与人机协同(HITL)确认模式[L2] L2 系统设计 · 分布式 vLLM/SGLang Prefill-Decode 分离推理与 KV 路由架构
站内交互工具与信源依据
- vLLM Documentation — Automatic Prefix Caching, Speculative Decoding & Disaggregated Prefill (official_docs, 2026-11-30)
- SGLang — Efficient Execution of Structured Language Model Programs (RadixAttention) (github, 2026-11-30)