Performance measurement · Research feature

AMD Releases Open Kernel Dataset to Improve GPU Kernel Optimization

AMD has launched AMDKernelVault, an open dataset and training framework for optimizing HIP and Triton kernels on its CDNA GPUs.

Adapted from research by Ji Liu, Saptarshi Majumder, Yiqing Huang and colleagues.

arXiv preprint revision · 2026-09-11 · Attribution & reuse
In this article
Editorial illustration of processor die.

Editor’s introduction

The study introduces AMDKernelVault, a corpus of 62,153 execution-verified HIP kernels, 2,377 production-grounded ROCm library entries, and 39,893 Triton kernels. Researchers evaluated Qwen3-8B fine-tuned with supervised learning and reinforcement learning, finding it achieves the highest correctness on specific benchmarks—34.0% Pass@1 for PyTorch-to-HIP, 33.2% Corr@3 on TritonBench-G, and 41.94% Corr@3 on ROCmBench—under fixed evaluation budgets. Common failures include incorrect tile sizing, synchronization errors, and memory-coalescing issues under AMD’s wavefront model. The evaluation is confined to AMD CDNA hardware and available benchmarks, and performance varies with ROCm, Triton, and hardware configurations. Some generated kernels may retain suboptimal structures from upstream CUDA or LLM-generated candidates, indicating limitations in achieving expert-level kernel quality.

Introduction

Recent advances in GPU kernel optimization have been driven by LLM-based and agent-based approaches, together with standardized benchmarks such as KernelBench. These agent-based systems leverage compiler feedback, runtime correctness checks, and performance profiling to iteratively refine generated kernels. However, the data and tooling behind these systems remain largely CUDA/NVIDIA-centric. In contrast, AMD’s HIP/ROCm ecosystem lacks large-scale, execution-verified kernel data for training and evaluating kernel LLMs, especially across both native HIP and Triton backends.

This data gap is not a matter of syntax conversion alone. Although CUDA and HIP expose similar programming abstractions, performant AMD kernels depend on ROCm compilation behavior, wavefront execution, LDS usage, memory coalescing, matrix-core support, and Triton backend constraints. Direct translation through hipify may preserve API structure while retaining NVIDIA-shaped tiling constants, warp-size assumptions, input-specialized indexing, or memory layouts that fail to compile or underperform on AMD GPUs. Reliable AMD kernel data therefore requires native compilation, execution-based correctness validation, and latency measurement under ROCm.

GPU Kernel Optimization

GPU kernel optimization is a longstanding problem in high-performance ML systems. Significant efforts have focused on operator fusion, tiling, memory hierarchy optimization, and custom kernel design. Representative systems such as FlashAttention show that carefully designed kernels can provide substantial speedups for modern ML workloads. More recently, automated frameworks have used program analysis, search, and learning-based techniques to reduce the manual effort required for kernel tuning. However, most of these methods are developed and evaluated primarily on Nvidia GPUs and CUDA backends, leaving AMD-focused kernel optimization comparatively underexplored.

HIP, Triton, and ROCm

AMD’s HIP provides a CUDA-like programming model within the ROCm software stack, while Triton offers a Python-based DSL for writing custom GPU kernels with explicit control over memory and parallelism. Although these abstractions improve portability, AMD execution differs in ROCm compiler behavior, wavefront-level execution, LDS usage, memory coalescing, and backend scheduling constraints. Source-to-source tools such as hipify can preserve syntax but provide limited guarantees of correctness or performance portability. This motivates native HIP/ROCm validation rather than treating AMD support as a post-hoc translation step.

GPU Kernel Datasets and Benchmarks

High-quality datasets are essential for advancing kernel optimization research. KernelBench provides standardized environments for generating and evaluating optimized kernels, while other benchmarks cover specific operator families. However, existing resources remain largely CUDA-centric. CASS facilitates CUDA-to-HIP translation, but does not provide large-scale PyTorch-to-HIP, HIP-to-HIP, or AMD Triton data. Existing Triton benchmarks also primarily target NVIDIA assumptions that may not generalize to ROCm. AMDKernelVault addresses this gap by constructing a unified HIP/Triton corpus validated through compilation, execution-based correctness checks, and latency profiling on AMD GPUs.

Stage 2: Backend-Specific Kernel Synthesis

Given the standardized PyTorch reference, backend-specific agents generate candidate GPU kernels. Each candidate is subjected to compilation, execution-based correctness checks against the PyTorch reference, and latency profiling. The default HIP checker uses torch.allclose with rtol=1e-4, atol=1e-4, and equal_nan=True. For Triton, task-specific tolerances may be configured from the reference task; otherwise, the fallback is rtol=1e-4, atol=1e-3, and equal_nan=False. We use no fixed dtype- or operator-specific rule. Failures trigger reflector-guided regeneration until correctness criteria are met or the attempt limit is reached.

