Skip to content

Commit

Permalink
Always show time range picker on benchmark dashboard (#6235)
Browse files Browse the repository at this point in the history
Fixes #6222

This is a minor tweak to always show time range picker on benchmark
dashboard so that people can choose a larger window than 7 days when
there is no data.

### Testing

https://hud.pytorch.org/benchmark/llms?repoName=pytorch%2Fao shows
nothing as nothing has been run in the last 7 days


https://torchci-git-fork-huydhn-fix-dashboard-no-da-e651c3-fbopensource.vercel.app/benchmark/llms?repoName=pytorch%2Fao
at least show the option to increase the time range to show older data
  • Loading branch information
huydhn authored Jan 31, 2025
1 parent 1bc53d7 commit 501b943
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
4 changes: 2 additions & 2 deletions torchci/components/benchmark/llms/SummaryPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ export function SummaryPanel({
<Grid2
size={{ xs: 12, lg: 12 }}
height={
data.length > 99
? 99 * ROW_HEIGHT
data.length > 98
? 98 * ROW_HEIGHT
: data.length * ROW_HEIGHT + ROW_GAP
}
>
Expand Down
48 changes: 47 additions & 1 deletion torchci/pages/benchmark/llms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,53 @@ export default function Page() {
});

if (data === undefined || data.length === 0) {
return <>Loading {REPO_TO_BENCHMARKS[repoName].join(", ")}...</>;
return (
<div>
<Stack direction="row" spacing={2} sx={{ mb: 2 }}>
<Typography fontSize={"2rem"} fontWeight={"bold"}>
{REPO_TO_BENCHMARKS[repoName]} dashboard
</Typography>
<CopyLink
textToCopy={`${baseUrl}?startTime=${encodeURIComponent(
startTime.toString()
)}&stopTime=${encodeURIComponent(
stopTime.toString()
)}&granularity=${granularity}&lBranch=${lBranch}&lCommit=${lCommit}&rBranch=${rBranch}&rCommit=${rCommit}&repoName=${encodeURIComponent(
repoName
)}&modelName=${encodeURIComponent(
modelName
)}&backendName=${encodeURIComponent(
backendName
)}&dtypeName=${encodeURIComponent(
dtypeName
)}&deviceName=${encodeURIComponent(
deviceName
)}&archName=${encodeURIComponent(archName)}`}
/>
</Stack>
<Stack direction="row" spacing={2} sx={{ mb: 2 }}>
<TimeRangePicker
startTime={startTime}
setStartTime={setStartTime}
stopTime={stopTime}
setStopTime={setStopTime}
timeRange={timeRange}
setTimeRange={setTimeRange}
setGranularity={setGranularity}
/>
<GranularityPicker
granularity={granularity}
setGranularity={setGranularity}
/>
</Stack>
<Stack>
<>
Found no records for {REPO_TO_BENCHMARKS[repoName].join(", ")},
please wait a min or select different time range
</>
</Stack>
</div>
);
}

const modelNames: string[] = [
Expand Down

0 comments on commit 501b943

Please sign in to comment.