Skip to content

Commit a6de730

Browse files
committed
[Helion Benchmark] Use geomean for speedup
stack-info: PR: #7126, branch: oulgen/stack/6
1 parent 1c37877 commit a6de730

4 files changed

Lines changed: 20 additions & 3 deletions

File tree

torchci/clickhouse_queries/oss_ci_benchmark_llms/query.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ WITH benchmarks AS (
1010
o.model.'backend' AS backend,
1111
o.model.'origins' AS origins,
1212
o.metric.'name' AS metric,
13+
-- Arithmetic mean
1314
floor(arrayAvg(o.metric.'benchmark_values'), 2) AS actual,
15+
-- Geometric mean
16+
floor(exp(arrayAvg(arrayMap(x -> log(x), o.metric.'benchmark_values'))), 2) AS actual_geomean,
1417
floor(toFloat64(o.metric.'target_value'), 2) AS target,
1518
o.benchmark.'mode' AS mode,
1619
o.benchmark.'dtype' AS dtype,
@@ -141,6 +144,7 @@ SELECT DISTINCT
141144
origins,
142145
metric,
143146
actual,
147+
actual_geomean,
144148
target,
145149
mode,
146150
dtype,

torchci/components/benchmark/llms/components/LLMsSummaryPanel.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ export default function LLMsSummaryPanel({
384384
l = l === 1 ? "Pass" : "Fail";
385385
r = r === 1 ? "Pass" : "Fail";
386386
} else if (metric.includes("speedup")) {
387+
l = v.l.actual_geomean;
388+
r = v.r.actual_geomean;
389+
387390
const accuracy = metric.replace(/_speedup$/, "_accuracy");
388391
const accuracy_v = params.row[accuracy];
389392
if (accuracy_v.l.actual !== 1) {

torchci/lib/benchmark/llms/common.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export const METRIC_DISPLAY_HEADERS: { [k: string]: string } = {
4242
p99_ttft_ms: "p99 TTFT (ms)",
4343
requests_per_second: "Requests/s",
4444
tokens_per_second: "Tokens/s",
45-
triton_speedup: "Triton Speedup",
45+
triton_speedup: "Triton Speedup (Geomean)",
4646
triton_accuracy: "Triton Accuracy",
47-
torch_compile_speedup: "Torch Compile Speedup",
47+
torch_compile_speedup: "Torch Compile Speedup (Geomean)",
4848
torch_compile_accuracy: "Torch Compile Accuracy",
49-
helion_speedup: "Helion Speedup",
49+
helion_speedup: "Helion Speedup (Geomean)",
5050
helion_accuracy: "Helion Accuracy",
5151
};
5252
// The variable name is a bit dumb, but it tells if a higher metric value
@@ -127,6 +127,7 @@ export interface LLMsBenchmarkData {
127127
job_id: number;
128128
metric: string;
129129
actual: number;
130+
actual_geomean: number;
130131
target: number;
131132
mode?: string;
132133
dtype: string;

torchci/lib/benchmark/llms/utils/llmUtils.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ export function computeGeomean(data: LLMsBenchmarkData[], metricName: string) {
184184
job_id: Number(jobId),
185185
metric: `${metric} (geomean)`,
186186
actual: Number(gm),
187+
actual_geomean: Number(gm),
187188
target: 0,
188189
dtype: dtype,
189190
device: device,
@@ -339,19 +340,23 @@ const toRowData = (
339340
l: hasL
340341
? {
341342
actual: Number.MAX_SAFE_INTEGER, // indicate the failure on left side
343+
actual_geomean: Number.MAX_SAFE_INTEGER, // indicate the failure on left side
342344
target: 0,
343345
}
344346
: {
345347
actual: 0,
348+
actual_geomean: 0,
346349
target: 0,
347350
},
348351
r: hasR
349352
? {
350353
actual: Number.MAX_SAFE_INTEGER, // indicate the failure on right side
354+
actual_geomean: Number.MAX_SAFE_INTEGER, // indicate the failure on right side
351355
target: 0,
352356
}
353357
: {
354358
actual: 0,
359+
actual_geomean: 0,
355360
target: 0,
356361
},
357362
highlight: hasL && hasR,
@@ -361,19 +366,23 @@ const toRowData = (
361366
l: hasL
362367
? {
363368
actual: record["l"].actual,
369+
actual_geomean: record["l"].actual_geomean,
364370
target: record["l"].target,
365371
}
366372
: {
367373
actual: 0,
374+
actual_geomean: 0,
368375
target: 0,
369376
},
370377
r: hasR
371378
? {
372379
actual: record["r"].actual,
380+
actual_geomean: record["r"].actual_geomean,
373381
target: record["r"].target,
374382
}
375383
: {
376384
actual: 0,
385+
actual_geomean: 0,
377386
target: 0,
378387
},
379388
highlight: hasL && hasR,

0 commit comments

Comments
 (0)