Files
agentic-kvc/TODO.md
Gahow Wang e4fa56cb1e LMetric routing policy (OSDI'26) + A/B results vs linear baseline
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>
2026-05-22 16:57:32 +08:00

2.0 KiB
Raw Blame History

实验 setup

GPU 机器dash0是 8*H20 的机器,可以直接 ssh dash0 进行连接访问

推理引擎:基于 vllm 0.18.1self 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/TBTprefix KVCache hit ratio

目标:

  1. 先实现标准的 trace-sampler将 cluster 规模的原始 tracesample 到合适当前机器数量的规模来跑,保持一份统一的 sample 后的 trace file 作为输入
  2. 实现标准的 trace replayer保证能够体现线上流量的流量到来特征KVCache 重用特征等
  3. 跑通 PD 分离,确认 PD 分离能够比普通的 PD 混合一起跑的性能要好,给出两者详细的性能对比以及原因分析
  4. 判断 trace 的 pattern是否有必要 PD 完全混合或者 PD 分离
  5. 参考本地的 ~/phd/agentic-pd-hybrid,判断是否能够实现一套 prefill-as-a-service 的架构,把重的 prefill 交给 prefill serviceprefill service 能够从本地 GPU/DRAM/别的 GPU 机器上 pull KVCache提高本地的 prefix KVCache hit ratio不影响 decoding 的 prefill就可以交给过去 PD 分离定义中 D-node 来做,提高 KVCache 命中率
  6. [TODO] Router 侧状态精确性 ablation当前 router 自己维护 shadow stateongoing_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 质量?