Skip to content

Commit bf6df38

Browse files
[HUD] [vLLM Profiling] Fix S3 path and add more filters for vLLM Profiling (#7196)
## Changes - Implemented a Generic approach for showing profiling traces for any repository. - Implemented filters for showing profiling traces based on "time_range", "model_name", "device_type" and "device_architecture". ## Testing - Verified through the HUD Dashboard for a scenario when we have profiling traces for a model (i.e. `repo`: `vllm` and `model`: `facebook\opt-125m`) : [link](https://torchci-6vl6o8lmz-fbopensource.vercel.app/benchmark/llms?startTime=Sat%2C%2013%20Sep%202025%2022%3A45%3A56%20GMT&stopTime=Sat%2C%2020%20Sep%202025%2022%3A45%3A56%20GMT&granularity=day&lBranch=main&lCommit=3e903b6cb4292ca1425a37cb809c1e3cddfdadcb&rBranch=main&rCommit=d88918e4c2d189eb25724a6cff9a9028c67daa07&repoName=vllm-project%2Fvllm&benchmarkName=&modelName=facebook%2Fopt-125m&backendName=All%20Backends&modeName=All%20Modes&dtypeName=All%20DType&deviceName=All%20Devices&archName=All%20Platforms) - Verified through the HUD Dashboard for a scenario when we don't have profiling traces for a model (i.e. `repo`: `vllm` and `model`: `llama3-8b`): [link](https://torchci-6vl6o8lmz-fbopensource.vercel.app/benchmark/llms?startTime=Sat%2C%2013%20Sep%202025%2022%3A45%3A56%20GMT&stopTime=Sat%2C%2020%20Sep%202025%2022%3A45%3A56%20GMT&granularity=day&lBranch=main&lCommit=3e903b6cb4292ca1425a37cb809c1e3cddfdadcb&rBranch=main&rCommit=bef180f00978186fcc84f7ca6328a6ae6c39676d&repoName=vllm-project%2Fvllm&benchmarkName=&modelName=meta-llama%2FMeta-Llama-3.1-8B-Instruct&backendName=All%20Backends&modeName=All%20Modes&dtypeName=All%20DType&deviceName=All%20Devices&archName=All%20Platforms) - Filter based on TimeRange and Device selection (once model is selected) also works as expected. <img width="1708" height="220" alt="Screenshot 2025-09-20 at 3 47 37 PM" src="https://github.com/user-attachments/assets/f985598f-968b-4793-80a3-468a30f0b79a" />
1 parent f568cf7 commit bf6df38

5 files changed

Lines changed: 275 additions & 180 deletions

File tree

torchci/components/benchmark/llms/LLMsBenchmarkPage.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ import {
3434
} from "lib/benchmark/llms/utils/llmUtils";
3535
import { LLMsDashboardPicker } from "./components/dashboardPicker/LLMsDashboardPicker";
3636
import { LLMsTimeRangePicker } from "./components/dashboardPicker/LLMsTimeRangePicker";
37+
import { ProfilingArtifactsTable } from "./components/ProfilingArtifactsTable";
3738
import LLMsReport from "./components/report/LLMsReport";
38-
import { VllmArtifactsTable } from "./components/VllmArtifactsTable";
3939

4040
export default function LLMsBenchmarkPage() {
4141
const router = useRouter();
@@ -220,9 +220,7 @@ const MainPage = ({
220220
metricNames={metricNames}
221221
benchmarkPropsQueryParams={queryParams}
222222
/>
223-
{props.repoName === "vllm-project/vllm" && (
224-
<VllmArtifactsTable selectedModelName={props.modelName} />
225-
)}
223+
<ProfilingArtifactsTable props={props} />
226224
</div>
227225
);
228226
};
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
import { Alert, Grid, Link } from "@mui/material";
2+
import type { GridColDef } from "@mui/x-data-grid";
3+
import { LAST_N_DAYS } from "components/benchmark/common";
4+
import { TablePanelWithData } from "components/metrics/panels/TablePanel";
5+
import {
6+
DEFAULT_ARCH_NAME,
7+
DEFAULT_DEVICE_NAME,
8+
DEFAULT_MODEL_NAME,
9+
} from "lib/benchmark/llms/common";
10+
import { LLMsBenchmarkProps } from "lib/benchmark/llms/types/dashboardProps";
11+
import type { ArtifactFile } from "lib/benchmark/llms/utils/artifacts";
12+
import { useArtifacts } from "lib/benchmark/llms/utils/artifacts";
13+
14+
type ArtifactRow = ArtifactFile;
15+
16+
const columns: GridColDef<ArtifactRow>[] = [
17+
{
18+
field: "date",
19+
headerName: "Date",
20+
flex: 0.8,
21+
renderCell: (params) => params.row.date || "—",
22+
},
23+
{
24+
field: "modelName",
25+
headerName: "Model Name",
26+
flex: 1.1,
27+
renderCell: (params) => (
28+
<span style={{ overflowWrap: "anywhere" }}>
29+
{params.row.modelName.replace(/_/, "/") || "—"}
30+
</span>
31+
),
32+
},
33+
{
34+
field: "deviceType",
35+
headerName: "Device Type",
36+
flex: 0.8,
37+
renderCell: (params) => (
38+
<span style={{ overflowWrap: "anywhere" }}>
39+
{params.row.deviceType || "—"}
40+
</span>
41+
),
42+
},
43+
{
44+
field: "deviceName",
45+
headerName: "Device Name",
46+
flex: 1.1,
47+
renderCell: (params) => (
48+
<span style={{ overflowWrap: "anywhere" }}>
49+
{params.row.deviceName || "—"}
50+
</span>
51+
),
52+
},
53+
{
54+
field: "commitHash",
55+
headerName: "Commit Hash",
56+
flex: 1.0,
57+
renderCell: (params) => (
58+
<span style={{ overflowWrap: "anywhere" }}>
59+
{params.row.commitHash || "—"}
60+
</span>
61+
),
62+
},
63+
{
64+
field: "workflowId",
65+
headerName: "Workflow ID",
66+
flex: 1.0,
67+
renderCell: (params) => (
68+
<span style={{ overflowWrap: "anywhere" }}>
69+
{params.row.workflowId || "—"}
70+
</span>
71+
),
72+
},
73+
{
74+
field: "fileName",
75+
headerName: "Profiler Trace",
76+
flex: 1.4,
77+
renderCell: (params) => (
78+
<Link
79+
href={params.row.url}
80+
target="_blank"
81+
rel="noopener noreferrer"
82+
underline="hover"
83+
sx={{ overflowWrap: "anywhere" }}
84+
>
85+
{params.row.fileName || params.row.key}
86+
</Link>
87+
),
88+
},
89+
];
90+
91+
type ProfilingArtifactsTableProps = {
92+
props: LLMsBenchmarkProps;
93+
};
94+
95+
export function ProfilingArtifactsTable({
96+
props,
97+
}: ProfilingArtifactsTableProps) {
98+
// Parse deviceName which is in format "deviceType (architecture)"
99+
// e.g., "cuda (NVIDIA B200)" -> deviceType: "cuda", deviceName: "NVIDIA B200"
100+
const deviceName =
101+
props.deviceName === DEFAULT_DEVICE_NAME ? "" : props.deviceName;
102+
const archName = props.archName === DEFAULT_ARCH_NAME ? "" : props.archName;
103+
104+
let device = "";
105+
let arch = "";
106+
if (archName === "") {
107+
// All the dashboards currently put device and arch into the same field in
108+
// device (arch) format, i.e. cuda (NVIDIA B200). So, we need to extract
109+
// the arch name here to use it in the query
110+
const deviceArchRegex = /^(.+)\s+\((.+)\)$/;
111+
const m = deviceName.match(deviceArchRegex);
112+
113+
if (m !== null && m[1] !== undefined && m[2] !== undefined) {
114+
device = m[1]; // e.g., "cuda"
115+
// Extract just the architecture name from "NVIDIA B200" -> "B200"
116+
const archParts = m[2].split(" ");
117+
arch = archParts.length > 1 ? archParts[archParts.length - 1] : m[2];
118+
} else {
119+
device = deviceName;
120+
arch = archName;
121+
}
122+
} else {
123+
// If both device and arch are set, we just need to use them as they are
124+
device = deviceName;
125+
arch = archName;
126+
}
127+
128+
// Replace "/" with "_" in model name for S3 path compatibility
129+
const processedModelName =
130+
props.modelName !== DEFAULT_MODEL_NAME && props.modelName
131+
? props.modelName.replace(/\//g, "_")
132+
: undefined;
133+
134+
const { data, error } = useArtifacts({
135+
repository: props.repoName,
136+
modelName: processedModelName,
137+
deviceType: device !== "" ? device : undefined,
138+
deviceName: arch !== "" ? arch : undefined,
139+
lookbackDays: props.timeRange > 0 ? props.timeRange : LAST_N_DAYS,
140+
});
141+
142+
if (error) {
143+
return (
144+
<Grid container spacing={10} sx={{ mt: 4 }}>
145+
<Grid size={{ xs: 12, lg: 11.8 }}>
146+
<Alert severity="error">
147+
Unable to load recent vLLM trace artifacts.
148+
</Alert>
149+
</Grid>
150+
</Grid>
151+
);
152+
}
153+
154+
if (data && data.files.length === 0) {
155+
return null;
156+
}
157+
158+
const tableData = data ? data.files : undefined;
159+
160+
return (
161+
<Grid container spacing={10} sx={{ mt: 4 }}>
162+
<Grid size={{ xs: 12, lg: 11.8 }}>
163+
<TablePanelWithData
164+
title={"Profiling Traces"}
165+
data={tableData}
166+
columns={columns}
167+
dataGridProps={{
168+
getRowId: (row: ArtifactRow) => row.key,
169+
disableColumnMenu: true,
170+
disableRowSelectionOnClick: true,
171+
}}
172+
showFooter={true}
173+
disableAutoPageSize={true}
174+
customStyle={{
175+
maxHeight: 600,
176+
}}
177+
/>
178+
</Grid>
179+
</Grid>
180+
);
181+
}

torchci/components/benchmark/llms/components/VllmArtifactsTable.tsx

Lines changed: 0 additions & 120 deletions
This file was deleted.

torchci/lib/benchmark/llms/utils/artifacts.ts

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { LAST_N_DAYS } from "components/benchmark/common";
12
import { fetcher } from "lib/GeneralUtils";
23
import useSWR from "swr";
34

@@ -6,6 +7,8 @@ export type ArtifactFile = {
67
url: string;
78
date: string;
89
modelName: string;
10+
deviceType: string;
11+
deviceName: string;
912
fileName: string;
1013
commitHash: string;
1114
workflowId: string;
@@ -16,24 +19,39 @@ export type ArtifactResponse = {
1619
};
1720

1821
export type UseArtifactsOptions = {
19-
prefix?: string;
20-
lookbackMonths?: number;
22+
repository?: string;
23+
lookbackDays?: number;
24+
modelName?: string;
25+
deviceType?: string;
26+
deviceName?: string;
2127
};
2228

23-
const DEFAULT_OPTIONS: Required<Pick<UseArtifactsOptions, "lookbackMonths">> = {
24-
lookbackMonths: 6,
29+
const DEFAULT_OPTIONS: Required<Pick<UseArtifactsOptions, "lookbackDays">> = {
30+
lookbackDays: LAST_N_DAYS,
2531
};
2632

2733
export const useArtifacts = (options: UseArtifactsOptions = {}) => {
2834
const mergedOptions = { ...DEFAULT_OPTIONS, ...options };
2935
const params = new URLSearchParams();
3036

31-
if (options.prefix) {
32-
params.set("prefix", options.prefix);
37+
if (options.repository) {
38+
params.set("repository", options.repository);
3339
}
3440

35-
if (mergedOptions.lookbackMonths) {
36-
params.set("lookbackMonths", String(mergedOptions.lookbackMonths));
41+
if (options.modelName) {
42+
params.set("modelName", options.modelName);
43+
}
44+
45+
if (options.deviceType) {
46+
params.set("deviceType", options.deviceType);
47+
}
48+
49+
if (options.deviceName) {
50+
params.set("deviceName", options.deviceName);
51+
}
52+
53+
if (mergedOptions.lookbackDays) {
54+
params.set("lookbackDays", String(mergedOptions.lookbackDays));
3755
}
3856

3957
const queryString = params.toString();

0 commit comments

Comments
 (0)