Manuscript Offprint

arXiv:2610.03226

D2K-Bench: Can LLM Agents Turn Expert Designs into Efficient GPU Kernels?

Daifeng Li, Huiqiang Jiang, Chengruidong Zhang, Wei Wu, Xudong Guo, Jianhong Tu, Jianwei Zhang, Binhang Yuan, Dayiheng Liu

Abstract

GPU kernels generated by large language model (LLM) agents can remain less efficient than expert implementations, but runtime alone does not reveal how the gap relates to design discovery and implementation. We introduce D2K-BENCH, a diagnostic benchmark of 26 tasks and 85 workloads that measures how effectively agents translate expert design guidance into efficient GPU kernels. The guidance covers L1: high-level algorithmic insights, L2: dataflow design, and L3: low-level optimization tricks, including dependencies among these levels. Pairwise runs with and without guidance share task descriptions, workloads, tools, hardware, and a 350-turn budget. Complementary assessments examine independently proposed designs and the design properties implemented in generated code. Across five models on NVIDIA B200 GPUs, guidance raises correctness over 130 model–task pairs from 93.1% to 98.5% and increases the Performance Score over all 26 tasks from 1.46 to 1.95. For the three frontier models with correct submissions on all 26 tasks in both runs (GPT-6-Astra, Claude-Opus-4.8, and GPT-5.6-Sol), geometric mean speedup increases from 1.69×1.69\times to 2.49×2.49\times. Across all five models, the mean combined implementation score increases from 57 to 70 out of 100. These results show the value of expert design guidance while identifying design properties that remain unimplemented.

Code: https://github.com/QwenLM/D2K-Bench

1 Introduction

In modern machine learning systems, GPU kernels usually execute the core computations of machine learning workloads, and their efficiency significantly affects training and inference latency, throughput, and GPU operating cost. Recently, large language model (LLM) agents have offered an effective way to automate GPU kernel development through code generation, compilation, testing, profiling, and iterative optimization [1,2][1, 2]. Although these development loops can improve performance, the generated GPU kernels could still be less efficient than expert implementations [3][3]. Concretely, the LLM-generated kernels and expert implementations could differ in their algorithms, dataflow, and low-level optimization techniques. In this paper, we investigate how effectively LLM agents can translate expert design guidance into efficient GPU kernel implementations.

Understanding the performance gap between LLM-generated kernels and expert implementations helps target improvements in automated kernel development. The accurately identified gap can inform whether agents need better support for discovering effective designs, implementing and tuning those designs, or both. Algorithmic and dataflow choices can reduce computation and memory traffic, but their benefits depend on the generated code preserving these savings while using GPU resources effectively. Recognizing a promising design therefore does not ensure that an agent can achieve its performance potential. Useful diagnostics should connect an agent's design choices, their implementation in code, and measured runtime to identify limitations that warrant further investigation. Without such evidence, additional tuning may leave an inefficient algorithm or dataflow unchanged, while further design guidance may fail to resolve implementation limitations.

However, assessing how effectively agents translate expert design guidance into efficient kernels is difficult since the execution time alone does not clearly reveal which design choices the generated code implements or how well it implements them. An agent must identify an effective algorithm and dataflow, then implement those choices through correct code, GPU execution mechanisms, and tuning. For example, FlashAttention combines online normalization with tiled computation to avoid storing the full attention matrix [4]. Discovering this design reveals an opportunity to reduce memory traffic; implementing the design further requires coordinated computation and data movement, careful GPU resource management, and tile-size tuning. Runtime alone cannot reveal where an agent falls short. Assessments of independently proposed designs and executable source provide complementary evidence about design discovery and implementation.

Existing benchmarks evaluate kernel correctness and performance in different ways: KernelBench evaluates speedup over PyTorch, SOL-ExecBench uses analytical hardware-performance estimates, and FastKernels evaluates generated kernels against production implementations [1, 3, 5]. Prior work also studies optimization guidance and generated code: KernelBench examines hardware knowledge and optimization examples, Hari et al. [2] use Speed-of-Light guidance and LLM-based integrity review, and Shui et al. [6] compare expert-assisted and autonomous kernel development. On the other hand, we focus on a diagnostic approach that can connect task-specific design guidance, pairwise comparisons with and without guidance, and structured assessments of independently proposed designs and generated code. This combination makes the assessed design properties explicit and relates their implementation to correctness and runtime.

We introduce D2K-BENCH, a benchmark that connects performance comparisons with assessments of design discovery and implementation. Expert design guidance and pairwise comparisons with and without guidance make both guidance benefits and unimplemented design properties observable. We make the following concrete contributions:

Contribution 1. We construct a targeted diagnostic benchmark of 26 tasks and 85 workloads, pairing task descriptions with selected expert references and task-specific design guidance (Section 2). The guidance covers L1: high-level algorithmic insights, L2: dataflow design, and L3: low-level optimization tricks, and records dependencies among these levels. This structure captures algorithmic transformations, data representation and movement, and GPU execution mechanisms within a common framework for guidance and assessment.

Contribution 2. We develop an evaluation protocol that compares kernel performance and design implementation with and without expert design guidance (Section 3). The runs in each pair use the same task description, workloads, Triton implementation language, tools, and hardware; guidance provides explanations without expert source code or prescribed tuning parameters. An LLM judge assesses independently proposed designs and executable source evidence, with runtime hidden for source assessment and credit for correct alternative designs. Source comparisons use all 26 tasks in both runs, providing a diagnostic of implemented properties on these tasks and the shortfall that remains under guidance.

Contribution 3. We characterize the benefits and limits of expert design guidance across five models on NVIDIA B200 GPUs (Section 4). Guidance raises correctness over 130 model–task pairs from 93.1% to 98.5%. The Performance Score is computed over all 26 tasks for each model and increases from 1.46 to 1.95. For GPT-6-Astra, Claude-Opus-4.8, and GPT-5.6-Sol, which have correct submissions on all 26 tasks in both runs, geometric mean speedup increases from 1.69×1.69 \times to 2.49×2.49 \times. Across all five models, the mean combined implementation score increases from 57 to 70 out of 100, while guided code still leaves assessed properties unimplemented. Additional analyses examine cumulative guidance in a fixed level order and an illustrative implementation. The evaluations separately assess agents' independently proposed designs and their ability to implement supplied expert designs in executable code, and relate these assessments to kernel performance.

References (34)