From 74bbd14425123d76867527afb632a0ec2dd3c90e Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Mon, 9 Feb 2026 15:31:56 -0800 Subject: [PATCH 1/3] hidemetadata --- kernelboard/api/leaderboard.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/kernelboard/api/leaderboard.py b/kernelboard/api/leaderboard.py index eb475b7f..a7399408 100644 --- a/kernelboard/api/leaderboard.py +++ b/kernelboard/api/leaderboard.py @@ -281,21 +281,22 @@ def get_ai_trend(leaderboard_id: int): def parse_model_from_filename(file_name: str) -> str: """ - Extract model name from file names ending with ka_submission.py: - - trimul_H100_claude-opus-4.5_ka_submission.py -> claude-opus-4.5 + Extract model name - the segment right before _ka_submission.py + Examples: + - matmul_py_H100_claude-opus-4.5_ka_submission.py -> claude-opus-4.5 - trimul_H100_gpt-52_ka_submission.py -> gpt-52 - - trimul_H100_gpt-5_ka_submission.py -> gpt-5 Returns None if file doesn't match pattern. """ - if not file_name or not file_name.endswith("_ka_submission.py"): + suffix = "_ka_submission.py" + if not file_name or not file_name.endswith(suffix): return None - # Extract model name: everything between last GPU type and _ka_submission - # Pattern: {anything}_{gpu}_{model}_ka_submission.py - pattern = r"^.+_[A-Za-z0-9]+_(.+?)_ka_submission\.py$" - match = re.match(pattern, file_name) - if match: - return match.group(1) + # Remove the suffix and get everything before it + base = file_name[:-len(suffix)] + # Split by underscore and get the last segment + parts = base.rsplit("_", 1) + if len(parts) == 2: + return parts[1] return None From 2da3049aff8884eee6cd893592b6cb9da216d9fd Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Mon, 9 Feb 2026 15:44:07 -0800 Subject: [PATCH 2/3] hidemetadata --- kernelboard/api/leaderboard.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/kernelboard/api/leaderboard.py b/kernelboard/api/leaderboard.py index a7399408..1aac45d4 100644 --- a/kernelboard/api/leaderboard.py +++ b/kernelboard/api/leaderboard.py @@ -303,14 +303,21 @@ 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. + Returns: { "H100": { "claude-opus-4.5": [...], "gpt-5": [...] } } """ series = {} for item in items: + gpu_type = item.get("gpu_type", "unknown") model = item.get("model", "unknown") - if model not in series: - series[model] = [] - series[model].append({ + + 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"], From 6d83924888a537beaac61ceb40ec762e40ad8fa2 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Mon, 9 Feb 2026 15:46:09 -0800 Subject: [PATCH 3/3] hidemetadata --- kernelboard/api/leaderboard.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kernelboard/api/leaderboard.py b/kernelboard/api/leaderboard.py index 1aac45d4..d662cc0e 100644 --- a/kernelboard/api/leaderboard.py +++ b/kernelboard/api/leaderboard.py @@ -304,12 +304,19 @@ def parse_model_from_filename(file_name: str) -> str: def group_by_model(items: List[dict]) -> dict: """ 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: - gpu_type = item.get("gpu_type", "unknown") - model = item.get("model", "unknown") + 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] = {}