衡量检查器:GPU内核基准测试预言机的变异分析

·

研究论文 · 2026/09/22

针对LLM生成的GPU内核基准测试,其正确性判定通常依赖少量随机输入和宽松的浮点容差,而判定结果却用于排行榜和强化学习奖励。近期研究普遍认为这些检查器薄弱,并通过手动修补(如增加输入分布、模糊测试配方、收紧容差)来改进,但无法衡量修补是否充分。我们引入变异分析作为内核基准预言机的充分性度量:确定性规则向188个KernelBench问题的已验证CUDA实现中注入10,303个可编译故障,其中7,384个有独立的杀死见证;任何测试协议按检测到的故障比例评分。官方检查确定性地漏检六分之一的见证故障(16.9%),且漏检按家族偏斜:算术故障漏检8.7%,但精度故障漏检78.6%。该度量解释了原因(容差盲区随归约规模增长;由合法浮点方差设定的输入激进性上限),审计了最强现有补丁(KernelBench-Verified的增益拆分为隐藏输入贡献+4.0分和更紧容差贡献+4.5分,其作者无法计算此拆分),并暴露了一个已发布的模糊测试配方错误拒绝正确内核107次。在杀死矩阵上优化测试套件,每个问题两个输入达到98.0%检测率(留出集94.8%),且该度量的故障分类比原始故障本身更能教会测试生成器。在48个完整架构上,盲区随规模增长,集中在深度同质流水线中,两个问题被证明无法仲裁:其官方参考在fp64下违反基准自身的容差。我们发布所有内容为https://huggingface.co/datasets/Elfsong/KernelBench-M。

该研究首次为GPU内核基准测试的预言机提供了可量化的充分性度量,揭示了官方检查的严重盲区,并给出了高效的测试优化方案,对提升LLM生成代码的评估可靠性具有重要意义。

Benchmarks for LLM-generated GPU kernels decide correctness with a few random inputs and a loose floating-point tolerance, and their verdicts now feed leaderboards and reinforcement-learning rewards. Recent work agrees these checkers are weak and patches them by hand---extra input distributions, fuzzing recipes, tighter tolerances---with no way to measure whether any patch suffices. We introduce mutation analysis as an adequacy metric for kernel-benchmark oracles: deterministic rules inject 10{,}303 compilable faults into verified CUDA implementations of 188 KernelBench problems, 7{,}384 of them with an independent kill witness; any test protocol is scored by the fraction it detects. The official check misses one in six witnessed faults (16.9%), deterministically, and the misses are skewed by family: 8.7% of arithmetic faults escape, but 78.6% of precision faults do. The metric explains why (a tolerance blind band growing with reduction size; a measured ceiling on input aggressiveness set by legitimate floating-point variance), audits the strongest existing patch (KernelBench-Verified's gain splits into +4.0 points from hidden inputs and +4.5 from tighter tolerance, a split its authors could not compute), and exposes a published fuzzing recipe that rejects correct kernels 107 times. Optimizing suites over the kill matrix reaches 98.0% detection with two inputs per problem (94.8% held-out), and the measurement's fault taxonomy teaches a test generator more than the raw faults themselves. Across 48 whole architectures, the blindness grows with scale, concentrating in deep homogeneous pipelines, and two problems prove unrefereeable: their official references violate the benchmark's own tolerance against fp64. We release everything as https://huggingface.co/datasets/Elfsong/KernelBench-M{KernelBench-M}.

阅读原文

参与讨论