Skip to content

Commit 1adb695

Browse files
authored
[CacheBench] Add unit for speedup (#6340)
1 parent ea29dac commit 1adb695

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

torchci/components/benchmark/llms/SummaryPanel.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
IS_INCREASING_METRIC_VALUE_GOOD,
66
METRIC_DISPLAY_HEADERS,
77
RELATIVE_THRESHOLD,
8+
UNIT_FOR_METRIC,
89
} from "components/benchmark/llms/common";
910
import styles from "components/metrics.module.css";
1011
import { TablePanelWithData } from "components/metrics/panels/TablePanel";
@@ -316,6 +317,9 @@ export function SummaryPanel({
316317
const l = v.l.actual;
317318
const r = v.r.actual;
318319

320+
const unit =
321+
metric in UNIT_FOR_METRIC ? UNIT_FOR_METRIC[metric] : "";
322+
319323
// Compute the percentage
320324
const target = v.r.target;
321325
const lPercent =
@@ -330,9 +334,9 @@ export function SummaryPanel({
330334
target && target != 0 ? `[target = ${target}]` : "";
331335

332336
if (lCommit === rCommit || !v.highlight) {
333-
return `${r} ${rPercent} ${showTarget}`;
337+
return `${r}${unit} ${rPercent} ${showTarget}`;
334338
} else {
335-
return `${l} ${lPercent}${r} ${rPercent} ${showTarget}`;
339+
return `${l}${unit} ${lPercent}${r}${unit} ${rPercent} ${showTarget}`;
336340
}
337341
},
338342
};

torchci/components/benchmark/llms/common.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ export const METRIC_DISPLAY_SHORT_HEADERS: { [k: string]: string } = {
8383
"Cold compile time (s)": "ColdCompTime",
8484
"Warm compile time (s)": "WarmCompTime",
8585
};
86+
export const UNIT_FOR_METRIC: { [k: string]: string } = {
87+
"Speedup (%)": "%",
88+
};
8689
export const DEFAULT_DEVICE_NAME = "All Devices";
8790
export const DEFAULT_ARCH_NAME = "All Platforms";
8891
export const DEFAULT_DTYPE_NAME = "All DType";

0 commit comments

Comments
 (0)