IX. Kernels & GPU Programming
The GPU code underneath the engines.
49 entries · 5 subsections
Editor’s pick
IX.1 Kernel Libraries 16
FlashAttention Library
IO-aware exact attention kernels; FA3 targets Hopper and FA4, written in CuTe DSL, targets Blackwell.
FlashInfer Library
Attention, sampling, MoE, and GEMM kernels built for LLM serving, with JIT-compiled variants used as backends by vLLM and SGLang.
CUTLASS Library
NVIDIA's C++ templates and CuTe layout abstractions for GEMM-class kernels, plus the Python CuTe DSL, from Ampere through Blackwell.
DeepGEMM Library
DeepSeek's JIT-compiled tensor-core kernels for FP8, FP4, and BF16 GEMMs, grouped MoE GEMMs, and MoE fused with communication.
FlashMLA Library
DeepSeek's sparse and dense MLA attention kernels with FP8 or FP4 KV cache, for Blackwell GPUs and Ascend NPUs (Hopper in older releases).
Transformer Engine Library
Transformer layers and scaling recipes for FP8, MXFP8, and NVFP4 execution on Hopper and Blackwell, with PyTorch and JAX bindings.
ThunderKittens Library
Tile primitives embedded in CUDA C++ for writing attention and GEMM kernels; version 2.0 adds Blackwell, MXFP8, and NVFP4 support.
QuACK Library
Norm, softmax, cross-entropy, and GEMM-with-epilogue kernels written in CuTe DSL by the FlashAttention authors, for Hopper and Blackwell.
AITER Library
AMD's operator library for inference and training on ROCm, combining Triton, Composable Kernel, and hand-written assembly backends.
Composable Kernel Library
AMD's C++ templates for tiled GEMM, attention, and fused operators on Instinct GPUs; the source now lives in the rocm-libraries monorepo.
HipKittens Library
ThunderKittens-style tile primitives for AMD CDNA 3 and CDNA 4 GPUs, also shipped as a kernel backend inside AITER.
SageAttention Library
Quantized attention kernels (INT8 QK, FP8 PV, FP4 on Blackwell) that replace FlashAttention without retraining, common in video diffusion.
Kernels (Hugging Face) Library
Loader and build tooling that fetches precompiled, version-pinned compute kernels from the Hugging Face Hub at runtime.
TileKernels Library
DeepSeek's TileLang kernels for MoE routing, FP8 and FP4 quantization, Engram gating, and hyper-connections on NVIDIA GPUs and Ascend NPUs.
DeepSelect Library
Top-k selection kernels for the lightning indexer in DeepSeek Sparse Attention and for token samplers, on CUDA and Ascend.
Marlin Library
Reference FP16xINT4 mixed-precision GEMM kernel for small-batch decoding; maintained Marlin variants now ship inside vLLM.
IX.2 Kernel Languages & DSLs 13
Triton Tool
Python-embedded language and compiler for writing tiled GPU kernels, with Gluon as a lower-level layer.
NVIDIA's normative reference for the CUDA execution model, memory hierarchy, C++ language extensions, and per-architecture features.
PTX ISA Spec
Specification of NVIDIA's virtual instruction set and memory model, including async-copy, TMA, wgmma, and tcgen05 instructions.
CUDA C++ Best Practices Guide Docs
Official optimization workflow for CUDA C++ covering memory coalescing, shared memory, occupancy, and the assess-parallelize-optimize cycle.
CuTe DSL Docs
Python DSL exposing CUTLASS's CuTe layouts and tensor-core atoms with JIT compilation; FlashAttention-4 and QuACK are written in it.
Triton Tutorials Docs
Official worked kernels from vector add through fused softmax, grouped matmul, fused attention, persistent and block-scaled matmul.
Gluon Docs
Lower-level Triton programming model that makes layouts, warp specialization, and target-specific features explicit to the kernel author.
cuTile Python Tool
NVIDIA's tile-level Python kernel language, compiled through the MLIR-based CUDA Tile IR rather than written as per-thread SIMT code.
TileLang Tool
Python tile DSL built on TVM for writing GPU and accelerator kernels with explicit pipelining, used by DeepSeek's TileKernels.
Helion Tool
PyTorch-native kernel DSL that lowers tiled Python code to Triton and autotunes across many implementation choices.
Pallas Docs
JAX extension for writing custom kernels that lower through Mosaic on TPUs and through Triton or Mosaic GPU on NVIDIA GPUs.
NKI (Neuron Kernel Interface) Docs
Tile-level Python kernel language for AWS Trainium and Inferentia NeuronCores with explicit control over on-chip memory and engines.
Mojo GPU Programming Docs
Guide to writing GPU kernels in Mojo, a Python-syntax systems language that targets NVIDIA, AMD, and Apple GPUs from one codebase.
IX.3 Megakernels & Superoptimizers 4
Mirage Persistent Kernel (MPK) Tool
Compiler and runtime that turns a multi-GPU LLM forward pass into one persistent megakernel with SM-level task scheduling.
Mirage: A Multi-Level Superoptimizer for Tensor Programs Paper
Searches kernel, thread-block, and thread-level program transformations to discover fused GPU kernels that hand-written rules miss.
Megakernels (Hazy Research) Tool
ThunderKittens-based research megakernels that run a full Llama forward pass in a single launch to eliminate kernel-boundary stalls.
TileRT Tool
Tile-level runtime that splits LLM operators into fine-grained tasks and overlaps compute, I/O, and communication for low-latency decoding.
IX.4 Collective Communication 10
NCCL Library
NVIDIA's collective and point-to-point communication library over NVLink, PCIe, InfiniBand, and RoCE; the default PyTorch GPU backend.
NCCL Device API Docs
Docs for NCCL's device-side API, which lets kernels issue communication over NVLink load/store, multicast, and GPU-initiated RDMA.
NVSHMEM Library
OpenSHMEM-style global address space for NVIDIA GPUs with one-sided puts, gets, atomics, and signals issued from inside kernels.
DeepEP Library
Expert-parallel dispatch and combine kernels with high-throughput NVLink/RDMA modes for prefill and low-latency modes for decoding.
RCCL Library
AMD's NCCL-compatible collective library for Instinct GPUs over Infinity Fabric and RDMA; its source now lives in the rocm-systems monorepo.
UCCL Library
GPU communication library with an NCCL/RCCL-compatible collective layer, P2P transfers for KV cache and weights, and GPU-driven EP.
pplx-garden Library
Perplexity's RDMA transfer engine and point-to-point MoE dispatch/combine kernels for ConnectX and AWS EFA; supersedes pplx-kernels.
MoonEP Library
Expert-parallel communication library that equalizes per-rank token load by planning redundant experts online from router outputs.
Triton-distributed Tool
Triton extended with communication primitives for writing kernels that overlap computation with intra- and inter-node transfers.
MSCCL++ Library
GPU-driven communication stack with one-sided put, get, and signal primitives over NVLink, xGMI, and InfiniBand for custom collectives.
IX.5 AI-Generated Kernels & Kernel Benchmarks 6
KernelBench Benchmark
Stanford benchmark of PyTorch operators and models that LLMs must rewrite as correct, faster GPU kernels; introduced at ICML 2025.
KernelBench-Verified Paper
Shows how reward hacking inflates KernelBench speedups and adds TF32 baselines, hidden multi-distribution tests, and memory metrics.
FlashInfer-Bench Benchmark
Kernel tasks and workloads captured from LLM serving, with tooling to swap verified AI-written kernels into SGLang and vLLM.
SOL-ExecBench Benchmark
Scores AI-written kernels in several DSLs against an analytical B200 speed-of-light bound, with correctness and reward-hack checks.
KernelGuard Paper
Integrity layer of static rules, physics-floor timing checks, and an LLM judge that catches reward-hacked submissions in kernel competitions.
TritonBench Benchmark
Operator benchmark suite that times Triton kernels against PyTorch eager, vendor libraries, and other baselines on standard inputs.