为张量核函数自动校准更严格的容错阈值,提升漏洞检测能力。
Operator-Aware Mixed-Precision Tolerance Calibration for Tensor Kernels
- 基于云端大量运行数据,分析每个算子的误差分布并动态校准容错阈值。
- 在7个大模型类错误变体上,漏洞检测召回率从73.2%提升至82.4%。
- 适合作为深度学习框架的测试验证工具,尤其适合追求高精度的工程团队。
当前张量核函数的正确性测试普遍采用固定形状的全范围近似检查,容忍度由人工设定且长期不变。本文通过对26个gpuemu测试用例、两种数据类型(共8,076条结果)的云端GPU运行数据进行挖掘,分析每项测试用例的逐元素误差分布。核心问题:在正确实现下,该算子自身能支持多大的绝对容错阈值?答案显示,当前人工设定的atol远宽松于实际可接受范围,最大可收紧达2,184倍。在7个配备对应正确版本的大模型风格错误变体上,按(算子,数据类型)粒度校准后的容错阈值,使漏洞检测召回率从73.2%(1,805/2,467)提升至82.4%(2,034/2,467),绝对提升9.3个百分点(新增229例检出)。控制组误报率从0升至20/1,882(+1.1个百分点)。
原文摘要 · Abstract (English)
Most tensor-kernel correctness tests go through a fixed-shape all close-style check with hand-picked absolute and relative tolerances. The thresholds are copied across the corpus and rarely revisited. We mine the element-wise error distribution of every test case from accumulated cloud GPU runs across the 26-entry gpuemu corpus and 2 dtypes (8,076 result rows). We then ask one empirical question: what absolute tolerance would the kernel itself, observed under its correct implementation, justify? The answer is much tighter than the current hand-picked atol. The largest tightening is attention_triton fp16 at $2{,}184\times$. Restricted to the seven LLM-style buggy variants for which the corpus ships a paired correct counterpart, calibrated per-(op, dtype) tolerances raise bug-detection recall from 73.2% (1,805 of 2,467) to 82.4% (2,034 of 2,467), an absolute gain of 9.3 percentage points (+229 new detections). The control false-positive count rises from 0 to 20 out of 1,882 correct-control cases (+1.1 percentage points).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。