Skip to content
Merged
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
24 changes: 19 additions & 5 deletions kernelboard/api/leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,28 @@ def parse_model_from_filename(file_name: str) -> str:

def group_by_model(items: List[dict]) -> dict:
"""
Group time series items by model name for easier charting.
Group time series items by gpu_type first, then by model name.
Skips items where model or gpu_type is unknown.
Returns: { "H100": { "claude-opus-4.5": [...], "gpt-5": [...] } }
"""
series = {}
for item in items:
model = item.get("model", "unknown")
if model not in series:
series[model] = []
series[model].append({
gpu_type = item.get("gpu_type")
model = item.get("model")

# Skip if model or gpu_type is unknown or missing
if not gpu_type or gpu_type == "unknown":
continue
if not model or model == "unknown":
continue

if gpu_type not in series:
series[gpu_type] = {}

if model not in series[gpu_type]:
series[gpu_type][model] = []

series[gpu_type][model].append({
"submission_time": item["submission_time"],
"score": item["score"],
"submission_id": item["submission_id"],
Expand Down
Loading