fix(power): withhold invalid and ambiguous measured energy / 屏蔽无效与语义不明的实测能耗 - #734
fix(power): withhold invalid and ambiguous measured energy / 屏蔽无效与语义不明的实测能耗#734edwingao28 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @edwingao28's task in 3m 21s —— View job Review: withhold invalid and ambiguous measured energy
FindingsThe core guard is correct and well-reasoned, and the test coverage is thorough (both the consumer boundary and the ETL discriminators, including the mutation-check on
One 🟡 non-blocking item (inline on 🟢 No blocking issues. |
| prefill_joules_per_input_token?: number; | ||
| decode_joules_per_output_token?: number; |
There was a problem hiding this comment.
🟡 Non-blocking: These role-prefixed fields are threaded through rowToAggDataEntry but not consumed anywhere. The chart's only J/input axis (measuredJPerInputToken) reads the unprefixed entry.joules_per_input_token in both chart-utils.ts:472 and useInterpolatedTrendData.ts:92; there is no Y-axis metric wired to prefill_joules_per_input_token / decode_joules_per_output_token.
Why it matters: The PR description says "Role-prefixed fields … are unambiguous across versions and stay visible." As written they never become visible — a reviewer reading the diff would assume the disagg rows still show a role-local J/token point after their unprefixed value is withheld, but the chart surfaces nothing for them. That's a larger silent regression than the "7 rows" documented, since it hits every version-2 disagg row too.
Fix: If they're intended to render, wire a Y-axis metric (register in Y_AXIS_METRICS, createChartDataPoint, and ChartControls) so the role-local energy actually shows. If they're deliberate groundwork for a follow-up, a one-line comment saying so — and a note in the PR body — would avoid the "stay visible" claim being read as current behavior.
|
Claude finished @edwingao28's task in 2m 3s —— View job Re-review: withhold invalid and ambiguous measured energyFocused on the new commit since my last review (
Findings
CI: all green — typecheck / unit / lint / Component / E2E (chrome+firefox all shards) / Cursor Bugbot all pass. Runtime: Still open (previously noted, non-blocking)The 🟢 LGTM — no blocking issuesThe ETL guard is well-reasoned, fails closed, and is comprehensively tested. Nothing new to block on. |
What
Two guards on measured power at the presentation boundary:
power_valid = 0is authoritative. An explicit invalid verdict scrubs every measured power/energy field instead of letting stale or unvalidated numbers render.power_metric_schema_version = 2before their unprefixedjoules_per_*fields are shown. Role-prefixed fields (prefill_avg_power_w,decode_avg_power_w,prefill_joules_per_input_token,decode_joules_per_output_token) are unambiguous across versions and stay visible.Legacy rows without a
power_validverdict remain eligible, so historical single-node measurements do not disappear.Why
The unprefixed
joules_per_*fields silently switched from role-local to whole-deployment energy when multinode aggregation landed. The values alone cannot distinguish the two, so a disaggregated row without the version stamp could be off by the prefill/decode split ratio with no way to detect it on the chart.The producer-side stamp is InferenceX#2599. This PR is the consumer half.
Known, accepted regression
7 fixture/DB rows lose their 3 unprefixed J/token values:
mori-sglang/mi355x/dsr1, disaggregated, no schema version.These are vendor-supplied and we have no evidence of which energy convention they used. Their role watts still render — only the ambiguous unprefixed joules are withheld.
This is deliberate: a point that is wrong by several times, with no visual indication, is worse than a missing point. If the vendor confirms the convention, a follow-up can stamp the version at supplemental ingest and the rows come back.
Exact version match, not
>=power_metric_schema_version === 2, not>= 2. An open bound would silently admit a future schema whose semantics changed again — which is the exact failure that made versioning necessary. Bumping the producer constant now forces a deliberate change here too.Verification
Mutation-checked: reverting the guard to
>= 2fails exactly the new future-version test (1 failed | 89 passed).Note
Medium Risk
Changes how disaggregated and invalid power rows render on charts (intentional withholding of ambiguous joules); ingest normalization affects stored
power_valid/schema_versionfor malformed artifacts.Overview
Adds a consumer-side power publication contract so charts do not show measured energy when the producer verdict or schema semantics are unclear.
ETL (
benchmark-mapper) re-normalizespower_validandpower_metric_schema_versionafter generic numeric capture: only1/'1'counts as valid; malformed schema versions are dropped instead of loosely coerced.Chart transform (
rowToAggDataEntry) applies two guards:power_valid === 0scrubs all measured power/energy fields (includingworkers), while legacy rows without a verdict still show power.joules_per_*whenpower_metric_schema_version === 2(exact match, not>=). Role watts and explicitprefill_joules_*/decode_joules_*stay visible when power is valid.Types and
METRIC_KEYSdocument the new contract fields and version-2 whole-deployment vs role-local joules semantics.Reviewed by Cursor Bugbot for commit db4422f. Bugbot is set up for automated code reviews on this repo. Configure here.