SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2025.findings-acl.1183 · ACL Findings · 2025

TRITONBENCH: Benchmarking Large Language Model Capabilities for Generating Triton Operators

Maosong Sun, Zhiyuan Liu, Xu Han, Jiacheng Huang, Zefan Wang, Yuxuan Li, Jianling Li, Qi Shi, Shangzhan Li, Zhenye Gao, Haojie Wang, Jianrong Wang

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 1 failure of our instrument; 4 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2025.findings-acl.1183.json · badge: /api/ran/2025.findings-acl.1183.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
thunlp/TritonBench canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
calculate Ran
ran on a synthesized input
thunlp/TritonBench/EVAL/eval_G/2_efficiency.py
code served (permissive licence) · get_code("6c5603b32e76815a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
import os

# Create temporary JSON files with the expected structure
temp_dir = tempfile.mkdtemp()

# Create reference data file
ref_data = [
    {"ms": 5.0, "GB/s": 1500.0, "TFLOPS": 200.0},
    {"ms": 6.0, "GB/s": 1600.0, "TFLOPS": 210.0},
    {"ms": 5.5, "GB/s": 1550.0, "TFLOPS": 205.0}
]

# Create generated data file (with slightly better efficiency to avoid assertion)
gen_data = [
    {"ms": 5.1, "GB/s": 1550.0, "TFLOPS": 210.0},
    {"ms": 6.1, "GB/s": 1620.0, "TFLOPS": 220.0},
    {"ms": 5.6, "GB/s": 1580.0, "TFLOPS": 215.0}
]

path_ref = os.path.join(temp_dir, "ref.json")
path_gen = os.path.join(temp_dir, "gen.json")

with open(path_ref, 'w', encoding='utf-8') as f:
    json.dump(ref_data, f)

with open(path_gen, 'w', encoding='utf-8') as f:
    json.dump(gen_data, f)

ARGS = {
    "path_gen": path_gen,
    "path_ref": path_ref
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
clear_code Ran
ran on a synthesized input
thunlp/TritonBench/EVAL/eval_T/0_call_acc.py
code served (permissive licence) · get_code("e6b50ef2c8ad55a5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def clear_code(code: str) -> str:
    if '```python' in code:
        code = code.split('```python')[-1].replace('<|im_end|>', '').replace('<|EOT|>', '')
    return code

# Test cases for the function
test_code_1 = "```python\nprint('hello')\n```"
test_code_2 = "some code without markdown"
test_code_3 = "```python\nprint('test')<|im_end|>"
test_code_4 = "```python\ncode<|EOT|>"

ARGS = {
    'code': test_code_1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_functions_and_imports Ran
ran on a synthesized input
thunlp/TritonBench/EVAL/eval_T/0_call_acc.py
code served (permissive licence) · get_code("c23ff7dc5dcdee3a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import ast

# The function extract_functions_and_imports takes a single parameter 'code'
# which is a string containing Python code to be parsed and analyzed.
# The function uses ast.parse() to parse the code string and then walks
# the AST to extract function definitions and import statements.

# Create a simple Python code string with both functions and imports
sample_code = """
import os
from typing import List
import numpy as np

def hello_world():
    print("Hello")

def add(a, b):
    return a + b

from collections import defaultdict

def multiply(x, y):
    return x * y
"""

ARGS = {
    "code": sample_code
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_test Ran
ran on a synthesized input
thunlp/TritonBench/EVAL/eval_G/0_call_acc.py
code served (permissive licence) · get_code("093b95b4e2a2ff84")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile

# Create a temporary directory with test files
temp_dir = tempfile.mkdtemp()

# Create test files with content that includes the delimiter and test function
test_content_1 = "some code here\n" + "#" * 146 + "\ndef test_example():\n    assert True\n"
test_content_2 = "other code\n" + "#" * 146 + "\ndef test_another():\n    pass\n"

file1 = "test_file1.py"
file2 = "test_file2.py"

with open(os.path.join(temp_dir, file1), 'w', encoding='utf-8') as f:
    f.write(test_content_1)

with open(os.path.join(temp_dir, file2), 'w', encoding='utf-8') as f:
    f.write(test_content_2)

ARGS = {
    "folder": temp_dir,
    "files": [file1, file2]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_weights Ran
ran on a synthesized input
thunlp/TritonBench/EVAL/CodeBLEU/calc_code_bleu.py
code served (permissive licence) · get_code("bb29054e8efd01ff")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - reference_tokens: iterable of tokens (strings or hashable objects)
# - key_word_list: iterable of tokens to check membership in
# The function creates a dict mapping tokens to weights (1 if in key_word_list, else 0.2)

reference_tokens = ['the', 'quick', 'brown', 'fox', 'jumps', 'over', 'lazy', 'dog']
key_word_list = ['the', 'quick', 'fox']

ARGS = {
    'reference_tokens': reference_tokens,
    'key_word_list': key_word_list,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pad_sequence Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thunlp/TritonBench/EVAL/CodeBLEU/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from alex-haochenli/reco, is pointer only (licence: NONE) · get_code("cd90fe437a24c233")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from alex-haochenli/reco, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

process_code Ran
ran on a synthesized input
thunlp/TritonBench/EVAL/eval_G/0_call_acc.py
code served (permissive licence) · get_code("2ee28aaca00e44e6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import ast

# Test case 1: Code with function definitions and imports
code_with_functions = """
import numpy as np
from typing import List

def hello_world():
    return "Hello"

def add(a, b):
    return a + b
"""

# Test case 2: Code wrapped in markdown
code_with_markdown = """```python
import torch

def process_tensor(x):
    return x * 2
"""

# Test case 3: Code with syntax error (should return original)
code_with_error = """
def broken(
    this is not valid python
"""

# Test case 4: Code with only imports
code_only_imports = """
import sys
from collections import defaultdict
from itertools import chain
"""

# Test case 5: Mixed code with multiple function defs
code_mixed = """
import os
from pathlib import Path

def func_one():
    pass

def func_two(x, y):
    return x + y

def func_three():
    pass
"""

ARGS = {
    "code": code_with_functions
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compare_python_files Not yet run
unverified (harvested, no recorded run)
thunlp/TritonBench/EVAL/eval_G/1_exe_acc.py
code served (permissive licence) · get_code("e96ed144e0fefb4b")
How it ran

no invocation recorded.

eval_similarity Not yet run
unverified (harvested, no recorded run)
thunlp/TritonBench/EVAL/evaluate_similarity.py
code served (permissive licence) · get_code("888c9ae3f00660db")
How it ran

no invocation recorded.

get_file_order Not yet run
unverified (harvested, no recorded run)
thunlp/TritonBench/EVAL/eval_G/0_call_acc.py
code served (permissive licence) · get_code("4979aabc708ab70e")
How it ran

no invocation recorded.

run_with_gpu Not yet run
unverified (harvested, no recorded run)
thunlp/TritonBench/EVAL/eval_G/1_exe_acc.py
code served (permissive licence) · get_code("0abab0c72e0f00da")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
pad_sequence 10 other papers
10 dated earlier
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
1911.04700 (2019-11)
A Pre-training Based Personalized Dialogue Generation Model with Persona-sparse Data
2009.10297 (2020-09)
CodeBLEU: a Method for Automatic Evaluation of Code Synthesis
and 7 more not named here
make_weights 1 other paper
1 dated earlier
2206.08474 (2022-06)
XLCoST: A Benchmark Dataset for Cross-lingual Code Intelligence

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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 realworld operators from GitHub and a collection of 166 operators aligned with PyTorch interfaces. Unlike conventional code benchmarks prioritizing functional correctness, TRITON-BENCH 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 is available at https: //github.com/thunlp/TritonBench.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2025.findings-acl.1183")
get_code_for_paper("2025.findings-acl.1183")
have("2025.findings-acl.1183")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2025.findings-acl.1183.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2025.findings-acl.1183.svg)](https://syntology.ai/paper/2025.findings-acl.1183)

Connect an agent — have() is free.