Skip to content

Commit 0ca13ac

Browse files
authored
Create custom priority order for cache bench columns (#6332)
1 parent 1ee2e97 commit 0ca13ac

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

torchci/components/benchmark/llms/SummaryPanel.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,27 @@ export function SummaryPanel({
202202
});
203203
}
204204

205+
if (benchmarkName === "TorchCache Benchmark") {
206+
// We want to set a custom order for cache benchmark
207+
const priorityOrder = [
208+
"Cold compile time (s)",
209+
"Warm compile time (s)",
210+
"Speedup (%)",
211+
];
212+
metricNames.sort((x, y) => {
213+
const indexX = priorityOrder.indexOf(x);
214+
const indexY = priorityOrder.indexOf(y);
215+
216+
if (indexX !== -1 && indexY !== -1) {
217+
return indexX - indexY; // Keep the priority order
218+
}
219+
if (indexX !== -1) return -1; // Move priority items to the front
220+
if (indexY !== -1) return 1;
221+
222+
return 0; // Keep original order for non-priority items
223+
});
224+
}
225+
205226
columns.push(
206227
...[
207228
{

0 commit comments

Comments
 (0)