Skip to content

Commit 59ee6d8

Browse files
authored
Fix wrong commit date on benchmark dashboards (#5725)
Fixes #5696 I discover two issues with the current query to get the commits and their date: * The query inherits the granularity parameter, so when the granularity is set to week, for example, all commit's dates are truncated to the beginning of the week. This is the root cause of #5696. For more context, switching to weekly granularity is a hack I have at the moment to be able to reduce the payload side and be able to load last quarter data (#4123). So the issue only manifests when a time range from last quarter or more is selected. The fix then is just to truncate commit's dates by day because that's the format displayed in the dashboard (YYYY/MM/DD) * Truncating the commit's date by day also fixes an off-by-one-day mismatch in the dashboard. For example, [77fba0c407](https://hud.pytorch.org/pytorch/pytorch/commit/77fba0c407c10e3e2b5182578aa8affae6abc398#inductor-A100-perf-nightly)'s date is 2024/09/26, which is actually a day later than the actual date pytorch/pytorch@77fba0c (2024/09/25) ### Testing * Selecting last quarter with weekly granularity doesn't screw up the commit's dates now https://torchci-git-fork-huydhn-fix-wrong-commit-da-ccea24-fbopensource.vercel.app/benchmark/compilers?dashboard=torchinductor&startTime=Sat%2C%2029%20Jun%202024%2005%3A17%3A28%20GMT&stopTime=Fri%2C%2027%20Sep%202024%2005%3A17%3A28%20GMT&granularity=week&suite=torchbench&mode=inference&dtype=bfloat16&deviceName=cuda%20(a100)&lBranch=main&lCommit=77fba0c407c10e3e2b5182578aa8affae6abc398&rBranch=main&rCommit=a676b7c5f3cf05690afbce3c99575916b3b468aa * Regular view https://torchci-git-fork-huydhn-fix-wrong-commit-da-ccea24-fbopensource.vercel.app/benchmark/compilers shows the correct commit's dates. * Other benchmark dashboards also looks correct: * https://torchci-git-fork-huydhn-fix-wrong-commit-da-ccea24-fbopensource.vercel.app/benchmark/llms
1 parent 95906b3 commit 59ee6d8

File tree

6 files changed

+5
-17
lines changed

6 files changed

+5
-17
lines changed

torchci/components/benchmark/CommitPanel.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Stack, Typography } from "@mui/material";
22
import { SHA_DISPLAY_LENGTH } from "components/benchmark/common";
3-
import dayjs from "dayjs";
43
import { BranchAndCommit } from "lib/types";
54
import { ReactNode } from "react";
65

@@ -27,8 +26,7 @@ export function CommitPanel({
2726
>
2827
{lBranchAndCommit.commit.substring(0, SHA_DISPLAY_LENGTH)}
2928
</a>{" "}
30-
on {dayjs(lBranchAndCommit.date).format("YYYY/MM/DD")} comparing with{" "}
31-
{rBranchAndCommit.branch} branch at commit{" "}
29+
comparing with {rBranchAndCommit.branch} branch at commit{" "}
3230
<a
3331
href={`/${repoName}/commit/${rBranchAndCommit.commit}#${workflowName}`}
3432
>

torchci/rockset/benchmarks/__sql/oss_ci_benchmark_branches.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SELECT
55
w.head_sha,
66
w.id,
77
FORMAT_ISO8601(
8-
DATE_TRUNC(: granularity, TIMESTAMP_MILLIS(o.timestamp))
8+
DATE_TRUNC('day', TIMESTAMP_MILLIS(o.timestamp))
99
) AS event_time,
1010
o.filename
1111
FROM

torchci/rockset/benchmarks/oss_ci_benchmark_branches.lambda.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
"type": "string",
1212
"value": ""
1313
},
14-
{
15-
"name": "granularity",
16-
"type": "string",
17-
"value": "day"
18-
},
1914
{
2015
"name": "repo",
2116
"type": "string",

torchci/rockset/inductor/__sql/compilers_benchmark_performance_branches.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SELECT
44
w.id,
55
FORMAT_ISO8601(
66
DATE_TRUNC(
7-
: granularity, TIMESTAMP_MILLIS(p.timestamp)
7+
'day', TIMESTAMP_MILLIS(p.timestamp)
88
)
99
) AS event_time,
1010
FROM

torchci/rockset/inductor/compilers_benchmark_performance_branches.lambda.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
"type": "string",
1212
"value": "amp"
1313
},
14-
{
15-
"name": "granularity",
16-
"type": "string",
17-
"value": "day"
18-
},
1914
{
2015
"name": "mode",
2116
"type": "string",

torchci/rockset/prodVersions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
},
8585
"inductor": {
8686
"compilers_benchmark_performance": "442c41fbbc0eb758",
87-
"compilers_benchmark_performance_branches": "a07ce298be770d63",
87+
"compilers_benchmark_performance_branches": "2d47c0ef6d04d7f1",
8888
"torchao_query": "89dd8524b4784c7b",
8989
"torchao_query_branches": "dae2141eab66e839"
9090
},
@@ -110,7 +110,7 @@
110110
},
111111
"benchmarks": {
112112
"oss_ci_benchmark_llms": "ec0dd4a03918ba0f",
113-
"oss_ci_benchmark_branches": "c23c2d736b13edd4",
113+
"oss_ci_benchmark_branches": "80fdbef4cf5b8360",
114114
"oss_ci_benchmark_names": "80824879afbc1c5b"
115115
}
116116
}

0 commit comments

Comments
 (0)