Counting and audit

The 64,530 HIP/ROCm total comprises 62,153 execution-verified HIP kernel samples and 2,377 ROCm Libraries QA entries. It excludes a separately released 14,282-entry HIP-AICUDA subset that was not used in this paper. HIP-CudaAgent retains 5,388 of 6,000 upstream tasks after excluding 612 incomplete records; HIP-GPUMode contains 5,910 unique tasks and 22,397 kernel variants; and HIP2HIP contains 31,155 single-turn and 3,213 multi-turn records. Triton counts use 39,893 unique source-level samples; packaged reasoning variants may yield a different row count. Since rejection logs were not aggregated uniformly across source pipelines, we report retained counts and subset-specific validation rather than a single corpus-wide failure rate.

HIP Datasets

HIP-CudaAgent: Built from CUDA-Agent-Ops-6K using HIPKernelGen. We adapt the synthesized PyTorch operator tasks into function-style references and use the generate–evaluate–reflect pipeline to produce HIP implementations. Each candidate is compiled with the ROCm toolchain, checked against the PyTorch reference, and filtered by execution-based correctness validation. This yields 5,388 validated PyTorch-to-HIP samples.

HIP-GPUMode: Generated from GPUMODE-KernelBook using HIPKernelGen. We first convert PyTorch modules to function-style references, then generate HIP kernels using frontier LLMs. Each candidate undergoes compilation, execution-based validation, and latency profiling. The generate–evaluate–reflect loop iterates until correctness is achieved or a maximum attempt limit is reached. This produces 5,910 unique PyTorch entries with 22,397 HIP kernel variants (avg 3.8 variants/entry).

Kernel-centric QA generation

Given the retrieved interface context, an agent constructs HIP-kernel-focused QA pairs. The questions target concrete implementation aspects, including computation semantics, index-to-tensor mappings, memory access patterns, synchronization and reduction strategies, launch configuration, and correctness constraints. Answers are grounded in the retrieved code context rather than generic library descriptions, so the resulting supervision emphasizes actionable kernel logic.

Applying this pipeline yields 519 interface-level entries from rocSOLVER, comprising 226 kernel-implementation-focused samples and 293 kernel-centric QA explanations. From rocBLAS, we extract 1,858 entries, including 1,169 kernel-implementation samples and 689 QA-style explanations. Together, these 2,377 production-grounded entries complement benchmark-derived HIP and Triton datasets with real-world host–device orchestration and production HIP development patterns.

Difficulty Distribution

We classify samples into three difficulty levels for curriculum training: Level 1 covers standalone single-function kernels, Level 2 covers fused operators or single-file implementations, and Level 3 covers multi-file kernels with cross-module dependencies. The full Triton corpus comprises 11,824 L1 (29.6%), 24,765 L2 (62.1%), and 3,304 L3 (8.3%) samples; the curriculum-eligible subset used per Triton RL phase is reported in Appendix G. The ROCm Libraries QA data follows a similar distribution: rocSOLVER (190 L1, 198 L2, 131 L3) and rocBLAS (971 L1, 506 L2, 381 L3).

Supervised Fine-Tuning

Direct RL from a pretrained model is difficult in this domain because early rollouts often fail to compile or violate kernel interfaces, producing sparse feedback. We therefore first apply SFT to teach kernel syntax, binding conventions, memory-access idioms, and common implementation patterns.

For HIP, we use instruction–response pairs from the HIP portions of AMDKernelVault, where the input is a PyTorch task or source HIP kernel and the output is a validated HIP implementation. For Triton, we use reasoning-augmented examples when available, so that the model learns to plan tiling, masking, boundary checks, and memory layouts before emitting code. This stage provides the cold-start capability needed for subsequent execution-aware RL.

Execution-Aware Reinforcement Learning

After SFT, we optimize the model using execution feedback. HIP training uses single-turn GRPO, where each candidate is compiled, tested, and scored after one generation attempt. Triton training uses a multi-turn variant aligned with the GEAK-style generate–evaluate–reflect loop: the model proposes a kernel, observes compiler or runtime feedback, reflects on the failure or performance bottleneck, and generates an improved candidate.

The reward combines three signals: compilation, correctness, and speedup. Compilation credit provides partial feedback for syntactically and interface-compatible kernels, correctness rewards functional equivalence, and a bounded speedup term encourages performance improvements without allowing timing outliers to dominate learning. This reward is designed for the low-success regime of AMD kernel generation, where binary correctness rewards alone provide too little gradient signal. Full reward definitions and GRPO details are provided in Appendix E.

