Skip to content

Commit 27d47f2

Browse files
authored
Add TorchAO LLM benchmark dashboard (#6087)
A simple change to add the initial version of TorchAO LLM benchmark dashboard. ### Testing https://torchci-git-fork-huydhn-add-ao-llm-dashboard-fbopensource.vercel.app/benchmark/llms?repoName=pytorch%2Fao
1 parent a07505a commit 27d47f2

File tree

12 files changed

+319
-283
lines changed

12 files changed

+319
-283
lines changed

torchci/clickhouse_queries/oss_ci_benchmark_branches/params.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"excludedMetrics": "Array(String)",
55
"benchmarks": "Array(String)",
66
"models": "Array(String)",
7+
"backends": "Array(String)",
78
"repo": "String",
89
"startTime": "DateTime64(3)",
910
"stopTime": "DateTime64(3)"

torchci/clickhouse_queries/oss_ci_benchmark_branches/query.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ WITH benchmarks AS (
3030
has({models: Array(String) }, o.model.name)
3131
OR empty({models: Array(String) })
3232
)
33+
AND (
34+
has({backends: Array(String) }, o.model.backend)
35+
OR empty({backends: Array(String) })
36+
)
3337
AND (
3438
has({dtypes: Array(String) }, o.benchmark.dtype)
3539
OR empty({dtypes: Array(String) })

torchci/clickhouse_queries/oss_ci_benchmark_llms/params.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"benchmarks": "Array(String)",
88
"granularity": "String",
99
"models": "Array(String)",
10+
"backends": "Array(String)",
1011
"repo": "String",
1112
"startTime": "DateTime64(3)",
1213
"stopTime": "DateTime64(3)"

torchci/clickhouse_queries/oss_ci_benchmark_llms/query.sql

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ WITH benchmarks AS (
4444
has({models: Array(String) }, o.model.name)
4545
OR empty({models: Array(String) })
4646
)
47+
AND (
48+
has({backends: Array(String) }, o.model.backend)
49+
OR empty({backends: Array(String) })
50+
)
4751
AND (
4852
has({dtypes: Array(String) }, o.benchmark.dtype)
4953
OR empty({dtypes: Array(String) })
@@ -58,7 +62,8 @@ WITH benchmarks AS (
5862
SELECT
5963
DISTINCT workflow_id,
6064
job_id,
61-
CONCAT(model, ' ', backend) AS name,
65+
model,
66+
backend,
6267
metric,
6368
actual,
6469
target,
@@ -70,10 +75,6 @@ FROM
7075
benchmarks
7176
WHERE
7277
(
73-
has({models: Array(String) }, CONCAT(model, ' ', backend))
74-
OR empty({models: Array(String) })
75-
)
76-
AND (
7778
has({branches: Array(String) }, head_branch)
7879
OR empty({branches: Array(String) })
7980
)
@@ -91,6 +92,7 @@ WHERE
9192
ORDER BY
9293
granularity_bucket DESC,
9394
workflow_id DESC,
94-
name,
95+
backend,
96+
model,
9597
dtype,
9698
device

torchci/clickhouse_queries/oss_ci_benchmark_names/params.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"excludedMetrics": "Array(String)",
55
"benchmarks": "Array(String)",
66
"models": "Array(String)",
7+
"backends": "Array(String)",
78
"repo": "String",
89
"startTime": "DateTime64(3)",
910
"stopTime": "DateTime64(3)"

torchci/clickhouse_queries/oss_ci_benchmark_names/query.sql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ WITH benchmarks AS (
3030
has({models: Array(String) }, o.model.name)
3131
OR empty({models: Array(String) })
3232
)
33+
AND (
34+
has({backends: Array(String) }, o.model.backend)
35+
OR empty({backends: Array(String) })
36+
)
3337
AND (
3438
has({dtypes: Array(String) }, o.benchmark.dtype)
3539
OR empty({dtypes: Array(String) })
@@ -43,7 +47,8 @@ WITH benchmarks AS (
4347
)
4448
SELECT
4549
DISTINCT benchmark,
46-
CONCAT(model, ' ', backend) AS name,
50+
model,
51+
backend,
4752
metric,
4853
dtype,
4954
device,
@@ -64,7 +69,8 @@ WHERE
6469
AND notEmpty(device)
6570
ORDER BY
6671
benchmark,
67-
name,
72+
backend,
73+
model,
6874
metric,
6975
dtype,
7076
device

torchci/components/NavBar.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@ function NavBar() {
5050
href: "/torchbench/userbenchmark",
5151
},
5252
{
53-
name: "LLMs",
53+
name: "PyTorch LLMs",
5454
href: "/benchmark/llms?repoName=pytorch%2Fpytorch",
5555
},
5656
{
5757
name: "ExecuTorch",
5858
href: "/benchmark/llms?repoName=pytorch%2Fexecutorch",
5959
},
60+
{
61+
name: "TorchAO LLMs",
62+
href: "/benchmark/llms?repoName=pytorch%2Fao",
63+
},
6064
];
6165

6266
const devInfraDropdown = [

torchci/components/benchmark/llms/ModelGraphPanel.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export function GraphPanel({
2727
queryParams,
2828
granularity,
2929
modelName,
30+
backendName,
3031
dtypeName,
3132
deviceName,
3233
metricNames,
@@ -36,6 +37,7 @@ export function GraphPanel({
3637
queryParams: { [key: string]: any };
3738
granularity: Granularity;
3839
modelName: string;
40+
backendName: string;
3941
dtypeName: string;
4042
deviceName: string;
4143
metricNames: string[];
@@ -44,16 +46,10 @@ export function GraphPanel({
4446
}) {
4547
// Do not set the commit here to query all the records in the time range to
4648
// draw a chart
47-
const { data, error } = useBenchmark(
48-
queryParams,
49-
modelName,
50-
dtypeName,
51-
deviceName,
52-
{
53-
branch: rBranchAndCommit.branch,
54-
commit: "",
55-
}
56-
);
49+
const { data, error } = useBenchmark(queryParams, {
50+
branch: rBranchAndCommit.branch,
51+
commit: "",
52+
});
5753

5854
if (data === undefined || data.length === 0) {
5955
return (
@@ -86,7 +82,7 @@ export function GraphPanel({
8682
chartData[metric] = data
8783
.filter((record: LLMsBenchmarkData) => {
8884
return (
89-
record.name === modelName &&
85+
record.model === modelName &&
9086
(record.dtype === dtypeName || dtypeName === DEFAULT_DTYPE_NAME) &&
9187
(`${record.device} (${record.arch})` === deviceName ||
9288
deviceName === DEFAULT_DEVICE_NAME) &&
@@ -102,17 +98,17 @@ export function GraphPanel({
10298
);
10399
})
104100
.map((record: LLMsBenchmarkData) => {
105-
const name = record.name;
101+
const model = record.model;
106102
const dtype = record.dtype;
107103
const device = record.device;
108104

109-
record.display = name.includes(dtype)
110-
? name.includes(device)
111-
? name
112-
: `${name} (${device})`
113-
: name.includes(device)
114-
? `${name} (${dtype})`
115-
: `${name} (${dtype} / ${device})`;
105+
record.display = model.includes(dtype)
106+
? model.includes(device)
107+
? model
108+
: `${model} (${device})`
109+
: model.includes(device)
110+
? `${model} (${dtype})`
111+
: `${model} (${dtype} / ${device})`;
116112

117113
return record;
118114
});

0 commit comments

Comments
 (0)