Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface LeaderboardDetail {
description: string;
name: string;
reference: string;
benchmarks: Record<string, unknown>[];
gpu_types: string[];
rankings: Record<
string,
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/pages/leaderboard/Leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,20 @@ export default function Leaderboard() {
<CardContent>
<CardTitle fontWeight="bold">Description</CardTitle>
<MarkdownRenderer content={data.description} />
{data.benchmarks && data.benchmarks.length > 0 && (
<Box sx={{ mt: 2 }}>
<Typography variant="subtitle1" fontWeight="bold">
Benchmark Shapes
</Typography>
<ul>
{data.benchmarks.map((b, i) => (
<li key={i}>
<code>{JSON.stringify(Object.fromEntries(Object.entries(b).filter(([k]) => k !== "seed")))}</code>
</li>
))}
</ul>
</Box>
)}
</CardContent>
</Card>
</Grid>
Expand Down
7 changes: 6 additions & 1 deletion kernelboard/api/leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def to_api_leaderboard_item(data: dict[str, Any]):
reference = leaderboard_data["reference"] or ""
reference = reference.replace("\\n", "\n")

benchmarks = leaderboard_data.get("benchmarks") or []

gpu_types = leaderboard_data["gpu_types"]
gpu_types.sort()

Expand Down Expand Up @@ -111,6 +113,7 @@ def to_api_leaderboard_item(data: dict[str, Any]):
"gpu_types": gpu_types,
"description": description,
"reference": reference,
"benchmarks": benchmarks,
"rankings": rankings,
}

Expand All @@ -126,7 +129,8 @@ def _get_query():
deadline,
task->>'lang' AS lang,
description AS description,
task->'files'->>'reference.py' AS reference
task->'files'->>'reference.py' AS reference,
task->'benchmarks' AS benchmarks
FROM leaderboard.leaderboard
WHERE id = %(leaderboard_id)s
),
Expand Down Expand Up @@ -188,6 +192,7 @@ def _get_query():
'lang', lang,
'description', description,
'reference', reference,
'benchmarks', benchmarks,
'gpu_types', (SELECT jsonb_agg(gpu_type) FROM gpu_types)
) FROM leaderboard_info)
) AS result FROM (SELECT gpu_type FROM gpu_types) g;
Expand Down
Loading