Skip to content

Commit a64c479

Browse files
authored
Fix compiler bug (#7482)
1. fix compiler name bug for geomean, it should be geomean_speedup 2. filter export for all other aggregated metrics except passrate https://torchci-git-fixcompilerbug-fbopensource.vercel.app/benchmark/compilers_regression 3. render missing data with light grey if it's enabled
1 parent aa0928b commit a64c479

File tree

8 files changed

+46
-13
lines changed

8 files changed

+46
-13
lines changed

aws/lambda/benchmark_regression_summary_report/common/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@
228228
threshold=0.9,
229229
baseline_aggregation="max",
230230
),
231-
"geomean": RegressionPolicy(
232-
name="geomean",
231+
"geomean_speedup": RegressionPolicy(
232+
name="geomean_speedup",
233233
condition="greater_equal",
234234
threshold=0.95,
235235
baseline_aggregation="max",

torchci/components/benchmark_v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesComparisonSection/BenchmarkTimeSeriesComparisonTable/ComparisonTableColumnRendering.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export function getComparisionTableConlumnRendering(
157157
const VIOLATE_RULE_COLOR = "#ffebee"; // red[50]
158158
const IMPROVEMENT_COLOR = "#e8f5e9"; // green[50]
159159
const WARNING_COLOR = "#fff9c4"; // yellow[50]
160+
const MISSING_DATA_COLOR = "#F5F5F5"; // ~ MUI grey[300]
160161

161162
export function ComparisonTablePrimaryFieldValueCell({
162163
params,
@@ -222,6 +223,9 @@ export function ComparisonTableColumnFieldValueCell({
222223
case "warning":
223224
bgColor = WARNING_COLOR;
224225
break;
226+
case "missing":
227+
bgColor = MISSING_DATA_COLOR;
228+
break;
225229
case "neutral":
226230
default:
227231
break;
@@ -365,6 +369,21 @@ export function getComparisonResult(
365369
? missingText
366370
: config?.renderOptions?.bothMissingText;
367371

372+
// if either side missing, mark as missing
373+
if (config?.renderOptions?.renderMissing) {
374+
if (ldata == null && rdata == null) {
375+
result.verdict = "missing";
376+
result.reason = "both missing";
377+
} else if (ldata == null) {
378+
result.verdict = "missing";
379+
result.reason = "left missing";
380+
} else if (rdata == null) {
381+
result.verdict = "missing";
382+
result.reason = "right missing";
383+
}
384+
}
385+
386+
// if either side failed, mark as failure, failure is higher priority than missing
368387
if (ldata?.is_failure || rdata?.is_failure) {
369388
result.verdict = "warning";
370389
result.reason = "detect failure";
@@ -382,6 +401,7 @@ export function getComparisonResult(
382401
missingText,
383402
bothMissingText
384403
);
404+
385405
return {
386406
result,
387407
text,

torchci/components/benchmark_v3/components/dataRender/components/benchmarkTimeSeries/helper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export interface BenchmarkComparisonTableRenderingOptions {
6868
};
6969
missingText?: string;
7070
bothMissingText?: string;
71+
renderMissing?: boolean;
7172
}
7273

7374
export interface BenchmarkComparisonTablePrimaryColumnConfig {

torchci/components/benchmark_v3/configs/helpers/RegressionPolicy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { asNumber } from "components/benchmark_v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesComparisonSection/BenchmarkTimeSeriesComparisonTable/ComparisonTableHelpers";
22

3-
export type ComparisonVerdict = "good" | "neutral" | "regression" | "warning";
3+
export type ComparisonVerdict =
4+
| "good"
5+
| "neutral"
6+
| "regression"
7+
| "warning"
8+
| "missing";
49
export type ComparisonPolicyType = "ratio" | "status" | "threshold";
510
export const DEFAULT_TYPE = "ratio";
611
export const DEFAULT_BAD_RATIO = 0.9;

torchci/components/benchmark_v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ export const CompilerPrecomputeConfirmDialogContent: React.FC<
6262
triggerUpdate();
6363
return;
6464
}
65-
6665
const cell = await navigateToDataGrid(
6766
tableId,
68-
[`${left?.compiler}`],
67+
[`${left?.compiler}|`],
6968
`${left?.suite}`,
7069
toggleSectonId
7170
);

torchci/components/benchmark_v3/configs/teams/compilers/config.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const PASSRATE_COMPARISON_POLICY: BenchmarkComparisonPolicyConfig = {
3232
},
3333
};
3434
const GEOMEAN_COMPARISON_POLICY: BenchmarkComparisonPolicyConfig = {
35-
target: "geomean",
35+
target: "geomean_speedup",
3636
type: "ratio",
3737
ratioPolicy: {
3838
badRatio: 0.95,
@@ -107,7 +107,7 @@ const RENDER_MAPPING_BOOK = {
107107
scale: 100,
108108
},
109109
},
110-
geomean: {
110+
geomean_speedup: {
111111
unit: {
112112
unit: "x",
113113
},
@@ -323,6 +323,7 @@ export const CompilerDashboardBenchmarkUIConfig: BenchmarkUIConfig = {
323323
extraMetadata: DASHBOARD_COMPARISON_TABLE_METADATA_COLUMNS,
324324
renderOptions: {
325325
tableRenderingBook: DashboardRenderBook,
326+
renderMissing: true,
326327
flex: {
327328
primary: 2,
328329
},
@@ -418,7 +419,7 @@ export const CompilerPrecomputeBenchmarkUIConfig: BenchmarkUIConfig = {
418419
passrate: {
419420
text: "Passrate",
420421
},
421-
geomean: {
422+
geomean_speedup: {
422423
text: "Geometric mean speedup",
423424
},
424425
compilation_latency: {
@@ -447,7 +448,7 @@ export const CompilerPrecomputeBenchmarkUIConfig: BenchmarkUIConfig = {
447448
filterByFieldValues: {
448449
metric: [
449450
"passrate",
450-
"geomean",
451+
"geomean_speedup",
451452
"compilation_latency",
452453
"compression_ratio",
453454
],
@@ -465,7 +466,7 @@ export const CompilerPrecomputeBenchmarkUIConfig: BenchmarkUIConfig = {
465466
targetField: "metric",
466467
comparisonPolicy: {
467468
passrate: PASSRATE_COMPARISON_POLICY,
468-
geomean: GEOMEAN_COMPARISON_POLICY,
469+
geomean_speedup: GEOMEAN_COMPARISON_POLICY,
469470
compilation_latency: COMPILATION_LATENCY_COMPARISON_POLICY,
470471
compression_ratio: COMPRESSION_RATIO_POLICY,
471472
},
@@ -474,17 +475,18 @@ export const CompilerPrecomputeBenchmarkUIConfig: BenchmarkUIConfig = {
474475
passrate: {
475476
text: "Passrate (threshold: 95%)",
476477
},
477-
geomean: {
478+
geomean_speedup: {
478479
text: "Geometric mean speedup (threshold = 0.95x)",
479480
},
480481
compilation_latency: {
481-
text: "compilation time (seconds)",
482+
text: "Compilation time (seconds)",
482483
},
483484
compression_ratio: {
484485
text: "Peak memory footprint compression ratio (threshold = 0.95x)",
485486
},
486487
},
487488
tableRenderingBook: RENDER_MAPPING_BOOK,
489+
renderMissing: true,
488490
},
489491
},
490492
},

torchci/lib/benchmark/api_helper/backend/compilers/helpers/precompute.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export function toPrecomputeCompilerData(
6767
const executionTime = computeExecutionTime(data, models);
6868
const peakMemoryUsage = computePeakMemoryUsage(data, models);
6969

70+
// filter out export for compiler since it's always 0
71+
7072
let all_data = [
7173
passrate,
7274
geomean,
@@ -76,6 +78,10 @@ export function toPrecomputeCompilerData(
7678
peakMemoryUsage,
7779
].flat();
7880

81+
// only show export for passrate
82+
all_data = all_data.filter((row) =>
83+
row.compiler == "export" && row.metric != "passrate" ? false : true
84+
);
7985
all_data = [...all_data].sort(
8086
(a, b) =>
8187
Date.parse(a.granularity_bucket) - Date.parse(b.granularity_bucket)

torchci/lib/benchmark/compilerUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export function computeGeomean(
166166

167167
const [bucket, workflowId, suite, compiler] = key.split("+");
168168
returnedGeomean.push({
169-
metric: "geomean",
169+
metric: "geomean_speedup",
170170
value: Number(gm),
171171
granularity_bucket: bucket,
172172
workflow_id: workflowId,

0 commit comments

Comments
 (0)