Agentic Integration

A key goal is to test whether the corpus can train a compact local model for an agentic kernel optimization loop. We train one Qwen3-8B policy to serve the generator, reflector, and optimizer roles. During multi-turn Triton RL, the same model produces a candidate, interprets execution feedback, and emits the next revision.

This training recipe is not presented as a new RL algorithm. Rather, it evaluates whether execution-verified AMDKernelVault data can specialize a compact policy for AMD kernel agents. Section 5 therefore reports controlled, metric-specific comparisons under identical agent budgets.

Training Configuration

We train Qwen3-8B with SFT followed by RL on AMD MI-series GPUs. HIP training uses SFT followed by single-turn GRPO, while Triton training uses SFT followed by multi-turn on-policy reflection RL with curriculum scheduling. We keep the main text focused on the training recipe used to evaluate AMDKernelVault as a corpus for compact AMD kernel LLMs. Appendix E provides task serialization, SFT and GRPO objectives, reward implementation, curriculum schedule, hyperparameters, and additional analysis of reward sensitivity.

Experiments

We evaluate whether AMDKernelVault can train compact AMD kernel LLMs that improve HIP and Triton kernel generation under execution-based validation. We compare Qwen3-8B trained on our corpus against frontier LLMs (GPT-5, Gemini 2.5 Pro, Claude Sonnet 4). For HIP, we evaluate PyTorch-to-HIP translation on 200 KernelBench Level-1/2 tasks and HIP-to-HIP optimization on 100 held-out samples. For Triton, we use TritonBench-G (184 kernels) and ROCmBench (31 AMD-specific kernels) with the same 3-iteration OptimAgent-v2 protocol. Each model serves as generator, reflector, and optimizer under identical agent settings, and all reported Triton inference runs use MI355X GPUs.

Train/test separation and overlap controls

Evaluation cases are excluded from training by source and task identifier. HIP evaluation uses 200 held-out KernelBench-derived translation tasks and 100 held-out HIP-to-HIP optimization tasks; Triton evaluation uses the curated 184-kernel TritonBench-G and 31-kernel ROCmBench sets. These controls prevent exact task-identifier reuse. However, because generated kernels can implement semantically similar operator patterns using different code, exact-match filtering cannot exclude every functional near-duplicate. We did not conduct an exhaustive corpus-wide semantic-overlap search and therefore interpret the reported results as benchmark-specific rather than as evidence of overlap-free generalization.

Benchmark coverage

The evaluation covers attention and softmax variants, layer and RMS normalization, GEMM-family operations, elementwise transformations, reductions, fused blocks, MoE-style routing, and online-softmax-style fused reductions. KernelBench Level-1/2 tests emphasize operator implementation and composition, while TritonBench-G spans difficulty levels from standalone operators to harder fused kernels; ROCmBench adds AMD-specific cases. This breadth tests multiple common deep-learning kernel patterns, but it is not a per-family performance study: the benchmark sizes are limited, and we do not report operator-family-specific pass rates.

Triton reproducibility setup

Triton workflows use Triton 3.3.0. Corpus validation and profiling use MI325 and MI350 GPUs; Triton SFT and RL use 32 MI325X GPUs; and reported Triton inference uses MI355X GPUs. The corpus targets gfx942 for MI325X stages and gfx950 for MI350/MI355X stages. ROCm, PyTorch, and Python versions vary across data-production snapshots and are not pinned to one release. Warm-up and measurement use 25 ms and 100 ms time budgets, respectively, with per-kernel iteration counts derived from a short timing estimate. We report median GPU-event timing, flush L2 before each measured call, synchronize after the measured loop, and discard no timing observations.

Limitations

Our evaluation is limited to AMD GPU environments and kernel-generation benchmarks available to us. Expert-level kernels remain difficult across all tested models, and the reported performance depends on the specific ROCm, Triton, and hardware configurations used during validation. Although we include production-derived ROCm library supervision, some generated kernels may still inherit suboptimal structures from upstream CUDA/Triton sources or from LLM-generated candidates.

Several gaps remain for future work: broader corpus-level profiling of latency, memory footprint, register pressure, and occupancy; per-operator-family pass-rate analysis beyond the current difficulty breakdown; larger held-out HIP evaluation sets; and evaluation beyond deep-learning workloads, including HPC, sparse/graph, and database kernels. Future work should also incorporate richer profiler-guided feedback and broader expert-kernel supervision.

Ethical Considerations and Impact Statement

This work focuses on GPU kernel generation and optimization for AMD hardware. The released artifacts consist of program code, generated kernels, execution metadata, and QA supervision grounded in public ROCm library code. Provenance, usage conditions, and per-source license notes are included with the public artifact.

