Datasets:
Download kernel_bench/build_h100_suites.py from code-roamer/gpu-kernel-benchmark: direct link, hf CLI and curl.
- Browser
- Download file 2.92 kB
-
https://huggingface.co/datasets/code-roamer/gpu-kernel-benchmark/resolve/main/kernel_bench/build_h100_suites.py
- Command line
-
hf download hf://datasets/code-roamer/gpu-kernel-benchmark/kernel_bench/build_h100_suites.py
-
curl -L -o build_h100_suites.py https://huggingface.co/datasets/code-roamer/gpu-kernel-benchmark/resolve/main/kernel_bench/build_h100_suites.py
2.92 kB
| """Native H100 sparse workloads, versioned separately from the v0.4 pilot.""" | |
| import argparse | |
| import copy | |
| from pathlib import Path | |
| import random | |
| import secrets | |
| from .build_sparse_suites import public_suite as legacy_public, write | |
| ROOT = Path(__file__).resolve().parent | |
| def public_suite(): | |
| suite = copy.deepcopy(legacy_public()) | |
| suite.update(protocol_version="0.5.0-dev-h100", suite_id="h100-sparse-v0.5-public", | |
| provenance="H100-native expert baseline calibration; not a completed model capability benchmark.") | |
| for case in suite["cases"]: | |
| case["id"] = "h100_" + case["id"] | |
| if case["task"] == "sparse_mla": | |
| case["heads"] = 128 if case["q_len"] == 127 else max(64, case["heads"]) | |
| case["selected"] = (case["selected"] // 128) * 128 | |
| case["baseline_profile"] = "flashmla-sm90-ba89a346" | |
| return suite | |
| def stress_suite(seed, private=False): | |
| suite = public_suite() | |
| rng = random.Random(seed) | |
| split = "holdout" if private else "calibration" | |
| suite.update(suite_id=f"h100-sparse-v0.5-{split}", generation_seed=seed, | |
| provenance="Grader-only holdout." if private else "Visible calibration; not hidden evidence.") | |
| for case in suite["cases"]: | |
| case["id"] = split + "_" + case["id"] | |
| case["q_len"] += rng.choice([1, 3, 7]) | |
| if case["task"] == "sparse_mla": | |
| case["heads"] = 192 - case["heads"] | |
| case["kv_len"] += case["page_size"] * rng.choice([1, 3, 7]) | |
| case["selected"] += rng.choice([128, 256, 384]) | |
| else: | |
| case["kv_len"] += rng.choice([17, 33, 129]) | |
| case["max_blocks"] += 1 | |
| return suite | |
| def smoke_suite(): | |
| suite = public_suite() | |
| block, mla = suite["cases"][0], suite["cases"][4] | |
| block.update(id="h100_smoke_block_sparse_gqa", batch=2, heads=4, kv_heads=2, | |
| q_len=129, kv_len=257, head_dim=64, max_blocks=2) | |
| mla.update(id="h100_smoke_sparse_mla", batch=2, q_len=2, heads=64, | |
| kv_len=256, selected=128) | |
| suite.update(suite_id="h100-sparse-v0.5-smoke", cases=[block, mla]) | |
| return suite | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--private-dir", type=Path) | |
| args = parser.parse_args() | |
| if args.private_dir: | |
| args.private_dir.mkdir(parents=True, exist_ok=False, mode=0o700) | |
| path = args.private_dir / "holdout.json" | |
| write(path, stress_suite(secrets.randbits(48), private=True)) | |
| path.chmod(0o600) | |
| print("Created private split:", path) | |
| else: | |
| for name, suite in (("h100_sparse_v05", public_suite()), | |
| ("h100_sparse_calibration_v05", stress_suite(2026110305)), | |
| ("h100_sparse_smoke_v05", smoke_suite())): | |
| write(ROOT / "suites" / (name + ".json"), suite) | |
| if __name__ == "__main__": | |
| main() | |