Skip to content

Commit

Permalink
Add torchao dashboard to benchmarks (#5284)
Browse files Browse the repository at this point in the history
Co-authored-by: Huy Do <[email protected]>
  • Loading branch information
xuzhao9 and huydhn authored Jun 5, 2024
1 parent 1e0f0d5 commit 270b951
Show file tree
Hide file tree
Showing 11 changed files with 703 additions and 7 deletions.
4 changes: 4 additions & 0 deletions torchci/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ function NavBar() {
name: "TorchInductor",
href: "/benchmark/compilers",
},
{
name: "TorchAO",
href: "/benchmark/torchao",
},
{
name: "TorchBench",
href: "/torchbench/userbenchmark",
Expand Down
14 changes: 8 additions & 6 deletions torchci/components/benchmark/compilers/SummaryPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
SCALE,
SPEEDUP_THRESHOLD,
} from "components/benchmark/compilers/common";
import { SUITES } from "components/benchmark/compilers/SuitePicker";
import styles from "components/metrics.module.css";
import { TablePanelWithData } from "components/metrics/panels/TablePanel";
import { Granularity } from "components/metrics/panels/TimeSeriesPanel";
Expand Down Expand Up @@ -136,6 +135,7 @@ export function SummaryPanel({
dtype,
lPerfData,
rPerfData,
all_suites,
}: {
startTime: dayjs.Dayjs;
stopTime: dayjs.Dayjs;
Expand All @@ -144,6 +144,7 @@ export function SummaryPanel({
dtype: string;
lPerfData: BranchAndCommitPerfData;
rPerfData: BranchAndCommitPerfData;
all_suites: { [key: string]: string };
}) {
const fields: { [k: string]: any } = {
passrate_display: computePassrate,
Expand All @@ -167,7 +168,8 @@ export function SummaryPanel({
fields
);

const suites = Object.keys(SUITES);
const suites = Object.keys(all_suites);

// Combine both sides
const passrate = combineLeftAndRight(
lCommit,
Expand Down Expand Up @@ -229,7 +231,7 @@ export function SummaryPanel({
suites.map((suite: string) => {
return {
field: suite,
headerName: SUITES[suite],
headerName: all_suites[suite],
flex: 1,
renderCell: (params: GridRenderCellParams<any>) => {
const v = params.value;
Expand Down Expand Up @@ -319,7 +321,7 @@ export function SummaryPanel({
suites.map((suite: string) => {
return {
field: suite,
headerName: SUITES[suite],
headerName: all_suites[suite],
flex: 1,
renderCell: (params: GridRenderCellParams<any>) => {
const v = params.value;
Expand Down Expand Up @@ -412,7 +414,7 @@ export function SummaryPanel({
suites.map((suite: string) => {
return {
field: suite,
headerName: SUITES[suite],
headerName: all_suites[suite],
flex: 1,
renderCell: (params: GridRenderCellParams<any>) => {
const v = params.value;
Expand Down Expand Up @@ -501,7 +503,7 @@ export function SummaryPanel({
suites.map((suite: string) => {
return {
field: suite,
headerName: SUITES[suite],
headerName: all_suites[suite],
flex: 1,
renderCell: (params: GridRenderCellParams<any>) => {
const v = params.value;
Expand Down
46 changes: 46 additions & 0 deletions torchci/components/benchmark/torchao/SuitePicker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import {
FormControl,
InputLabel,
MenuItem,
Select,
SelectChangeEvent,
} from "@mui/material";

export const SUITES: { [k: string]: string } = {
torchbench: "Torchbench",
huggingface: "Huggingface",
timm_models: "TIMM models",
};

export function SuitePicker({
suite,
setSuite,
}: {
suite: string;
setSuite: any;
}) {
function handleChange(e: SelectChangeEvent<string>) {
setSuite(e.target.value);
}

return (
<>
<FormControl>
<InputLabel id="suite-picker-input-label">Suite</InputLabel>
<Select
value={suite}
label="Suite"
labelId="suite-picker-select-label"
onChange={handleChange}
id="suite-picker-select"
>
{Object.keys(SUITES).map((suite) => (
<MenuItem key={suite} value={suite}>
{SUITES[suite]}
</MenuItem>
))}
</Select>
</FormControl>
</>
);
}
3 changes: 3 additions & 0 deletions torchci/components/benchmark/torchao/common.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const DEFAULT_REPO_NAME = "pytorch/ao";
export const DTYPES = ["amp", "bfloat16"];
export const DEFAULT_MODE = "inference";
1 change: 1 addition & 0 deletions torchci/pages/benchmark/compilers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ function Report({
...rBranchAndCommit,
data: rData,
}}
all_suites={SUITES}
/>
<GraphPanel
queryParams={queryParams}
Expand Down
Loading

0 comments on commit 270b951

Please sign in to comment.