Repository navigation
Fix ATOMesh KV-cache counters / 修复 ATOMesh KV-cache 计数 - #4397
chunfangamd wants to merge 4 commits into
Conversation
仅汇总 prefill/unified 缓存计数,CPU reuse 使用 offload counter, overall 合并 GPU 和 CPU reuse;缺少增量或角色时保留未知值。
|
Generally most InferenceX submissions don't need to add changes to the infx package. On the off chance they do, generally the diff is small. Please prompt your agent to clean your PR to keep your diff to only necessary & minimal changes too. We have an increased code quality bar for changes to the infx package. 中文大多数 InferenceX 提交通常不需要修改 infx 包。即使确实需要,改动通常也很小。请让你的 agent 清理 PR,使改动只包含必要且最小的内容。infx 包的改动有更高的代码质量要求。 |
|
Claude finished @chunfangamd's task in 59s —— View job LGTM - no blocking issues found. I traced the new endpoint-role path from start to finish:
One thing I could not check: the new CPU source only works if ATOM workers with I could not run the tests ( |
仅在确认关闭 CPU offload 且无计数器时补零,保留单端点自定义 metrics 的角色回退,并从输入总量中排除 decode 重复计数。补充相应行为回归。
中文:同步当前 main,保留 ATOM 缓存计数修复与上游 KV 使用率处理。
中文:按端点与完整标签域校验缓存分层计数;仅在 CPU offload 明确关闭且现有计数均为零时补齐缺失零值,拒绝无效或矛盾的 offload 数据。
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ATOM P/D exports report prompt counters on both prefill and decode. Counting both dilutes the hit rate; using LMCache transfer tokens for CPU reuse also measures the wrong quantity.
Count prefill/unified counters once, read CPU reuse from
prefix_cache_offload_tokens, and include GPU + CPU in overall. For prefill full=1000, GPU=600, CPU=100, the result is 60% / 10% / 70%; decode's repeated full=1000 is excluded. Validate each endpoint/label domain before summing so another engine cannot hide invalid reuse. WithKV_OFFLOADING=none, missing CPU domains are zero only when present values are valid zeros; otherwise CPU/overall remain unavailable.This is the counter layer. #4405 adds modern-export qualification; together they replace closed #3964. No historical window reconstruction or serving recipe changes. Real modern P/D with nonzero offload remains unverified. Measured-pricing deployment also needs the consumer protection in app #1377 or an equivalent maintainer-approved isolation.
中文
ATOM 的 P/D 两端都可能上报 prompt counter,累加会重复计算分母;LMCache 传输量也不能代表 CPU 复用。本层只统计 prefill/unified,用 offload counter 计算 CPU,overall 为 GPU+CPU。示例 full=1000、GPU=600、CPU=100 得到 60%/10%/70%,排除 decode 重复分母。
先逐 endpoint/标签域校验,再汇总;关闭 offload 时,仅在已有值都是合法零且域匹配的情况下补缺失零。坏值、非零矛盾或额外域不会获得 CPU/overall 数值。
本层与 #4405 的现代数据资格层一起替代已关闭的 #3964;不重建历史窗口、不改 serving 配方。真实现代 P/D+非零 offload 尚未验证;计价上线仍依赖 app #1377 或维护者接受的等价隔离。
AI model disclosure
GPT-6 (Codex), including delegated implementation and independent review agents, prepared and checked these revisions. A finer runtime model identifier is not exposed. Earlier producer/app work was prepared by an agent reporting Claude Opus 5.5; that historical runtime identifier could not be independently verified.