File size: 4,880 Bytes
5d12def
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
"""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()