一句话:首个面向 Triton 的设备无关内存 Sanitizer,以符号执行加 SMT 求解替代逐访问插桩,检测精确且诊断信息丰富。
GPU 程序中的内存访问错误十分普遍,但现有 GPU sanitizer(如 compute-sanitizer)需要对底层 IR 或二进制中的每条内存指令插桩,开销高且几乎不提供修复所需的诊断上下文。本文提出 Triton-Sanitizer,这是首个为 Triton(面向深度学习可移植高效 GPU kernel 的领域特定语言)设计的设备无关内存 sanitizer。它利用 Triton 的 tile 语义为内存地址与掩码构造符号表达式,借助 SMT 求解器进行验证,并对间接访问有选择地回退到即时模拟,从而在避免逐访问插桩开销的同时实现无误报的精确检测。在检测之外,它还能生成丰富诊断报告:将违规归因到最接近违规地址的张量、追踪完整调用路径并展示导致错误地址的符号操作。作者在七个常用开源 Triton kernel 仓库上评估,发现 24 个此前未知的内存访问错误,其中 8 个已由作者修复并上游合并;相比 compute-sanitizer 获得 1.07× 至 14.66× 加速,平均 1.62×,在性能、精度与可用性上均有提升。
Memory access errors remain one of the most pervasive bugs in GPU programming. Existing GPU sanitizers such as compute-sanitizer detect memory access errors by instrumenting every memory instruction in low-level IRs or binaries, which imposes high overhead and provides minimal memory access error diagnostic context for fixing problems. We present Triton-Sanitizer, the first device-agnostic memory sanitizer designed for Triton, a domain-specific language for developing portable, efficient GPU kernels for deep learning workloads. Triton-Sanitizer leverages Triton's tile-oriented semantics to construct symbolic expressions for memory addresses and masks, verifies them with an SMT solver, and selectively falls back to eager simulation for indirect accesses. This hybrid analysis enables precise detection of memory access errors without false positives while avoiding the cost of per-access instrumentation. Beyond detection, Triton-Sanitizer generates rich diagnostic reports that attribute violations to the tensors nearest to the violated addresses, track the complete call path, and expose the symbolic operations responsible for incorrect addresses. Evaluated on seven widely used open-source repositories of Triton kernels, Triton-Sanitizer uncovered 24 previously unknown memory access errors, of which 8 have already been fixed and upstreamed by us. Compared to compute-sanitizer, Triton-Sanitizer achieves speedups ranging from 1.07× to 14.66×, with an average improvement of 1.62×, demonstrating its ability to enhance performance, precision, and usability in memory access error detection.
@inproceedings{WuZCCHLCA026,
title = {Triton-Sanitizer: A Fast and Device-Agnostic Memory Sanitizer for Triton with Rich Diagnostic Context},
author = {Hao Wu and Qidong Zhao and Songqing Chen and Yang Chen and Yueming Hao and Tony CW Liu and Sijia Chen and Adnan Aziz and Keren Zhou},
booktitle = {ASPLOS},
year = {2026},
doi = {10.1145/3779212.3790241}
}