fix(inference): price GB300 cached input from the theoretical hit rate when unmeasured / GB300 缺少实测命中率时按理论命中率为缓存输入定价 - #980
Merged
Conversation
…e when unmeasured PR #975 backfilled GB200 hit rates onto the 14 GB300 dynamo-vllm DeepSeek-V4 AgentX points, but every other GB300 AgentX sweep has the same gap: Kimi K3 and MiniMax M3 on dynamo-vllm carry no server cache hit rate at all, and half the dynamo-trt DSv4/GLM-5.2/Qwen3.5 points are missing it too. With the rate treated as 0, ~97% cached input is billed at the uncached price and GB300 shows ~$42/GPU/hr on Kimi K3 against ~$7 for GB200. Add pricingCacheHitRate: prefer the measured server rate, and only when a GB300 point has none fall back to the trace's theoretical_cache_hit_rate. Every other hardware keeps returning null so a missing measurement there stays visible as a data bug. Wire it into token revenue, historical trends, and the calculator, and let theoretical_cache_hit_rate survive the calculator allowlist trim. Kimi K3 GB300 now prices at ~$6/GPU/hr. 中文:PR #975 只为 14 个 GB300 dynamo-vllm DeepSeek-V4 AgentX 数据点回填了 GB200 的命中率,但其他 GB300 AgentX sweep 存在同样缺口:Kimi K3 与 MiniMax M3 的 dynamo-vllm 完全没有服务端缓存命中率,dynamo-trt 的 DSv4/GLM-5.2/Qwen3.5 也有一半缺失。 命中率按 0 处理时,约 97% 的缓存输入按未缓存价格计费,Kimi K3 上 GB300 显示约 $42/GPU/hr,而 GB200 约 $7。新增 pricingCacheHitRate:优先使用实测服务端命中率, 仅当 GB300 数据点没有实测值时回退到 trace 的 theoretical_cache_hit_rate;其他硬件 仍返回 null,缺失测量值时保持可见。接入 token 收入、历史趋势和计算器,并让 theoretical_cache_hit_rate 通过计算器字段白名单。Kimi K3 GB300 现约 $6/GPU/hr。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
edwingao28
pushed a commit
that referenced
this pull request
Sep 4, 2026
Resolve conflicts from the hook -> pure-module extraction against master's token-revenue, cache-pricing, powerValid, and refetch/retry changes: - interpolated-trend-core.ts: port tokenRevenuePerGpuHour pricing (applyTokenRevenuePricing, tokenRevenueFromRatesPerGpuHour, pricingCacheHitRate), drop removed tokensPerRmb* proportional keys; hook wrapper gains tokenRevenuePricing/error/refetch. - throughput-data.ts: replace local cacheHitRateOf with pricingCacheHitRate (GB300 theoretical-hit-rate fallback, #980). - reliability/aggregate.ts, EvaluationContext.tsx: keep extraction, port master's lint-style tweak and retryFailedEvaluationQueries. - api-documentation.ts: merge imports (POWER_METRIC_KEYS, POWER_VALIDITY_FILTERS) with api-documentation-base re-exports. - views/inference: pass power: [] for the new measured-power quick filter. - Default metric is now y_tokensPerDollarH (master); update docs, skills reference, and tests; refresh inference route SHA-256 digest. - landing-performance.cy.ts: take master's text-only supporter strip assertion, which supersedes the earlier deflake.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #975. That PR patched the 14 GB300 dynamo-vllm DeepSeek-V4 AgentX points with GB200 hit rates, but the inflated revenue persisted on other models. The production DB shows the same gap across GB300:
server_*_cache_hit_rateThe cause is the same as #975: the GB300 launcher pins srt-slurm builds that do not hand AIPerf the backend worker
/metricsURLs, so only the Dynamo frontend gets scraped and novllm:prefix_cache_*counters are captured. Cache-aware pricing treats the missing rate as 0 hits and bills ~97% cached input at the uncached price. On Kimi K3 that put GB300 at ~$42/GPU/hr against ~$7 for GB200.Fix. Add
pricingCacheHitRateinsrc/lib/cache-pricing.ts:measuredCacheHitRatesemantics, so the fix(db): backfill GB300 dynamo-vllm AgentX cache hit rates from GB200 / 用 GB200 实测值回填 GB300 dynamo-vllm AgentX 缓存命中率 #975 backfill still wins for those 14 points).theoretical_cache_hit_rate, clamped to [0, 1]. The allowlist is a single exported set containing onlygb300, and a test pins it.Wired into the three pricing paths:
tokenRevenuePerGpuHour(inference chart),useInterpolatedTrendData(historical trends, which now also carrieshwandtheoretical_cache_hit_rateon its lightweight points), anduseThroughputData(calculator).theoretical_cache_hit_rateis added to the calculator response allowlist so the fallback survives the trim; the API catalog guard passes.Verified against live API rows for Kimi K3 (2026-08-31) at normalized pricing, best point per hardware:
Overlay support:
applyTokenRevenuePricingruns on both official rows and?unofficialrun=overlay points, so the fallback applies to both paths. Tooltips are unchanged and continue to show the measured rate only when one exists, plus the theoretical rate.Still missing, out of scope here: GB200 dynamo-vllm Kimi K3 (13 of 44 rows), B200/B300 TRT MiniMax M3 (22 of 33 each), and one B200 GLM-5.1 tilert row also lack a server hit rate. Those stay at the uncached price by design of the GB300-only allowlist. The durable fix is upstream: give GB300 AgentX recipes a launcher branch on srt-slurm v1.0.45+ so the sweeps measure their own rate.
Test plan
cache-pricing.test.ts(measured wins, GB300 fallback, clamp, other hardware null, allowlist pinned to gb300) andtoken-revenue.test.ts(GB300 revenue with fallback, other hardware unchanged, measured beats fallback)benchmark-api-view.test.tsfor the new allowlisted keybunx vitest runinpackages/app: 292 files, 4789 tests passbun run typecheck, oxlint, oxfmt clean;api-route-catalog.test.tspasses中文说明
#975 的后续修复。该 PR 用 GB200 的命中率修补了 14 个 GB300 dynamo-vllm DeepSeek-V4 AgentX 数据点,但其他模型上的收入仍然虚高。生产库显示 GB300 普遍存在同样缺口:
server_*_cache_hit_rate的行数原因与 #975 相同:GB300 启动脚本固定使用的 srt-slurm 版本不会把后端 worker 的
/metrics地址交给 AIPerf,只抓取了 Dynamo 前端,没有采集vllm:prefix_cache_*计数器。缓存感知定价将缺失的命中率视为 0,把约 97% 的缓存输入按未缓存价格计费。Kimi K3 上 GB300 因此约为 $42/GPU/hr,而 GB200 约 $7。修复方式。 在
src/lib/cache-pricing.ts新增pricingCacheHitRate:measuredCacheHitRate语义不变,fix(db): backfill GB300 dynamo-vllm AgentX cache hit rates from GB200 / 用 GB200 实测值回填 GB300 dynamo-vllm AgentX 缓存命中率 #975 回填的 14 个点仍以回填值为准)。theoretical_cache_hit_rate,并裁剪到 [0, 1]。白名单是仅含gb300的单个导出集合,并有测试固定。已接入三条定价路径:
tokenRevenuePerGpuHour(推理图表)、useInterpolatedTrendData(历史趋势,其轻量数据点现在也携带hw与theoretical_cache_hit_rate)和useThroughputData(计算器)。theoretical_cache_hit_rate加入计算器响应字段白名单,避免被裁剪;API catalog 守卫通过。用线上 Kimi K3(2026-08-31)数据按标准化定价验证,各硬件最佳点:GB300 dynamo-vllm 从约 $42/GPU/hr 降到 $6.0,GB200 保持 $6.9,B300 vLLM 保持 $8.2。
Overlay 支持:
applyTokenRevenuePricing同时作用于官方数据行和?unofficialrun=overlay 数据点,回退逻辑对两条路径均生效。Tooltip 不变,仅在存在实测值时显示实测命中率,另显示理论命中率。仍然缺失、不在本 PR 范围: GB200 dynamo-vllm Kimi K3(44 行中 13 行)、B200/B300 TRT MiniMax M3(各 33 行中 22 行)以及 1 行 B200 GLM-5.1 tilert 也没有服务端命中率。按照仅限 GB300 的白名单设计,这些仍按未缓存价格计费。根本修复应在上游为 GB300 AgentX 配方增加使用 srt-slurm v1.0.45+ 的启动分支,让 sweep 自行测量命中率。
Note
Medium Risk
Changes cache-aware revenue math on a hardware-specific fallback; scope is narrow (GB300 allowlist) but affects dollar metrics users compare across SKUs.
Overview
Fixes inflated token revenue on GB300 when AgentX sweeps lack scraped
server_*_cache_hit_ratetelemetry (missing backend/metrics), which had been pricing ~97% cached input at the uncached rate.Introduces
pricingCacheHitRate: still usesmeasuredCacheHitRatewhen present; for GB300 only, falls back totheoretical_cache_hit_rate(clamped). Other hardware keep returning null so missing measurements stay visible.Wires that helper into token revenue (
tokenRevenuePerGpuHour), the calculator (useThroughputData, passinghw), and historical trends (useInterpolatedTrendData, withhw+ theoretical rate on lightweight points).theoretical_cache_hit_rateis added to the calculator response metric allowlist so it survives trimming.Reviewed by Cursor Bugbot for commit be7955a. Bugbot is set up for automated code reviews on this repo. Configure here.