Datasets:
Download kernel_bench/main_h100.py from code-roamer/gpu-kernel-benchmark: direct link, hf CLI and curl.
- Browser
- Download file 4.88 kB
-
https://huggingface.co/datasets/code-roamer/gpu-kernel-benchmark/resolve/main/kernel_bench/main_h100.py
- Command line
-
hf download hf://datasets/code-roamer/gpu-kernel-benchmark/kernel_bench/main_h100.py
-
curl -L -o main_h100.py https://huggingface.co/datasets/code-roamer/gpu-kernel-benchmark/resolve/main/kernel_bench/main_h100.py
4.88 kB
| """Build the H100 v0.6 scoring suite and its four diagnostic controls.""" | |
| import argparse | |
| import math | |
| from pathlib import Path | |
| from . import H100_V06_PROTOCOL as VERSION | |
| from . import build_expansion_suites as previous | |
| from .build_sparse_suites import write | |
| ROOT = Path(__file__).resolve().parent | |
| PACK = "v0.6-h100-kernels" | |
| PROFILE = "h100-main-v06" | |
| DIAGNOSTICS = {"mtp_embedding_norm", "skinny_gemm", "ragged_softmax", "paged_dequant_gather"} | |
| # task -> (implementation module, public baseline name, tier) | |
| REPLACEMENTS = { | |
| "block_sparse_gqa": ("sparse_gqa", "H100/FlexAttention+direct-Triton-sparse-GQA/shape-tuned", "library_and_handwritten"), | |
| "int8_scaled_gemm": ("int8_gemm", "H100/SGL-INT8+DP4A+Triton-INT32-split-K/shape-tuned", "library_and_handwritten"), | |
| "causal_conv_update": ("causal_conv", "Triton/direct-output-causal-depthwise-conv+history", "handwritten_fused"), | |
| } | |
| def suite(smoke=False, seed=None, private=False, diagnostic=False): | |
| data = previous.suite(smoke=smoke, seed=seed, private=private) | |
| cases = [c for c in data["cases"] if (c["task"] in DIAGNOSTICS) == diagnostic] | |
| for case in cases: | |
| if case["task"] in REPLACEMENTS: | |
| case["baseline_profile"] = PROFILE | |
| split = data["suite_id"].rsplit("-", 1)[-1] | |
| track = "diagnostic" if diagnostic else "main" | |
| return dict(data, protocol_version=VERSION, suite_id=f"h100-v06-{track}-{split}", | |
| track=track, provenance=f"H100 v0.6 {track} workloads, {split} split.", cases=cases) | |
| def validate_cases(data): | |
| """Reject a mislabeled suite before starting a v0.6 GPU run.""" | |
| if data.get("protocol_version") != VERSION: | |
| return | |
| is_diagnostic = data.get("track", "main") == "diagnostic" | |
| for case in data["cases"]: | |
| task = case["task"] | |
| if (task in DIAGNOSTICS) != is_diagnostic: | |
| raise ValueError(f"{task} belongs to a different H100 track") | |
| if (task in REPLACEMENTS) != (case.get("baseline_profile") == PROFILE): | |
| raise ValueError(f"{task} has the wrong v0.6 baseline profile") | |
| def catalog(): | |
| data = previous.catalog() | |
| tasks = [] | |
| for spec in data["tasks"]: | |
| task = spec["id"] | |
| if task in DIAGNOSTICS: | |
| continue | |
| if task in REPLACEMENTS: | |
| _, name, tier = REPLACEMENTS[task] | |
| spec.update(baseline=name, baseline_tier=tier, baseline_revision=VERSION, | |
| admission_report="reports/2026-11-12-h100-v06/qualification.md", | |
| calibration_status="v06_paired_h100_qualification", | |
| performance_qualification="H100 v0.6 paired comparison with v0.5") | |
| for key in ("sanitizer_report", "sanitizer_status"): | |
| spec.pop(key, None) | |
| tasks.append(spec) | |
| return dict(data, version=VERSION, research_entries=len({s["research_ids"][0] for s in tasks}), | |
| diagnostic_tasks=sorted(DIAGNOSTICS), tasks=tasks) | |
| def score_trials(rows, specs=None, protocol=VERSION): | |
| """Use the complete v0.6 denominator; partial/invalid campaigns have no official score.""" | |
| if specs is None: | |
| specs = catalog()["tasks"] | |
| by_task = {row["task"]: row for row in rows} | |
| if len(by_task) != len(rows) or set(by_task) != {s["id"] for s in specs}: | |
| return None | |
| if any(not row["eligible_for_model_scoring"] for row in rows): | |
| return None | |
| entries = {} | |
| for spec in specs: | |
| entries.setdefault(spec["research_ids"][0], []).append(by_task[spec["id"]]) | |
| points = [] | |
| for members in entries.values(): | |
| if not all(row["both_splits_correct"] and row["hidden"].get("stable") for row in members): | |
| points.append(0.0) | |
| continue | |
| total = sum(row["hidden_cases"] for row in members) | |
| mean_log = sum(row["hidden_cases"] * math.log2(row["hidden"]["kernel_lower_bound"]) | |
| for row in members) / total | |
| points.append(100 * max(0.0, mean_log)) | |
| return {"score": sum(points) / len(points), "research_entries": len(points), | |
| "interfaces": len(rows), "protocol": protocol} | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--export-packs", action="store_true") | |
| args = parser.parse_args() | |
| path = ROOT / "h100_main_catalog_v06.json" | |
| write(path, catalog()) | |
| public = ROOT / "suites/h100_kernel_v06.json" | |
| write(public, suite()) | |
| write(ROOT / "suites/h100_kernel_calibration_v06.json", suite(seed=2026110306)) | |
| write(ROOT / "suites/h100_kernel_smoke_v06.json", suite(smoke=True)) | |
| write(ROOT / "suites/h100_kernel_diagnostics_v06.json", suite(diagnostic=True)) | |
| if args.export_packs: | |
| from .export_taskpacks import export | |
| export(ROOT / "taskpacks" / PACK, path, public, ROOT / "docs/h100-kernel-v0.6.md") | |
| if __name__ == "__main__": | |
| main() | |