Repository navigation
fix(atom): read P/D cache counters from prefill and ingest CPU offload - #1533
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 28, 2026
Closed
Jasen2201
added a commit
to SemiAnalysisAI/InferenceX
that referenced
this pull request
Oct 28, 2026
#4397 was closed in favor of SemiAnalysisAI/InferenceX-app#1533, which reads the ATOM P/D counters from server_metrics_export.json at ingest. This PR now changes only the recipe, its master config entry, the changelog and the srt-slurm patch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 of 11 tasks
This branch was successfully deployed
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.
ATOM P/D cache rates are wrong at ingest. Every counter needed is already in
server_metrics_export.json, so no rerun is needed. This PR only changes how the app reads those counters.What is wrong on main
ATOM endpoints in P/D runs have no role label (
engine_role: "default"on both prefill and decode). The chart series sums every endpoint.atom:prompt_tokensandatom:prefix_cache_full_tokens. That doubles the denominator.atom:prefix_cache_cached_tokens.atom:prefix_cache_offload_tokensis never read, so the CPU tier is null.Trace ingest writes
server_gpu_cache_hit_rate/server_cpu_cache_hit_ratefrom this chart series, so pricing inherits the error.Fix
atom:prefill_batch_tokensstats.count > 0). Decode endpoints report 0 there.atom:prompt_tokens,atom:prefix_cache_{cached,full,offload}_tokensare read from prefill only.atom:prefix_cache_offload_tokensbecomescache hit (CPU offload)and is subtracted from compute. It is disjoint fromcached_tokensper ATOM's metric description.backfill-chart-seriesnow also rewrites the linked rows' cache-hit metrics formooncake-atom/atom-disaggtrace replays. The ingest SQL moves into a sharedwriteCacheHitMetrics.Before / after on real artifacts
Run through
computeChartSerieswith the ATOM P/D context.Per-endpoint counter totals for GLM c56 (profiling CSV):
atom:prompt_tokensatom:prefix_cache_full_tokensatom:prefix_cache_cached_tokensatom:prefix_cache_offload_tokensatom:prefill_batch_tokenscountDSv4 decode reports 0 cached tokens, so main roughly halves its hit rate.
Backfill
There are no ATOM P/D AgentX rows in the public availability API today. The ATOM P/D PRs will ingest correctly once they merge. For any existing trace replays:
Out of scope
extractServerMetricSamples(agentic aggregate distributions) still sums all endpoints.CHART_SERIES_VERSIONis not bumped because the change is ATOM P/D only. Use--force --run-id.Tests
atom-metrics.test.tscovers prefill-only scoping with offload as CPU, and the no-marker fallback. Allpackages/dbtests pass (1183), along with typecheck, lint and format.Note
Medium Risk
Changes how stored benchmark cache-hit rates are derived for ATOM P/D runs, which downstream pricing and UI consume; logic is scoped to those frameworks with tests and backfill support.
Overview
Fixes ATOM prefill/decode chart series and ingest so prompt and prefix-cache counters are not double-counted when decode endpoints re-export the same tokens without role labels.
Chart computation identifies prefill endpoints via
atom:prefill_batch_tokens(stats.count > 0) and, when mixed with decode, scopesatom:prompt_tokensandatom:prefix_cache_*counters to those endpoints only. It now ingestsatom:prefix_cache_offload_tokensas cache hit (CPU offload) and subtracts offload from compute (miss). Exports without the prefill marker still sum all endpoints.Trace ingest and backfill share a new
writeCacheHitMetricshelper (replacing duplicated SQL).backfill-chart-seriesalso rewrites linkedbenchmark_resultsGPU/CPU cache-hit fields formooncake-atom/atom-disaggafter recomputing chart series, matching fresh ingest behavior.Tests cover prefill-only scoping with offload and the no-marker fallback.
Reviewed by Cursor Bugbot for commit e979c8e. Bugbot is set up for automated code reviews on this repo. Configure here.