Skip to content

Commit d3042d2

Browse files
committed
fix: align unofficial run table percentiles
1 parent bc30638 commit d3042d2

3 files changed

Lines changed: 27 additions & 7 deletions

File tree

packages/app/cypress/component/scatter-graph.cy.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,13 +917,17 @@ describe('ChartDisplay engine comparison guard', () => {
917917
hw: 'Official SGLang',
918918
model: Model.DeepSeek_V4_Pro,
919919
precision: Precision.FP4,
920+
p75_ttft: 0.75,
921+
p75_intvty: 75,
920922
});
921923
const runUrl = 'https://github.com/x/y/actions/runs/456';
922924
const overlayRow = createMockInferenceData({
923925
hwKey: 'h100_vllm',
924926
hw: 'Unofficial vLLM',
925927
model: Model.DeepSeek_V4_Pro,
926928
precision: Precision.FP4,
929+
p75_ttft: 0.85,
930+
p75_intvty: 65,
927931
run_url: runUrl,
928932
});
929933
const exclusion = buildExclusion([
@@ -968,6 +972,7 @@ describe('ChartDisplay engine comparison guard', () => {
968972
selectedModel: Model.DeepSeek_V4_Pro,
969973
selectedSequence: Sequence.AgenticTraces,
970974
selectedXAxisMode: 'interactivity',
975+
selectedPercentile: 'p75',
971976
activeHwTypes: new Set(['b200_sglang']),
972977
hwTypesWithData: new Set(['b200_sglang']),
973978
resolveComparisonSelection: resolveSelection,
@@ -992,6 +997,15 @@ describe('ChartDisplay engine comparison guard', () => {
992997
cy.get('[data-testid="inference-results-table"] tbody tr').should('have.length', 2);
993998
cy.get('[data-testid="inference-results-table"] tbody').contains('vLLM').should('exist');
994999
cy.get('[data-testid="inference-results-table"] tbody').contains('SGLang').should('exist');
1000+
cy.get('[data-testid="inference-results-table"] thead')
1001+
.should('contain.text', 'P75 TTFT (ms)')
1002+
.and('contain.text', 'P75 Interactivity (tok/s)')
1003+
.and('not.contain.text', 'Median TTFT');
1004+
cy.get('[data-testid="inference-results-table"] tbody')
1005+
.should('contain.text', '750')
1006+
.and('contain.text', '850')
1007+
.and('contain.text', '75.0')
1008+
.and('contain.text', '65.0');
9951009
// The reconciliation effect must not strip the run's hw types from the provider.
9961010
cy.get('@setActiveOverlayHwTypes').should('not.have.been.called');
9971011
});

packages/app/src/components/inference/ui/ChartDisplay.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ export default function ChartDisplay() {
871871
data={[...officialRows, ...overlayRows]}
872872
chartDefinition={graph.chartDefinition}
873873
selectedYAxisMetric={selectedYAxisMetric}
874+
percentile={isAgenticSequence ? selectedPercentile : 'median'}
874875
/>
875876
</>
876877
);

packages/app/src/components/inference/ui/InferenceTable.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface InferenceTableProps {
1313
data: InferenceData[];
1414
chartDefinition: ChartDefinition;
1515
selectedYAxisMetric: string;
16+
percentile?: string;
1617
}
1718

1819
/** Format a number for table display — picks sensible precision based on magnitude. */
@@ -28,10 +29,14 @@ export default function InferenceTable({
2829
data,
2930
chartDefinition,
3031
selectedYAxisMetric,
32+
percentile = 'median',
3133
}: InferenceTableProps) {
3234
const yPath = chartDefinition[selectedYAxisMetric as keyof ChartDefinition] as string | undefined;
3335
const yLabel = chartDefinition[`${selectedYAxisMetric}_label` as keyof ChartDefinition] as string;
3436
const xLabel = chartDefinition.x_label;
37+
const percentileLabel = percentile === 'median' ? 'Median' : percentile.toUpperCase();
38+
const ttftKey = `${percentile}_ttft` as keyof InferenceData;
39+
const interactivityKey = `${percentile}_intvty` as keyof InferenceData;
3540

3641
const rooflineDir = chartDefinition[
3742
`${selectedYAxisMetric}_roofline` as keyof ChartDefinition
@@ -97,21 +102,21 @@ export default function InferenceTable({
97102
className: 'tabular-nums',
98103
},
99104
{
100-
header: 'Median TTFT (ms)',
105+
header: `${percentileLabel} TTFT (ms)`,
101106
align: 'right',
102-
cell: (row) => fmt((row.median_ttft ?? 0) * 1000, 0),
103-
sortValue: (row) => row.median_ttft ?? 0,
107+
cell: (row) => fmt(((row[ttftKey] as number | undefined) ?? 0) * 1000, 0),
108+
sortValue: (row) => (row[ttftKey] as number | undefined) ?? 0,
104109
className: 'tabular-nums',
105110
},
106111
{
107-
header: 'Median Interactivity (tok/s)',
112+
header: `${percentileLabel} Interactivity (tok/s)`,
108113
align: 'right',
109-
cell: (row) => fmt(row.median_intvty ?? 0, 1),
110-
sortValue: (row) => row.median_intvty ?? 0,
114+
cell: (row) => fmt((row[interactivityKey] as number | undefined) ?? 0, 1),
115+
sortValue: (row) => (row[interactivityKey] as number | undefined) ?? 0,
111116
className: 'tabular-nums',
112117
},
113118
],
114-
[yPath, yLabel, xLabel],
119+
[yPath, yLabel, xLabel, percentileLabel, ttftKey, interactivityKey],
115120
);
116121

117122
return (

0 commit comments

Comments
 (0)