The fastest code in an AI system usually lives in a few dozen GPU kernels: small, specialized loops that run matrix multiplies, normalizations and attention with maximum efficiency on specific silicon. For most of the deep-learning era those loops were written by hand in CUDA by a small guild of engineers who understood shared memory, warp scheduling and tensor cores at the register level.
That guild now has competition. Between 2021 and 2026 the kernel-authoring layer re-layered itself at least four times: first into a Python-like DSL, then into compiler output, then into an auto-tuned higher-level DSL, and most recently into model-generated code. The comparison between these approaches is no longer philosophical. There are published cross-vendor benchmarks with numbers.
Here is the current stack, lane by lane, and what the benchmarks actually show.
The five lanes

CUDA remains the ground truth. Every other lane ultimately emits instructions that a vendor toolchain can run, and hand-written CUDA still holds the performance ceiling on NVIDIA hardware. Its cost is expertise: OpenAI's own rationale at Triton's launch was that a hand-written cuBLAS-matching matrix-multiply kernel is "something that many GPU programmers cannot do." CUDA also gives you nothing on non-NVIDIA silicon.
Triton is the DSL that started the reshuffle. OpenAI released it in August 2021 as a Python-like language for writing GPU kernels in tiles rather than threads, claiming researchers with no CUDA experience could match cuBLAS matrix-multiply performance in under 25 lines of code, and that its own kernels ran up to 2x faster than equivalent Torch implementations. Five years on, Triton is less a competitor to CUDA than the de facto interchange format underneath everyone else: PyTorch's compiler emits Triton, Helion emits Triton, and the kernel-generating models emit Triton.
torch.compile moved kernel authoring into the compiler. Introduced with PyTorch 2.0 in 2023, it captures Python programs with TorchDynamo and lowers them through TorchInductor, which code-generates fused Triton kernels you never wrote. The PyTorch 2 paper reported geometric-mean speedups of 2.27x for inference and 1.41x for training on an NVIDIA A100 across more than 180 real-world models. The long-standing caveat was fragility: unsupported patterns cause graph breaks that fall back to eager execution. The PyTorch 2.9 release in October 2025 added an error_on_graph_break toggle to make that failure mode auditable, and reported that the TorchBench, Hugging Face and TIMM suites now run faster in torch.compile mode than in eager mode across the board.
Helion is the newest hand-authored lane. Meta released it in late 2025 as a Python-embedded DSL that sits between PyTorch and Triton: you write tile-oriented logic in roughly PyTorch syntax, and the tool generates and auto-tunes hundreds of Triton candidates per kernel on the target GPU. Meta's published benchmark on an NVIDIA B200 put Helion at a 3.27x geomean speedup over eager mode, versus 2.7x for torch.compile with max-autotune and 1.76x for hand-written Triton kernels (largely the Liger suite). In its own example, an attention kernel that takes about 120 lines of Triton takes about 30 lines of Helion. In April 2026 the PyTorch Foundation accepted Helion as a hosted project alongside PyTorch, vLLM, DeepSpeed, Ray and Safetensors, with Triton and TileIR listed as compilation backends.
Generated kernels are the lane that did not exist three years ago. Meta's KernelLLM, an 8B model fine-tuned from Llama 3.1 on roughly 25,000 PyTorch-to-Triton pairs, scored 20.2 pass@1 on KernelBench-Triton in mid-2025, ahead of GPT-4o (15) and DeepSeek V3 (16), with pass@20 of 57.1, meaning fewer than six in ten tasks produce a correct kernel even with twenty tries. Google's AlphaEvolve, which pairs Gemini models with evolutionary search and automated evaluators, found a smarter matrix-partition for a kernel inside Gemini's training that ran 23% faster and cut end-to-end training time by 1%, and up to 32.5% speedups on a FlashAttention GPU kernel. Google also reported a scheduling heuristic that has been recovering about 0.7% of its worldwide compute in production for over a year.
What the cross-vendor benchmark says
The most direct comparison to date comes from Red Hat's Emerging Technologies team, which benchmarked five kernel-authoring backends across four GPUs from two vendors in February 2026: hand-written Triton, TorchInductor (torch.compile), Helion, KernelLLM and the hosted generator Makora Generate. Operators were MatMul, LayerNorm and a fused GEMM+GELU, all in bf16, with 852 test configurations.
The numbers, in brief:
- Correctness is close to solved for the compiler lanes. 850 of 852 configurations passed (99.77%). The only failures came from Helion on very small GEMM+GELU shapes, and every backend hit 100% at production-relevant sizes.
- Compilers beat most experts at default settings. Inductor and Helion consistently matched or exceeded the hand-written Triton baseline on MatMul across all four GPUs, with Inductor peaking at 706 TFLOPS on one data center GPU.
- Helion has the highest ceiling and the widest variance. It hit 1,949 GB/s on LayerNorm on one data center GPU, roughly 60% over Triton, but collapsed to 27 TFLOPS on GEMM+GELU on one consumer GPU where every other backend exceeded 150, a tuning or path-selection bug filed against the project.
- Generated kernels trail unless they get lucky. KernelLLM and Makora generally ran 20-50% behind the auto-tuned approaches on MatMul, consistent with having no tuning loop. On one fused GEMM+GELU case, KernelLLM was actually the best kernel at 215 TFLOPS, a reminder that an LLM can land on an excellent fusion a human did not write.
- Tuning has a bill. Helion's broader search space meant waiting hours for a full benchmark sweep, and its docs flag about 10+ minutes of auto-tuning per kernel and shape. Inductor's max-autotune also adds compilation latency, but Red Hat found it significantly cheaper in wall-clock time to results.
Red Hat's own scorecard ranks torch.compile/Inductor strongest on ease, correctness, performance and portability together; Helion second on raw performance with caveats; hand-written Triton as the expert baseline with a portability problem; and the generation tools as usable but higher-friction, with KernelLLM repeatedly emitting grid mismatches, dtype errors and hard-coded shapes that needed manual fixes.
The portability trap
Every lane's pitch is "write once, runs fast everywhere," and the benchmark data says that is only true of the auto-tuned lanes. Same-source Triton kernels do run on both NVIDIA and AMD, but the tuning that makes them fast is per-device: Red Hat noted the lower-end consumer GPU showed the widest spread between backends, precisely because vendor defaults are least optimized there. Helion's answer is to automate the per-target search, generating hundreds of Triton variants until one is fast on this GPU specifically. The cost of that answer is time, and the occasional silent mis-selection, as its 27 TFLOPS anomaly shows. The compiler lane's equivalent failure mode is silent eager fallback, which is why a toggle that errors on graph breaks matters more in production than any headline speedup.
Generated kernels are now third-party code you never audited
There is a supply-chain wrinkle the benchmarks skip. A kernel emitted by KernelLLM, Makora or an in-house frontier model is unreviewed machine code that will run on your GPUs against your data. Red Hat's companion posts from January and February 2026 describe the direction of travel: caching approved kernels as OCI artifacts so fleets skip re-JITting, and cryptographically signing Triton kernel deployments so a runtime can refuse anything that did not come from a trusted build. Labs that once shipped hand-tuned kernels inside closed binaries are now, in effect, consuming generated kernels from outside. Treat the lane accordingly: benchmark, sign, pin.
Choosing a lane