The expected positive impact is improved efficiency for AI workloads. Faster generated kernels can reduce training and inference runtime, while a compact local model can reduce repeated frontier-LLM calls during kernel search. These improvements may lower computational cost and energy use for AMD GPU deployments.

Positioning Relative to Multi-Turn RL Kernel Agents

Prior multi-turn systems, including Kevin, demonstrate that iterative execution feedback can improve kernel generation. We do not claim that multi-turn feedback alone is new. Our setting differs in two ways. First, AMD HIP/Triton generation starts from a lower-success regime, where early compilation and correctness rewards are sparse. Second, our goal is to train a model that can be deployed inside an agent-training framework, rather than only evaluate an external LLM called by an agent wrapper. In GEAK-style workflows, repeated LLM calls normally handle generation, reflection, and optimization. We instead train one compact policy on execution-feedback trajectories so that the same model can serve these roles locally under ROCm.

On Comparing to Kevin and Devin-Class Agents

Kevin is trained to emit raw CUDA via torch.utils.cpp_extension.load_inline on NVIDIA hardware, using CUDA-specific primitives such as __shfl_xor_sync and __shared__ memory. Our evaluation targets AMD GPUs through HIP/ROCm and TritonBench-G/ROCmBench under ROCm. A same-protocol comparison would require Kevin to emit AMD-compatible Triton or HIP kernels, which it was not trained for. We therefore treat Kevin as evidence that RL on execution feedback is effective in CUDA settings, while focusing our empirical comparison on models evaluated under the same GEAK OptimAgent-v2 protocol. Devin is a hosted coding agent without a benchmark-accessible interface exposing the fixed generator/reflector/optimizer role assignment used here, so we do not include it as a direct baseline.

Kernel Diversity and Optimization Variants

The datasets exhibit substantial diversity in valid kernel implementations for the same functional operators. In HIP-GPUMode, multiple HIP kernels are provided per PyTorch entry, differing in block sizes, thread mapping strategies, tiling schemes, memory access orderings, and reduction structures.

Similarly, Triton-Curated contains multiple kernel realizations for overlapping operators, capturing variation in program structure, scheduling decisions, and memory layouts at the DSL level. This diversity exposes non-trivial performance trade-offs and supports studies in kernel ranking, selection, and agent-driven optimization.

Data Quality and Bias Mitigation

Because a large fraction of the corpus is produced by automated agents, we explicitly filter for execution quality rather than trusting raw model outputs. Candidates must compile, pass reference-based tests, and satisfy ROCm execution constraints before entering the released set. For performance-oriented subsets, multiple candidates are generated and the retained variants are selected after latency measurement on AMD hardware. Public expert-level HIP kernels are scarce, so the corpus combines production kernels from ROCm Libraries with rigorously filtered generated variants. This design removes obviously poor kernels while preserving multiple correct implementations when they expose different optimization strategies.

We also mitigate NVIDIA-centric bias in four ways. First, CUDA-derived samples are treated as seeds, not final AMD supervision: they are translated, compiled, and filtered under ROCm. Second, generated HIP variants are re-optimized and measured on AMD hardware rather than accepted solely for syntactic portability. Third, ROCm Libraries provide expert-written HIP examples from rocBLAS and rocSOLVER, anchoring the dataset in production AMD code. Fourth, Triton samples are refactored and tested for shape generality, stride awareness, and AMD-compatible scheduling assumptions. These checks reduce reliance on NVIDIA-specific warp-size, tensor-core, and tiling assumptions while still preserving useful algorithmic structure from upstream corpora.

Validation Metadata

Validation metadata is subset-dependent. Where available, packaged records include source identifiers, task or reference information, dtype/shape coverage, compiler or runtime status, latency, and speedup relative to the relevant baseline. Some packaged verification fields are empty even when construction-time validation was performed, and rejected-candidate logs were not retained uniformly across pipelines. For ROCm Libraries QA, available provenance can include source paths and interface-level context. We therefore do not claim that every released record contains all fields needed to reconstruct the complete validation trajectory.

Task Serialization and SFT Objective

Each training instance is serialized as an instruction–response pair. The instruction contains the task specification, such as PyTorch reference code, a natural-language Triton prompt, or an input HIP/Triton kernel. The response contains the target kernel implementation, optionally preceded by reasoning annotations for Triton examples.

This helps the model learn tiling choices, masking logic, memory-access patterns, and boundary handling. All SFT runs use full-parameter fine-tuning rather than PEFT/LoRA; in preliminary experiments, parameter-efficient adapters underperformed for this setting because the model has to learn both low-level kernel syntax and agentic self-reflection behavior, and the coupled generation and debugging skills required broader updates than adapter-only training provided.