Implement LMetric (P_tokens × BS multiplication score) from "Simple is
Better" (Zhang et al., OSDI'26) as alternative routing policy for
combined mode. Key changes:
- cache_aware_proxy.py: add --policy {linear,lmetric} flag, track
pending_prefill_tokens and num_requests per instance, /stats endpoint
- run_lmetric_ab.sh: automated A/B script for fair comparison
Results (200 req, fresh restart, same trace):
Linear: TTFT50=1.086 TPOT90=0.077 E2E50=5.423
LMetric: TTFT50=1.099 TPOT90=0.073 E2E50=5.205
Delta: TTFT +1.2% TPOT -5.9% E2E -4.0%
LMetric improves TPOT/E2E modestly through better load balancing, but
routing policy headroom is limited vs elastic P2P offload (-44% E2E).
TODO: vLLM → Redis → router pipeline for exact state ablation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.0 KiB
2.0 KiB
实验 setup:
GPU 机器:dash0,是 8*H20 的机器,可以直接 ssh dash0 进行连接访问
推理引擎:基于 vllm 0.18.1,self build,支持后续 patch 放在 git 中维护
模型:~/models/Qwen/Qwen3-Coder-30B-A3B-Instruct
推理 trace:原始完整 2h trace 在 dash0 的 ~/ali-trace/trace-glm5.1-formatted/051315-051317.jsonl
性能指标:每个请求的 TTFT/TPOT/E2E/TBT,prefix KVCache hit ratio
目标:
- 先实现标准的 trace-sampler,将 cluster 规模的原始 trace,sample 到合适当前机器数量的规模来跑,保持一份统一的 sample 后的 trace file 作为输入
- 实现标准的 trace replayer,保证能够体现线上流量的流量到来特征,KVCache 重用特征等
- 跑通 PD 分离,确认 PD 分离能够比普通的 PD 混合一起跑的性能要好,给出两者详细的性能对比以及原因分析
- 判断 trace 的 pattern,是否有必要 PD 完全混合或者 PD 分离
- 参考本地的
~/phd/agentic-pd-hybrid,判断是否能够实现一套 prefill-as-a-service 的架构,把重的 prefill 交给 prefill service,prefill service 能够从本地 GPU/DRAM/别的 GPU 机器上 pull KVCache,提高本地的 prefix KVCache hit ratio,不影响 decoding 的 prefill,就可以交给过去 PD 分离定义中 D-node 来做,提高 KVCache 命中率 - [TODO] Router 侧状态精确性 ablation:当前 router 自己维护 shadow state(ongoing_tokens, pending_prefill_tokens, cached_blocks 等),与 vLLM 引擎内部真实状态可能存在 gap(尤其是 cache eviction 导致的 APC 偏差)。需要:
- 修改 vLLM,让每个 instance 定期把内部状态(waiting queue depth, running batch size, KV cache usage, actual prefix cache hit blocks)写入 Redis
- Router 从 Redis 读取精确状态,替代当前的 proxy-side 近似
- 对比 proxy shadow state vs Redis exact state 的 routing 决策差异和最终性能差异
- 量化 gap 大小:哪些指标差距最大?是否影响实际 routing 质量?