A defensible reading of the 2026 evidence:
- Default to torch.compile. It is the only backend Red Hat scored strong on all four axes, it needs no new skills, and as of PyTorch 2.9 it beats eager mode on every major open-source model suite.
- Reach for Helion for the kernels that matter, the ones where a 60% memory-bandwidth edge on LayerNorm-style operations pays for the hours of tuning. Budget the tuning time and watch for shape-dependent regressions.
- Hand-written Triton (or CUDA) remains the ceiling for single-vendor hot paths where an expert is available and the answer must be exact. The Red Hat data shows experts' baselines being matched by compilers more often than not, which is exactly why the scarce time should go to the few kernels that still need it.
- Use generated kernels as a search process, not a shipping lane. A 20-57% correctness band and no tuning loop means the output belongs in a candidate pool that a compiler or a human refines, behind signed-kernel infrastructure if your deployment cares where its code comes from.
The honest summary is that the compiler is now the better default kernel author more often than the community's instincts admit, and the interesting open question is not whether models can write Triton. They can. It is whether anyone can tell, cheaply and before deployment, which of the resulting kernels are fast on your hardware and came from somewhere you trust.
Sources
- OpenAI, Introducing Triton: Open-source GPU programming for neural networks (August 2021) - https://openai.com/index/triton/
- Ansel et al., PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph Compilation - https://arxiv.org/abs/2308.12993
- PyTorch, PyTorch 2.x (torch.compile, Dynamo/Inductor) - https://pytorch.org/get-started/pytorch-2-x/
- PyTorch, PyTorch 2.9 Release Blog (October 2025) - https://pytorch.org/blog/pytorch-2-9/
- PyTorch, Helion: A High-Level DSL for Performant and Portable ML Kernels - https://pytorch.org/blog/helion/
- pytorch/helion repository (auto-tuning behavior, ~10 min per kernel) - https://github.com/pytorch/helion
- Linux Foundation press release, PyTorch Foundation Welcomes Helion (April 7, 2026) - https://www.linuxfoundation.org/press/pytorch-foundation-welcomes-helion-as-a-foundation-hosted-project-to-standardize-open-portable-and-accessible-ai-kernel-authoring
- Sangiorgi & Kesem, From hand-tuned to generated: A reproducible Triton GPU kernel benchmark across different vendors, Red Hat Emerging Technologies (February 12, 2026) - https://next.redhat.com/2026-02-12/from-hand-tuned-to-generated-a-reproducible-triton-gpu-kernel-benchmark-across-different-vendors
- Red Hat Emerging Technologies, Protecting Triton kernel deployments with cryptographic signatures (February 5, 2026) - https://next.redhat.com/2026-02-05/protecting-triton-kernel-deployments-with-cryptographic-signatures/
- Red Hat Emerging Technologies, Skip the Jitters: Fast, Trusted Model Kernels with OCI Caching (January 29, 2026) - https://next.redhat.com/2026-01-29/skip-the-jitters-fast-trusted-model-kernels-with-oci-caching/
- facebook/KernelLLM model card and KernelBench-Triton results (May 2025) - https://huggingface.co/facebook/KernelLLM
- Google DeepMind, AlphaEvolve: A Gemini-powered coding agent for designing advanced algorithms (May 2025) - https://deepmind.google/blog/alphaevolve-a-gemini-powered-coding-agent-for-designing-advanced-algorithms
- KernelGeneration benchmark repository - https://github.com/LironKesem/KernelGeneration
