SynKer: Synthesize, Kernelize, Reinforce - Teaching GPU Kernel Generation to Small Language Models

Qi Sun, Robert Tjarko Lange, Alex L ZhangDL4C @ ICML 2026

TL;DR

This paper introduces SYNKER, a novel framework that generates a large, diverse dataset of synthetic GPU kernel tasks and their verified implementations. By training small language models (SLMs) on this dataset, SYNKER significantly improves their ability to generate correct and efficient GPU kernels, bridging a critical gap in current AI capabilities for hardware optimization.

What Problem Does This Paper Address?

Generating high-performance GPU kernels is a complex task, crucial for optimizing machine learning workloads. While large language models (LLMs) have shown promise in code generation, smaller, more accessible models struggle to produce robust, compilable backend-specific code for GPUs. This limitation stems from a lack of diverse training data that accurately reflects the complexities of real-world kernel development. Existing benchmarks often have loopholes, leading to "reward hacking" rather than genuine capability. SYNKER aims to overcome this by creating a comprehensive, validated synthetic dataset to effectively train SLMs for this specialized domain.

Methods

SYNKER employs a three-stage pipeline:

  1. Synthetic Task Generation: It starts with a single seed task (the Triangular Multiplicative Update from AlphaFold2) and uses an LLM-driven evolutionary process to generate a large, diverse set of natural-language task descriptions. These descriptions are then translated into executable PyTorch task environments, ensuring semantic diversity and avoiding redundancy.
  2. Evolutionary Kernel Optimization: For each generated task, SYNKER uses an evolutionary search (ShinkaEvolve) to translate the PyTorch reference into kernels for CUDA, Triton, and HIP. This process involves generating multiple candidate kernels, compiling and verifying them, and iteratively refining them to improve performance. This stage builds a large archive of approximately 100,000 verified kernels.
  3. Post-Training: The curated dataset of verified kernels is used to fine-tune SLMs (8B, 14B, and 32B parameters) using supervised fine-tuning (SFT) and reinforcement learning (RL). This stage distills the knowledge from the synthetic dataset into the models, enhancing their kernel generation capabilities.

Datasets

  • Training Data: SYNKER generates its own synthetic dataset. This dataset consists of:
  • 2,365 diverse and validated PyTorch task environments.
  • An archive of approximately 100,000 verified kernels across CUDA, Triton, and HIP.
  • Evaluation Data: The paper uses the BackendBench benchmark for evaluating the performance of the fine-tuned models on held-out tasks. This benchmark focuses on kernel correctness rather than just runtime, avoiding common evaluation loopholes.

Key Insights and Ideas

  • Task Diversity is Key: The study strongly suggests that increasing the diversity of synthetic tasks, even with a fixed kernel budget, leads to better generalization and lower validation loss for the trained models. This highlights that breadth of understanding is more critical than sheer volume of similar examples.
  • Cross-Language Training Benefits: Training models on kernels from multiple backends (CUDA, Triton, HIP) simultaneously improves their ability to reason about PyTorch operations independently of specific hardware, leading to better performance.
  • RL Needs a Strong SFT Foundation: Reinforcement learning for kernel generation is most effective when initialized with a model already fine-tuned via SFT on a good dataset. Pure RL from a base model shows limited improvement.
  • Synthetic Data Can Bridge the Gap: SYNKER demonstrates that a carefully constructed synthetic dataset can effectively train smaller, more accessible language models to perform a highly specialized and challenging task like GPU kernel generation.

Key Results

  • SYNKER generated 2,365 diverse synthetic tasks and a corpus of over 100,000 verified kernels.
  • Post-training SLMs (8B, 14B, 32B) on this dataset significantly improved their performance on held-out BackendBench tasks.
  • Task diversity was shown to be a critical factor, with models trained on more diverse tasks exhibiting lower validation loss and better performance.
  • Cross-language training (e.g., CUDA + Triton) further boosted performance, suggesting improved PyTorch-centric reasoning.
  • The fine-tuned models showed improved kernel generation capabilities, with the 8B model surprisingly competitive on Triton syntax even with low task diversity.

Limitations and Future Work

  • Search Budget: The evolutionary search budget (~$0.5 per task) means that complex control flow tasks (like Cluster 8) remain under-solved.
  • Runtime Performance: The current evaluation focuses on correctness (PASS@1) and doesn't directly demonstrate runtime improvements on real workloads.
  • RL Exploratory: The RL component is still experimental, with challenges in stable training due to reward sparsity and hardware dependency.
  • Single Seed Task: All synthetic tasks originate from a single seed task (TriMul from AlphaFold2), potentially biasing the coverage towards scientific computing.
  • Future Work: The authors suggest using the fine-tuned models as proposal policies in the evolutionary search to create a self-improvement loop. Expanding the seed set with more deep-learning primitives, exploring more stable RL techniques, and targeting multi-GPU or distributed kernels are also proposed directions.

Summary updated

BibTeX
@inproceedings{sun2026synker,
  author = {Qi Sun and Robert Tjarko Lange and Alex L Zhang},
  title = {{SynKer: Synthesize, Kernelize, Reinforce - Teaching GPU Kernel Generation to Small Language Models}},
  booktitle = {DL4C @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=oqktWVZOiq},
}
Figure