TritonBench: Benchmarking Large Language Model Capabilities for Generating Triton Operators

Jianling Li, Shangzhan Li, Zhenye Gao, Qi Shi, Yuxuan Li +7 more
2/20/2025
cs.CLcs.LG

Official code: thunlp/TritonBench (138 stars, Apache-2.0, last commit 2025-06-14).

Abstract

Triton, a high-level Python-like language designed for building efficient GPU kernels, is widely adopted in deep learning frameworks due to its portability, flexibility, and accessibility. However, programming and parallel optimization still require considerable trial and error from Triton developers. Despite advances in large language models (LLMs) for conventional code generation, these models struggle to generate accurate, performance-optimized Triton code, as they lack awareness of its specifications and the complexities of GPU programming. More critically, there is an urgent need for systematic evaluations tailored to Triton. In this work, we introduce TritonBench, the first comprehensive benchmark for Triton operator generation. TritonBench features two evaluation channels: a curated set of 184 real-world operators from GitHub and a collection of operators aligned with PyTorch interfaces. Unlike conventional code benchmarks prioritizing functional correctness, TritonBench also profiles efficiency performance on widely deployed GPUs aligned with industry applications. Our study reveals that current state-of-the-art code LLMs struggle to generate efficient Triton operators, highlighting a significant gap in high-performance code generation. TritonBench will be available at https://github.com/thunlp/TritonBench.

View on arXivView PDF

Code Implementations(1)

thunlp/TritonBenchOfficial100%
Apache-2.0

TritonBench: Benchmarking Large Language Model Capabilities for Generating Triton Operators

13816Shell, PythonFeb 20, 20251 years agoApache-2.0

Similar Papers

Cite this paper

@article{li2025tritonbench,
  title  = {TritonBench: Benchmarking Large Language Model Capabilities for Generating Triton Operators},
  author = {Jianling Li and Shangzhan Li and Zhenye Gao and Qi Shi and Yuxuan Li and Zefan Wang and Jiacheng Huang and Haojie Wang and Jianrong Wang and Xu Han and Zhiyuan Liu and Maosong Sun},
  year   = {2025},
  eprint = {2502.14752},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.14752v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.14752.svg)](https://codeofpaper.com/paper/2502.14752)

Discussion