From 777bae3b9a4a9403d3dc4f3a9ecb5c5d8d704b7c Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 11:26:01 +0900 Subject: [PATCH 01/12] hidemetadata --- .../common/BenchmarkShortcutCardList.tsx | 160 ++++++++++++++++++ .../dataRender/auto/autoComponents.tsx | 80 +++++++++ .../teams/torchao/ao_micro_api_config.ts | 6 + .../configs/teams/torchao/config.ts | 6 + .../configs/utils/autoRegistration.tsx | 5 +- 5 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 torchci/components/benchmark_v3/components/common/BenchmarkShortcutCardList.tsx diff --git a/torchci/components/benchmark_v3/components/common/BenchmarkShortcutCardList.tsx b/torchci/components/benchmark_v3/components/common/BenchmarkShortcutCardList.tsx new file mode 100644 index 0000000000..766354d3e0 --- /dev/null +++ b/torchci/components/benchmark_v3/components/common/BenchmarkShortcutCardList.tsx @@ -0,0 +1,160 @@ +import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; +import ChevronRightIcon from "@mui/icons-material/ChevronRight"; +import { + Box, + Card, + CardActionArea, + CardContent, + IconButton, + Typography, +} from "@mui/material"; +import React, { useMemo, useRef } from "react"; +// import { useRouter } from "next/router"; + +export type BenchmarkShortcutItem = { + displayName: string; + fieldName: string; + value: string; + description?: string; + url?: string; +}; + +type BenchmarkShortcutCardListProps = { + benchmarkId: string; + // whatever your query params shape is + data: any; + title?: string; + /** + * Optional custom navigation (e.g. Next.js router.push). + * If not provided, falls back to window.location.href. + */ + onNavigate?: (item: BenchmarkShortcutItem) => void; +}; + +export const BenchmarkShortcutCardList: React.FC< + BenchmarkShortcutCardListProps +> = ({ benchmarkId, data, title = "Shortcuts", onNavigate }) => { + const scrollContainerRef = useRef(null); + // const router = useRouter(); + + // ---- map API response -> cardList ---- + const cardList: BenchmarkShortcutItem[] = useMemo(() => { + if (!data) return []; + + // TODO: adapt this to your real response shape. + // Example assumes resp.items = [{ name, summary, url }, ...] + const items = data; + return items; + }, [data]); + + // ---- scrolling helpers ---- + const handleScroll = (direction: "left" | "right") => { + const node = scrollContainerRef.current; + if (!node) return; + const delta = direction === "left" ? -320 : 320; + node.scrollBy({ left: delta, behavior: "smooth" }); + }; + + // ---- navigation ---- + const handleClickCard = (item: BenchmarkShortcutItem) => { + if (onNavigate) { + onNavigate(item); + return; + } + // Fallback: normal navigation + if (typeof window !== "undefined" && item.url) { + window.location.href = item.url; + } + }; + + if (!cardList.length) { + return null; + } + + // ---- main UI ---- + return ( + + + + {title} + + + handleScroll("left")} + > + + + handleScroll("right")} + > + + + + + + + {cardList.map((item) => ( + + handleClickCard(item)}> + + + {item.displayName} + + {item.description && ( + + {item.description} + + )} + + + + ))} + + + ); +}; diff --git a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx index a5e84b7ece..622316cde7 100644 --- a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx +++ b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx @@ -5,6 +5,7 @@ import LoadingPage from "components/common/LoadingPage"; import { useBenchmarkCommittedContext, useBenchmarkTimeSeriesData, + useListBenchmarkMetadata, } from "lib/benchmark/api_helper/fe/hooks"; import { useDashboardSelector } from "lib/benchmark/store/benchmark_dashboard_provider"; import BenchmarkRawDataTable from "../components/benchmarkTimeSeries/components/BenchmarkRawDataTable"; @@ -14,6 +15,11 @@ import { UIRenderConfig } from "components/benchmark_v3/configs/config_book_type import { useRouter } from "next/router"; import { useEffect, useState } from "react"; import { BenchmarkLogSidePanelWrapper } from "../../common/BenchmarkLogViewer/BenchmarkSidePanel"; +import { + BenchmarkShortcutCardList, + BenchmarkShortcutItem, +} from "../../common/BenchmarkShortcutCardList"; +import { RenderRawContent } from "../../common/RawContentDialog"; import BenchmarkSingleDataTable from "../components/benchmarkTimeSeries/components/BenchmarkSingleDataTable"; import { BenchmarkSingleViewNavigation } from "../components/benchmarkTimeSeries/components/BenchmarkSingleViewNatigation"; import BenchmarkTimeSeriesChartGroup from "../components/benchmarkTimeSeries/components/BenchmarkTimeSeriesChart/BenchmarkTimeSeriesChartGroup"; @@ -675,6 +681,80 @@ export function AutoBenchmarkRawDataTable({ config }: AutoComponentProps) { ); } +export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { + const ctx = useBenchmarkCommittedContext(); + const update = useDashboardSelector((s) => s.update); + + const ready = !!ctx && !!ctx.committedTime; + const dataBinding = ctx?.configHandler.dataBinding; + const uiRenderConfig = config as UIRenderConfig; + const queryParams = ready + ? dataBinding.toQueryParams({ + repo: ctx.repo, + benchmarkName: ctx.benchmarkName, + timeRange: ctx.committedTime, + filters: {}, // the dropdown does not rerender when filter changes, since it manages the filter optons + }) + : null; + + const { + data: resp, + isLoading, + error, + } = useListBenchmarkMetadata(ctx.benchmarkId, queryParams); + + if (isLoading) { + return ( + + ); + } + + if (error) { + return ( + (AutoBenchmarkRawDataTable){error.message} + ); + } + const filters = uiRenderConfig.config?.filters; + let data: BenchmarkShortcutItem[] = []; + resp?.data?.forEach((item: any) => { + const name = filters?.find((f: string) => f === item?.type); + if (name) { + const options = item?.options; + options.forEach((option: any) => { + data.push({ + displayName: option.displayName ?? "unkown", + value: option.value, + description: item?.type, + fieldName: name, + url: `${window.location.pathname}${window.location.search}&filters.${name}=${option.value}`, + }); + }); + } + }); + return ( + <> + + { + const changed: Record = {}; + changed[item.fieldName] = item.value; + update({ + filters: { + ...ctx.committedFilters, + ...changed, + }, + }); + }} + /> + + ); +} + export function AutoBenchmarkSingleDataTable({ config }: AutoComponentProps) { const ctx = useBenchmarkCommittedContext(); const isWorkflowsReady = diff --git a/torchci/components/benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts b/torchci/components/benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts index f597fdc016..188d518415 100644 --- a/torchci/components/benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts +++ b/torchci/components/benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts @@ -96,6 +96,12 @@ export const PytorcAoMicroApiBenchmarkDashoboardConfig: BenchmarkUIConfig = { }, }, renders: [ + { + type: "AutoBenchmarkShortcutCardList", + config: { + filters: ["dtype"], + }, + }, { type: "AutoBenchmarkComparisonGithubExternalLink", description: "See original github runs for left and right runs", diff --git a/torchci/components/benchmark_v3/configs/teams/torchao/config.ts b/torchci/components/benchmark_v3/configs/teams/torchao/config.ts index 9fb2d6de89..1019ce4359 100644 --- a/torchci/components/benchmark_v3/configs/teams/torchao/config.ts +++ b/torchci/components/benchmark_v3/configs/teams/torchao/config.ts @@ -150,6 +150,12 @@ export const PytorchOperatorMicroBenchmarkDashoboardConfig: BenchmarkUIConfig = }, }, renders: [ + { + type: "AutoBenchmarkShortcutCardList", + config: { + filters: ["operatorName"], + }, + }, { type: "AutoBenchmarkComparisonGithubExternalLink", description: "See original github runs for left and right runs", diff --git a/torchci/components/benchmark_v3/configs/utils/autoRegistration.tsx b/torchci/components/benchmark_v3/configs/utils/autoRegistration.tsx index cf7d905660..82d11642c9 100644 --- a/torchci/components/benchmark_v3/configs/utils/autoRegistration.tsx +++ b/torchci/components/benchmark_v3/configs/utils/autoRegistration.tsx @@ -3,6 +3,7 @@ import { AutoBenchmarkLogs, AutoBenchmarkPairwiseTable, AutoBenchmarkRawDataTable, + AutoBenchmarkShortcutCardList, AutoBenchmarkSingleDataTable, AutoBenchmarkSingleViewNavigation, AutoBenchmarkTimeSeriesChartGroup, @@ -70,7 +71,9 @@ export class AutoComponentRegistry { AutoBenchmarkLogs: { Component: AutoBenchmarkLogs, }, - + AutoBenchmarkShortcutCardList: { + Component: AutoBenchmarkShortcutCardList, + }, // Add your auto components here }; this.map = Object.freeze({ ...registry }); From 73a7ce8c779e037bfca0be8addbeba28af8f4996 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 11:34:20 +0900 Subject: [PATCH 02/12] hidemetadata --- .../components/common/BenchmarkShortcutCardList.tsx | 6 +----- .../components/dataRender/auto/autoComponents.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/torchci/components/benchmark_v3/components/common/BenchmarkShortcutCardList.tsx b/torchci/components/benchmark_v3/components/common/BenchmarkShortcutCardList.tsx index 766354d3e0..f8d6b1779d 100644 --- a/torchci/components/benchmark_v3/components/common/BenchmarkShortcutCardList.tsx +++ b/torchci/components/benchmark_v3/components/common/BenchmarkShortcutCardList.tsx @@ -40,11 +40,7 @@ export const BenchmarkShortcutCardList: React.FC< // ---- map API response -> cardList ---- const cardList: BenchmarkShortcutItem[] = useMemo(() => { if (!data) return []; - - // TODO: adapt this to your real response shape. - // Example assumes resp.items = [{ name, summary, url }, ...] - const items = data; - return items; + return data; }, [data]); // ---- scrolling helpers ---- diff --git a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx index 622316cde7..3f98847515 100644 --- a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx +++ b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx @@ -707,14 +707,16 @@ export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { return ( ); } if (error) { return ( - (AutoBenchmarkRawDataTable){error.message} + + (AutoBenchmarkShortcutCardList){error.message} + ); } const filters = uiRenderConfig.config?.filters; From fda49efe56c3da9c6e8c5ab74d167f7158aa18e2 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 11:37:01 +0900 Subject: [PATCH 03/12] hidemetadata --- .../components/dataRender/auto/autoComponents.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx index 3f98847515..0b588784de 100644 --- a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx +++ b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx @@ -693,7 +693,7 @@ export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { repo: ctx.repo, benchmarkName: ctx.benchmarkName, timeRange: ctx.committedTime, - filters: {}, // the dropdown does not rerender when filter changes, since it manages the filter optons + filters: {}, // does not rerender when filter changes, since it fetches the filter optons }) : null; @@ -719,6 +719,8 @@ export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { ); } + + // ------------------ convert to the shortcut items ------------------ const filters = uiRenderConfig.config?.filters; let data: BenchmarkShortcutItem[] = []; resp?.data?.forEach((item: any) => { @@ -731,11 +733,11 @@ export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { value: option.value, description: item?.type, fieldName: name, - url: `${window.location.pathname}${window.location.search}&filters.${name}=${option.value}`, }); }); } }); + return ( <> From c53a28db56f79b45e1c269705cdf0a4277fea6d6 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 12:08:19 +0900 Subject: [PATCH 04/12] hidemetadata --- .../dataRender/auto/autoComponents.tsx | 28 ++++++++------- .../teams/torchao/ao_micro_api_config.ts | 5 +++ .../backend/dataFetchers/fetchers.ts | 2 ++ .../listMetadataQueryBuilder.ts | 35 +++++++++++++++++++ 4 files changed, 57 insertions(+), 13 deletions(-) diff --git a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx index 0b588784de..3509613ce1 100644 --- a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx +++ b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx @@ -1,5 +1,5 @@ import { Alert, Typography } from "@mui/material"; -import { Grid, Stack } from "@mui/system"; +import { Box, Grid, Stack } from "@mui/system"; import { AutoComponentProps } from "components/benchmark_v3/configs/utils/autoRegistration"; import LoadingPage from "components/common/LoadingPage"; import { @@ -332,16 +332,18 @@ export function AutoBenchmarkComparisonGithubExternalLink({ return <>; } return ( - + + + ); } @@ -731,7 +733,7 @@ export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { data.push({ displayName: option.displayName ?? "unkown", value: option.value, - description: item?.type, + description: item?.labelName ?? "", fieldName: name, }); }); @@ -740,7 +742,7 @@ export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { return ( <> - + BenchmarkDataFetcher> = { // Register benchmark metadata fetchers. this is mainly used in list_metadata api const metaCtors: Record BenchmarkMetadataFetcher> = { pytorch_operator_microbenchmark: PytorchOperatorMicrobenchmarkMetadataFetcher, + torchao_micro_api_benchmark: TorchAoMicrobApienchmarkMetadataFetcher, default: BenchmarkMetadataQuery, }; diff --git a/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/listMetadataQueryBuilder.ts b/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/listMetadataQueryBuilder.ts index 8413f6c5a7..1f1b0ade5a 100644 --- a/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/listMetadataQueryBuilder.ts +++ b/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/listMetadataQueryBuilder.ts @@ -235,3 +235,38 @@ export class PytorchOperatorMicrobenchmarkMetadataFetcher return this._data_query.toQueryParams(params); } } + +export class TorchAoMicrobApienchmarkMetadataFetcher + extends ExecutableQueryBase + implements BenchmarkMetadataFetcher +{ + private _data_query: BenchmarkMetadataQuery; + + constructor() { + super(); + this._data_query = new BenchmarkMetadataQuery(); + } + + postProcess(data: any[]) { + let li = getDefaultBenchmarkMetadataGroup(data); + li = li.filter((item) => item.type !== BenchmarkMetadataType.DtypeName); + const customizedDtype = makeMetadataItem( + data, + "dtype", + BenchmarkMetadataType.DtypeName, + { displayName: "All Quant type", value: "" }, + "Quant Type" + ); + if (customizedDtype) { + li.push(customizedDtype); + } + return li; + } + build() { + return this._data_query.build(); + } + + toQueryParams(inputs: any) { + return this._data_query.toQueryParams(inputs); + } +} From 354e6bd814598494fc720a6c7fc2a4da5c43d832 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 12:11:37 +0900 Subject: [PATCH 05/12] hidemetadata --- .../benchmark_v3/components/dataRender/auto/autoComponents.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx index 3509613ce1..858f6820a6 100644 --- a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx +++ b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx @@ -742,7 +742,6 @@ export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { return ( <> - Date: Thu, 4 Dec 2025 12:12:27 +0900 Subject: [PATCH 06/12] hidemetadata --- torchci/components/benchmark_v3/configs/teams/torchao/config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/torchci/components/benchmark_v3/configs/teams/torchao/config.ts b/torchci/components/benchmark_v3/configs/teams/torchao/config.ts index 1019ce4359..782d876ff2 100644 --- a/torchci/components/benchmark_v3/configs/teams/torchao/config.ts +++ b/torchci/components/benchmark_v3/configs/teams/torchao/config.ts @@ -158,6 +158,7 @@ export const PytorchOperatorMicroBenchmarkDashoboardConfig: BenchmarkUIConfig = }, { type: "AutoBenchmarkComparisonGithubExternalLink", + title: "Github runs (external)", description: "See original github runs for left and right runs", config: {}, }, From 421c5a64675442533c523d5222f3041fed5a407a Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 12:19:09 +0900 Subject: [PATCH 07/12] hidemetadata --- .../benchmark_v3/components/dataRender/auto/autoComponents.tsx | 2 +- .../benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts | 1 + torchci/components/benchmark_v3/configs/teams/torchao/config.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx index 858f6820a6..8dfe914274 100644 --- a/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx +++ b/torchci/components/benchmark_v3/components/dataRender/auto/autoComponents.tsx @@ -19,7 +19,6 @@ import { BenchmarkShortcutCardList, BenchmarkShortcutItem, } from "../../common/BenchmarkShortcutCardList"; -import { RenderRawContent } from "../../common/RawContentDialog"; import BenchmarkSingleDataTable from "../components/benchmarkTimeSeries/components/BenchmarkSingleDataTable"; import { BenchmarkSingleViewNavigation } from "../components/benchmarkTimeSeries/components/BenchmarkSingleViewNatigation"; import BenchmarkTimeSeriesChartGroup from "../components/benchmarkTimeSeries/components/BenchmarkTimeSeriesChart/BenchmarkTimeSeriesChartGroup"; @@ -745,6 +744,7 @@ export function AutoBenchmarkShortcutCardList({ config }: AutoComponentProps) { { const changed: Record = {}; changed[item.fieldName] = item.value; diff --git a/torchci/components/benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts b/torchci/components/benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts index 869e5df776..7f5be0f8bc 100644 --- a/torchci/components/benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts +++ b/torchci/components/benchmark_v3/configs/teams/torchao/ao_micro_api_config.ts @@ -102,6 +102,7 @@ export const PytorcAoMicroApiBenchmarkDashoboardConfig: BenchmarkUIConfig = { renders: [ { type: "AutoBenchmarkShortcutCardList", + title: "Dtype Lists", config: { filters: ["dtype"], }, diff --git a/torchci/components/benchmark_v3/configs/teams/torchao/config.ts b/torchci/components/benchmark_v3/configs/teams/torchao/config.ts index 782d876ff2..c6db357066 100644 --- a/torchci/components/benchmark_v3/configs/teams/torchao/config.ts +++ b/torchci/components/benchmark_v3/configs/teams/torchao/config.ts @@ -152,6 +152,7 @@ export const PytorchOperatorMicroBenchmarkDashoboardConfig: BenchmarkUIConfig = renders: [ { type: "AutoBenchmarkShortcutCardList", + title: "Operator Lists", config: { filters: ["operatorName"], }, From 4d3095dc18952eea9ce34b22ae144f5f67817bc6 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 12:31:53 +0900 Subject: [PATCH 08/12] hidemetadata --- .../dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts | 2 ++ torchci/lib/benchmark/api_helper/backend/list_commits.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts b/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts index 8af8a8fd4b..552b10f1cd 100644 --- a/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts +++ b/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts @@ -345,6 +345,8 @@ export class BenchmarkDataQuery extends ExecutableQueryBase { toQueryParams(inputs: any, id?: string): Record { this.validateInputs(inputs); + console.log("[benchmarkDatQueryBuilder] inputs:", inputs); + if (inputs.benchmarkName && !inputs.benchmarkNames) { inputs.benchmarkNames = [inputs.benchmarkName]; } diff --git a/torchci/lib/benchmark/api_helper/backend/list_commits.ts b/torchci/lib/benchmark/api_helper/backend/list_commits.ts index 5ba36aaf17..5cc994029b 100644 --- a/torchci/lib/benchmark/api_helper/backend/list_commits.ts +++ b/torchci/lib/benchmark/api_helper/backend/list_commits.ts @@ -86,7 +86,7 @@ const defaultGetCommitsInputs: any = { models: [], backends: [], device: "", - arch: [], + arches: [], dtype: "", mode: "", }; From 6fd5fe1cf7cf0978d9e0ff8ea1e2d0097a8ec082 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 12:33:47 +0900 Subject: [PATCH 09/12] hidemetadata --- torchci/lib/benchmark/api_helper/backend/list_commits.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchci/lib/benchmark/api_helper/backend/list_commits.ts b/torchci/lib/benchmark/api_helper/backend/list_commits.ts index 5cc994029b..3295c512cc 100644 --- a/torchci/lib/benchmark/api_helper/backend/list_commits.ts +++ b/torchci/lib/benchmark/api_helper/backend/list_commits.ts @@ -81,7 +81,7 @@ function getFormat(data: any, format: string = "raw") { } } -const defaultGetCommitsInputs: any = { +const defaultGeneralListCommitsInputs: any = { branches: [], models: [], backends: [], @@ -117,7 +117,7 @@ export async function getGeneralCommits(id: string, inputparams: any) { } const queryParams = { - ...defaultGetCommitsInputs, // base defaults + ...defaultGeneralListCommitsInputs, // base defaults ...inputparams, // override with caller's values }; From 0552fa5a97e14ca70783ac0965935d81980f2230 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 12:43:59 +0900 Subject: [PATCH 10/12] hidemetadata --- .../backend/compilers/compiler_benchmark_data.ts | 5 ++++- .../queryBuilderUtils/benchmarkDataQueryBuilder.ts | 2 +- torchci/pages/api/benchmark/get_time_series.ts | 9 ++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/torchci/lib/benchmark/api_helper/backend/compilers/compiler_benchmark_data.ts b/torchci/lib/benchmark/api_helper/backend/compilers/compiler_benchmark_data.ts index f0d0279bcd..d950218cf5 100644 --- a/torchci/lib/benchmark/api_helper/backend/compilers/compiler_benchmark_data.ts +++ b/torchci/lib/benchmark/api_helper/backend/compilers/compiler_benchmark_data.ts @@ -28,6 +28,9 @@ export async function getCompilerBenchmarkTimeSeriesData( const queryParams = await getCompilerBenchmarkTimeRangeQueryParams( inputparams ); + if (!queryParams) { + return emptyTimeSeriesResponse(); + } const rows = await fetchCompilerDataFromDb(queryParams); if (rows.length === 0) { return emptyTimeSeriesResponse(); @@ -106,7 +109,7 @@ export async function getCompilerBenchmarkTimeRangeQueryParams( queryParams["workflows"] = unique_workflows; } else { console.log(`no workflow found in clickhouse using ${queryParams}`); - return []; + return undefined; } } else { console.log( diff --git a/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts b/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts index 552b10f1cd..548a8cb0ea 100644 --- a/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts +++ b/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/benchmarkDataQueryBuilder.ts @@ -334,7 +334,7 @@ export class BenchmarkDataQuery extends ExecutableQueryBase { validateInputs(inputs: any) { if (!inputs.benchmarkName && !inputs.benchmarkNames) { throw new Error( - "Either benchmarkName or benchmarkNames must be provided" + "[BenchmarkDataQuery]Either benchmarkName or benchmarkNames must be provided" ); } if (!inputs.repo) { diff --git a/torchci/pages/api/benchmark/get_time_series.ts b/torchci/pages/api/benchmark/get_time_series.ts index adc964cfce..12f234e3c2 100644 --- a/torchci/pages/api/benchmark/get_time_series.ts +++ b/torchci/pages/api/benchmark/get_time_series.ts @@ -1,6 +1,6 @@ import { checkAuthWithApiToken } from "lib/auth/auth"; import { CompilerQueryType } from "lib/benchmark/api_helper/backend/common/type"; -import { readApiGetParams } from "lib/benchmark/api_helper/backend/common/utils"; +import { emptyTimeSeriesResponse, readApiGetParams } from "lib/benchmark/api_helper/backend/common/utils"; import { getCompilerBenchmarkTimeSeriesData } from "lib/benchmark/api_helper/backend/compilers/compiler_benchmark_data"; import { getBenchmarkDataFetcher } from "lib/benchmark/api_helper/backend/dataFetchers/fetchers"; import { getGeneralCommits } from "lib/benchmark/api_helper/backend/list_commits"; @@ -107,6 +107,9 @@ async function getGenernalBenchmarkTimeSeries( query_params ); + if (!params) { + return emptyTimeSeriesResponse() + } const fetcher = getBenchmarkDataFetcher(id); const result = await fetcher.applyQuery(params); return fetcher.applyFormat(result, formats); @@ -132,8 +135,8 @@ export async function getGeneralBenchmarkTimeRangeQueryParams( if (commit_results.length > 0) { queryParams["workflows"] = unique_workflows; } else { - console.log(`no workflow found in clickhouse using ${queryParams}`); - return []; + console.log("no workflow found in clickhouse using", queryParams); + return undefined; } } else { console.log( From d2f740e1c9870e84ec04f8ef3d73c5929ff9f127 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 12:45:33 +0900 Subject: [PATCH 11/12] hidemetadata --- torchci/pages/api/benchmark/get_time_series.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/torchci/pages/api/benchmark/get_time_series.ts b/torchci/pages/api/benchmark/get_time_series.ts index 12f234e3c2..2d1555e0b0 100644 --- a/torchci/pages/api/benchmark/get_time_series.ts +++ b/torchci/pages/api/benchmark/get_time_series.ts @@ -1,6 +1,9 @@ import { checkAuthWithApiToken } from "lib/auth/auth"; import { CompilerQueryType } from "lib/benchmark/api_helper/backend/common/type"; -import { emptyTimeSeriesResponse, readApiGetParams } from "lib/benchmark/api_helper/backend/common/utils"; +import { + emptyTimeSeriesResponse, + readApiGetParams, +} from "lib/benchmark/api_helper/backend/common/utils"; import { getCompilerBenchmarkTimeSeriesData } from "lib/benchmark/api_helper/backend/compilers/compiler_benchmark_data"; import { getBenchmarkDataFetcher } from "lib/benchmark/api_helper/backend/dataFetchers/fetchers"; import { getGeneralCommits } from "lib/benchmark/api_helper/backend/list_commits"; @@ -108,7 +111,7 @@ async function getGenernalBenchmarkTimeSeries( ); if (!params) { - return emptyTimeSeriesResponse() + return emptyTimeSeriesResponse(); } const fetcher = getBenchmarkDataFetcher(id); const result = await fetcher.applyQuery(params); From c3b5692e944fc61a35d2172b765b17c37f11edc9 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 4 Dec 2025 13:11:45 +0900 Subject: [PATCH 12/12] hidemetadata --- .../queryBuilderUtils/listCommitQueryBuilder.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/listCommitQueryBuilder.ts b/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/listCommitQueryBuilder.ts index badae39461..46351d0108 100644 --- a/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/listCommitQueryBuilder.ts +++ b/torchci/lib/benchmark/api_helper/backend/dataFetchers/queryBuilderUtils/listCommitQueryBuilder.ts @@ -142,7 +142,11 @@ export class PytorchOperatorMicroListCommitsDataFetcher } toQueryParams(inputs: any, id?: string): Record { - const params = this._data_query.toQueryParams(inputs); + const pq = { + ...inputs, + operatorName: inputs.operatorName ?? "", + }; + const params = this._data_query.toQueryParams(pq); return params; }