Skip to content

Commit 6e3763d

Browse files
authored
Dynamic QueryBuilder For benchmark + ListMetadataApi & get_time_series Api (#7350)
# Overview 1. add dynamic query builder in HUD 2. add default and microOperatar fetcher in both listMetadata and get_time_series 3. make the compiler benchmark query depends on workflows instead of commits - when fetch based on commits, sometimes additinonal worklfows pop up ## BE 1. Move FE and Backend code into two folders for benchmark FE and Backend should not depends/share same module, make it clear the use cases
1 parent ea334ab commit 6e3763d

File tree

95 files changed

+2394
-720
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+2394
-720
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"params": {
3+
"repo": "String",
4+
"benchmarkNames": "Array<String>",
5+
"branches": "Array<String>",
6+
"models": "Array(String)",
7+
"backends": "Array(String)",
8+
"startTime": "DateTime64(3)",
9+
"stopTime": "DateTime64(3)",
10+
"arch": "String",
11+
"dtype": "String",
12+
"device": "String",
13+
"mode": "String"
14+
},
15+
"tests": []
16+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
SELECT
2+
replaceAll(head_branch, 'refs/heads/', '') AS branch,
3+
head_sha AS commit,
4+
workflow_id,
5+
toStartOfHour(min(fromUnixTimestamp(timestamp))) AS date
6+
FROM benchmark.oss_ci_benchmark_metadata
7+
PREWHERE
8+
timestamp >= toUnixTimestamp({startTime: DateTime64(3)})
9+
AND timestamp < toUnixTimestamp({stopTime: DateTime64(3)})
10+
WHERE
11+
repo = {repo: String}
12+
AND (
13+
has(
14+
{branches: Array(String)},
15+
replaceAll(head_branch, 'refs/heads/', '')
16+
)
17+
OR empty({branches: Array(String)})
18+
)
19+
AND (benchmark_dtype = {dtype: String} OR empty({dtype: String}))
20+
AND (
21+
has({benchmarkNames: Array(String)}, benchmark_name)
22+
OR empty({benchmarkNames: Array(String)})
23+
)
24+
AND notEmpty(metric_name)
25+
AND notEmpty(device)
26+
AND (
27+
arch LIKE concat('%', {arch: String}, '%')
28+
OR {arch: String} = ''
29+
)
30+
AND (
31+
has({models: Array(String)}, model_name)
32+
OR empty({models: Array(String)})
33+
)
34+
AND (
35+
has({backends: Array(String)}, model_backend)
36+
OR empty({backends: Array(String)})
37+
)
38+
AND (
39+
startsWith(device, {device: String})
40+
OR {device: String} = ''
41+
)
42+
GROUP BY
43+
replaceAll(head_branch, 'refs/heads/', ''),
44+
head_sha,
45+
workflow_id
46+
ORDER BY
47+
branch, -- OK to use alias in ORDER BY
48+
date;

torchci/clickhouse_queries/compilers_benchmark_api_commit_query/params.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"mode": "String",
88
"startTime": "DateTime64(3)",
99
"stopTime": "DateTime64(3)",
10-
"suites": "Array(String)",
11-
"workflowIds": "Array(Int64)"
10+
"suites": "Array(String)"
1211
},
1312
"tests": []
1413
}

torchci/clickhouse_queries/compilers_benchmark_api_query/params.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"branches": "Array(String)",
44
"commits": "Array(String)",
55
"compilers": "Array(String)",
6+
"workflows": "Array(UInt64)",
67
"device": "String",
78
"arch": "Array(String)",
89
"dtype": "String",

torchci/clickhouse_queries/compilers_benchmark_api_query/query.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SELECT
1818
AS granularity_bucket
1919
FROM benchmark.oss_ci_benchmark_torchinductor
2020
WHERE
21-
head_sha IN ({commits: Array(String)})
21+
workflow_id IN ({workflows: Array(UInt64)})
2222
AND (
2323
has(
2424
{branches: Array(String)},

torchci/components/benchmark/llms/LLMsBenchmarkPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const MainPage = ({
139139
);
140140
}, [router.query]);
141141
const queryParams = getLLMsBenchmarkPropsQueryParameter(props);
142+
142143
const { data, error, isLoading } = useBenchmarkPropsData(queryParams);
143144

144145
// an error occured while fetching the benchmark props data

torchci/components/benchmark/v3/configs/configBook.tsx

Lines changed: 0 additions & 142 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Badge, IconButton, Tooltip } from "@mui/material";
22
import { Box } from "@mui/system";
33
import dayjs from "dayjs";
4-
import { useListBenchmarkRegressionReportsData } from "lib/benchmark/api_helper/apis/hooks";
4+
import { useListBenchmarkRegressionReportsData } from "lib/benchmark/api_helper/fe/hooks";
55
import { RiNotification2Fill } from "react-icons/ri";
66
import { BenchmarkReportFeatureSidePanel } from "./BenchmarkReportFeatureSidePanel";
77
import {

0 commit comments

Comments
 (0)