[ { "name": "activation-recompute-fusion", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 2356.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "activation-checkpointing", "recompute", "swiglu", "mlp", "backward", "training", "post-training", "gemm", "fusion" ], "description": "Activation checkpointing saves the block's input and throws the intermediates away, so the backward of a SwiGLU MLP has to rebuild the gate and up projections before it can differentiate through them. Autograd does that as a separate recompute graph: two GEMMs that write a pair of (tokens x intermediate) tensors to HBM, three elementwise kernels that read them back, then two more GEMMs. One kernel keeps the recomputed tile in registers and never lets it reach memory." }, { "name": "adafactor-factored-update", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 520.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "adafactor", "optimizer", "training", "post-training", "memory-bound", "reduction", "fine-tuning" ], "description": "Adafactor is what you reach for when the second moment will not fit: instead of one accumulator per parameter it keeps a row vector and a column vector and reconstructs the moment as their outer product. That turns a trivially elementwise optimiser into a three-phase kernel \u2014 a row AND column reduction over the whole gradient, then a global RMS of the update it implies, then the apply \u2014 with two batch-wide barriers no element can cross. Every phase re-reads a half-gigabyte gradient." }, { "name": "adaptive-sparsity-threshold", "family": "Video \u2014 sparse / efficient attention", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 359.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sparse-attention", "video-diffusion", "block-mask", "bitmap", "dilation", "hunyuanvideo", "wan", "mask-build" ], "description": "Every run-time sparse video attention scheme has to turn a tile-level score estimate into the actual bitmap the attention kernel consumes, and a fixed top-k is the wrong tool: heads differ wildly in how concentrated they are, so the budget has to ADAPT. The rule that survives is per-row and relative \u2014 keep every tile within `delta` logits of the row's best \u2014 followed by a 3D DILATION, because a pooled estimate is coarse and the real mass straddles tile boundaries. One pass over a multi-gigabyte score map, out comes a packed bitmap, per-row counts and the per-head density the scheduler needs." }, { "name": "alibi-slopes-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "alibi", "positional-bias", "flash-attention" ], "description": "ALiBi (Attention with Linear Biases) replaces positional embeddings with a bias on the attention logits: each head subtracts its own slope times the query-key distance, so distant keys are penalised at a learned per-head rate. It is still shipped in production models (BLOOM, MPT, Jamba-class hybrids) because it extrapolates past the trained context. The bias is defined over the whole T-by-T grid, so a fast kernel has to synthesise it inside a flash-attention-style tiled loop rather than materialise it." }, { "name": "altup-predict-step", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "GB/s", "roofline_us": 651.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "altup", "alternating-updates", "gemma", "residual", "memory-bound", "router" ], "description": "AltUp \u2014 Alternating Updates \u2014 widens a transformer without paying for the width: the model carries n copies of the residual stream, but each block is executed on only ONE of them and the other n-1 are advanced by a cheap learned mixing. The mixing coefficients are predicted per token from the active stream by a tiny router, so the step is an RMS reduction and two sub-kilobyte matmuls followed by an n x n linear combination applied to the entire n-stream activation volume. It runs once per block and touches n times the usual amount of activation." }, { "name": "any-res-image-split", "family": "Multimodal & audio", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 336.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "vision-language", "anyres", "preprocessing", "tiling", "multimodal", "memory-bound" ], "description": "High-resolution VLMs (LLaVA-NeXT, InternVL, MiniCPM-V) do not resize a 1344x1344 document down to 336x336 \u2014 they cut it into a grid of ViT-sized tiles and add one downscaled thumbnail for global context. The preprocessing kernel reads raw channel-last uint8 pixels, normalises them, transposes to channel-first, scatters them into per-tile buffers and area-pools the thumbnail. On a batch of document pages it moves gigabytes and it sits directly in the request latency." }, { "name": "async-weight-prefetch-pipeline", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "async-copy", "tma", "double-buffering", "prefetch", "memory-bound", "gemv" ], "description": "The single biggest lever inside any megakernel is having the next layer's weights already in flight while the current layer's math runs. This task isolates it: 32 strictly sequential 6144x6144 matvecs, no weight reused, no arithmetic to hide behind, all in one kernel. Graded on achieved GB/s, which here is exactly a measure of how deep your load pipeline is." }, { "name": "attention-lse-merge", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 1057.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "flash-decoding", "split-k", "log-sum-exp", "merge-state", "memory-bound", "reduction" ], "description": "The second half of every flash-decoding kernel and of every cascade/chunked attention pipeline: K blocks each attended over their own slice of the keys and produced a PARTIAL attention state \u2014 a normalised partial output plus its log-sum-exp \u2014 and those partials have to be folded into the single answer the unsplit softmax would have produced. It is a pure reduction over the split axis with no matmul at all, so it is entirely BANDWIDTH bound: the score is achieved GB/s against the partials that must be read once and the merged state that must be written once." }, { "name": "attention-qk-norm-inline", "family": "Normalization, RoPE & elementwise fusion", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "qk-norm", "rmsnorm", "qwen3", "gemma", "fusion", "flash-attention" ], "description": "Qwen3, Gemma-3, Chameleon and OLMo-2 RMS-normalise every attention head of q and k \u2014 with their own learned per-head gains \u2014 before the dot product, because it is what keeps attention logits from exploding at scale. Doing it as a separate torch op costs two extra round trips of q and k through HBM and a second kernel launch; doing it INSIDE the attention mainloop costs nothing extra, because the tile is already in registers. The catch is that a key tile is visited by many query tiles, so where you put the normalisation decides whether you pay for it once or many times." }, { "name": "attention-sink-decode", "family": "KV cache & paging", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "GB/s", "roofline_us": 416.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "attention-sink", "sliding-window", "decode", "kv-cache", "gpt-oss", "memory-bound", "flash-decoding" ], "description": "The decode step of the attention pattern gpt-oss ships (2025): one new query token per request attending over only the last W positions of its KV cache, plus a learned per-head ATTENTION SINK \u2014 an extra logit that joins the softmax denominator but contributes no value. It is a pure BANDWIDTH kernel scored in GB/s, and the credited bytes are the WINDOW only, so a kernel that streams the whole cache is scored against traffic it never needed to move." }, { "name": "attn-density-profile-fused", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 1057.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "calibration", "profiling", "sparse-videogen", "hunyuanvideo", "online-softmax" ], "description": "Before a video DiT can be run sparse, something has to decide which pattern each head can tolerate, and the only honest way to know is to measure: what FRACTION of each head's attention mass falls inside the same-frame pattern, inside the same-spatial-position temporal comb, and inside a local 3D window. That is a full dense score pass whose output is three numbers per head \u2014 no value matmul, no attention output, just a masked mass accumulated against the true softmax denominator, and it must be a SINGLE pass or it costs twice what it should." }, { "name": "audio-codec-rvq-quantize", "family": "Multimodal & audio", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 431.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "audio", "codec", "rvq", "vector-quantisation", "encodec", "speech", "compute-bound" ], "description": "Neural audio codecs (EnCodec, DAC, Mimi, SNAC) \u2014 the tokenisers under every speech LM and TTS system \u2014 compress each latent frame with a CHAIN of vector quantisers: find the nearest entry in codebook 0, subtract it, find the nearest in codebook 1, subtract, and so on. Each stage is a (frames x dim) by (dim x codebook) distance GEMM followed by an argmin, and the stages are strictly sequential, so the residual has to stay resident while eight to sixteen of them run." }, { "name": "audio-mel-spectrogram-fused", "family": "Multimodal & audio", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 315.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "audio", "whisper", "asr", "mel-spectrogram", "reduction", "memory-bound" ], "description": "Between the FFT and the encoder, every ASR request runs the same chain: power spectrum, mel filterbank projection, log10, and a per-clip dynamic-range clamp that depends on the maximum of the whole clip. The complex STFT of a batch of 30-second clips is well over a gigabyte, the filterbank collapses it 1.6x, and the clamp forces a second pass \u2014 so the naive version writes and re-reads four full-size temporaries for what should be one streaming kernel with a reduction in the middle." }, { "name": "awq-dequant-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int4", "awq", "quantization", "gemm", "low-precision", "w4a16" ], "description": "AWQ is one of the two 4-bit weight formats the open-weight ecosystem actually ships. Eight codes are packed into each int32 along the OUTPUT axis, in a deliberately interleaved order that lets a kernel unpack a whole word into eight halves with shifts and no byte permutes \u2014 and both the scales and the zero-points are per 128-element group along K. Get the interleave wrong and the output columns come out shuffled; expand the weights to bf16 in HBM first and the 4 bits bought you nothing." }, { "name": "based-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 533.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "based", "taylor", "backward", "linear-attention", "feature-map" ], "description": "The training-side counterpart of Based: softmax replaced by its 2nd-order Taylor expansion, 1 + s + s^2/2, which is exactly a dot product of the feature map [1, x, x (x) x / sqrt(2)] \u2014 a linear attention over 1 + K + K^2 features plus a running normaliser. The backward has to differentiate through BOTH the huge (P, V) state and the quotient by that normaliser, and the reference does it by replaying the whole chunked graph under autograd." }, { "name": "based-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 480.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "based", "taylor", "linear-attention", "feature-map", "gpu" ], "description": "Based replaces softmax with its 2nd-order Taylor expansion, 1 + s + s^2/2. That polynomial is exactly a dot product of the feature map [1, x, x (x) x / sqrt(2)], so the whole layer is a linear attention over a feature dimension of 1 + K + K^2 \u2014 a state hundreds of times larger than the head dimension, plus a running normaliser that has to be carried alongside it." }, { "name": "beam-search-step", "family": "Sampling & speculative decoding", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 416.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "beam-search", "top-k", "decoding", "sampling", "large-vocab", "memory-bound" ], "description": "Every decode step of a beam-search request has to pick the best W continuations out of the whole W-by-V grid of (existing beam, next token) pairs, ranked by cumulative log-probability. With W = 4..16 beams and a 128k-256k vocabulary that is a two-million-entry top-k per sequence, per step, and it sits directly on the latency path of every summarisation and translation request that still uses beams." }, { "name": "block-sparse-video-attn", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 1346.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "block-sparse", "video-diffusion", "mm-dit", "hunyuanvideo", "bitmap-mask", "cross-modal", "flash-attention" ], "description": "What a video DiT block actually attends over: one joint sequence of ~10^5 VIDEO latent tokens followed by a few hundred TEXT tokens, with the video-video quadrant made sparse by a per-head 3D-tile BITMAP produced upstream, while the text stream stays fully dense in both directions. The kernel has to consume a bit-per-tile mask instead of an index list, gather 3D tiles out of a raster-ordered sequence, and fold the dense cross-modal block into the same online softmax." }, { "name": "blockwise-fp8-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "compilation", "kernels", "fp8", "gemm", "blockwise", "low-precision", "gpu", "cuda", "cutlass" ], "description": "Write a fast blockwise-FP8 GEMM: given FP8 (e4m3) activations/weights with DeepSeek-style block scaling (per-token 1x128 for A, per-128x128 block for B), produce a kernel that matches an fp32 dequant reference AND is faster than a bfloat16 cuBLAS matmul. Requires FP8 tensor cores (Triton insufficient -> CUDA/CuTe DSL). Graded on correctness (gate) + a continuous speedup score over bf16 cuBLAS, rising to a state-of-the-art FP8 kernel, on GPU." }, { "name": "cache-hit-skip-gate", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 593.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "caching", "block-cache", "video-generation", "memory-bound" ], "description": "Token-block caching in video diffusion decides hit-or-miss per TOKEN BLOCK, not per request: the static background of a clip can reuse its cached residual for many steps while the moving region is recomputed every step. The gate kernel walks the hidden states with that per-block boolean, reconstructing hit blocks from the cache and refreshing missed ones \u2014 and the whole point is that a hit block never has to touch the freshly computed tensor and a missed block never has to touch the cache, so the traffic is one stream lower than the naive select." }, { "name": "cascade-prefix-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kernels", "cascade", "prefix-caching", "attention", "lse-merge", "triton", "gpu" ], "description": "Write a fast shared-prefix (cascade) attention kernel \u2014 the attention pattern behind prefix caching in LLM serving. A batch of requests shares one long KV prefix (P 16k-32k) and each has a short suffix; the naive path streams the shared prefix across HBM once PER REQUEST. The fast path attends all queries against the single prefix once, attends each suffix separately, and combines the two partial softmaxes via a log-sum-exp merge. Gated on correctness vs the bf16 reference (relerr 2e-2, checked at the timed configs too); scored on ACHIEVED TFLOP/s (geomean over undisclosed configs, uncapped speed leaderboard, 0 if wrong). No attention library is installed and there is no internet, so the kernel (which must emit its own LSE) is the agent's own." }, { "name": "causal-conv1d-decode-step", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 625.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv1d", "mamba", "qwen3-next", "decode", "memory-bound" ], "description": "At every generated token, a Mamba-2 / Qwen3-Next block advances a short depthwise causal convolution by ONE position: read the rolling window state, produce one output, shift the state. Batched over hundreds of concurrent sequences this is pure bandwidth on the conv state, and it runs once per layer per token \u2014 a different kernel shape entirely from the prefill convolution." }, { "name": "causal-conv1d-fused", "family": "Linear attention & SSM", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 833.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv1d", "mamba", "qwen3-next", "depthwise", "memory-bound" ], "description": "Mamba-2, Qwen3-Next and every other SSM/linear-attention block puts a short depthwise causal convolution (width 4) plus a SiLU in front of the recurrent core. It is pure bandwidth \u2014 a 4-tap filter per channel \u2014 so the only thing that matters is reading the activations once and writing them once, with the taps and the activation fused in." }, { "name": "causal-conv3d-backward", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 728.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "backward", "video", "vae", "wan", "hunyuanvideo", "training", "tokenizer" ], "description": "Training or fine-tuning a Wan / HunyuanVideo 3D tokenizer means running the causal Conv3d backward pass over the same enormous video activations as the forward \u2014 twice the FLOPs, and with the one-sided temporal padding turned inside out: the data gradient correlates with a time-REVERSED kernel, so its padding is one-sided in the opposite direction. Getting that inversion right is the whole difficulty, and the weight gradient is a 27-way reduction over every voxel in the clip." }, { "name": "causal-conv3d-cache-step", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 465.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "streaming", "cache", "video", "vae", "wan", "hunyuanvideo", "decode" ], "description": "A 720p x 129-frame decode does not fit in memory as one tensor, so Wan and HunyuanVideo decode the clip in short chunks of frames and carry a per-layer feat_cache holding the last two input frames. Each step conditions on that cache instead of on zero padding, emits the chunk's outputs, and hands the last two frames forward. Chunks are only one to a few frames deep but full pixel resolution, so the kernel is short-and-wide: a two-frame halo dominates the traffic and the arithmetic has almost no temporal reuse to hide behind." }, { "name": "causal-conv3d-forward", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 533.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "video", "vae", "wan", "hunyuanvideo", "tokenizer", "diffusion" ], "description": "Every layer of the Wan and HunyuanVideo 3D video tokenizers is a CAUSAL Conv3d: a 3x3x3 convolution whose temporal padding is entirely one-sided, so a frame can only ever see itself and the frames before it. That one-sided pad is what lets the tokenizer stream, and it is the single most expensive operator in the whole decoder \u2014 at 720p the activations are hundreds of megabytes per layer and cuDNN's NCDHW 3D kernels leave a lot of the machine on the table." }, { "name": "causal-conv3d-fp8", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 640.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "fp8", "video", "vae", "wan", "hunyuanvideo", "quantization", "low-precision" ], "description": "Decoding 129 frames of 720p through a 3D video tokenizer is limited as much by activation bandwidth as by math, so production video pipelines run the causal Conv3d with FP8 e4m3 activations and weights: half the bytes moved and double the tensor-core rate. The inputs arrive already quantised \u2014 a per-tensor activation scale and a per-output-channel weight scale \u2014 and the kernel must accumulate the raw FP8 products in fp32 and apply the scales in the epilogue, all while keeping the one-sided temporal padding that makes the tokenizer causal." }, { "name": "causal-video-kv-cache-decode", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 2503.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "video-diffusion", "causvid", "self-forcing", "kv-cache", "paged-attention", "autoregressive-video", "block-causal" ], "description": "Autoregressive video generation (CausVid, self-forcing) does not decode a token at a time \u2014 it decodes a CHUNK OF FRAMES at a time. The new chunk's ~5k tokens attend bidirectionally to each other and causally to every frame already generated, and the cache is paged at FRAME granularity, so the keys arrive through a per-request frame table with a different number of cached frames per request. A prefill-shaped query block against a paged, ragged, frame-indexed KV cache." }, { "name": "cfg-distill-single-pass", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 494.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "cfg", "guidance-rescale", "video-generation", "reduction", "memory-bound" ], "description": "Classifier-free guidance combines the conditional and unconditional model outputs, and every serious video pipeline follows it with the guidance RESCALE fix \u2014 renormalising the guided prediction back to the conditional branch's standard deviation, because high guidance scales otherwise over-expose the sample. That makes the operation a per-sample reduction over hundreds of megabytes followed by a second scaling pass, and it runs twice per denoising step. Fusing the whole thing into one kernel launch is the difference between free and expensive." }, { "name": "chunked-prefill-attention", "family": "KV cache & paging", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 520.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "chunked-prefill", "kv-cache", "serving", "flash-attention", "vllm" ], "description": "The attention shape that modern serving engines actually run: a long prompt is prefilled a CHUNK at a time, so a block of new query tokens attends to everything already in that request's KV cache \u2014 unmasked, and a different length for every request in the batch \u2014 plus to its own chunk, causally. Two mask regimes in one softmax over a padded cache buffer, which is exactly the structure a flash-style kernel has to exploit rather than materialise." }, { "name": "chunked-prefill-gather", "family": "Attention \u2014 text LLM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 472.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "chunked-prefill", "varlen", "cu-seqlens", "gather", "packing", "memory-bound" ], "description": "A chunked-prefill scheduler hands the attention kernel a batch whose query tokens and KV context are scattered in pieces all over the staging buffers \u2014 a sequence's context is whatever chunks were written on earlier steps, wherever there was room. Before FlashAttention can run, all of it has to be gathered into one packed varlen buffer with the cu_seqlens that delimit it. It is the largest pure data movement in a prefill step." }, { "name": "chunked-zloss-cross-entropy", "family": "Training, optimizer & RL", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 113092.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "cross-entropy", "z-loss", "lm-head", "large-vocab", "training" ], "description": "Large-vocabulary LM training regularises the log-partition function with an auxiliary z-loss \u2014 `z_coef * logsumexp(logits)^2` \u2014 which keeps the softmax normaliser from drifting and is what makes bf16 training of a 200k-token vocabulary stable. It costs almost nothing in flops and everything in structure: the term couples the loss AND the gradients to the log-sum-exp of a row that is far too wide to keep, so the whole computation has to be tiled over the vocabulary while carrying a running maximum, and the logits are never written down." }, { "name": "clip-logit-scale-fused", "family": "Multimodal & audio", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "clip", "siglip", "contrastive", "gemm", "multimodal", "compute-bound" ], "description": "Contrastive training and large-scale retrieval both end in the same operation: L2-normalise every image embedding and every text embedding, multiply the two matrices, scale by the learned temperature and add the SigLIP bias. With tens of thousands of items per batch the logit matrix is half a gigabyte and the GEMM is half a TFLOP, but the naive version normalises into two full temporaries first and then hands cuBLAS a plain matmul \u2014 the normalisation belongs in the GEMM's prologue." }, { "name": "cogvideox-expert-adaln-block", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "GB/s", "roofline_us": 419.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "cogvideox", "video-diffusion", "mmdit", "expert-adaln", "layernorm", "modulation", "diffusion-transformer", "memory-bound" ], "description": "CogVideoX's MMDiT keeps the text and the video tokens in ONE buffer and runs ONE attention over them, but it refuses to let them share a modulation: a single Linear fans the timestep vector out to six chunks, the first three modulate the video tokens and the last three the text tokens, and only the LayerNorm's affine weights are shared. So the kernel normalises a 100k-token x 3072-channel activation and then applies a DIFFERENT shift/scale on either side of a boundary that sits at token 226 \u2014 nowhere near a tile edge. It runs twice per block, 42 blocks deep, on both classifier-free-guidance branches, every denoising step." }, { "name": "cogvideox-joint-3d-attention", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 5546.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "cogvideox", "video-diffusion", "mmdit", "joint-attention", "flash-attention", "rope", "3d-rope", "diffusion-transformer", "video-generation" ], "description": "CogVideoX runs ONE full bidirectional attention over the concatenation of the 226 prompt tokens and every video latent token \u2014 no cross-attention, no windowing, no sparsity. The twist is the position embedding: the 3-D rotary embedding is applied ONLY to the video segment, because the text tokens have no place in the (frame, height, width) grid, so q and k are rotated from token 226 onward and passed through untouched before it. Done as written that is a separate rotation pass over two ~10^5 x 3072 tensors before attention even starts." }, { "name": "cogvideox-shared-ffn-expert-gate", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 3883.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "cogvideox", "video-diffusion", "mmdit", "ffn", "gelu", "gemm", "fusion", "gated-residual", "diffusion-transformer" ], "description": "CogVideoX gives the text and video streams separate normalisation experts but makes them share ONE feed-forward network: a single 4x-wide MLP runs over the whole concatenated [text | video] sequence, and only on the way back into the residual does the sequence split again, each half scaled by its own adaLN-zero gate. So it is two GEMMs over ~10^5 tokens with a tanh-GELU between them and an epilogue whose scaling vector changes at token 226. Written as separate ops the 4D-wide hidden state is a multi-gigabyte round trip through HBM per block, 42 blocks per step." }, { "name": "cogvideox-sincos-3d-embed", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 419.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "cogvideox", "video-diffusion", "position-embedding", "sincos", "patch-embed", "diffusion-transformer", "video-generation", "memory-bound" ], "description": "CogVideoX does not use a rotary embedding for its patch embedding \u2014 it ADDS a fixed sinusoidal one, factorised as a 2-D spatial embedding over (height, width) concatenated with a 1-D temporal embedding over frames. Because it is additive, the reference implementation builds the whole (frames x height x width, 3072) fp32 table and adds it, which at 1360x768x81 is a gigabyte of tensor that exists only to be added once and thrown away. The information in it is three tiny per-axis tables; a good kernel never materialises the product." }, { "name": "cogvideox-vae-spatial-norm3d", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "GB/s", "roofline_us": 511.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "cogvideox", "vae", "video-diffusion", "groupnorm", "spatial-norm", "3d", "upsample", "decoder", "memory-bound" ], "description": "CogVideoX's 4x8x8 causal VAE decoder does not use a plain GroupNorm. Every normalisation in the decoder is conditioned on the LATENT itself: the latent volume is nearest-upsampled to the current decoder resolution, pushed through two 1x1x1 convolutions to produce a per-voxel scale and shift, and those modulate the GroupNorm output. So one kernel has to do a whole-volume group reduction, a strided nearest-neighbour gather with a causal first-frame exception, and a 16-to-256 channel matvec per voxel \u2014 over an activation that is a gigabyte and a half at 720p." }, { "name": "comba-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "comba", "linear-attention", "delta-rule", "backward", "gpu" ], "description": "The training-side counterpart of Comba (2025): the gated delta rule with a DECOUPLED read key \u2014 the state correction is read with `p` while the write still uses `k`, so the within-chunk transform is not the symmetric one DeltaNet's WY trick relies on, and neither is its transpose in the backward. The reference obtains the six gradients by running the chunked fp32 forward under autograd, including the triangular solve; a fused backward recomputes the chunk transform instead and carries the reverse state scan in registers." }, { "name": "comba-decode-step", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 473.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "comba", "decode", "linear-attention", "delta-rule", "memory-bound", "gpu" ], "description": "This is what a Comba layer runs at every generated token: ONE gated delta-rule recurrent step with a DECOUPLED read key \u2014 the state correction is read with p while the write still uses k \u2014 applied to every sequence in the decode batch at once. No chunking and no WY transform: it is a pure bandwidth problem over the (K, V) recurrent state, which for a large decode batch is a gigabyte of HBM traffic per layer per token." }, { "name": "comba-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 220.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "comba", "linear-attention", "delta-rule", "gpu" ], "description": "Comba is a 2025 linear-attention layer: the gated delta rule with a DECOUPLED read key \u2014 the state correction is read with a separate vector p while the write still uses k, so the within-chunk transform is no longer the symmetric one DeltaNet's WY trick relies on." }, { "name": "compressed-kv-video-attn", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 1187.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "video-diffusion", "kv-compression", "long-video", "temporal-pooling", "hunyuanvideo", "wan", "streaming" ], "description": "A minute-long generated clip cannot keep every frame's KV, and dropping the old ones loses the scene. What survives in practice is TEMPORAL compression: frames are grouped, the groups near the query stay at full resolution, and every distant group collapses into a single summary frame \u2014 one averaged key and value per SPATIAL POSITION, so the summary still knows where things are. The pooling is a stride-S reduction across frames, the two key regions have different lengths for every query group, and a log-count bonus keeps the collapsed mass honest." }, { "name": "conformer-conv-module", "family": "Multimodal & audio", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 871.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "audio", "asr", "conformer", "speech", "depthwise-conv", "glu", "fused-block", "compute-bound" ], "description": "Every speech encoder in production \u2014 Conformer, Zipformer, the Whisper-sized ASR models that replaced the plain transformer block \u2014 carries a convolution module next to its attention: layer-norm, a pointwise projection to 2C with a GLU gate, a wide depthwise convolution along time, a frozen batch-norm affine, SiLU, a second pointwise projection, and a residual add. It is two GEMMs with a stencil wedged between them, and eager PyTorch runs it as eight kernels with a transpose on either side of the depthwise conv." }, { "name": "conv3d-layout-transform", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 358.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "layout", "transpose", "ndhwc", "conv3d", "video", "vae", "memory-bound", "channels-last" ], "description": "Every fast 3D convolution wants NDHWC \u2014 the reduction axis contiguous, channels padded up to the tensor-core alignment \u2014 while PyTorch hands you NCDHW. In a video VAE that repack runs twice per layer on activations of hundreds of megabytes, and the two directions are not symmetric: going in you pad the channel axis with zeros, coming out you drop the padding. It is the least glamorous kernel in the decoder and often several percent of the wall clock, because a naive permute-and-copy strides through memory in exactly the wrong order." }, { "name": "conv3d-tiled-decode-blend", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 943.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "tiling", "blending", "feather", "video", "vae", "decode", "wan", "hunyuanvideo" ], "description": "Tiled VAE decoding does not just slice the activation \u2014 each tile is convolved as if it were a standalone image, against its OWN zero padding at the tile borders. That is what makes tiling cheap and what makes the seams: the tile-local padding gives different answers near the borders than a whole-image convolution would. Production decoders hide it by overlapping the tiles and blending them with a feathered ramp. This kernel is the whole stage: the per-tile convolution, the tile-local padding, and the weighted accumulation, all at once." }, { "name": "cross-attention-varlen", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 571.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "cross-attention", "encoder-decoder", "varlen", "packed", "cu-seqlens", "whisper", "ragged" ], "description": "Cross attention is where every encoder-decoder model (Whisper, T5, NMT, diffusion text-conditioning) spends its attention budget: decoder queries attend over the encoder's output, so the query sequence and the key sequence are DIFFERENT lengths and neither is causal. Batched for real, both sides are packed into flat buffers with their OWN cu_seqlens arrays, so sequence s reads a query run and a key run whose lengths are unrelated \u2014 a rectangular, ragged, load-imbalanced tile problem rather than the triangular one every flash-attention tutorial solves." }, { "name": "cross-layer-fusion-2layer", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "cross-layer-fusion", "grid-sync", "decode", "gqa", "memory-bound" ], "description": "Fusing inside a layer is a known technique. Fusing ACROSS one is the thing that turns a fast layer kernel into a megakernel: the residual stream must survive the transition without touching HBM, and layer 2's weights must already be in flight while layer 1's attention is still running. The gates are set so that one-kernel-per-layer fails, which leaves exactly one legal shape: two layers, one launch, a barrier in between." }, { "name": "ddim-inversion-step", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 593.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "ddim", "inversion", "editing", "video-generation", "memory-bound" ], "description": "Video and image EDITING pipelines run the diffusion ODE backwards first: DDIM inversion walks a real clip from clean latents up to noise, recording the epsilon it passed through so the forward pass can re-inject it. Each step converts a v-prediction to epsilon, forms the clean-latent estimate, and re-noises to the next timestep with alphas gathered per sample from the 1000-entry training schedule. Inversion is run in fp32 because the trajectory has to be retraced, so every element costs four bytes and the kernel is pure bandwidth." }, { "name": "deepseek-mla-lowrank-proj", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 1237.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mla", "deepseek", "latent-attention", "low-rank", "rope", "rmsnorm", "gemm", "fusion", "compute-bound" ], "description": "Everything a DeepSeek-V3 attention layer does BEFORE the attention: RMS-normalise the residual stream, compress the queries through a 1536-wide bottleneck and the keys and values through a 512-wide one, normalise both bottlenecks, expand the queries back out to 128 heads, and apply the decoupled RoPE to the trailing 64 channels of the query and to the ONE shared key that carries position. It is three chained GEMMs of wildly different shapes with a normalisation between them, and a framework runs it as fifteen kernels with the widest intermediate in the layer going to HBM twice." }, { "name": "deepseek-mla-proj-backward", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 2830.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mla", "deepseek", "latent-attention", "backward", "training", "rope", "rmsnorm", "gemm", "compute-bound" ], "description": "Training a DeepSeek-V3 attention layer means differentiating its projection front-end: a gradient arriving on 128 heads of query has to be un-rotated, pushed back through a 1536-wide bottleneck and its RMSNorm, and merged with the gradient arriving on the shared KV latent and the one positional key \u2014 while five weight gradients are accumulated over every token in the micro-batch. Autograd does it in forty kernels and rebuilds the widest tensor in the layer to do it." }, { "name": "deepseek-mla-vabsorb-outproj", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "MLA V-absorb folds the value projection into the output projection: a fused GEMM pair, not a plain one", "metric": "TFLOP/s", "roofline_us": 736.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mla", "deepseek", "latent-attention", "decode", "batched-gemm", "output-projection", "fusion", "compute-bound" ], "description": "An absorbed MLA decode does not produce an attention output \u2014 it produces 128 heads of LATENT, one 512-wide vector per head, because the value up-projection was folded away to keep the KV cache small. Getting back to the residual stream costs a per-head batched matmul against 128 different (512, 128) matrices followed by the 7168-wide output projection, and the tensor between them is four times larger than either endpoint. Every decode step of every layer runs it, and run as two library calls it goes to HBM in between." }, { "name": "deepseek-node-dispatch-pack", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 456.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "expert-parallel", "dispatch", "all-to-all", "deepseek", "node-limited", "gather", "memory-bound" ], "description": "DeepSeek-V3's node-limited routing exists so that a token's experts live on at most a handful of nodes \u2014 and the payoff is collected right here, in the kernel that builds the all-to-all send buffer. A token routed to four experts on the same node is sent to that node ONCE, not four times, so the dispatch has to deduplicate every token's expert set down to a node set, rank the tokens per node, and gather the hidden states into node-major order. It is the largest tensor in the layer moved once, with an index computation that is anything but a memcpy." }, { "name": "deepseek-v32-indexer-decode", "family": "KV cache & paging", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 314.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "dsa", "deepseek", "sparse-attention", "lightning-indexer", "decode", "paged", "kv-cache", "memory-bound" ], "description": "Before DeepSeek-V3.2 can run its sparse attention it has to decide WHICH of the cached tokens to attend to, and that decision is made by a lightning indexer that scores every position in the history \u2014 all of it, every step, for every request in the batch. The index keys live in their own paged cache and are shared by all indexer heads, so the kernel is a scan over gigabytes of scattered pages with a handful of arithmetic per byte: whatever fraction of peak bandwidth you reach IS the score." }, { "name": "deepseek-v32-sparse-mla-decode", "family": "KV cache & paging", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 570.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mla", "dsa", "deepseek", "sparse-attention", "latent-attention", "decode", "gather", "kv-cache", "memory-bound" ], "description": "Once DeepSeek-V3.2's indexer has picked the few thousand positions worth attending to, this is the kernel that actually attends to them: absorbed Multi-head Latent Attention over an arbitrary LIST of cache rows rather than a contiguous history. One latent per selected position serves as both key and value for all 128 heads, and the rows are scattered anywhere in a multi-gigabyte pool \u2014 so unlike dense decode there is no contiguity to exploit at all, and the whole problem is turning a random gather into something that still streams." }, { "name": "delta-product-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 398.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "deltaproduct", "linear-attention", "delta-rule", "householder", "backward" ], "description": "The training-side counterpart of Gated DeltaProduct (2025), which applies num_householder rank-1 state edits per TOKEN instead of one, so the per-step transition is a PRODUCT of Householder-like operators. The backward has to run the reverse scan over n_h*T sub-steps while the gate and the readout live only at every n_h-th of them \u2014 so dg and the query gradient are strided with respect to the edit sequence. The reference obtains the five gradients by running the chunked fp32 forward under autograd, materialising the whole (n_h*C, n_h*C) chunk transform in HBM." }, { "name": "delta-rule-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 539.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "deltanet", "delta-rule", "linear-attention", "wy-transform", "gpu" ], "description": "DeltaNet is linear attention whose state is updated by the classical delta rule: before writing v_t, the model first READS what it would already retrieve for k_t and writes only the difference. There is no forget gate at all, so the state is a pure product of Householder-like reflections (I - beta_t k_t k_t^T) \u2014 nothing decays, and every write is visible for the rest of the sequence." }, { "name": "deltaformer-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 1570.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "deltaformer", "delta-rule", "backward", "attention", "triangular-solve" ], "description": "The training-side counterpart of DeltaFormer (2025), which puts the delta rule inside softmax attention: before attending, every value is corrected by what the model would already have retrieved for it, so the values solve a triangular system whose off-diagonal blocks are themselves attention matrices. Differentiating that means solving the TRANSPOSED system \u2014 a backward substitution running the other way down the sequence \u2014 and only then doing the flash-attention backward on top of it." }, { "name": "deltaformer-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 3141.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "deltaformer", "delta-rule", "attention", "triangular-solve" ], "description": "DeltaFormer (2025) puts the delta rule inside softmax attention: before attending, every value is corrected by what the model would already have retrieved for it, u_i = v_i - beta_i * sum_{j 4C -> C) pair with a tanh-GELU between, and their own output gate. The two problems have identical shapes and completely different weights, and their row counts differ by a factor of 8 to 32 \u2014 so run back to back as four `torch.matmul`s, two of them cannot fill a single wave and the prompt stream costs almost as much wall-clock as the image stream that is 32x bigger." }, { "name": "flux-final-layer-unpatchify", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "GB/s", "roofline_us": 478.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "flux", "mmdit", "unpatchify", "adaln", "layernorm", "scatter", "memory-bound", "diffusion-transformer", "image-generation" ], "description": "The last thing FLUX.1 does every denoising step: LayerNorm the image token stream, modulate it with a 2-way adaLN, project each 3072-channel token down to the 64 numbers that are its 2x2 patch of 16 latent channels, and scatter those into a (B, 16, H, W) latent image. The projection is trivial arithmetic on a huge read, and the scatter turns one contiguous token into four 16-element columns two rows apart \u2014 so the kernel is a bandwidth problem wrapped around a write pattern that punishes the obvious layout." }, { "name": "flux-fused-qkv-mlp-proj", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 4831.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "flux", "mmdit", "gemm", "epilogue-fusion", "rope", "rmsnorm", "gelu", "diffusion-transformer", "image-generation" ], "description": "The fusion at the heart of FLUX.1's 38 single-stream blocks is `linear1`: a single (C -> 3C + Cm) projection whose output columns feed two branches that share nothing. Columns [0, 3C) are the QKV triple and need a de-interleave, a per-head RMS-normalisation of Q and K, a 2-D rotation and a head-major transpose; columns [3C, 3C+Cm) are the MLP hidden and need a tanh-GELU. Written as torch ops that 21504-wide intermediate is written once and re-read five times; written as one GEMM with two column-range epilogues, none of it ever reaches HBM." }, { "name": "flux-joint-attention", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 5752.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "flux", "mmdit", "joint-attention", "flash-attention", "diffusion-transformer", "image-generation", "fusion" ], "description": "FLUX.1's double-stream blocks have no cross-attention. The prompt tokens and the image tokens are concatenated \u2014 PROMPT FIRST \u2014 into one bidirectional sequence, attended densely, and then split apart again so each stream can go through its own output projection. The two halves live in separate tensors on both sides of the call, so a naive implementation pays for two concatenations of Q, K and V and one split of the output \u2014 four full round-trips of a 1.6 GB working set \u2014 before any attention arithmetic happens. A good kernel never builds the joint tensors at all." }, { "name": "flux-modulation-backward", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "GB/s", "roofline_us": 395.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "flux", "mmdit", "backward", "adaln", "layernorm-backward", "reduction", "memory-bound", "diffusion-transformer", "image-generation", "training" ], "description": "Fine-tuning FLUX.1 \u2014 LoRA, DreamBooth, distillation \u2014 means differentiating the block preamble: a gated residual add feeding a LayerNorm feeding a per-image modulate. The backward is a LayerNorm backward chained onto a gate backward, plus three reductions over 10^5 tokens per image, and then the two streams' parameter gradients have to be pushed back through TWO different Linears into the ONE conditioning vector they share. Elementwise work, token-axis reductions and a shared destination in a single memory-bound pass." }, { "name": "flux-modulation-fused", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "GB/s", "roofline_us": 366.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "flux", "mmdit", "adaln", "layernorm", "gated-residual", "memory-bound", "fusion", "diffusion-transformer", "image-generation" ], "description": "Halfway through every FLUX.1 double-stream block, both streams do the same four things back to back: gate the attention projection, add it to the residual, LayerNorm the result, and re-affine it with the second pair of adaLN parameters. The residual has to be kept \u2014 the block's final output adds to it \u2014 so the pass produces TWO tensors per stream from TWO inputs, and the six modulation parameters it needs come from a Linear on the shared conditioning vector that has to be evaluated first. Written as torch ops it is six kernels and five full round-trips of a multi-hundred-megabyte activation; it should be one." }, { "name": "flux-qk-rmsnorm-rope", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 395.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "flux", "mmdit", "rmsnorm", "rope", "layout", "memory-bound", "fusion", "diffusion-transformer", "image-generation" ], "description": "Between the two QKV projections and the joint attention, a FLUX.1 double-stream block has to do something structurally awkward: de-interleave TWO packed (3, H, D) QKV tensors, RMS-normalise Q and K per head with FOUR different gain vectors, rotate them by a table of 2x2 matrices, transpose to head-major, and write the two streams into ONE Q/K/V triple with the prompt first. Six layout changes and two norms over a tensor that is three times the size of the activation, and none of it is arithmetic worth counting." }, { "name": "flux-rope2d-apply", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 366.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "flux", "rope", "positional-embedding", "memory-bound", "mmdit", "diffusion-transformer", "image-generation" ], "description": "FLUX.1 does not position its tokens with a cos/sin pair. It builds a table of explicit 2x2 rotation matrices \u2014 one per (token, channel pair), split [D/8 | ~3D/8 | ~3D/8] between an image index axis and the row and column of the latent grid \u2014 and applies it to Q and K in every one of 57 blocks. The table is float32 while Q and K are bfloat16, the prompt prefix rotates by the identity, and the whole thing is a strided 4-float gather feeding a 2x2 matrix-vector product. Run as torch ops it is six elementwise kernels over a multi-gigabyte pair of tensors." }, { "name": "flux-single-stream-block", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 10478.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "flux", "single-stream", "mmdit", "transformer-block", "parallel-attention-mlp", "fusion", "gemm", "rope", "adaln", "diffusion-transformer", "image-generation" ], "description": "38 of FLUX.1's 57 blocks are single-stream, and they are built around a genuine fusion: ONE 21504-wide `linear1` emits the QKV triple AND the MLP hidden state from the same modulated input, attention and the MLP then run in PARALLEL rather than in sequence, and ONE 15360-wide `linear2` consumes their concatenation and adds a single gated residual. There is no second LayerNorm and no intermediate residual \u2014 the two branches never see each other until they are summed by `linear2`'s K axis. Run as ~15 separate torch ops it spends most of its time pushing 21504-wide intermediates through HBM." }, { "name": "forgetting-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "forgetting-transformer", "fox", "attention", "flash-attention" ], "description": "The Forgetting Transformer (2025) adds a learned FORGET GATE to softmax attention: a cumulative log-gate is added to the attention logits as a data-dependent decay bias before the softmax. A fast kernel must fold that bias into the online softmax of a flash-attention-style tiled loop, since the whole point is never to materialise the T-by-T score matrix the reference builds." }, { "name": "forgetting-attn-backward", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 883.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "forgetting-transformer", "fox", "attention", "flash-attention", "backward" ], "description": "The training-side counterpart of the Forgetting Transformer (FoX, 2025): softmax attention whose logits carry a learned, data-dependent decay bias `gc_i - gc_j`. The reference gets the four gradients by running the dense fp32 forward under autograd, which materialises the whole (B, H, T, T) score matrix and its softmax twice over; a real kernel is a flash-attention-style tiled backward that never writes a score matrix and folds the gate into the recomputed logits \u2014 and it must also produce `dg`, a reduction the forward kernel never has to do." }, { "name": "fp4-stochastic-round", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 413.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mxfp4", "fp4", "stochastic-rounding", "quantization", "low-precision", "training", "memory-bound" ], "description": "FP4 training only works because the tensors that get quantised on the backward path are rounded STOCHASTICALLY: with 8 magnitudes to choose from, round-to-nearest biases every gradient towards zero and the model stops learning, while rounding up or down with probability proportional to the distance is unbiased in expectation. The kernel is a full-bandwidth sweep over a multi-gigabyte gradient: a per-32-element block absmax, a power-of-two shared exponent, and a randomised round into 4 bits, two elements to a byte." }, { "name": "fp8-attention-backward", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 1963.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "flash-attention", "backward", "low-precision", "training", "hopper" ], "description": "FP8 training keeps Q, K and V in float8_e4m3 with per-head descale factors, and the backward pass has to recompute the probabilities from the saved log-sum-exp and then run FIVE matmuls over the same causal T-by-T grid \u2014 two of them transposed. Every one of those contractions mixes differently-scaled FP8 operands, so the descales have to be folded into the accumulator constants rather than applied per element, and the score matrix must never touch HBM." }, { "name": "fp8-blockwise-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "gemm", "quantization", "deepseek", "low-precision" ], "description": "DeepSeek-V3 serves every dense projection in FP8 with fine-grained scaling: activations carry one fp32 scale per token per 128-element K block, weights carry one fp32 scale per 128x128 tile. That layout is what makes FP8 accurate enough to train and serve with, and it is why the GEMM cannot be a plain cuBLAS FP8 call \u2014 the scales have to be applied inside the K loop, on the fp32 accumulator, while the tensor cores stay fed with FP8." }, { "name": "fp8-flash-attention", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "flash-attention", "low-precision", "hopper" ], "description": "FP8 attention is how FlashAttention-3-class kernels serve long context on Hopper: Q, K and V arrive already quantised to float8_e4m3 with per-head descale factors, the QK product is accumulated in fp32 and descaled before the softmax, and the PV product runs in FP8 again. The hard part is that the softmax sits between two differently-scaled FP8 matmuls." }, { "name": "fp8-grouped-gemm-masked", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 687.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "moe", "grouped-gemm", "cuda-graph", "quantization", "low-precision", "deepgemm" ], "description": "MoE decode under CUDA graphs cannot change tensor shapes between steps, so the expert GEMM is given a fixed per-expert capacity and a device-side tensor of how many rows are actually valid. This is DeepGEMM's masked grouped GEMM: one launch over all experts, blockwise-FP8 operands, and a row count that is only known on the GPU \u2014 so the tile scheduler has to skip the padding without ever asking the host how much work there is." }, { "name": "fp8-kv-decode-attention", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "GB/s", "roofline_us": 214.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "attention", "decode", "kv-cache", "memory-bound", "low-precision" ], "description": "Long-context serving stores the KV cache in FP8 with a per-token dequant scale \u2014 it halves the cache and therefore doubles the batch that fits, and decode attention is pure bandwidth, so halving the bytes nearly doubles the throughput. The kernel has to read one byte per element, dequantise it in registers with the token's scale, and never write a bf16 copy of the cache anywhere." }, { "name": "fp8-per-token-quant-transpose", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 423.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "quantization", "transpose", "memory-bound", "training", "low-precision", "deepseek" ], "description": "FP8 training needs the same activation matrix twice: once quantised along the feature axis for the forward GEMM, and once transposed and quantised along the token axis for the backward one. The two copies have DIFFERENT scales, because each is grouped along its own contraction dimension. Producing them with separate ops costs several round trips of the activations through HBM plus a full fp32 transpose; a good kernel reads the bf16 matrix exactly once and emits both FP8 copies and both scale arrays." }, { "name": "fp8-quant-dequant-fused", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 366.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "quantization", "fake-quant", "residual", "memory-bound", "low-precision", "training" ], "description": "FP8 blocks have a consistency problem: the GEMM sees the rounded FP8 activations, but the residual stream carries the unrounded bf16 ones, so the two branches drift apart layer after layer. The fix every FP8 training and QAT stack uses is to quantise and IMMEDIATELY dequantise on the skip path, so the residual carries exactly the values the GEMM consumed. Done as separate ops it is four round trips of the activations through HBM; fused it is two reads and three writes, and the FP8 codes never have to be read back." }, { "name": "frame-anchor-attention", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 3779.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "anchor-frames", "keyframe", "hunyuanvideo", "wan" ], "description": "The cheapest sparse pattern that keeps a generated clip globally coherent: every token attends densely inside its OWN frame, plus densely to a handful of ANCHOR frames chosen per head by an upstream selector \u2014 the keyframes that carry the scene. The anchor list is a device tensor and differs from head to head, so the kernel is an indirection over frame-sized KV blocks, and the anchor set and the query's own frame can overlap, which must not be double-counted in the softmax." }, { "name": "fsdp-allgather-unflatten", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 400.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fsdp", "zero3", "all-gather", "copy-out", "sharding", "distributed", "training", "layout", "memory-bound" ], "description": "An FSDP2 all-gather does not hand back usable weights. Every parameter is sharded on dim 0, so the gather buffer is RANK-major: rank 0's slice of every parameter, then rank 1's slice of every parameter, and so on, each padded up so the ranks divide evenly. Turning that back into contiguous parameters means interleaving world_size widely separated blocks per tensor and throwing away the padding rows \u2014 it runs before every forward of every layer, it moves the whole unsharded model, and it is the kernel that decides whether the all-gather overlaps." }, { "name": "fsdp-flatten-shard-params", "family": "Training, optimizer & RL", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 585.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fsdp", "zero", "sharding", "flat-parameter", "training", "distributed", "layout", "memory-bound" ], "description": "Before FSDP can shard anything it has to build a FlatParameter: every parameter of the unit is relaid into ONE contiguous buffer, each one starting on a 128-byte boundary so the shard boundaries stay aligned, the holes zero-filled, and the result cut into world_size equal shards. It runs on hundreds of tensors whose sizes span four orders of magnitude, it moves the entire fp32 master copy of the model, and it is the layout every later collective assumes." }, { "name": "fsdp-mixed-precision-cast", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 453.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fsdp", "fp8", "e4m3", "delayed-scaling", "amax", "quantization", "mixed-precision", "distributed", "training", "memory-bound" ], "description": "FSDP keeps the master weights in fp32 but nobody all-gathers fp32. With fp8 mixed precision the shard is quantised to e4m3 before it goes on the wire \u2014 per parameter, against a scale carried over from the previous step's amax history, and the new amax has to be recorded in the SAME pass or the whole shard gets read twice. It runs once per unit per step over hundreds of millions of fp32 elements, and delayed scaling is exactly what makes one pass possible." }, { "name": "fsdp-reduce-scatter-bucket", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 568.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fsdp", "zero", "reduce-scatter", "bucketing", "gradient", "mixed-precision", "moe", "distributed", "training", "memory-bound" ], "description": "Every FSDP backward ends by packing a whole unit's gradients into ONE reduce-scatter bucket: each parameter's rows split across the ranks and written rank-major, the padding rows zeroed so they cannot poison the sum, the whole thing pre-divided by the world size and cast down to the bf16 reduce dtype \u2014 and, since every element is already in registers, the per-parameter squared gradient norm the clipper needs falls out of the same pass. On an MoE unit that is hundreds of expert matrices and gigabytes of fp32 gradient, and it is what the backward waits on." }, { "name": "fused-adamw-multitensor", "family": "Training, optimizer & RL", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 4050.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "adamw", "optimizer", "multi-tensor", "mixed-precision", "memory-bound", "training" ], "description": "The optimiser step of a real training loop touches hundreds of separate parameter tensors whose sizes span four orders of magnitude, from a 1024-element RMSNorm gain to a 100M-element embedding table. Done tensor-by-tensor it is thousands of tiny launches, most of them too small to fill the GPU; done properly it is ONE launch over a flat buffer, with each element finding its own tensor's learning-rate multiplier and weight decay through an offset map. It is purely memory-bound: every parameter is 28 bytes of traffic and about ten flops." }, { "name": "fused-linear-cross-entropy", "family": "Training, optimizer & RL", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 221325.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "cross-entropy", "lm-head", "large-vocab", "training" ], "description": "The LM head of a modern model projects to a 150k-260k vocabulary, so the logits are far larger than the activations that produced them. At the graded sizes a materialised logit tensor is tens of gigabytes and simply will not fit, so the kernel must compute the loss AND its gradients in tiles, never holding the full (N, V) matrix." }, { "name": "fused-muon-newton-schulz-batched", "family": "Training, optimizer & RL", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 6626.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "muon", "newton-schulz", "optimizer", "batched-gemm", "symmetric-gemm", "training" ], "description": "Muon orthogonalises every 2D weight/momentum matrix in the model with a 5-step quintic Newton-Schulz iteration, so one optimiser step runs it hundreds of times on matrices that are individually far too small to fill a datacentre GPU. A real Muon implementation groups the like-shaped matrices (all 32 layers' q_proj, all 32 gate_proj, ...) and runs the whole group in ONE batched launch, and it exploits the fact that the Gram matrix X @ X^T driving the iteration is symmetric \u2014 the reference does neither." }, { "name": "fused-qk-norm-rope", "family": "Normalization, RoPE & elementwise fusion", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 361.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rmsnorm", "rope", "qk-norm", "qwen3", "memory-bound", "attention" ], "description": "Qwen3, Gemma-2/3 and Chameleon RMS-normalise every attention head of q and k -- with their own learned per-head-channel gains -- before applying RoPE. That is a reduction over 128 channels and a rotation on the same 128 channels, and doing it as separate torch ops costs four round trips of the q/k tensors through HBM; fused it costs one read and one write." }, { "name": "fused-residual-rmsnorm", "family": "Normalization, RoPE & elementwise fusion", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 312.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rmsnorm", "residual", "fusion", "memory-bound", "transformer" ], "description": "This runs twice per transformer block in every modern LLM: add the sublayer output back into the residual stream, keep that updated residual for the next skip connection, and hand the RMS-normalised version to the next sublayer. Done as separate ops it is three round trips of the hidden states through HBM; fused it is one read pair and one write pair." }, { "name": "fused-rmsnorm-fp8-quant", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 473.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "rmsnorm", "quantization", "memory-bound", "deepseek" ], "description": "Every FP8-served transformer runs this between blocks: RMS-normalise the hidden states and immediately quantise them to FP8 with a per-128-element block scale, so the next GEMM can consume FP8 directly. Done as separate ops it costs three round trips of the activations through HBM; fused it costs one read and one (four-times smaller) write." }, { "name": "fused-topk-topp-filter", "family": "Sampling & speculative decoding", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 416.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sampling", "top-k", "top-p", "nucleus", "decode", "memory-bound", "vllm", "sglang" ], "description": "Every decode step of every served model ends here: turn a batch of raw logit rows over a 128k-262k vocabulary into renormalised probability distributions, truncated per request by top-k and top-p. The stock torch path sorts the whole vocabulary \u2014 an O(V log V) pass over a gigabyte of logits \u2014 for a decision that only depends on the few dozen largest entries, and it sits directly between the model's last GEMM and the sampler." }, { "name": "gae-advantage-scan", "family": "Training, optimizer & RL", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 546.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gae", "ppo", "rlhf", "post-training", "scan", "recurrence", "memory-bound" ], "description": "PPO's advantage estimator is a reverse-time first-order recurrence: walk each rollout backwards from its last generated token, accumulating the TD residual with a gamma*lambda decay. Written the obvious way it is one tiny kernel launch per token \u2014 tens of thousands of them per training step, each touching only a few hundred kilobytes \u2014 while the buffer itself is gigabytes. The fast form is a blocked parallel scan over the affine recurrence, which is a completely different kernel from the loop it replaces." }, { "name": "gated-delta-product-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 478.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "deltaproduct", "linear-attention", "delta-rule", "householder" ], "description": "Gated DeltaProduct (2025) raises the expressivity of the gated delta rule by applying num_householder rank-1 state edits per TOKEN instead of one, so the per-step transition is a PRODUCT of Householder-like operators. The chunked reformulation has to linearise a sequence of n_h*C edits per chunk rather than C, which is where the difficulty is." }, { "name": "gated-deltanet-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kernels", "gated-deltanet", "backward", "qwen3-next", "linear-attention", "delta-rule", "triton", "gpu" ], "description": "Write a fast FUSED BACKWARD kernel for Gated DeltaNet (the linear-attention layer of Qwen3-Next / Kimi Linear). The reference computes the backward by running the chunked fp32 forward under autograd. Gated on ALL FIVE gradients matching (relerr 1e-2, checked at the timed shapes too); scored on ACHIEVED TFLOP/s (geomean over undisclosed shapes with B*H >= 128, uncapped speed leaderboard, 0 if wrong). No gold solution needed. Timed reps use fresh inputs so memoized results cannot be replayed." }, { "name": "gated-deltanet-decode-step", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 472.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gated-deltanet", "decode", "linear-attention", "delta-rule", "memory-bound", "gpu" ], "description": "This is what a Qwen3-Next / Gated-DeltaNet-style hybrid model runs at every generated token: ONE gated delta-rule recurrent step \u2014 scalar forget gate, rank-1 delta-rule write, readout \u2014 applied to every sequence in the decode batch at once. No chunking, no WY transform, no intra-chunk matmul: it is a pure bandwidth problem over the (K, V) recurrent state, which for a large decode batch is a gigabyte of HBM traffic per layer per token." }, { "name": "gated-deltanet-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "compilation", "kernels", "deltanet", "delta-rule", "linear-attention", "gpu", "triton" ], "description": "Optimize the Gated DeltaNet forward: given a correct but slow chunk-parallel PyTorch reference (the gated delta rule with the WY/UT transform + a sequential chunk recurrence), write a fused GPU kernel that matches it and runs much faster at long sequence length. Graded on correctness vs an independent reference (gate) + a continuous speedup score over the reference, rising to a state-of-the-art kernel, on GPU." }, { "name": "geglu-backward-fused", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 781.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "geglu", "gelu", "gated-mlp", "backward", "training", "memory-bound", "gemma" ], "description": "GEGLU is the gated MLP of Gemma, T5-v1.1, PaLM and the GPT-OSS family: one fused projection produces [gate | up], a tanh-approximated GELU squashes the gate, and the two halves multiply. Its backward pass has to recompute the GELU and its derivative from the saved pre-activations, produce a (M, 2N) gradient, and reduce the same values down the token axis for the bias gradient. As separate autograd ops that is six round trips of a tensor twice the size of the activations; fused it is one read and one write." }, { "name": "gla-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gla", "linear-attention", "gated", "backward", "gpu" ], "description": "The training-side counterpart of the GLA layer: a matrix-valued recurrent state decayed by a data-dependent, PER-CHANNEL forget gate. The reference obtains the four gradients by running the chunked fp32 forward under autograd, which keeps every chunk intermediate alive in HBM; a fused backward recomputes them instead and carries the reverse state scan in registers. The per-channel gate gradient `dgk` is a reduction over both the decay application and the state carry." }, { "name": "gla-decode-step", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 474.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gla", "decode", "linear-attention", "gated", "memory-bound", "gpu" ], "description": "This is what a GLA/RWKV-style linear-attention layer runs at every generated token: ONE gated linear-attention recurrent step \u2014 per-channel decay of the (K, V) state, a rank-1 write, and a readout \u2014 applied to every sequence in the decode batch at once. No chunking and no intra-chunk score matrix; it is a pure streaming problem over the recurrent state, which for a large decode batch is a gigabyte of HBM traffic per layer per token." }, { "name": "gla-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gla", "linear-attention", "gated", "gpu" ], "description": "Gated Linear Attention is the linear-attention layer behind GLA/RWKV-style LLMs: a matrix-valued recurrent state updated by a rank-1 write and decayed by a DATA-DEPENDENT, PER-CHANNEL forget gate. The per-channel gate is what makes it hard \u2014 the decay cannot be pulled out of the chunk matmuls as a scalar, so the chunked reformulation has to carry a cumulative log-gate through both operands without overflowing." }, { "name": "gptq-actorder-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int4", "gptq", "act-order", "desc-act", "quantization", "gemm", "low-precision", "w4a16" ], "description": "GPTQ's activation-ordering mode is what makes 4-bit checkpoints accurate at group size 128, and it is also what makes them slow: the quantiser processes the input channels in order of activation importance, so the 128 rows sharing a scale are SCATTERED along K and every row carries an explicit group id in `g_idx`. A kernel can no longer assume the scale for row k lives at k//128 \u2014 it has to follow the indirection without giving up coalesced weight loads or the fused unpack." }, { "name": "gqa-decode-attention", "family": "KV cache & paging", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 833.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "gqa", "decode", "kv-cache", "memory-bound", "flash-decoding" ], "description": "The single hottest kernel in LLM serving: one new query token per request attending over the whole KV cache, with grouped-query attention so several query heads share one KV head. There is essentially no arithmetic intensity \u2014 the entire cost is streaming the KV cache out of HBM once \u2014 so this is a pure BANDWIDTH task, and the score is achieved GB/s against the unavoidable cache traffic." }, { "name": "gqa-paged-decode-attention", "family": "KV cache & paging", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "GB/s", "roofline_us": 626.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "gqa", "decode", "paged-attention", "kv-cache", "vllm", "memory-bound", "flash-decoding" ], "description": "The kernel every production LLM server actually runs: one new query token per request attending over a KV cache that is not contiguous at all, but scattered across fixed-size PAGES in a shared pool and reached through a per-request page table, with a different history length per request. There is essentially no arithmetic intensity \u2014 the cost is streaming the live pages out of HBM once \u2014 so this is a pure BANDWIDTH task, and the score is achieved GB/s against the unavoidable cache traffic." }, { "name": "grad-global-norm-clip", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 2842.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gradient-clipping", "reduction", "multi-tensor", "memory-bound", "training" ], "description": "Between backward and the optimiser, every training step reduces the L2 norm of EVERY gradient in the model down to one scalar, and then rescales all of them by a factor that is not known until that scalar exists. It is irreducibly two passes over multiple gigabytes, spread over hundreds of ragged tensors, and `torch.nn.utils.clip_grad_norm_` does it with thousands of tiny launches \u2014 one per tensor per pass." }, { "name": "grad-topk-error-feedback", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 319.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gradient-compression", "top-k", "error-feedback", "sparsity", "distributed", "training", "memory-bound" ], "description": "Gradient compression sends 1-3% of a gradient bucket over the wire and keeps the rest as a residual that is added back next step \u2014 error feedback is what makes it converge at all. The kernel is blockwise: for every 1024-element block, add the carried residual, take the k largest by magnitude, emit their values and indices, and write back everything you did not send. It runs on the whole gradient of the model every step, the indices are integers compared exactly, and the residual is the state that makes the whole scheme work." }, { "name": "gradient-accumulation-fused", "family": "Training, optimizer & RL", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 2095.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gradient-accumulation", "mixed-precision", "loss-scaling", "training", "memory-bound" ], "description": "Between every micro-batch of a mixed-precision training step, the whole model's bf16 gradients are divided by the loss scale, added into an fp32 accumulator, and re-emitted as the bf16 buffer the all-reduce will consume \u2014 and the entire update is thrown away if a single element anywhere in the multi-gigabyte buffer came back infinite or NaN. That global veto is the interesting part: nothing may be committed until every element has been inspected, and the common case (no overflow) still has to run at HBM speed." }, { "name": "grammar-jump-ahead-compile", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 417.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "structured-output", "guided-decoding", "grammar", "xgrammar", "jump-ahead", "bitmask", "popcount", "serving", "memory-bound" ], "description": "Most states of a compiled JSON/regex grammar allow exactly ONE token \u2014 the middle of a key name, a closing brace, the `': '` after a field. A serving engine exploits that with jump-ahead decoding: from any state it emits the whole forced run without calling the model. Finding those runs means counting the allowed tokens of every state in the grammar's mask cache \u2014 a bit-population count over a table with one bit per vocabulary entry per state \u2014 and then chasing the forced transitions." }, { "name": "gridwide-barrier-primitive", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "grid-sync", "persistent-kernel", "barrier", "atomics", "memory-model" ], "description": "Every megakernel rests on one primitive: a barrier that synchronises the whole grid without ending the kernel. Implement it, then use it to run 512 rounds of global-reduce-then-update inside a single launch. Graded on barriers per second, gated on the result being bit-exact -- the arithmetic is exact integer mixing, so any missing fence or reused partial buffer produces a completely different number rather than a small drift." }, { "name": "grouped-fp8-gemm", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "compilation", "kernels", "fp8", "gemm", "grouped", "moe", "blockwise", "low-precision", "gpu", "cuda", "cutlass" ], "description": "Write a fast grouped (mixture-of-experts) blockwise-FP8 GEMM \u2014 the MoE expert matmul: given FP8 (e4m3) grouped activations + per-expert weights with DeepSeek-style block scaling (per-token 1x128 for A, per-128x128 block for B) and an m_indices tensor grouping tokens by expert (contiguous runs), produce a fused kernel that matches an fp32 dequant loop-MoE reference AND is faster than a CUDA-graphed bf16 loop-MoE. Requires FP8 tensor cores + a contiguous grouped scheduler (Triton insufficient -> CUDA/CuTe DSL). Graded on correctness (gate) + a continuous speedup score over the bf16 loop-MoE, rising to a state-of-the-art fused FP8 grouped kernel (DeepGEMM m_grouped_fp8_gemm_nt_contiguous), across diverse expert counts / token splits / N / K, on GPU." }, { "name": "groupnorm3d-backward", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 418.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "groupnorm", "silu", "backward", "video", "vae", "wan", "hunyuanvideo", "training", "memory-bound" ], "description": "Fine-tuning a Wan / HunyuanVideo 3D tokenizer runs the GroupNorm(32)+SiLU backward pass over gigabyte-scale 5D activation volumes. It is three fused reductions in one: the SiLU derivative needs the pre-activation reconstructed from the saved statistics, the parameter gradients are per-channel sums over the whole clip, and the data gradient needs two more group-wide means before a single element of dx can be written. Done as separate torch ops it is six passes over a gigabyte; done properly it is two." }, { "name": "groupnorm3d-forward", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 370.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "groupnorm", "silu", "video", "vae", "wan", "hunyuanvideo", "normalization", "memory-bound" ], "description": "Every residual block of the Wan / HunyuanVideo 3D tokenizer opens with GroupNorm(32) followed by SiLU, applied to a 5D (B, C, T, H, W) activation volume that at 1080p latent resolution is close to a gigabyte. Unlike LayerNorm, the reduction runs over an entire GROUP of channels AND all of T, H and W \u2014 hundreds of millions of elements per group \u2014 so it is a whole-tensor reduction with a channel-strided access pattern, and it is pure HBM bandwidth." }, { "name": "grpo-advantage-whiten", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 325.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "grpo", "rlhf", "advantage", "post-training", "reduction", "memory-bound" ], "description": "Between the reward model and the policy loss, a GRPO step turns one scalar reward per rollout into one advantage per generated token: the per-sequence KL penalty is summed over hundreds of millions of padded token slots, each prompt's G samples are normalised against their own group, and the result is whitened over every valid token in the batch before being broadcast back out across the buffer. Two full passes over a multi-gigabyte ragged buffer with a global scalar in between \u2014 and a framework implementation does it in a dozen separate launches." }, { "name": "grpo-logprob-ratio", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 1223.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "grpo", "ppo", "rlhf", "post-training", "cross-entropy", "large-vocab", "memory-bound" ], "description": "Every GRPO/PPO optimisation step turns a (tokens x vocab) logit tensor into three per-token scalars \u2014 the sampled token's log-probability, the importance ratio against the behaviour policy, and a k3 KL estimate against the reference policy \u2014 clips the surrogate, and pushes the result straight back out as a gradient of the same size. At 150k-vocab scale the logits are gigabytes, so the ratio, the clip and the softmax backward all have to happen in one streaming pass instead of the six materialised temporaries a framework implementation creates." }, { "name": "gsa-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gsa", "slot-attention", "linear-attention", "backward", "gpu" ], "description": "The training-side counterpart of Gated Slot Attention: two chained gated recurrences with a softmax over M memory slots between them. The backward has to run the reverse of BOTH scans and push the gradient back through the slot softmax that couples them, and the gate `g` \u2014 which decays both states \u2014 collects a gradient from every one of those paths. The reference gets the five gradients by running the chunked fp32 forward under autograd." }, { "name": "gsa-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 392.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "gsa", "slot-attention", "linear-attention", "gpu" ], "description": "Gated Slot Attention routes through a bounded set of M memory SLOTS: one gated recurrence writes keys into a (K, M) slot state, a softmax over slots turns the readout into a distribution, and a second gated recurrence reads a (M, V) state. The softmax sits BETWEEN the two scans, so a fused kernel cannot simply merge them \u2014 it has to keep both states resident and stage the softmax." }, { "name": "guided-decoding-mask", "family": "Sampling & speculative decoding", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 317.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "guided-decoding", "structured-output", "grammar", "xgrammar", "json-mode", "sampling", "bitmask", "memory-bound" ], "description": "Structured / JSON-mode decoding constrains every sampling step to the tokens a grammar FSM currently allows. Each sequence in the batch sits at its OWN FSM state, and the allowed set is a bitmask one bit per vocabulary entry. Applying it means touching the whole large-vocab logits tensor per step \u2014 xgrammar / Outlines / llguidance all do exactly this, and done naively it is three full passes over a 256k-wide fp32 logits matrix." }, { "name": "hgrn2-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hgrn2", "linear-attention", "gated-rnn", "gpu" ], "description": "HGRN2 turns HGRN's element-wise gated RNN into a matrix-state linear recurrence by outer-product state expansion. Its defining trick is that the input gate is TIED to the forget gate \u2014 the write vector is exactly `1 - f_t`, so there is no key tensor at all: the gate and the key are the same operand, read once and used twice." }, { "name": "hierarchical-coarse-fine-attn", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 2279.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "hierarchical", "pooling", "multi-resolution", "hunyuanvideo", "wan" ], "description": "Two attentions at two resolutions, blended by a learned per-head gate. The FINE branch is exact attention inside a small 3D tile window; the COARSE branch attends over the whole clip at tile resolution, against one mean-pooled key and value per 3D tile. Between them a token gets sharp local detail and blurry global context for a couple of percent of the dense cost \u2014 and the kernel has to build the pooled level itself, run two independent softmaxes, and combine them without ever writing the intermediate outputs to HBM." }, { "name": "hifigan-mrf-resblock", "family": "Multimodal & audio", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 517.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "audio", "vocoder", "hifigan", "bigvgan", "tts", "dilated-conv", "residual-block", "compute-bound" ], "description": "The decoder of every GAN vocoder \u2014 HiFi-GAN, BigVGAN, and the vocoders inside VITS, XTTS and most TTS stacks \u2014 is a stack of multi-receptive-field residual blocks: three branches of two dilated 1-D convolutions each, chained through residual adds, with a LeakyReLU in front of every convolution. Six dependent convolutions over the same long activation, at full channel width, is where a vocoder forward actually spends its time, and eager PyTorch runs it as eighteen kernels that round-trip the activation through HBM every time." }, { "name": "hunyuan-attention-backward", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 9498.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "mmdit", "joint-attention", "backward", "flash-attention", "training", "diffusion-transformer", "video-generation" ], "description": "Training or fine-tuning HunyuanVideo means differentiating through the joint attention that carries ~10^5 video tokens and ~10^2 text tokens in one bidirectional sequence. The backward is 2x the forward's arithmetic and, unlike the forward, it has a reduction over QUERIES as well as over keys \u2014 dK and dV accumulate down the whole sequence \u2014 while the ragged text padding has to stay out of both directions of every one of those reductions." }, { "name": "hunyuan-attn-fp8", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 10602.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "fp8", "attention", "block-scaling", "diffusion-transformer", "video-generation", "hopper", "low-precision" ], "description": "Running HunyuanVideo's 118,800-token attention in FP8 is the single biggest inference win available, but a per-tensor or per-head scale does not survive video: the dynamic range of a static background patch and a fast-moving foreground patch differ by more than E4M3 can hold. Production FP8 video attention therefore ships PER-128-TOKEN-BLOCK descales for Q and K and a PER-CHANNEL descale for V \u2014 so the descale factor changes inside the key loop, right where the running softmax lives." }, { "name": "hunyuan-dualstream-attn-proj", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "two per-stream output projections plus per-sample gates: a 2-group GEMM with M=1e5 against M=1e2", "metric": "TFLOP/s", "roofline_us": 2222.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "mmdit", "dual-stream", "gemm", "grouped-gemm", "gated-residual", "diffusion-transformer", "video-generation", "fusion" ], "description": "The joint attention in a HunyuanVideo dual-stream block returns ONE sequence, but the two streams immediately part ways again: the output is split at the video/text boundary and each half goes through its OWN output projection, its OWN adaLN gate and its OWN residual. That is two GEMMs sharing nothing but a source tensor, with M = 118,800 for one and M = 256 for the other \u2014 run back to back the small one is pure launch overhead and the big one never gets to overlap its epilogue." }, { "name": "hunyuan-dualstream-block", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 10013.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "dual-stream", "mmdit", "transformer-block", "joint-attention", "fusion", "gemm", "rope", "adaln", "diffusion-transformer", "video-generation" ], "description": "The first 20 of HunyuanVideo's 60 blocks are dual-stream: the video tokens and the text tokens keep COMPLETELY SEPARATE weights \u2014 their own 6-way adaLN, their own QKV projection, their own QK-norm gains, their own output projection and their own MLP \u2014 and the only place they meet is one joint attention over the concatenation. That means every op in the block is really two ops with 118,800 and 256 rows respectively, which is a scheduling problem as much as a fusion one." }, { "name": "hunyuan-final-layer-unpatchify", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "GB/s", "roofline_us": 433.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "diffusion-transformer", "unpatchify", "adaln", "final-layer", "video-generation", "memory-bound", "scatter" ], "description": "The last thing HunyuanVideo does every denoising step: LayerNorm the 118,800 x 3072 token stream, modulate it with a 2-way adaLN, project each token down to the 64 numbers that are its (1,2,2) patch of 16 latent channels, and scatter those into a (B, 16, 33, 90, 160) 5-D latent volume. The projection is trivial arithmetic on a 730 MB read, and the scatter turns one contiguous token into 4 spatial positions in 4 completely different places \u2014 done in torch it is a LayerNorm, a GEMM, an 8-D permute and a `contiguous()` that all move the data again." }, { "name": "hunyuan-joint-attention", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 10657.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "mmdit", "joint-attention", "flash-attention", "diffusion-transformer", "video-generation", "bidirectional", "padding-mask" ], "description": "HunyuanVideo's MMDiT does not use cross-attention. Both of its stream types CONCATENATE the video tokens and the text tokens into one sequence and run a single bidirectional attention over it, so video attends to video, video to text, text to video and text to text in one pass. The two segments are wildly asymmetric \u2014 ~10^5 video tokens against ~10^2 text tokens \u2014 and the text segment is zero-padded to a fixed width with a per-sample valid length, so the mask is a thin ragged strip glued to the right and bottom of an enormous dense block." }, { "name": "hunyuan-mmdit-modulation", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "GB/s", "roofline_us": 284.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "diffusion-transformer", "mmdit", "adaln", "modulation", "layernorm", "video-generation", "memory-bound" ], "description": "Every one of HunyuanVideo's 20 dual-stream blocks opens the same way: a single conditioning vector (timestep + distilled guidance + pooled text) is pushed through SiLU and a Linear that fans it out to SIX modulation parameters, and the video and text streams are then LayerNormed (no affine) and re-affined by their OWN shift/scale. At 720p the video stream is 118,800 tokens x 3072 channels, so this 'cheap' preamble is a full HBM round-trip of the activation twice per block, 60 blocks per step, 50 steps per video." }, { "name": "hunyuan-modulation-backward", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 585.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "i2v", "token-replace", "adaln", "layernorm", "backward", "training", "segmented-reduction", "video-generation", "memory-bound" ], "description": "The backward of HunyuanVideo-I2V's block preamble. The forward was a gated residual add followed by a LayerNorm-and-modulate whose parameters switch part-way down the sequence (the replaced first-frame tokens use a t=0 conditioning vector). Differentiating it gives a LayerNorm backward chained onto a gate backward, plus SEGMENTED reductions over 10^5 tokens: the same three parameter gradients have to be accumulated into two separate destinations depending on which side of the token-replace boundary a token lies." }, { "name": "hunyuan-qk-norm-fused", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 853.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "mmdit", "dual-stream", "qk-norm", "rmsnorm", "diffusion-transformer", "video-generation", "memory-bound", "layout" ], "description": "Between the QKV projections and the joint attention, HunyuanVideo's dual-stream block has to do something structurally awkward: de-interleave TWO packed (3, H, D) QKV tensors \u2014 one for the video stream, one for the text stream \u2014 RMS-normalise Q and K per head with FOUR different gain vectors, and concatenate the two streams into the single Q/K/V triple that attention consumes. At 118,800 video tokens the packed QKV is 2.2 GB, and torch does this as six slices, four normalisations and three concatenations, every one of which copies the whole thing." }, { "name": "hunyuan-rope3d-apply", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 643.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "rope", "3d-rope", "diffusion-transformer", "video-generation", "memory-bound", "attention" ], "description": "HunyuanVideo positions its video tokens with a THREE-axis rotary embedding: the 128 channels of every head are split [16 | 56 | 56] between the temporal, height and width axes, and a token's angle is the concatenation of three separate table lookups driven by its (t, h, w) coordinate in the 33 x 45 x 80 latent grid. The text tokens that share the joint sequence get NO rotation at all. Done in torch it is an index-expand, three gathers, a concatenate and a complex multiply \u2014 several full round-trips of a 730 MB q/k pair; fused it is one read and one write." }, { "name": "hunyuan-singlestream-block", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 10013.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "single-stream", "mmdit", "transformer-block", "fusion", "attention", "gemm", "rope", "adaln", "diffusion-transformer", "video-generation" ], "description": "40 of HunyuanVideo's 60 blocks are single-stream: video and text share ONE weight set and one sequence, and the block is deliberately built out of two enormous Linears \u2014 `linear1` emits QKV and the MLP hidden in one 21504-wide GEMM, `linear2` consumes the attention output and the GELU'd hidden as one 15360-wide GEMM \u2014 with a 3-way adaLN, a per-head QK-RMSNorm, RoPE on the video prefix only, and joint attention wedged between them. Run as ~15 separate torch ops it spends most of its time moving 21504-wide intermediates through HBM." }, { "name": "hunyuan-split-ffn", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 9939.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "single-stream", "mmdit", "ffn", "gelu", "gemm", "fusion", "diffusion-transformer", "video-generation" ], "description": "HunyuanVideo's 40 single-stream blocks do not have a separate attention projection and MLP. `linear1` emits QKV and the MLP hidden state as one 21504-wide matrix, and `linear2` consumes the CONCATENATION of the attention output and the GELU'd MLP hidden as one 15360-wide input. The MLP half of that pair is two GEMMs with a tanh-GELU in between and a gated residual on the end \u2014 and if you do it naively the 12288-wide fp32 hidden state is a 2 GB round-trip through HBM per block, 40 blocks per step." }, { "name": "hunyuan-split-ffn-backward", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 7951.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "single-stream", "ffn", "backward", "training", "gelu", "gemm", "diffusion-transformer", "video-generation" ], "description": "Fine-tuning HunyuanVideo means differentiating the single-stream block's fused pair of Linears, and the fusion that made the forward fast makes the backward awkward: `linear2`'s input was a CONCATENATION, so its input gradient has to be cut in two at column C \u2014 the first slice is the attention path's gradient and goes straight out, the second slice has to run back through a tanh-GELU before it meets `linear1`. Four GEMMs, two of them weight gradients that reduce over all 118,800 tokens." }, { "name": "hunyuan-token-replace-i2v", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "GB/s", "roofline_us": 566.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "i2v", "image-to-video", "token-replace", "diffusion-transformer", "adaln", "modulation", "video-generation", "memory-bound" ], "description": "HunyuanVideo-I2V conditions on a reference image by REPLACING the first latent frame's tokens with the clean image latent. Those tokens are not noisy, so they must not be conditioned on the current timestep: every block runs its modulation Linear TWICE \u2014 once on the timestep vector and once on a t=0 vector \u2014 and then applies a DIFFERENT shift/scale/gate to the first GH*GW = 3600 tokens than to the other 115,200. The result is a gated residual add plus a LayerNorm-and-modulate whose parameters change part-way down the sequence." }, { "name": "hunyuan-varlen-multiresolution", "family": "Video \u2014 HunyuanVideo MMDiT", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 9484.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hunyuanvideo", "varlen", "multi-resolution", "cu-seqlens", "joint-attention", "flash-attention", "packed", "video-generation", "load-balance" ], "description": "A HunyuanVideo server does not get one resolution. A 544p 5-second clip is 12,240 latent tokens, a 720p 5-second clip is 46,800, and a 720p 129-frame clip is 118,800 \u2014 and they arrive in the same batch. Padding to the longest would throw away most of the machine, so the sequences are packed end to end behind a cu_seqlens array, each one carrying its own video tokens followed by its own text tokens, with full bidirectional attention inside a sequence and none across. Work grows as L^2, so a 6x spread in length is a 36x spread in work per sequence." }, { "name": "hybrid-layer-output-gate", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 1767.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "qwen3-next", "hybrid-attention", "output-gate", "gated-attention", "rmsnorm", "silu", "gemm", "fusion" ], "description": "Hybrid-attention models (Qwen3-Next, and every gated-DeltaNet / linear-attention block that follows it) do not send the attention output straight into the output projection. They RMS-normalise it per head, multiply by an output gate projected from the layer input, and only then project back to the model width. Run as separate ops it is two GEMMs plus four full round-trips of a (T, H*Dh) activation through HBM; fused it is two GEMMs and nothing else." }, { "name": "hybrid-ssm-attn-parallel-decode", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "GB/s", "roofline_us": 731.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "hybrid", "ssm", "linear-attention", "gqa", "decode", "kv-cache", "recurrent-state", "memory-bound" ], "description": "The parallel flavour of the hybrid architectures \u2014 Hymba-style heads where attention and a state-space branch run side by side inside the SAME layer and their outputs are normalised and blended, rather than alternating layer by layer. At decode that means one kernel touching two completely different memories in one step: a KV cache that grows with context and is streamed, and a fixed-size recurrent state that is read, decayed, rank-1 updated and written back. Both are pure bandwidth, and they want opposite things from the scheduler." }, { "name": "image-token-merge-pixelunshuffle", "family": "Multimodal & audio", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 421.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "vision-language", "token-merge", "pixel-unshuffle", "layernorm", "multimodal", "memory-bound" ], "description": "Every modern VLM shrinks its vision tokens 4x before they reach the language model: the InternVL/Qwen2-VL merger takes each 2x2 block of patch features, concatenates them along the channel axis (a pixel-unshuffle), and LayerNorms the resulting 4C-wide vector. It is the one step that touches the full, un-merged vision feature map \u2014 hundreds of megabytes for a video \u2014 and it combines an awkward strided gather with a reduction along the gathered axis." }, { "name": "instruction-interpreter-dispatch", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "task-graph", "scheduler", "work-queue", "interpreter", "dependency-tracking" ], "description": "Megakernel compilers (Mirage/MPK, Hazy's low-latency stack) do not hard-code the model -- they lower it to a stream of tasks and let one persistent kernel pop, execute and retire them, decrementing successors' dependency counters as it goes. Build that executor. The 512-instruction program is a GPU tensor that changes on every call, so it cannot be specialised away; graded on instructions per second." }, { "name": "int4-kv-cache-quant", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 546.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int4", "kv-cache", "quantization", "memory-bound", "kivi", "low-precision" ], "description": "KIVI-style int4 KV-cache compression: take the bf16 keys and values coming out of a decode step and squeeze them to 4 bits, with an affine scale and zero-point per 64-element group along the head dimension. It shrinks the cache 4x \u2014 the single biggest lever on long-context serving batch size \u2014 but it sits on the critical path of every step, so it has to run at HBM speed: one read of the bf16 tensors, one packed write, nothing in between." }, { "name": "int4-weight-only-decode-gemv", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "GB/s", "roofline_us": 218.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int4", "gemv", "decode", "quantization", "memory-bound", "low-precision", "w4a16" ], "description": "Autoregressive decoding at batch 1 is not a GEMM problem \u2014 every projection reads a whole int4 weight matrix to produce a single output vector, so the kernel is pure HBM bandwidth and the only thing that matters is that each packed byte crosses the bus exactly once and gets unpacked in registers. This is the regime where a weight-only-quantised model actually earns its 4x, and where a dequantise-then-matmul path gives all of it back." }, { "name": "int8-w8a8-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int8", "w8a8", "smoothquant", "quantization", "gemm", "low-precision" ], "description": "W8A8 is the quantisation scheme every INT8 serving stack ships: both the weights and the activations are 8-bit integers, the contraction is an exact int32 dot product, and the result is rescaled by one scale per activation row and one per weight column. The integer tensor cores run at twice bf16 throughput, but only if the kernel keeps the operands 8-bit and does the affine rescale in the epilogue instead of dequantising into HBM first." }, { "name": "istft-overlap-add", "family": "Multimodal & audio", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 516.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "audio", "vocoder", "istft", "overlap-add", "tts", "asr", "memory-bound" ], "description": "Every spectrogram-domain vocoder \u2014 Vocos, iSTFTNet, the HiFi-GAN variants that predict magnitude and phase, and the streaming ASR frontends that run in reverse \u2014 ends the same way: take frames of time-domain samples, window them, add them into an output waveform at a hop stride, and divide by the accumulated squared window. It is the transpose of framing, so the reads are contiguous and the writes collide, which is exactly the shape a naive implementation handles by materialising a frames-by-length matrix and reducing it." }, { "name": "kda-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 539.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kda", "kimi-linear", "backward", "linear-attention", "gpu" ], "description": "The training-side counterpart of Kimi Linear's KDA layer: the delta rule with a per-CHANNEL forget gate. The reference obtains the five gradients by running the chunked fp32 forward under autograd, which materialises every chunk intermediate in HBM; a fused backward recomputes them instead and carries the reverse state scan in registers." }, { "name": "kda-decode-step", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 474.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kda", "kimi-linear", "decode", "linear-attention", "delta-rule", "memory-bound", "gpu" ], "description": "This is what a Kimi-Linear-style hybrid model actually runs at every generated token: ONE Kimi Delta Attention recurrent step \u2014 channel-wise gated delta-rule state update plus readout \u2014 applied to every sequence in the decode batch at once. There is no chunking and no intra-chunk matmul; the whole thing is a bandwidth problem over the (K, V) recurrent state, which for a large decode batch is a gigabyte of HBM traffic per layer per token." }, { "name": "kda-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 539.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kda", "kimi-linear", "linear-attention", "delta-rule", "gpu" ], "description": "Kimi Delta Attention is the linear-attention layer of Kimi Linear: the delta rule with a per-CHANNEL forget gate, so the decay cannot be factored out of the chunk matmuls." }, { "name": "kv-block-pack-for-transfer", "family": "KV cache & paging", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 586.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kv-cache", "disaggregated", "prefill-decode", "tensor-parallel", "transfer", "paged-attention", "serving", "memory-bound" ], "description": "Before a prefill engine can hand a request to a decode engine it has to pack the request's KV out of its paged pool into a contiguous wire buffer \u2014 one buffer per destination rank, because the decode side usually runs at a different tensor-parallel degree and each of its ranks owns a different slice of the heads. The pages are scattered, the last block of every sequence is only partly full, and nothing may be sent twice: it is a strided gather of gigabytes of bf16 KV into R separately addressable buffers." }, { "name": "kv-cache-4bit-groupwise", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "GB/s", "roofline_us": 520.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int4", "kv-cache", "decode", "attention", "gqa", "quantization", "low-precision", "memory-bound" ], "description": "A 4-bit KV cache quadruples the sequences a server can hold, but only if the decode attention reads the packed nibbles directly: dequantising the cache into bf16 first costs more bandwidth than the compression saved. This kernel walks a KIVI-style cache \u2014 two 4-bit codes per byte with an affine scale and zero-point per 32 elements of the head dimension \u2014 and turns it into attention output for one decode step, at long context and large batch, where the cache is the only thing that matters." }, { "name": "kv-cache-block-compaction", "family": "KV cache & paging", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 625.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kv-cache", "paged-attention", "compaction", "defragmentation", "serving", "memory-bound", "vllm" ], "description": "A long-running serving engine's page pool fragments: live blocks end up scattered across a pool much larger than the memory actually in use. Compaction moves every live block to a dense destination given by a source->destination mapping the allocator computed, and rewrites the page table so the sequences still find their pages. It is a page-granularity gather-scatter over gigabytes of bf16 KV plus an index remap, and it blocks new admissions while it runs." }, { "name": "kv-cache-fp8-quant-paged", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 473.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "kv-cache", "paged-attention", "quantization", "memory-bound", "serving", "low-precision" ], "description": "Every FP8-KV serving engine runs this on the critical path of every step: take the freshly projected keys and values, quantise them to FP8 with a scale per (token, head), and scatter them into a PAGED cache through a slot map that sends each token to an arbitrary page and offset. Halving the cache is the biggest lever on long-context batch size, but the write has to run at HBM speed: one read of the bf16 tensors, one indirect FP8 write, nothing in between." }, { "name": "kv-cache-page-alloc", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 417.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kv-cache", "paged-attention", "allocator", "block-table", "scheduler", "vllm", "memory-bound" ], "description": "Before every forward pass a paged-attention engine has to hand out the KV pages the scheduled sequences will need: pop them off the free pool, append them to each sequence's block table, and compact what is left of the pool. The block table is provisioned for maximum concurrency times maximum context, so this innocuous bookkeeping step rewrites a multi-gigabyte integer table on the critical path of every step, and it must be exactly reproducible." }, { "name": "kv-layout-contig-to-paged", "family": "KV cache & paging", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 636.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kv-cache", "disaggregated", "prefill-decode", "paged-attention", "layout", "varlen", "serving", "memory-bound" ], "description": "In disaggregated serving the prefill engine produces KV varlen-packed and token-major \u2014 one contiguous run per sequence, per layer \u2014 while the decode engine wants it paged, with K and V interleaved and the head axis outside the page's token axis. Handing a prompt over therefore means a scattered page-granular write plus a transpose inside every page, on gigabytes of bf16 KV, before the first decode step can run." }, { "name": "kv-repage-block-size-convert", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 645.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kv-cache", "paged-attention", "repaging", "block-size", "disaggregated", "prefix-cache", "serving", "memory-bound" ], "description": "Two serving engines almost never agree on a KV page size: a prefill pool built from 16-token pages has to be re-paged into the 32-, 64- or 128-token pages the decode engine's attention kernel was compiled for, and a prefix cache shared between them has to do the same. Each destination page gathers M scattered source pages, sequences whose page count is not a multiple of M leave a hole that must be zeroed, and the whole cache moves through HBM once." }, { "name": "latent-blend-i2v-mask", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 509.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "image-to-video", "inpainting", "masking", "video-generation", "memory-bound" ], "description": "Image-to-video and video inpainting pin part of the latent to a known reference: after every denoising step the known region is overwritten with the ground-truth latent re-noised to the CURRENT sigma, and the unknown region keeps what the model produced. The mask is per pixel and per frame but shared across the 16 latent channels, so a naive implementation re-reads it 16 times; a good one reads it once. Three full-size latents in, one out, once per step per clip." }, { "name": "latent-interpolate-keyframe", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 314.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "video-generation", "keyframe", "gather", "interpolation", "memory-bound" ], "description": "Long-video pipelines are conditioned on a handful of keyframe latents and have to expand them into a full-length latent track: every output frame linearly interpolates between two keyframes chosen per (clip, frame), and the same keyframe is re-read by many output frames. The keyframe tensor is small enough to stay resident while the output is gigabytes, so the achievable bandwidth depends entirely on whether the gather is turned into a reuse pattern or left as random access." }, { "name": "latent-normalize-perchannel", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 385.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "vae", "latent", "normalization", "kl", "sampling", "video", "wan", "hunyuanvideo", "memory-bound" ], "description": "Every video the Wan / HunyuanVideo pipeline trains on goes through the same encode tail: the encoder emits 32 channels of moments, they are split into a mean and a log-variance, a latent is sampled, the KL term is reduced over the whole clip, and the 16 latent channels are normalised by the model's per-channel latents_mean / latents_std before the diffusion transformer ever sees them. Written as a dozen torch ops on a batch of 1080p clips it is ten passes over several gigabytes; it should be one." }, { "name": "latent-patchify-3d", "family": "Video \u2014 sparse / efficient attention", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 300.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "video-generation", "patchify", "layout", "transpose", "memory-bound" ], "description": "Before every denoising step a video DiT turns its 5-D latent into a flat token sequence: each 1x2x2 space-time patch of the (B, 16, T, H, W) latent becomes one token whose 64 features are the patch's channels interleaved with its 2x2 spatial offsets, and each token carries its (t, h, w) coordinate for 3-D RoPE. It is a pure layout transform \u2014 no arithmetic at all \u2014 but the source stride pattern fights coalescing in both directions, so a naive permute-and-reshape moves the data several times over." }, { "name": "laurel-lowrank-residual", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 521.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "laurel", "residual", "low-rank", "rmsnorm", "gemma", "memory-bound", "fusion" ], "description": "LAuReL replaces the plain residual connection with a learned one: alongside the identity path the stream is projected down to a small rank r, back up to full width, RMS-normalised and added. It costs a fraction of a percent of the parameters and buys most of the quality of an extra layer, which is why on-device models ship it in every block. The kernel is an awkward shape for a library \u2014 two skinny GEMMs and a row reduction chained on the same activation \u2014 so unfused it makes four passes over the largest tensor in the model to do the work of one." }, { "name": "layernorm-residual-fp8-backward", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 824.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "layernorm", "backward", "fp8", "residual", "memory-bound", "training" ], "description": "FP8 training fuses three things between transformer blocks: adding the residual, LayerNorm-ing the result, and quantising it to FP8 for the next GEMM. The backward has to undo all three in one pass \u2014 dequantise an FP8 gradient with its per-128-block scales, run the LayerNorm backward (which needs two row reductions AND two full-height column reductions), and fold the residual branch's gradient back in. Autograd does it as a dozen full-size elementwise kernels plus separate reductions, each one a full round trip through HBM." }, { "name": "layerscale-residual-fused", "family": "Normalization, RoPE & elementwise fusion", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 703.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "layerscale", "residual", "dit", "video-diffusion", "mixed-precision", "memory-bound" ], "description": "Deep diffusion transformers keep every sublayer behind a LayerScale: a learned per-channel gain, initialised near zero, that decides how much of each branch is allowed into the residual stream. Because those gains are small and the stack is 40-60 blocks deep, the stream itself is carried in fp32 while every branch and every matmul input stays bf16 \u2014 so the seam between two sublayers is a mixed-precision accumulate that produces two tensors at once: the updated fp32 stream and the bf16 copy the next projection consumes. It runs twice per block, on the largest tensor in the model." }, { "name": "lightning-attn-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "lightning-attention", "minimax", "backward", "linear-attention" ], "description": "The training-side counterpart of MiniMax-01's Lightning Attention: no softmax, a single (K, V) state per head, and a DATA-INDEPENDENT exponential decay whose rate is fixed per head. Because the forward carries the state in AND out, the backward is seeded from BOTH ends \u2014 the incoming output gradient `do` and the incoming state gradient `dht` \u2014 and it must return a gradient for the per-head log-decay itself, a scalar per head reduced over the entire (B, T, K, V) grid." }, { "name": "lightning-attn-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 343.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "lightning-attention", "minimax", "linear-attention", "gpu" ], "description": "Lightning Attention is the linear-attention layer behind MiniMax-01: no softmax, a single (K, V) state per head, and a DATA-INDEPENDENT exponential decay whose rate is fixed per head. It is the right-product form \u2014 the state is carried in and out \u2014 so the kernel must consume an incoming (K, V) state and return the outgoing one alongside the output." }, { "name": "log-linear-attn-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "log-linear-attention", "linear-attention", "hierarchical", "backward", "gpu" ], "description": "The training-side counterpart of Log-Linear Attention (2025): a hierarchy of O(log T) dyadic states, each carrying its own learned per-position scale, with every (query, key) pair routed to exactly one level. The backward has to push gradients back through all O(log T) levels at once \u2014 including into the per-level scales and into the shared log-decay, which every level reads. The reference obtains the five gradients by replaying the level-by-level fp32 forward under autograd, which re-reads q, k, v and the gates once per level in each direction." }, { "name": "log-linear-attn-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "log-linear-attention", "linear-attention", "hierarchical", "gpu" ], "description": "Log-Linear Attention (2025) replaces linear attention's single fixed-size state with a HIERARCHY of O(log T) states, one per dyadic time scale. Every (query, key) pair is routed to exactly one level by the position of the highest bit in which the two indices differ, and each level carries its own learned per-position scale, so the model gets logarithmically growing memory instead of constant memory \u2014 at O(T log T) work instead of O(T^2)." }, { "name": "logits-gather-lastpos", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 1570.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "lm-head", "logits", "varlen", "cu-seqlens", "gemm", "prefill", "sampling" ], "description": "At the end of prefill only the LAST token of each sequence needs logits \u2014 that is the token the sampler turns into the first decoded one. Projecting the whole packed hidden-state buffer through a 128k-262k row LM head would be hundreds of times more work, so every serving stack gathers the last positions out of the varlen buffer first and runs one very tall, very thin GEMM on them." }, { "name": "lora-backward-fused", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 822.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "lora", "adapter", "backward", "fine-tuning", "gemm", "fusion", "post-training" ], "description": "The backward of a LoRA layer is five GEMMs of wildly different shapes: one big frozen dgrad, two skinny rank-r products that share an intermediate, and two tall-thin reductions over the token axis that produce the only tensors that actually get updated. Autograd runs them as five launches with three round trips through HBM; a fused kernel computes the shared (tokens x rank) gradient once and lets the big dgrad pay for the rest." }, { "name": "lora-fused-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 800.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "lora", "adapter", "fine-tuning", "gemm", "fusion", "post-training" ], "description": "A LoRA layer is one big frozen GEMM plus two tiny ones, and the tiny ones are the problem: at rank 16-64 the adapter GEMMs have almost no arithmetic intensity, they read the activations a second time, they force the rank-wide intermediate through HBM, and they add two kernel launches to every projection of every layer. Fusing all three into a single pass \u2014 with the (tokens x rank) intermediate living in shared memory \u2014 is what every serving stack and every fine-tuning framework wants and what this kernel has to do." }, { "name": "ltx-fractional-rope3d", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 510.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "ltx-video", "video-diffusion", "rope", "3d-rope", "rmsnorm", "qk-norm", "fractional-coordinates", "fusion", "memory-bound" ], "description": "LTX-Video's tokens do not sit on a regular grid. Conditioning frames are injected at arbitrary times, latents are assembled from pieces generated at different scales, and the whole sequence is addressed by an explicit per-token (frame, height, width) coordinate in floating point \u2014 so the rotary embedding cannot be a precomputed table indexed by position, it has to be evaluated from the coordinates themselves. The head dim splits into three bands with a few leading channels deliberately left unrotated, and the whole thing follows a per-head RMSNorm of q and k that a good kernel does in the same pass." }, { "name": "ltx-highcompression-vae-decode", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 942.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "ltx-video", "vae", "video-diffusion", "decoder", "conv3d", "depth-to-space", "pixel-shuffle", "causal", "upsample" ], "description": "LTX-Video compresses 32x32x8, so its DiT is cheap and its VAE decoder does almost all of the work: every decoder stage takes a small latent volume, runs a causal 3x3x3 convolution that expands the channel axis by the product of the three upsampling factors, and spends those channels on a depth-to-space in TIME as well as space. The first rt-1 frames of the result are then dropped to keep the decode causal, and a nearest-neighbour copy of the input is added back. One stage turns a 90 MB latent into a 700 MB feature volume." }, { "name": "ltx-per-token-adanorm", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 429.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "ltx-video", "video-diffusion", "dit", "adaln", "rmsnorm", "per-token-modulation", "diffusion-transformer", "memory-bound" ], "description": "Because LTX-Video conditions on video (keyframes, extension, inpainting), different tokens of the same latent are at different noise levels \u2014 so its DiT does not broadcast one modulation vector per sample the way every other video DiT does. Each token carries its OWN six modulation chunks, which makes the conditioning tensor SIX TIMES the size of the activation it modulates and turns a trivially cheap adaLN into the single largest memory read in the block. A learned (6, D) table is added to it first." }, { "name": "ltx-per-token-adanorm-backward", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 333.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "ltx-video", "video-diffusion", "backward", "adaln", "rmsnorm", "per-token-modulation", "training", "reduction", "memory-bound" ], "description": "Training LTX-Video means differentiating a modulation that is PER TOKEN, which inverts the usual adaLN backward: there is no reduction over the token axis for the conditioning gradient \u2014 it comes out the same 2x-wide shape it went in, the largest tensor the kernel writes \u2014 while the small learned scale_shift_table needs a reduction over every token in the batch. On top of that sits an RMSNorm backward whose row reduction has to be shared with the modulation gradient, or the activation gets read twice." }, { "name": "ltx-rectified-flow-shift", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 300.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "ltx-video", "video-diffusion", "rectified-flow", "scheduler", "sampler", "per-token-timestep", "stochastic-sampling", "memory-bound" ], "description": "LTX-Video's sampler is not a plain flow-matching Euler step. Every token carries its OWN timestep \u2014 conditioning frames sit at 0 and must come out untouched, partially-conditioned regions sit somewhere in between \u2014 each timestep is pushed through a resolution-dependent shifted schedule before it becomes a noise level, and the update is stochastic: it reconstructs the clean latent and re-noises it to the next level rather than integrating the velocity. Written as a chain of torch ops that is eight elementwise kernels over the whole in-flight batch, every step of every request." }, { "name": "mamba2-ssd-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 343.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mamba2", "ssd", "selective-scan", "backward", "gpu" ], "description": "The training-side counterpart of the Mamba-2 SSD layer: the state-space-duality scan with a per-step, input-dependent scalar decay exp(dt*A). The reference obtains the six gradients by running the chunked fp32 forward under autograd, which materialises every chunk intermediate in HBM; a fused backward recomputes them and carries the reverse state scan in registers. The awkward gradients are the reductions: `ddt` contracts the whole state, and `dA`/`dD` are single per-head scalars summed over the entire batch and sequence." }, { "name": "mamba2-ssd-decode-step", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 474.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mamba2", "ssd", "decode", "selective-scan", "state-space", "memory-bound", "gpu" ], "description": "This is what a Mamba-2 layer runs at every generated token: ONE selective-scan step \u2014 discretise, decay the (N, P) SSM state, add the rank-1 write, read it out with C and add the D skip \u2014 applied to every sequence in the decode batch at once. There is no chunk, no segsum and no state-space-duality matmul; it is a pure streaming problem over the SSM state cache, which for a large decode batch is a gigabyte of HBM traffic per layer per token." }, { "name": "mamba2-ssd-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "compilation", "kernels", "mamba", "ssm", "ssd", "selective-scan", "gpu", "triton" ], "description": "Implement the Mamba-2 SSD (state-space duality) selective-scan forward: a per-(batch,head) linear recurrence with input-dependent scalar decay, computed in parallel across the sequence. Graded on correctness vs an independent reference (gate) + a continuous speedup score over the reference, rising to a state-of-the-art kernel, on GPU." }, { "name": "megakernel-batch4-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "batching", "low-latency", "memory-bound" ], "description": "The batched form of the whole-model decode megakernel: four independent sequences decode in lockstep through one persistent kernel. The weight stream is shared across all four, so the per-token roofline is a quarter of the batch-1 task and the inner multiplies become 4-row GEMMs -- which is exactly where an unfused implementation wastes the reuse." }, { "name": "megakernel-gated-deltanet-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "gated-deltanet", "linear-attention", "delta-rule", "hybrid", "qwen3-next", "low-latency" ], "description": "Fuse a 24-layer Qwen3-Next-shaped hybrid -- 18 Gated DeltaNet blocks and 6 full-attention blocks, each with a SwiGLU MLP -- into one persistent kernel. Each DeltaNet layer carries a 128x128 matrix state per head that is decayed, READ, corrected and written every step: the delta rule reads the memory it is about to overwrite, so 75 MB of state is touched twice per token and the dependency is inside the layer, not between layers." }, { "name": "megakernel-gqa-paged-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "paged-attention", "kv-cache", "gqa", "long-context" ], "description": "The whole-model decode megakernel with production KV storage: the cache is a pool of 128-token pages and a per-sequence page table maps logical position to physical page, with the pages deliberately shuffled through the pool. The weight stream is still a schedule you can prefetch; the 538 MB of KV only has addresses after a table lookup." }, { "name": "megakernel-int4-weight-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "int4", "awq", "gptq", "quantization", "weight-only", "low-latency" ], "description": "Fuse a 28-layer 3B decoder whose weights arrive as packed 4-bit codes with per-group scales and zero points -- the AWQ/GPTQ layout -- into a single persistent GPU kernel. Four bits per weight puts the roofline at 400 us, but only if the unpack and the dequantise happen in registers between the load and the FMA. Materialise a bf16 copy and you have given the whole advantage back." }, { "name": "megakernel-llama1b-bf16-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "llama", "low-latency", "memory-bound" ], "description": "Fuse an entire 16-layer decoder forward pass -- embedding, 16 attention+MLP blocks, and a tied 128k LM head -- into a single persistent GPU kernel. At batch 1 this is pure weight bandwidth, and a per-op implementation drains the memory pipeline at every one of ~628 kernel boundaries. Graded on tokens/s, gated on actually being a megakernel." }, { "name": "megakernel-llama1b-fp8-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "fp8", "quantization", "low-latency" ], "description": "The fp8 form of the whole-model decode megakernel: weights arrive already quantised to e4m3 with per-output-channel scales, halving the bytes that must stream per token and moving the roofline to ~258 us. Fusing the dequant into the GEMV pipeline is the point." }, { "name": "megakernel-llama1b-longctx-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "long-context", "kv-cache", "memory-bound" ], "description": "The long-context form of the whole-model decode megakernel. At 32k of KV the bottleneck flips: reading the cache costs more per token than reading the weights, so the fusion has to keep the attention streaming while the MLP weights load. A different balance from the short-context case, and a different kernel." }, { "name": "megakernel-llama8b-bf16-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "llama", "low-latency", "memory-bound", "8b" ], "description": "Fuse an entire 32-layer 8B decoder forward pass -- embedding, 32 attention+MLP blocks and a tied 128k LM head -- into a single persistent GPU kernel. 15 GB of weights have to cross HBM for every single token, so the roofline is 3.2 ms and every kernel boundary you remove is real time. Graded on tokens/s, gated on actually being a megakernel." }, { "name": "megakernel-lm-head-sample-inline", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "lm-head", "sampling", "min-p", "logits", "fused-epilogue" ], "description": "A 128k-wide logit matrix for 1024 running sequences is 525 MB, and an unfused sampler reads and writes it six times over on top of a 525 MB weight read. Fuse the final RMSNorm, the tied LM head, temperature, min-p filtering and inverse-CDF sampling into one kernel and the logits never exist. Sampling is stochastic, so correctness is graded statistically against the reference's own distribution -- never on token equality." }, { "name": "megakernel-mamba-hybrid-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "mamba", "ssm", "hybrid", "state-space", "low-latency" ], "description": "Fuse a 24-layer hybrid -- 18 Mamba2 SSD blocks and 6 full-attention blocks, each with a SwiGLU MLP -- into one persistent kernel. The two mixer types have completely different state: attention streams a KV cache that grows with context, Mamba hammers a fixed 2 MB per layer of recurrent state read-modify-write every single step. One kernel, two residency patterns." }, { "name": "megakernel-mtp-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "mtp", "multi-token-prediction", "speculative-decoding", "low-latency" ], "description": "Fuse a 16-layer decoder AND a DeepSeek-V3-style MTP module into one persistent kernel. The main model emits logits for the next token; the MTP head takes the same final hidden state plus the following token's embedding, projects 2d->d, runs one more decoder block against its own KV cache, and emits logits two tokens ahead. Both are graded, both share the tied head, and the step stops being a straight line." }, { "name": "megakernel-nvfp4-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "nvfp4", "fp4", "blackwell", "microscaling", "quantization", "low-latency" ], "description": "Fuse a 36-layer 4B decoder whose weights arrive in NVFP4 -- e2m1 nibbles with an e4m3 scale every 16 elements and one fp32 scale per tensor -- into a single persistent GPU kernel. The e2m1 ladder is not uniform, so dequantisation is a table lookup rather than a multiply, and the block scales are themselves an 8-bit float you have to decode." }, { "name": "megakernel-prefill-chunk", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "chunked-prefill", "compute-bound", "gemm", "causal-attention" ], "description": "The other half of a serving stack: 256 tokens go through the entire 16-layer model in one call, filling the KV cache and returning logits for the last position only. The matmuls become real GEMMs and the regime flips from bandwidth to compute -- but the fusion problem is the same, and now you have arithmetic intensity to protect rather than bytes to save." }, { "name": "megakernel-qwen3-8b-fp8-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "qwen3", "fp8", "qk-norm", "quantization", "low-latency" ], "description": "Fuse a 36-layer Qwen3-8B-shaped decoder into a single persistent GPU kernel: fp8 e4m3 weights with per-channel scales, per-head QK-RMSNorm sitting between the QKV projection and RoPE, and an untied 152k LM head. 7.6 GB of weights cross HBM per token and the dequantisation has to ride inside the load pipeline, not in front of it." }, { "name": "megakernel-qwen3-moe-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "moe", "mixture-of-experts", "sparse", "low-latency" ], "description": "Fuse a 16-layer mixture-of-experts decoder -- GQA attention plus a 64-expert top-8 routed MLP per layer -- into a single persistent GPU kernel. The model holds 5.4 B parameters but touches only 1.2 B per token, so the kernel has to resolve 128 expert weight addresses at run time from a dispatch plan instead of streaming a fixed sequence of matrices." }, { "name": "megakernel-spec-decode-verify", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "speculative-decoding", "tree-attention", "eagle", "medusa", "low-latency" ], "description": "Verify a speculative draft TREE in one fused forward pass: 8 candidate nodes, each attending to the full committed KV cache plus exactly its own ancestors, each carrying the RoPE position of its depth so siblings share a position. The tree mask is 8x8 of data handed to you per call -- not a causal triangle, not decomposable, and sitting next to a 2.5 GB weight stream." }, { "name": "megakernel-untied-head-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "lm-head", "large-vocab", "low-latency", "memory-bound" ], "description": "A whole-model decode megakernel where the LM head is UNTIED and enormous: 262144 x 2560, 671 MB, 31% of everything you move per token, and a matrix that cannot share a load with the embedding gather the way a tied head can. The head stops being an epilogue and becomes the largest single object in the pipeline." }, { "name": "mesa-net-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 291.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mesanet", "backward", "linear-attention", "least-squares", "conjugate-gradient" ], "description": "The training-side counterpart of MesaNet (2025), whose readout is a LEAST-SQUARES fit: two gated states (the key Gram and the key-value matrix) and a regularised DxD solve at every position. Differentiating a solve costs a SECOND solve against the same system, and the resulting rank-1 adjoint has to be propagated back through the gated Gram \u2014 so the reverse pass carries its own pair of states and needs the solver embedded in it just as much as the forward does." }, { "name": "mesa-net-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 233.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mesanet", "linear-attention", "least-squares", "conjugate-gradient" ], "description": "MesaNet (2025) replaces the linear-attention readout with a LEAST-SQUARES one: it carries two gated states, the key Gram matrix and the key-value matrix, and at every position solves a regularised DxD linear system before reading out. A fast kernel has to embed an iterative solver (conjugate gradient) inside the sequence scan instead of calling a dense solve." }, { "name": "min-p-sampling-filter", "family": "Sampling & speculative decoding", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 416.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sampling", "min-p", "decode", "softmax", "memory-bound", "vllm", "sglang" ], "description": "Min-p truncation keeps every token whose probability is at least `min_p` times the most likely token's \u2014 a scale-free alternative to top-p that widens on flat distributions and collapses on confident ones. It runs once per decode step on the full logit matrix of the batch, between the output projection and the sampler, and the stock torch path costs four separate passes over a gigabyte of fp32 logits for what is fundamentally one streaming compare." }, { "name": "mixed-precision-gemm-split", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 809.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int8", "mixed-precision", "llm-int8", "outlier", "quantization", "gemm", "low-precision", "split-k" ], "description": "INT8 activations break on transformers because a handful of input channels carry values 20x larger than everything else. The fix that actually ships \u2014 LLM.int8(), Atom, and every outlier-aware W8A8 stack \u2014 is to split the contraction axis: the few high-magnitude channels stay bf16, all the rest go to int8 with per-token and per-channel scales, and the two partial products are summed. Run as two library calls it costs two extra full-size passes over the output; fused it is one mainloop with two operand types and one epilogue." }, { "name": "mla-backward", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 1178.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mla", "deepseek", "latent-attention", "backward", "attention" ], "description": "The training-side counterpart of DeepSeek's Multi-head Latent Attention prefill: one low-rank latent per token is up-projected into per-head keys and values, a decoupled-RoPE term is added to the logits, and dense causal attention runs on top. The backward has to push gradients back THROUGH the up-projection \u2014 down to the shared latent and to the two projection matrices \u2014 without ever materialising the per-head expansion it came from." }, { "name": "mla-decode", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "compilation", "kernels", "mla", "attention", "decode", "flash-attention", "deepseek", "gpu", "cuda", "cutlass" ], "description": "Write a fast Multi-head Latent Attention (MLA) decode kernel: given the absorbed 576-dim latent query/KV-cache (DeepSeek-V2/V3, 128 heads, 512 value dim + 64 decoupled-RoPE), produce a fused flash-decode kernel that matches a torch reference AND is much faster across a RANGE of (B,L) decode sizes (batch 8-128, cache 2k-32k, incl. a big case). torch.compile (~2.2x) and SDPA (head_dim 576) stay far behind -> needs a real fused kernel (Triton split-KV / CUDA / CuTe DSL, FlashMLA-style). Graded on correctness (gate) + a continuous GEOMEAN-speedup score over the reference across several undisclosed shapes, normalized to a live-benchmarked state-of-the-art kernel (FlashMLA), on GPU." }, { "name": "mla-decode-paged", "family": "KV cache & paging", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "GB/s", "roofline_us": 350.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mla", "deepseek", "latent-attention", "decode", "paged-attention", "kv-cache", "flashmla", "memory-bound", "flash-decoding" ], "description": "What a DeepSeek-V3-class server actually runs at decode: Multi-head Latent Attention in its ABSORBED form, where every head's query has already been folded into the latent space so the cache holds ONE low-rank vector per token \u2014 which serves as both the key and the value \u2014 and that cache is not contiguous but scattered across fixed-size PAGES reached through a per-request page table, with a different history length per request. The latent is read once and the whole head group reuses it, so this is a pure BANDWIDTH task scored in GB/s against the unavoidable cache traffic." }, { "name": "mla-prefill", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 1030.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mla", "deepseek", "latent-attention", "prefill" ], "description": "DeepSeek's Multi-head Latent Attention stores a single low-rank latent per token instead of per-head K and V. At PREFILL the latent must be up-projected into per-head keys and values and then attended over, with a decoupled RoPE component carried separately. Materialising the up-projected K and V costs more HBM traffic than the attention itself, so the win is fusing the up-projection into the attention mainloop." }, { "name": "mm-embed-merge-scatter", "family": "Multimodal & audio", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 410.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "vision-language", "multimodal", "scatter", "prefix-sum", "prefill", "memory-bound" ], "description": "Every VLM prefill ends with the same step: the language model's token embeddings are built, the vision tower's output is cast down, and the image/video embeddings are scattered into the positions the `` placeholders occupy. Deciding WHERE each vision embedding goes is a prefix sum over the placeholder mask, and the copy itself moves the entire prompt \u2014 for a video prompt that is tens of thousands of 3584-wide rows, most of them coming from fp32 and landing in bf16." }, { "name": "moba-backward", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 540.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moba", "kimi", "block-sparse", "attention", "backward", "gpu" ], "description": "The training-side counterpart of MoBA (Moonshot / Kimi): each query token attends only to the top-k causal blocks its own gate picked, plus its own block. The routing is frozen, so the backward is a block-sparse attention backward whose sparsity pattern is PER (token, head) \u2014 two tokens in the same block generally selected different key blocks, so dk and dv are scattered accumulations over an irregular set of contributing queries. The reference gets the three gradients by running the DENSE masked fp32 attention under autograd, which does O(T^2) work no matter how sparse the routing is." }, { "name": "moba-block-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kernels", "moba", "kimi", "sparse-attention", "block-attention", "triton", "gpu" ], "description": "Write a fast MoBA (Mixture of Block Attention, Kimi arXiv 2502.13189) kernel. Each query routes to the top-k fully-past KV blocks (scored against per-block key means) plus its own causal block; routing is PER TOKEN so the gather is ragged. Gated on ROW-WISE correctness (>=98% of (token,head) rows within relerr 2e-2 \u2014 a 2% budget for genuinely ambiguous top-k tie-flips); scored on ACHIEVED TFLOP/s (geomean over undisclosed long-context low-density configs, uncapped speed leaderboard, 0 if wrong). No attention library is installed and there is no internet, so the kernel must be the agent's own." }, { "name": "mochi-asymm-joint-attention", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 5107.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mochi", "asymmdit", "video-diffusion", "joint-attention", "flash-attention", "varlen", "cu-seqlens", "packed", "diffusion-transformer" ], "description": "Mochi-1's AsymmDiT refuses to pad. Its joint attention packs every sample's visual tokens followed by only its VALID text tokens into one flat key/value buffer addressed by cu_seqlens, so no cycle is ever spent on a padding slot \u2014 while the queries stay in a dense (B, Nx, H, D) layout because every sample has the same number of visual tokens, and in the later blocks the text stream is not updated at all so no text queries exist. The result is an attention whose query and key lengths differ, whose key length differs PER SAMPLE, and whose two operands live in different layouts." }, { "name": "mochi-asymm-qkv-proj", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 3621.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mochi", "asymmdit", "video-diffusion", "qkv-projection", "qk-norm", "rmsnorm", "gemm", "fusion", "diffusion-transformer" ], "description": "Mochi-1's AsymmDiT gives the visual stream four times the width of the text stream \u2014 3072 against 1536 \u2014 but both have to end up in the SAME 24x128 head space so a single joint attention can run over their concatenation. So the block opens with two QKV GEMMs that share an output width and nothing else: one with K=3072 over ~45,000 tokens, one with K=1536 over 256, writing into one packed buffer. Each stream then gets its OWN learned QK RMSNorm scale, applied per head. Run as separate torch ops the tiny text GEMM is pure launch overhead and the 0.8 GB packed buffer is written twice." }, { "name": "mochi-tanh-gated-rmsnorm", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 429.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mochi", "asymmdit", "video-diffusion", "rmsnorm", "residual", "tanh-gate", "modulation", "fusion", "memory-bound" ], "description": "Mochi-1 does not gate its residuals the way the rest of the DiT family does. Instead of scaling a branch by a raw adaLN gate and normalising the sum, it RMSNormalises the BRANCH OUTPUT, multiplies it by tanh of the gate, and only then adds the residual \u2014 and the very next thing that happens is another RMSNorm, of the sum, for the next branch's modulation. So one seam needs two dependent row reductions over a 44,520 x 3072 activation, and written as separate torch ops it is five kernels and five trips through HBM, twice per block, 48 blocks deep." }, { "name": "mochi-visual-text-split-mlp", "family": "Video \u2014 CogVideoX / Mochi / LTX", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 4829.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mochi", "asymmdit", "video-diffusion", "swiglu", "ffn", "rmsnorm", "modulation", "gemm", "fusion", "diffusion-transformer" ], "description": "Mochi-1's AsymmDiT never merges its two streams outside attention: the visual tokens and the text tokens go through completely separate SwiGLU feed-forwards whose widths differ by 2x, each preceded by its own modulated RMSNorm. One of them is 22,000 x 3072 -> 16384 -> 3072 and the other is 256 x 1536 -> 8192 -> 1536, so a naive back-to-back implementation spends a whole kernel launch and a tail wave on 0.3% of the FLOPs, and writes a 1.5 GB gated hidden state to HBM twice." }, { "name": "moe-capacity-drop-dispatch", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 483.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "dispatch", "capacity", "gshard", "scatter", "memory-bound" ], "description": "Every MoE layer that runs on a fixed-shape expert buffer has to decide, per expert, which of the tokens routed to it actually fit: each expert owns exactly `capacity` rows, tokens are placed in a fixed priority order, and everything past the limit is dropped. The placement is a per-expert running rank over the whole routing table and the payload is the largest tensor in the layer, so done as a stack of cumsums and a fancy-index scatter it costs many passes over HBM." }, { "name": "moe-combine-backward", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 581.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "combine", "backward", "scatter", "memory-bound" ], "description": "Training an MoE layer means differentiating its last step, the weighted un-permute. The gradient splits in two directions that want opposite memory access: each expert row gets the token's gradient scaled by its router weight \u2014 a scatter of the largest tensor in the layer \u2014 while each router weight gets a full-width dot product between that token's gradient and the expert output it multiplied. Written as autograd does it, the expert output tensor is streamed through HBM several times over." }, { "name": "moe-combine-weighted", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 205.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "combine", "unpermute", "scatter-add", "memory-bound" ], "description": "The last step of an MoE layer: the expert outputs are still in expert-contiguous order, and each token's K of them have to be gathered back, scaled by the router weights and summed into one hidden row. It is a weighted scatter-add over the largest tensor in the layer, so it is pure bandwidth \u2014 and done naively it reads and writes the fp32 accumulator K times instead of once." }, { "name": "moe-expert-bias-update", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 260.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "load-balancing", "histogram", "deepseek", "memory-bound" ], "description": "DeepSeek-V3 balances its experts without an auxiliary loss: at the end of every optimizer step each expert's routing bias is nudged by a fixed amount in the direction that corrects its load, using the per-expert token counts collected over the step. The nudge itself is a handful of floats, but producing the counts is a histogram over every routing decision the model made \u2014 every layer, every token, every top-k slot \u2014 and doing it one tiny launch per layer leaves the GPU idle for almost the whole kernel." }, { "name": "moe-expert-weight-gather", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 729.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "gather", "weights", "workspace", "transpose", "memory-bound" ], "description": "An MoE decode step touches only a fraction of the expert table, so systems that stream or offload expert weights stage exactly the slices the batch needs into a small contiguous workspace before the grouped GEMM runs. Two things make it more than a memcpy: the same expert is requested by many tokens and must be copied once, and the workspace has to be in the layout the GEMM wants rather than the layout the checkpoint is stored in \u2014 so the naive expression re-reads gigabytes and then transposes them in a second pass." }, { "name": "moe-group-limited-routing", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 221.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "routing", "top-k", "deepseek", "memory-bound" ], "description": "DeepSeek-V3 routes every token with a sigmoid gate, an aux-loss-free per-expert bias, and a two-stage selection: experts are partitioned into groups, the top groups are chosen by their top-2 expert-score sum, and the top-k experts are then taken only from those groups. Done as a dozen separate torch ops it costs many round trips of the (tokens x experts) score matrix through HBM; fused it is one pass, and it sits on the critical path of every MoE layer." }, { "name": "moe-grouped-gemm-contiguous", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T3", "tier_why": "grouped GEMM over a contiguous expert layout: no single library call covers it", "metric": "TFLOP/s", "roofline_us": 1374.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "grouped-gemm", "gemm", "expert-parallel", "compute-bound" ], "description": "After the router and the permute, an MoE layer's real arithmetic is one grouped GEMM: rows are already sorted so each expert owns a contiguous, 128-aligned segment, and every segment is multiplied by its own weight matrix. Looping over experts leaves the GPU mostly idle \u2014 the segments are uneven, many are small, and each launch drains the pipeline \u2014 so production MoE serving uses a single grouped launch with a scheduler that maps tiles to segments." }, { "name": "moe-grouped-gemm-varm", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T3", "tier_why": "variable-M grouped GEMM: cuBLAS has no such call", "metric": "TFLOP/s", "roofline_us": 1570.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "grouped-gemm", "gemm", "variable-length", "compute-bound" ], "description": "The MoE expert matmul as it actually arrives when nobody pads: the rows are sorted by expert, but each expert owns an arbitrary number of them \u2014 6 rows or 1400, described only by a prefix-sum offset array \u2014 and every segment is multiplied by its own weight matrix. Nothing is tile-aligned, so row tiles straddle expert boundaries and the tail of every segment is a partial tile; with 256 experts averaging a couple of hundred rows each, the scheduling of those ragged tiles is the entire performance story." }, { "name": "moe-grouped-swiglu", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T3", "tier_why": "grouped GEMM with a fused SwiGLU epilogue", "metric": "TFLOP/s", "roofline_us": 1570.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "grouped-gemm", "swiglu", "epilogue-fusion", "compute-bound" ], "description": "The first half of every MoE expert FFN: rows are already sorted so each expert owns a contiguous segment, each segment is multiplied by its own fused gate+up weight matrix, and the two halves of the result are immediately combined by SwiGLU. Run as a grouped GEMM followed by a separate activation it writes a (rows x 2*intermediate) tensor to HBM and reads it straight back; fused into the GEMM epilogue that tensor never exists, and the output written is half the size." }, { "name": "moe-router-backward", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 429.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "router", "backward", "top-k", "softmax", "compute-bound" ], "description": "Every MoE training step differentiates its router: the gradient of the renormalised top-k gate weights (plus the dense auxiliary load-balancing term) is pushed back through the softmax and then through the router's own linear projection, producing the hidden-state gradient and the router weight gradient. The discrete top-k selection is frozen, so the whole thing is a smooth function of the logits \u2014 but written as a dozen autograd ops it sends the (tokens x experts) score matrix through HBM six or seven times before either matmul even starts." }, { "name": "moe-shared-expert-fused", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 1032.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "shared-expert", "swiglu", "fusion", "deepseek", "qwen" ], "description": "DeepSeek-V3 and Qwen3-MoE both keep one always-on 'shared' expert alongside the routed ones: every token goes through a dense SwiGLU FFN whose output is added to the weighted sum of its top-k routed experts. Run as separate ops the shared FFN's tensor cores sit idle while the routed combine saturates HBM and vice versa; fused, the combine's ~1 GB of traffic hides entirely behind the shared expert's GEMMs." }, { "name": "moe-token-permute", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 205.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "permute", "gather", "scatter", "memory-bound" ], "description": "Between the router and the expert GEMM every MoE layer has to physically reorder its tokens so that all rows going to the same expert are contiguous, and remember the inverse permutation so the results can be put back afterwards. It is pure data movement over the largest tensor in the layer \u2014 each token is replicated to its top-k experts \u2014 and it is one of the top HBM consumers in a served MoE model." }, { "name": "moe-topk-softmax-fused", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 276.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "routing", "top-k", "softmax", "memory-bound" ], "description": "The simplest and most widely deployed MoE router \u2014 Mixtral, Qwen3-MoE, GPT-OSS and every framework's default `topk_softmax`: soften the gate logits over the expert axis, keep the k best experts, renormalise their weights to sum to one. As three separate torch ops it drags the (tokens x experts) score matrix through HBM four or five times and pays for a full sort it does not need; fused, it is a single streaming read at the memory roofline." }, { "name": "mrope-multimodal-apply", "family": "Multimodal & audio", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 325.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rope", "mrope", "qwen2-vl", "multimodal", "vision-language", "memory-bound" ], "description": "Qwen2-VL and Qwen2.5-VL replace 1-D RoPE with M-RoPE: every token carries three positions (temporal, height, width) and the head dimension is CUT INTO THREE SECTIONS, each rotated by a different one of them. Text tokens get all three equal, image tokens get a fixed frame index with varying h/w, video tokens vary all three. It runs on Q and K of every layer of a multimodal prefill that can be a hundred thousand tokens long, and the section-dependent table lookup makes it a very different memory pattern from ordinary RoPE." }, { "name": "mtp-head-forward", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 3337.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mtp", "multi-token-prediction", "deepseek", "speculative-decoding", "lm-head", "gemm", "rmsnorm" ], "description": "DeepSeek-V3 predicts K future tokens per position by chaining K tiny prediction modules off the main model's last hidden state: each module RMS-normalises the running state and the embedding of the next teacher-forced token, projects the pair back down to the model width, and pushes the result through the shared 128k-wide output head. It is what makes MTP training and EAGLE-style self-speculation work, and it is a chain of K dependent large-vocab GEMMs." }, { "name": "mtp-multi-head-loss", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 1666.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mtp", "multi-token-prediction", "cross-entropy", "post-training", "large-vocab", "memory-bound", "training" ], "description": "DeepSeek-V3 and Llama-4 style multi-token prediction trains D extra heads at once: depth d predicts the token d+1 positions ahead, each depth gets its own valid-token count and its own loss weight, and every depth needs a full large-vocabulary softmax backward. The logit tensor is (D, N, V) \u2014 several gigabytes \u2014 so a framework implementation that runs D separate cross-entropies materialises D full fp32 softmaxes and re-reads the whole thing five times." }, { "name": "multi-lora-batched-decode", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 477.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "lora", "multi-lora", "s-lora", "punica", "serving", "decode", "adapter", "memory-bound" ], "description": "A multi-tenant server keeps thousands of LoRA adapters resident and lets every request in the batch use a DIFFERENT one, so the decode step's low-rank branch has no weight reuse at all: each row of the batch pulls its own A and B matrices out of the adapter pool and does two tiny matvecs with them. S-LoRA and vLLM's punica path do exactly this, and at rank 16-64 it is entirely bound by streaming the adapter pool, not by the arithmetic." }, { "name": "muon-newton-schulz", "family": "Training, optimizer & RL", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "compilation", "kernels", "muon", "newton-schulz", "orthogonalization", "polar-decomposition", "symmetric-gemm", "gpu", "cute-dsl" ], "description": "Fuse Muon's 5-step quintic Newton-Schulz orthogonalization by exploiting that the Gram matrix XX\u1d40 is symmetric (symmetric GEMM / Gram-matrix reformulation). Graded on correctness vs the reference Newton-Schulz output (gate) + a continuous speedup score over the dense reference, rising to a state-of-the-art kernel, on GPU." }, { "name": "mxfp4-dequant-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mxfp4", "gpt-oss", "quantization", "gemm", "low-precision" ], "description": "gpt-oss ships its MoE weights in MXFP4: 4-bit E2M1 elements with one shared power-of-two E8M0 scale per 32-element block. sm90 has no native MX tensor cores, so the fast path is a software unpack fused INTO the GEMM, keeping the weights 4-bit all the way to the tensor cores instead of materialising a bf16 copy \u2014 which is exactly how these models are served on sm90-class parts." }, { "name": "mxfp4-training-backward", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mxfp4", "fp4", "wgrad", "backward", "quantization", "gemm", "low-precision", "training" ], "description": "The hardest GEMM in FP4 training is the weight gradient. Its two operands are the activation and the output gradient, both of which arrive in bf16 and must be quantised to MXFP4 *along the token axis* \u2014 the axis the GEMM contracts over \u2014 so the 32-element block scales change inside the reduction loop instead of indexing the free dimension. Every step of a low-precision training run pays for this twice per linear layer, and the quantisation has to be fused into the GEMM or it costs more than the GEMM does." }, { "name": "mxfp8-blockwise-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mxfp8", "microscaling", "fp8", "quantization", "gemm", "low-precision", "ocp" ], "description": "MXFP8 is the OCP microscaling format that block-scaled tensor cores (sm100 and later) consume natively and that FP8 training runs are converging on: E4M3 elements with one shared power-of-two E8M0 scale per 32-element block, on BOTH operands. sm90 has FP8 tensor cores but no block-scaled MMA, so at the sm90 floor this task assumes, the kernel has to drive a K=32 FP8 wgmma per microscaling block and fold the two exponents into the fp32 accumulator itself \u2014 a rank-1 correction every 32 elements of K, not a per-element dequantisation." }, { "name": "mxfp8-dual-axis-quantize", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 423.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "mxfp8", "fp8", "microscaling", "quantization", "training", "low-precision", "memory-bound", "ocp" ], "description": "MXFP8 training needs every activation twice: quantised in 32-element blocks along the last axis for the forward and dgrad GEMMs, and quantised in 32-element blocks along the FIRST axis for the weight-gradient GEMM, because that GEMM contracts the other way. Doing it as two kernels reads the tensor twice and makes the column pass a fully strided reduction. One kernel that stages a tile through shared memory produces both, plus both planes of E8M0 exponents, off a single read." }, { "name": "ngpt-l2norm-residual", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 703.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "ngpt", "l2norm", "normalization", "residual", "memory-bound", "training" ], "description": "The normalized transformer (nGPT) does not add its sublayer output into the residual stream \u2014 it takes a step along the hypersphere towards it: h <- L2norm( h + alpha * (L2norm(branch) - h) ), with a learned per-channel step size. Every hidden state stays unit-norm, so this runs between every sublayer of every layer, and it is two dependent row reductions and a lerp over the same row \u2014 five HBM round trips as separate torch ops, two reads and one write when fused." }, { "name": "ngram-lookahead-match", "family": "Sampling & speculative decoding", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 300.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "speculative-decoding", "prompt-lookup", "ngram", "drafting", "string-match", "memory-bound" ], "description": "Prompt-lookup decoding drafts speculative tokens with no draft model at all: take the last n tokens of a sequence, find where that n-gram last appeared earlier in the same sequence, and propose whatever followed it. It is free acceleration for summarisation, RAG and code editing, where the answer copies the prompt \u2014 and it means searching every live sequence's whole history on every decode step." }, { "name": "noise-add-scaled", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 494.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "flow-matching", "noising", "diffusion-forcing", "video-generation", "memory-bound" ], "description": "Rolling-window video generation (diffusion forcing, CausVid, Self-Forcing) gives every FRAME its own noise level: the frames near the end of the window are almost pure noise while the ones about to be emitted are almost clean. Building that state means interpolating each frame of the clean latent toward the noise with its own sigma, and emitting the velocity target alongside it. Two reads, two writes, and a coefficient that lives on the MIDDLE axis of a 5-D contiguous tensor." }, { "name": "nsa-compression-branch", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 393.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "nsa", "native-sparse-attention", "compression", "attention", "deepseek", "flash-attention" ], "description": "The compression branch of Native Sparse Attention (NSA, 2025): overlapping blocks of the KV cache are pooled into single COMPRESSED tokens by a learned intra-block position encoding, and the queries then attend over that much shorter compressed sequence. The reference materialises every block gather and the full query-by-compressed-token score matrix; a real kernel builds the compressed tokens inside the attention mainloop and never writes them to HBM." }, { "name": "nsa-selected-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "compilation", "kernels", "nsa", "native-sparse-attention", "sparse-attention", "gqa", "gpu", "triton" ], "description": "Optimize NSA selected attention (the selection branch of Native Sparse Attention): given a correct but slow vectorized PyTorch reference in which every query attends only to its top-S selected key/value blocks (GQA-grouped), write a fused GPU kernel that matches it and runs much faster at long sequence length. Graded on correctness vs an independent reference (gate) + a continuous speedup score over the reference, rising to a state-of-the-art kernel, on GPU." }, { "name": "nsa-selected-backward", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 392.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "nsa", "native-sparse-attention", "sparse", "backward", "gqa" ], "description": "The training-side counterpart of the selection branch of Native Sparse Attention: every query attends only to the union of its S selected key/value blocks, GQA-grouped so HQ query heads share H kv heads. The selection is an integer input and is frozen, so this is a block-sparse attention backward with a PER-TOKEN sparsity pattern \u2014 dk and dv must be accumulated over an irregular, data-dependent set of contributing queries. The reference gets the gradients by running the fp32 gather-and-attend forward under autograd, materialising S*block_size keys and values for every single query." }, { "name": "nvfp4-dequant-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "nvfp4", "fp4", "quantization", "gemm", "low-precision" ], "description": "NVFP4 is NVIDIA's 4-bit inference format: E2M1 elements, one FP8 (E4M3) scale per 16-element block, and a single fp32 per-tensor scale on top. sm100-class tensor cores eat it natively; sm90 does not, so at the sm90 floor this task assumes the fast path is a software unpack fused INTO the GEMM \u2014 weights stay 4-bit all the way to the tensor cores instead of being expanded to bf16 in HBM. That is how NVFP4 checkpoints are served on sm90 hardware today." }, { "name": "nvfp4-gemm-backward", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "nvfp4", "fp4", "backward", "dgrad", "quantization", "gemm", "low-precision", "training" ], "description": "Training or fine-tuning on top of an NVFP4 checkpoint needs the backward pass through the same 4-bit weight the forward used \u2014 but transposed. The forward contracts over K, the axis the E4M3 block scales run along; the backward contracts over N and leaves the scale axis as the free dimension, so the same packed bytes have to be unpacked, scaled and fed to the tensor cores in the opposite orientation, without ever materialising a bf16 copy of the weight." }, { "name": "nvfp4-quantize", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 534.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "nvfp4", "fp4", "quantization", "memory-bound", "low-precision", "blackwell" ], "description": "Producing NVFP4 is harder than consuming it: the per-tensor global scale has to be known before any block scale can be formed, each 16-element block then gets its own E4M3 scale, every element is rounded onto the eight E2M1 magnitudes, and two codes are packed per byte. Dynamic NVFP4 activation quantisation runs this on every activation tensor of a Blackwell-served model, and it is pure memory traffic \u2014 the arithmetic is a handful of comparisons per element." }, { "name": "optimizer-state-reshard", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 802.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fsdp", "zero", "optimizer", "checkpoint", "resharding", "adam", "distributed", "training", "layout", "memory-bound" ], "description": "Restart a job on a different number of GPUs and every sharded optimiser buffer is in the wrong layout. Each parameter's rows were split ceil(R/Wo) at a time and are now wanted ceil(R/Wn) at a time, so every row moves to a different rank at a different offset, the old padding has to be dropped and fresh padding zeroed, and it has to happen for both Adam moments of a multi-hundred-million-parameter model. It is a pure permutation of gigabytes with no arithmetic anywhere in it, and it is on the critical path of every checkpoint load." }, { "name": "paged-kv-append", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 629.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kv-cache", "paged-attention", "append", "serving", "memory-bound", "vllm", "flashinfer" ], "description": "Every step of a paged serving engine ends with this: take the new K and V for each sequence in the batch and write them into the KV-cache page pool through a page table, starting at whatever slot the sequence's last page happened to stop at. The append is a page-granularity scatter whose source and destination are misaligned by a per-sequence offset, and it is pure HBM traffic \u2014 the whole kernel is a bandwidth problem wrapped around some index arithmetic." }, { "name": "path-attn-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 865.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "path-attention", "householder", "attention", "backward", "gpu" ], "description": "The training-side counterpart of PaTH (2025), whose position encoding is DATA-DEPENDENT: the logit between positions i and j is the query pushed through the cumulative product of the Householder transforms I - beta_t w_t w_t^T for every t strictly between them. The backward has to differentiate through that cumulative product \u2014 which means back through the chunk-level UT transform and its triangular solve \u2014 as well as through the softmax and the log gate. The reference obtains the six gradients by replaying the chunked fp32 forward under autograd, including the double loop over chunk pairs." }, { "name": "path-attn-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 805.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "path-attention", "householder", "attention", "position-encoding" ], "description": "PaTH (2025) replaces RoPE's fixed rotation with a DATA-DEPENDENT position encoding: the logit between positions i and j is the query pushed through the cumulative product of the Householder transforms I - beta_t w_t w_t^T for every t between them. It is still a softmax attention, but the score matrix is no longer a plain q @ k^T, and the cumulative product has to be reorganised into chunk-level transforms or the op is O(T^2 D^2)." }, { "name": "penalty-count-bincount-build", "family": "Sampling & speculative decoding", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 417.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sampling", "penalties", "bincount", "scatter-add", "vllm", "serving", "memory-bound" ], "description": "Presence, frequency and repetition penalties need, for every sequence in the batch, how often each vocabulary entry occurs in its prompt and in what it has generated so far. vLLM rebuilds those two (batch x vocab) count tensors every single decode step with a scatter-add over the token histories. The histories are a few thousand ids; the tensors are hundreds of millions of entries, almost all of them zero \u2014 so the step is dominated by writing the zeros, and the handful of non-zeros lands with heavy atomic contention on the common tokens." }, { "name": "persistent-kv-append-inline", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "paged-attention", "kv-cache", "grid-sync", "memory-model", "gqa", "decode" ], "description": "Every serving stack does append-then-attend as two kernels, because a kernel boundary is a free device-wide fence. Fuse them and you have to rebuild that guarantee yourself: a release fence after a scattered page write, a grid-wide barrier, an acquire on the other side -- for a store whose address came out of a shuffled page table and whose reader is a different block. This task allows ONE launch, so the boundary genuinely has to go." }, { "name": "persistent-layer-fused-decode", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "decode", "gqa", "swiglu", "rmsnorm", "rope", "memory-bound" ], "description": "RMSNorm, GQA QKV projection, RoPE, KV append, attention over 4k tokens, output projection, residual, second RMSNorm, 28672-wide SwiGLU MLP, residual -- about 40 operations and 1.71 GB of weights, in one launch. This is the unit cell of a whole-model megakernel: get it right and a 16-layer megakernel is this plus a schedule. Graded on tokens/s." }, { "name": "persistent-rmsnorm-qkv-fused", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "rmsnorm", "qkv", "rope", "kv-cache", "continuous-batching", "grid-sync" ], "description": "The attention front end of a decode step, and a nastier fusion than it looks: the RMSNorm is a reduction over all 16384 hidden dimensions, and not one element of Q, K or V can be produced until it finishes -- so a single kernel has a mandatory grid-wide dependency before it touches any of its 604 MB of weights. Eight requests at eight different positions, so there is no single RoPE angle to bake in. Graded on GB/s." }, { "name": "persistent-scheduler-loadbalance", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "persistent-kernel", "scheduler", "load-balancing", "work-queue", "ragged-batch", "flash-decoding", "gqa" ], "description": "128 decode requests whose contexts span 2048 to 65536 tokens. The total bytes are fixed, so this is not a bandwidth puzzle -- it is a scheduling one. One block per request leaves all but a couple of the device's SMs idle while the longest sequences grind through alone. The lengths are re-permuted on every call, so the schedule has to be computed on the device from data that did not exist at build time. Graded on GB/s." }, { "name": "pipeline-microbatch-stash", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 410.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "pipeline-parallel", "1f1b", "activation-stash", "fp8", "e4m3", "micro-batch", "distributed", "training", "memory-bound" ], "description": "In a 1F1B pipeline schedule every stage holds the activations of several in-flight micro-batches at once, and that stash is the reason pipeline parallelism costs memory. Compressing it to fp8 with a per-token scale halves it again, but the schedule interleaves: at each step the stage quantises a newly computed micro-batch INTO its ring-buffer slot and dequantises a different, older slot OUT for the backward. The slot order is the schedule, not the loop index, and the whole thing is one pass over gigabytes of activation." }, { "name": "powersgd-lowrank-update", "family": "Training, optimizer & RL", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 392.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "powersgd", "gradient-compression", "low-rank", "orthogonalise", "cholesky", "distributed", "training", "memory-bound" ], "description": "PowerSGD replaces the all-reduce of a whole gradient matrix with the all-reduce of two rank-r factors, which is a 100x reduction in wire traffic for r = 32. Producing them is one power iteration: multiply the gradient by the carried Q, orthonormalise the result so the factorisation stays conditioned, and multiply the gradient's transpose by that. Both GEMMs are extremely tall and skinny, so the kernel is bound by streaming the gradient \u2014 twice, because the orthonormalisation sits between them." }, { "name": "prefix-cache-block-hash", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 339.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "prefix-cache", "automatic-prefix-caching", "hash", "vllm", "scheduler", "serving", "memory-bound" ], "description": "Automatic prefix caching identifies a reusable KV block by a hash that chains the parent block's hash with this block's token ids, so the hash of block i commits to the whole prefix ending at token 16*(i+1). Every admitted prompt is hashed block by block and every hash is probed against the cache's hash table. It is a serial-looking integer recurrence over hundreds of millions of prompt tokens plus a scattered table probe per block, on the critical path of every scheduler admission pass." }, { "name": "prefix-cache-copy-on-write", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 478.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "prefix-cache", "copy-on-write", "kv-cache", "paged-attention", "refcount", "vllm", "serving", "memory-bound" ], "description": "When two requests share a cached KV block and one of them appends a token, the block has to be forked: the shared tokens are copied into a freshly allocated page for the writer, the tail of that page is left clean for the tokens it is about to write, and the reference count of the original drops. vLLM hands the model runner a `blocks_to_copy` list and executes it for every layer at once; with n>1 sampling or a forked agent tree there are hundreds of forks per step, each a partial page copy across every layer's K and V pool." }, { "name": "prefix-lm-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 834.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "prefix-lm", "ul2", "bidirectional", "flash-attention", "masking" ], "description": "The attention mask of a prefix language model (UL2, T5-style PrefixLM, and the 'prefix' objective used for document infilling): tokens inside the PROMPT span see each other in BOTH directions, and every token after the prompt is ordinary causal. Each sequence in the batch has its own prompt length, so the mask is neither triangular nor block-diagonal \u2014 it is a triangle with a square glued onto its top-left corner, at a different place in every sequence." }, { "name": "pyramid-kv-video-attn", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 610.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "video-diffusion", "kv-compression", "pooling", "multi-resolution", "pyramid-kv", "wan", "hunyuanvideo" ], "description": "Masking a distant frame out of video attention throws its content away; POOLING it keeps the content at a resolution nobody will miss. Pyramid KV attends to its own frame at full resolution, to nearby frames at 1/4, to middle-distance frames at 1/16 and to everything else at 1/64 \u2014 one softmax over keys of four different resolutions, each carrying a log-count bonus so the pooled groups keep the mass they represent. Build the pyramid once, then attend to a different slice of it from every query frame." }, { "name": "qk-clip-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "qk-clip", "muonclip", "kimi-k2", "flash-attention" ], "description": "QK-Clip is the training-stability mechanism Kimi K2 ships with MuonClip: attention logits are held inside a learned per-head bound before the softmax, so no head can run away with an exploding max logit. The clamp is elementwise over the T-by-T logit grid, so it only makes sense fused inside a flash-attention-style tiled loop \u2014 and it hands the kernel a free win, because a bounded logit means the online softmax no longer needs a running maximum at all." }, { "name": "qk-norm-rope-kvwrite", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 534.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rmsnorm", "rope", "qk-norm", "kv-cache", "qwen3", "memory-bound", "serving" ], "description": "Between the QKV projection and attention itself, a Qwen3-class serving engine does three things to the same bytes: RMS-normalise every head of q and k with its learned gain, rotate them with RoPE at each token's own position, and scatter the rotated k and the raw v into the KV cache through a slot mapping. As three torch ops that is six or seven round trips of q, k and v through HBM; as one kernel it is one read and one (indirect) write, with the gather of the cos/sin rows and the scatter address both resolved in registers." }, { "name": "qlora-nf4-dequant-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "nf4", "qlora", "quantization", "gemm", "low-precision", "fine-tuning", "double-quantization" ], "description": "QLoRA freezes the base model in NF4: 4-bit indices into a fixed 16-entry NormalFloat table, one absmax per 64 weights \u2014 and because those absmaxes would themselves cost half a bit per weight, they are quantised to 8 bits with a second-level scale on top. Every forward pass of a fine-tuning step therefore has to run a nested dequantisation (scale of scale, then table lookup) inside the GEMM, at training batch sizes, without ever materialising a bf16 copy of the frozen weight." }, { "name": "quantized-optimizer-state", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 931.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "adamw", "optimizer", "8-bit", "quantization", "bitsandbytes", "low-precision", "training", "memory-bound" ], "description": "Adam's two moment buffers are twice the size of the model, which is why 8-bit optimisers exist: each moment is stored as a byte index into a nonlinear 256-entry map plus one fp32 absmax per 2048-element block. Every step has to dequantise both moments through that map, take the AdamW step, and requantise against a NEW block absmax that is not known until the whole block's new moment exists. It is the memory-heaviest kernel in the training loop and it is all bandwidth and lookups." }, { "name": "qwen-vl-window-attention", "family": "Multimodal & audio", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 570.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "vision", "qwen2.5-vl", "window-attention", "varlen", "vit", "multimodal", "compute-bound" ], "description": "Qwen2.5-VL's vision tower runs WINDOW attention in 28 of its 32 layers: the patch grid is cut into 112-pixel windows, tokens are permuted into window order, attention runs independently inside each window, and the result is permuted back. The windows are ragged \u2014 the right and bottom edges of an image are short \u2014 and there are thousands of them per request, so this is a block-diagonal attention with tiny blocks bracketed by a gather and a scatter, which is a completely different problem from one big attention." }, { "name": "qwen3-moe-route-align", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 330.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "moe", "routing", "top-k", "qwen3-next", "high-sparsity", "dispatch", "block-align", "memory-bound" ], "description": "Qwen3-Next routes every token to 10 of 512 experts, and the router is only half the job: before the grouped expert GEMM can launch, the routing decisions have to be turned into a work table \u2014 every routed slot sorted by expert, each expert's segment padded up to a whole tile, and a block-to-expert map so the GEMM knows which weight matrix each tile uses. At half a million tokens the score matrix alone is more than a gigabyte, and the usual implementation drags it through HBM five times and then runs a full sort it does not need." }, { "name": "qwen3-next-gated-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 2061.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "qwen3-next", "gated-attention", "output-gate", "gqa", "flash-attention", "fusion", "compute-bound" ], "description": "Qwen3-Next does not read the attention output straight out of the softmax: every element of every head is multiplied by a SIGMOID gate that is projected from the block's input, which is what lets the model shut a head off per token. Run as separate ops that is a second full-size projection plus two extra round trips of the (T, H*D) attention output through HBM, on top of an attention kernel that already had the tile in registers. Fusing the gate into the attention epilogue makes it nearly free \u2014 but the gate GEMM and the attention have completely different shapes, so the scheduling is the whole problem." }, { "name": "qwen3-next-gated-attn-decode", "family": "KV cache & paging", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "GB/s", "roofline_us": 633.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "qwen3-next", "gated-attention", "output-gate", "decode", "paged-attention", "kv-cache", "rmsnorm", "memory-bound" ], "description": "What a Qwen3-Next server actually runs at every generated token in its attention layers: grouped-query attention over a paged KV cache that holds K and V interleaved at each position, followed immediately by a zero-centred per-head RMSNorm and a sigmoid output gate projected from the block input. The attention is pure cache bandwidth; the epilogue is a projection and two normalisations on a tensor small enough that it should never leave registers \u2014 and as three separate launches it adds three round trips and three kernel launches to the critical path of every layer of every token." }, { "name": "qwen3-next-gdn-inproj", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 2368.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "qwen3-next", "gated-deltanet", "linear-attention", "rmsnorm", "l2-norm", "gemm", "fusion", "compute-bound" ], "description": "Three quarters of the layers in Qwen3-Next are gated-DeltaNet blocks, and every one of them starts here: zero-centred RMSNorm on the residual stream, one wide fused projection into queries, keys, values and the output gate, a second tiny projection into the two recurrence gates, then per-head L2 normalisation of q and k, a sigmoid for the delta-rule step size and a softplus-and-negate for the log forget gate. Run as fifteen separate torch ops it drags the (T, 12k) projection output through HBM four times and launches a kernel for every activation; fused, it is one GEMM with an epilogue." }, { "name": "qwen3-next-gdn-inproj-backward", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 3552.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "qwen3-next", "gated-deltanet", "backward", "training", "rmsnorm", "l2-norm", "gemm", "compute-bound" ], "description": "Differentiating the Qwen3-Next gated-DeltaNet input projection is four separate backward problems glued together: a per-head L2 normalisation (whose Jacobian is a rank-1 correction, not a scale), a sigmoid and a softplus feeding a log-decay gate, one wide and one skinny projection, and a zero-centred RMSNorm whose gain gradient is a reduction over every token. Autograd runs it as thirty kernels and rebuilds the (T, 12k) projection output twice." }, { "name": "qwen3-next-output-gate-backward", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 4417.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "qwen3-next", "gated-attention", "output-gate", "backward", "rmsnorm", "silu", "training", "gemm", "compute-bound" ], "description": "The training-side counterpart of the Qwen3-Next gated attention output: an attention result is RMS-normalised per head, multiplied by a SiLU gate projected from the block input, and projected back to the model width. Differentiating it means pushing one gradient back through a projection, splitting it between the normalised activation and the gate, and then back through BOTH a per-head normaliser and a second projection \u2014 five matmuls and two reductions that autograd runs as two dozen full-size kernels with the gate logits recomputed in the middle." }, { "name": "radial-attention-backward", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 736.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "backward", "sparse-attention", "video-diffusion", "radial-attention", "log-sparse", "training", "hunyuanvideo" ], "description": "Fine-tuning a video DiT on Radial Attention needs the wedge mask differentiated, and the wedge is not symmetric: the spatial band a query keeps shrinks by one halving per doubling of temporal distance, is centred with a floor, and is clamped inward at the edges of the frame \u2014 so the set of queries that saw a given key is a DIFFERENT band from the set of keys a query saw. dQ walks the wedge outward, dK and dV have to walk it inward, and both bands are pure geometry: no mask is ever materialised." }, { "name": "radial-attention-decay", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 4804.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "radial-attention", "log-sparse", "hunyuanvideo", "wan" ], "description": "Attention energy in a video diffusion transformer decays with spatiotemporal distance, and Radial Attention turns that observation into an O(n log n) mask: the diagonal frame is dense, and every time the temporal distance between two frames DOUBLES the spatial band a query keeps in that frame is HALVED. The result is a wedge-shaped, per-frame-pair band structure \u2014 a different number of live key blocks for every frame offset, all of it known from the geometry alone, and a kernel that has to walk a ragged, log-shrinking inner loop without ever materialising the mask." }, { "name": "radix-prefix-match", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 442.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "prefix-cache", "radix-tree", "trie", "paged-attention", "scheduler", "memory-bound" ], "description": "Before a request is scheduled, the serving engine looks its prompt up in a radix tree of already-cached KV pages to find how long a prefix it can reuse and which blocks hold it. SGLang's RadixAttention and vLLM's automatic prefix caching both run this on every admission pass, and the reference walks the tree one level at a time in Python-speed lockstep." }, { "name": "repetition-penalty-logits", "family": "Sampling & speculative decoding", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 625.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sampling", "penalties", "decode", "elementwise", "memory-bound", "vllm", "sglang" ], "description": "Before sampling, a serving engine rewrites the whole logit matrix with three per-request penalties driven by per-sequence token-count histograms: a multiplicative repetition penalty on everything the sequence has already seen, a linear frequency penalty on how often it was generated, and a flat presence penalty on whether it was generated at all. It runs every decode step over `batch x vocab` fp32 logits plus two `batch x vocab` count matrices, and the stock torch path streams that four gigabytes through HBM half a dozen times." }, { "name": "residual-diff-l1-reduce", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 300.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "caching", "reduction", "video-generation", "memory-bound" ], "description": "Frame-level step caching needs to know WHICH FRAMES of a video latent actually moved between two denoising steps: a static background frame can reuse its cached features for many steps while a frame with motion cannot. That is a relative-L1 reduction per (clip, frame) over a 5-D (B, 16, T, H, W) latent \u2014 and the frame axis sits in the MIDDLE of the layout, so each output gathers 16 strided slabs. Pure bandwidth over gigabytes, with an awkward reduction geometry." }, { "name": "retention-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 331.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "retention", "retnet", "backward", "linear-attention", "gpu" ], "description": "The training-side counterpart of RetNet retention: the same q/k/v, but the attention weight between positions i and j is gamma_h^(i-j) with gamma_h a CONSTANT fixed by the head index alone. The reference obtains the three gradients by running the chunked fp32 forward under autograd, which materialises every chunk's score matrix and state in HBM; a fused backward recomputes them and carries the reverse state scan in registers \u2014 and, as in the forward, synthesises the whole decay pattern from the head index instead of loading a gate." }, { "name": "retention-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "retention", "retnet", "linear-attention", "gpu" ], "description": "Retention is RetNet's replacement for softmax attention: the same q/k/v, but the attention weight between positions i and j is just gamma_h^(i-j) times the raw dot product, with gamma_h a CONSTANT fixed by the head index alone. Nothing is learned about the decay and nothing is passed in for it \u2014 the kernel has to synthesise the entire decay pattern from the head index." }, { "name": "rmsnorm-backward", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 468.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rmsnorm", "backward", "training", "memory-bound", "reduction" ], "description": "Every training step of every Llama/Qwen/Mistral-class model runs this twice per block: the gradient of `x * rsqrt(mean(x^2) + eps) * w` with respect to both the activations and the gain. It is two computations in one pass \u2014 a per-row projection that produces `dx`, and a per-column reduction over the whole token axis that produces `dweight` \u2014 and autograd does it as half a dozen separate full-size elementwise kernels plus a separate reduction." }, { "name": "rmsnorm-quant-transpose-fused", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 476.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "rmsnorm", "quantization", "transpose", "training", "memory-bound", "low-precision" ], "description": "An FP8 training step needs each normalised activation matrix twice: quantised along the feature axis for the forward GEMM, and transposed and quantised along the token axis for the weight gradient. Both copies come from the SAME RMS-normalised values, so the column-group scales depend on a row reduction \u2014 which is what makes this more than a cast-transpose. As separate ops it is a norm, a full fp32 transpose and two quantisations; fused it is a read of the bf16 matrix and two FP8 writes." }, { "name": "rolling-window-video-kv", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 2356.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "video-diffusion", "kv-cache", "ring-buffer", "rolling-window", "autoregressive-video", "causvid" ], "description": "Long autoregressive video generation cannot keep every frame, so the KV cache is a RING of the last W frames: each new chunk overwrites the oldest slots in place and the read order wraps. Because attention alone cannot tell how old a key is, the logits carry an explicit decay in frame age \u2014 which means the kernel must decode the ring's temporal order to know what to subtract. Append, wrap, decay and attend, all in one launch." }, { "name": "rope-backward", "family": "Training, optimizer & RL", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 722.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rope", "backward", "training", "memory-bound", "attention" ], "description": "Rotary embeddings sit between the QKV projection and attention, so every training step has to push the attention gradient back through them for both Q and K. The rotation is orthogonal, so the backward is the transposed rotation \u2014 the same butterfly with one sign flipped \u2014 but autograd runs it as a dozen elementwise kernels over two tensors that are each hundreds of megabytes, plus a gather of the cos/sin table per token." }, { "name": "rope-fused-kv-write", "family": "KV cache & paging", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 312.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rope", "kv-cache", "paged-attention", "memory-bound", "serving" ], "description": "Every paged-attention serving engine runs this immediately after the QKV projection: rotate q and k with RoPE and scatter the rotated k and the raw v into a paged KV cache through a page table. Done as separate ops the k and v tensors cross HBM three times each; fused it is one read and one (indirect) write, with the page-table indirection resolved in registers." }, { "name": "rwkv7-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 515.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rwkv7", "dplr", "delta-rule", "linear-attention", "backward" ], "description": "The training-side counterpart of RWKV-7 'Goose': a DIAGONAL-PLUS-LOW-RANK state transition, where each step multiplies the (K, V) state by diag(exp(w_t)) AND adds a rank-1 correction b_t (a_t^T S) read off the state itself, before the usual outer-product write. Six gradients come out, including a per-CHANNEL decay gradient that is a reduction over the whole state. The reference obtains them by running the chunked fp32 forward under autograd, which materialises every chunk transform and every chunk-local intermediate in HBM." }, { "name": "rwkv7-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 417.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rwkv7", "dplr", "delta-rule", "linear-attention", "gpu" ], "description": "RWKV-7 'Goose' (2025) generalises the delta rule to a DIAGONAL-PLUS-LOW-RANK state transition: each step multiplies the (K, V) state by diag(exp(w_t)) AND adds a rank-1 correction b_t (a_t^T S) read off the state itself, before the usual outer-product write. Neither the diagonal-only (GLA) nor the rank-1-only (DeltaNet) chunked algorithm applies \u2014 the within-chunk transform has to be re-derived for the combined form." }, { "name": "rwkv7-token-shift-mix", "family": "Linear attention & SSM", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 820.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rwkv7", "token-shift", "linear-attention", "lerp", "memory-bound", "recurrent" ], "description": "Every RWKV-7 time-mixing block starts by blending each token with the one before it \u2014 a learned per-channel interpolation between x[t] and x[t-1] \u2014 and it does so SIX times with six different mixing vectors, one for each of the r, w, k, v, a and g projections. Done as six separate lerps it reads the activation six times and materialises six full temporaries; done properly it is one read, one shifted neighbour already in registers, and six stores. The shift also carries state across chunk boundaries, so the kernel owns a boundary condition as well." }, { "name": "sandwich-norm-residual-fused", "family": "Normalization, RoPE & elementwise fusion", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 937.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rmsnorm", "residual", "sandwich-norm", "gemma", "olmo", "memory-bound", "serving" ], "description": "Gemma-2, OLMo-2 and Grok wrap every sublayer in TWO RMSNorms: the sublayer output is normalised before it is added to the residual stream, and the new residual stream is normalised again on the way into the next sublayer. Between two blocks that is a norm, an add and a norm over the same row, with the second reduction depending on the first \u2014 five HBM round trips as separate torch ops, and two reads and two writes when it is one kernel." }, { "name": "scheduler-multistep-buffer", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 395.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "scheduler", "multistep", "ring-buffer", "video-generation", "memory-bound" ], "description": "High-order diffusion samplers (Adams-Bashforth / linear multistep, UniPC, DEIS) keep the last few model outputs in a per-request RING BUFFER and take each step as a weighted combination of them. With video latents that buffer is gigabytes, the ring head is different for every request, and the weights change with the sampler order \u2014 so the kernel is a K-way weighted reduction over modularly-indexed slabs, which is a very different access pattern from a plain elementwise step." }, { "name": "sd3-joint-attention-tripletext", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 4846.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "stable-diffusion-3", "sd3", "mmdit", "joint-attention", "flash-attention", "multi-segment", "diffusion-transformer", "image-generation" ], "description": "Stable Diffusion 3.5 conditions on THREE text encoders \u2014 CLIP-L, CLIP-G and T5-XXL \u2014 whose token streams the pipeline holds as three separate tensors, and its MMDiT attends over the concatenation of all of them with the image latents, image first. Building that concatenation for Q, K and V and splitting the result again, once per block for 38 blocks, is four full round-trips of a multi-gigabyte working set that buys nothing: the concatenation only exists to define one softmax denominator. This kernel takes the four segments where they live and gives back four separate outputs." }, { "name": "sd3-mmdit-block", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 7395.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "stable-diffusion-3", "sd3", "mmdit", "dual-stream", "transformer-block", "joint-attention", "fusion", "gemm", "adaln", "diffusion-transformer", "image-generation" ], "description": "Every one of SD3.5's 38 blocks is dual-stream \u2014 unlike FLUX there is no single-stream phase at all \u2014 so the image latents and the concatenated triple-text-encoder context each keep their own 6-way adaLN, their own QKV projection, their own QK-RMSNorm gains, their own output projection and their own MLP, and meet only in one joint attention over the concatenation, IMAGE FIRST. There is no rotary embedding anywhere: position was added once as a 2-D sincos table at patchify, so the block is pure GEMM, norm and attention with a 50:1 row imbalance between the two streams." }, { "name": "sd3-pos-embed-interpolate", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "GB/s", "roofline_us": 388.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "stable-diffusion-3", "sd3", "patch-embed", "positional-embedding", "interpolation", "memory-bound", "diffusion-transformer", "image-generation" ], "description": "SD3 has no rotary embedding: position enters the model exactly once, as a fixed 2-D sincos table added to the patch embeddings. The table is built for one base grid, so every resolution other than the native one needs it BILINEARLY RESAMPLED to the target grid before it is added. The kernel is therefore a strided 2x2x16 gather feeding a skinny (64 -> 2432) projection, plus a float32 table resample whose source addresses are a non-integer function of the output coordinate \u2014 a gather, a GEMV and an interpolation that all want to be one pass." }, { "name": "sd3-qkv-proj-qknorm", "family": "Image generation \u2014 FLUX / SD3 MMDiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 2675.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "stable-diffusion-3", "sd3", "mmdit", "grouped-gemm", "epilogue-fusion", "rmsnorm", "diffusion-transformer", "image-generation" ], "description": "Both halves of every SD3.5 block project their own QKV: one (Ni, C) x (C, 3C) GEMM for the image latents and one (Nt, C) x (C, 3C) GEMM for the concatenated text context, with different weights and a 50:1 row imbalance. Whatever they produce then has to be de-interleaved into [3][H][D], RMS-normalised per head with four different gain vectors, transposed to head-major and written into ONE joint Q/K/V triple with the image first \u2014 so the interesting part is not the matmul, it is that the matmul's epilogue is a norm, a transpose and a concatenation at once." }, { "name": "seqparallel-partial-norm", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 390.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sequence-parallel", "tensor-parallel", "rmsnorm", "partial-sum", "all-reduce", "residual", "distributed", "training", "memory-bound" ], "description": "At the sequence-parallel to tensor-parallel boundary the hidden dimension is split across ranks, so a norm whose statistic spans the whole hidden vector cannot be computed locally. Each rank reduces its own shard, the partials are all-reduced, and only then can anything be normalised. The single-GPU work is the awkward half: a residual add, a partial sum of squares per (token, shard) in the rank-major layout the collective produced, and a second pass that normalises against the combined statistic with each shard's own gain." }, { "name": "sequence-packing-loss-mask", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 1223.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sft", "packing", "cross-entropy", "post-training", "varlen", "large-vocab", "memory-bound" ], "description": "Post-training runs pack dozens of documents end-to-end into one flat token stream to avoid padding, and the loss then has to respect boundaries the tensor no longer shows: each position predicts the NEXT token unless it is the last token of its document, prompt tokens carry no loss, and every document is normalised by its own answer length so a 4k-token document does not drown a 200-token one. Getting that mask wrong silently trains the model to predict the first token of the next document \u2014 and the whole thing has to run at streaming speed over gigabytes of logits." }, { "name": "sequence-unpad-repad", "family": "KV cache & paging", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 863.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "varlen", "cu-seqlens", "unpad", "repad", "packing", "flash-attention", "memory-bound" ], "description": "Trainers and HF-style model code hold activations as a padded (B, T, ...) rectangle, but FlashAttention's varlen entry point wants them packed end to end with a cu_seqlens index. So every attention call in a padded stack is wrapped by an unpad on the way in and a repad on the way out, and the repad has to zero the padding it reintroduces. At half a batch of wasted padding it is one of the largest pure data movements in a training step." }, { "name": "siglip-attention-pooled", "family": "Multimodal & audio", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 386.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "vision", "siglip", "vit", "attention", "attention-pooling", "multimodal", "compute-bound" ], "description": "A SigLIP vision tower runs fully bidirectional attention over every patch of every frame \u2014 no causal mask, no KV cache, and a head dimension of 72 that is deliberately awkward for tensor cores \u2014 and its MAP head then pools the same keys and values with a single learned probe query. Both halves read the same K and V, so a fused kernel gets the pooled vector almost for free while a naive one makes a second full pass over the encoder output." }, { "name": "simple-gla-forward", "family": "Linear attention & SSM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "TFLOP/s", "roofline_us": 589.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "simple-gla", "linear-attention", "mamba2", "ssd", "gpu" ], "description": "Simple GLA is the scalar-gate member of the gated-linear-attention family \u2014 the same recurrence Mamba-2's SSD layer runs: a matrix-valued state decayed by ONE data-dependent scalar per head per step. Because the gate is a scalar it factors straight out of the chunk matmuls into a cumulative-sum decay mask, which makes this the purest test of how close a linear-attention kernel can get to a dense-matmul roofline." }, { "name": "sliding-tile-attention-3d", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 4969.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "hunyuanvideo", "wan", "sliding-tile-attention", "3d-window", "flash-attention" ], "description": "Video diffusion transformers spend 80-90% of their time in self-attention over a 3D latent \u2014 HunyuanVideo at 720p/129f is 118k tokens in one sequence. Sliding Tile Attention is the fix that actually shipped: cut the (frame, height, width) latent into small 3D TILES and let every query tile attend only to a fixed (w_f, w_h, w_w) neighbourhood of tiles, shifted inward at the boundary so the count is constant. Because the window moves a whole tile at a time the mask is dense at block granularity \u2014 no per-element predication \u2014 but the tokens of a 3D tile are scattered through the raster-ordered sequence, and turning that scatter into contiguous tensor-core tiles is the entire kernel." }, { "name": "sliding-window-kv-evict", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 514.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "kv-cache", "sliding-window", "attention-sink", "paged-attention", "eviction", "memory-bound" ], "description": "Hybrid sliding-window models (Gemma-3, Ministral, Llama-4) keep only the last W tokens plus a few attention sinks in their SWA layers, so the serving engine periodically decides which KV pages fall outside the window, returns them to the allocator, and compacts what is left into a dense per-sequence slab. It is a ragged, page-granular gather over gigabytes of KV with an index rule that has to be exactly right." }, { "name": "sliding-window-sink-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 368.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sliding-window", "attention-sink", "gpt-oss", "flash-attention" ], "description": "The attention pattern shipped in gpt-oss (2025): causal attention restricted to a sliding window of the last W keys, plus a learned per-head ATTENTION SINK \u2014 one extra logit that joins the softmax denominator but contributes no value, letting a head park probability mass instead of being forced to attend. A fast kernel is a flash-style tiled loop that visits only the O(W) key tiles a query can see and folds the sink into the online softmax, never materialising scores." }, { "name": "smoothquant-fused-scale", "family": "Quantization & low-precision GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 312.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int8", "smoothquant", "w8a8", "quantization", "memory-bound", "low-precision" ], "description": "SmoothQuant makes INT8 activations viable by moving the outlier magnitude out of a few activation channels and into the weights: divide the activations by a per-channel factor, then quantise per token. Every W8A8 serving stack runs this immediately before the INT8 GEMM, and it is pure memory traffic \u2014 one bf16 read, one int8 write, and a full-row reduction in between that the naive implementation pays for with two extra passes over the activations." }, { "name": "snake-antialias-activation", "family": "Multimodal & audio", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "GB/s", "roofline_us": 416.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "audio", "vocoder", "bigvgan", "tts", "snake", "activation", "anti-aliasing", "memory-bound" ], "description": "Every neural vocoder under a modern TTS or speech-LM stack \u2014 BigVGAN, and everything derived from it \u2014 replaces LeakyReLU with a periodic Snake activation, and because a periodic nonlinearity aliases badly it wraps every one of them in a 2x FIR upsample and a 2x FIR downsample. The activation therefore runs on twice as many samples as it returns, and a naive implementation writes that doubled signal to HBM twice. It appears dozens of times per vocoder forward, on the longest tensors in the model." }, { "name": "softcap-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 785.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "softcap", "logit-capping", "gemma", "flash-attention" ], "description": "Gemma-2 stabilises training by SOFT-CAPPING the attention logits \u2014 every logit is squashed through `cap * tanh(logit / cap)` before the causal softmax, bounding it smoothly instead of clipping it. It is one extra elementwise op, but it sits in the innermost loop of attention, so the whole task is folding it into a flash-attention-style tiled loop without materialising the T-by-T score matrix the reference builds and without spending a slow transcendental per logit." }, { "name": "sparse-attn-backward-3d", "family": "Training, optimizer & RL", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 1058.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "backward", "block-sparse", "video-diffusion", "bitmap-mask", "flash-attention", "hunyuanvideo", "training" ], "description": "Fine-tuning a video DiT on a learned sparse pattern needs that pattern's BACKWARD pass, and a bitmap is much harder to differentiate than a window: dQ walks the mask by ROWS, but dK and dV have to accumulate from every query tile whose bitmap row contains them \u2014 a COLUMN traversal of the same bitmap, with a different number of contributors per key tile. Recompute the scores from the saved log-sum-exp, apply the softmax Jacobian, and scatter three gradients back into a raster-ordered latent." }, { "name": "sparse-attn-mask-build-3d", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 567.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "mask-build", "block-score", "pooling", "hunyuanvideo", "memory-bound" ], "description": "Every run-time sparse-attention scheme for video needs a cheap ESTIMATE of where the attention mass is before it can skip anything. The estimate is a block-level attention map: mean-pool Q and K over 3D latent tiles, take the tile-by-tile scores, add the spatiotemporal distance decay the pattern assumes, and row-softmax the result into a per-head tile-density map. It is a 3D-strided pooling reduction feeding a large square GEMM whose output is bigger than either input, so it is a bandwidth problem dressed as a matmul, and it runs at every layer of every denoising step." }, { "name": "sparse-block-worklist-build", "family": "Video \u2014 sparse / efficient attention", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 282.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sparse-attention", "video-diffusion", "block-mask", "prefix-sum", "stream-compaction", "scheduling", "csr", "load-balancing" ], "description": "Between the mask builder and the attention kernel sits the piece nobody writes about and everybody needs: turning a per-head tile BITMAP into the flat work list a block-sparse attention kernel actually consumes. Popcount every row, prefix-sum 300k rows into CSR offsets, compact the live (query tile, key tile) pairs in row-major order, and cut the result into equal-work slices for a persistent grid. It is a scan and a stream compaction over a gigabyte of pairs, and it runs before every attention call." }, { "name": "sparse24-backward-densify", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 463.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sparsity", "2:4", "structured-sparsity", "sr-ste", "backward", "straight-through", "sparse-training", "training", "memory-bound" ], "description": "Training with 2:4 sparsity keeps a DENSE master weight and re-prunes it every step, so the backward has to do two opposite things at once. The straight-through estimator passes the gradient to the dense weight, plus SR-STE's decay term that pushes the currently-pruned entries toward zero \u2014 which needs the 2-bit metadata densified back into a full mask. And the sparse optimiser state lives in the compressed layout, so the same gradient has to be gathered onto the kept positions. One pass over three full-size tensors, both directions of the format." }, { "name": "sparse24-compress-layout", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 366.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sparsity", "2:4", "structured-sparsity", "compression", "metadata", "bit-packing", "sparse-tensor-core", "training", "memory-bound" ], "description": "A 2:4-pruned weight is still stored densely, half of it zeros \u2014 that saves nothing. The format the sparse tensor cores take is a COMPRESSED one: a (M, K/2) buffer holding only the survivors, plus two bits per survivor saying which of the four slots it came from, packed four indices to a byte. Compressing is what actually halves the weight traffic of a sparse layer, it runs on every weight after every re-prune, and the metadata is a bit-exact integer contract." }, { "name": "sparse24-prune-metadata", "family": "Training, optimizer & RL", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 366.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sparsity", "2:4", "structured-sparsity", "pruning", "metadata", "sparse-tensor-core", "training", "memory-bound" ], "description": "Sparse tensor cores only accept one pattern: exactly two non-zeros in every aligned group of four along K. Getting a trained weight into that form means, for every group of four, ranking the magnitudes, keeping the top two, zeroing the rest, and recording WHICH two \u2014 the 2-bit indices the hardware needs to pick the matching operands out of B. It is run on every weight of the model at every re-prune during sparse fine-tuning, it is pure bandwidth, and the metadata is integer, so it is either exactly right or it is wrong." }, { "name": "sparse24-sparse-gemm", "family": "Training, optimizer & RL", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 883.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "sparsity", "2:4", "structured-sparsity", "sparse-gemm", "sparse-tensor-core", "mma-sp", "training", "compute-bound" ], "description": "This is the kernel 2:4 sparsity exists for. A is stored compressed \u2014 a (M, K/2) value buffer and two bits per value saying which of its group of four it came from \u2014 and the GEMM has to walk B with those indices, doing half the multiply-accumulates of the dense problem. Ampere and later expose it directly through the sparse MMA instruction; done properly it is the fastest matmul on the machine, and done as a densify-then-dense-GEMM it does twice the arithmetic for the same answer." }, { "name": "spatial-upsample-pixelshuffle3d", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T2", "tier_why": "pixel-shuffle upsample is a layout transform, not a convolution cuDNN accelerates", "metric": "TFLOP/s", "roofline_us": 398.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "pixelshuffle", "upsample", "depth-to-space", "video", "vae", "wan", "hunyuanvideo", "decoder" ], "description": "A 4x8x8 video tokenizer spends three spatial 2x upsamples turning a 90x160 latent grid back into 720x1280 pixels, and the cheapest way to do one is a pointwise convolution that produces 4x the channels followed by a depth-to-space shuffle. The convolution is a plain GEMM over the channel axis, but the shuffle is a strided scatter into a tensor four times larger in H and W \u2014 run as two ops it writes the biggest tensor in the decoder twice, once in the wrong layout." }, { "name": "spatial-window-temporal-global", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 1751.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "global-tokens", "strided-gather", "hunyuanvideo", "wan" ], "description": "Local in space, global in time: every token attends densely inside a small window of its own frame, and additionally to a uniform stride-`s` sample of every OTHER frame, so the whole clip stays visible for a few percent of the keys. Two gathers with opposite characters \u2014 a short 2D box with row stride Ww, and a long stride-`s` comb spanning the entire sequence \u2014 sharing one softmax, plus a boundary rule that keeps the two sets disjoint." }, { "name": "spec-decode-tree-attention", "family": "Sampling & speculative decoding", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 791.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "speculative-decoding", "eagle", "mtp", "tree-attention" ], "description": "Speculative decoding verifies a TREE of draft tokens in one forward pass. Each draft token attends to the whole KV cache plus only its own ancestors in the tree, so the draft-vs-draft mask is an arbitrary DAG rather than a triangle. Every current serving stack (EAGLE-3, DeepSeek MTP) runs this kernel on every decode step." }, { "name": "spec-decode-verify-accept", "family": "Sampling & speculative decoding", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 468.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "speculative-decoding", "rejection-sampling", "eagle", "mtp", "sampling", "memory-bound" ], "description": "After the target model scores a draft path, every speculative-decoding stack runs the rejection-sampling rule that decides how many draft tokens survive and what the one extra token is. It touches two probability tensors over a 128k-262k vocabulary, but a correct kernel only has to read a couple of ROWS of them \u2014 the reference reads all of it, which is gigabytes per decode step." }, { "name": "speculative-draft-kv-rollback", "family": "KV cache & paging", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 466.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "speculative-decoding", "eagle", "mtp", "kv-cache", "rollback", "tree-attention", "serving", "memory-bound" ], "description": "Tree speculative decoding writes KV for every draft token before it knows which ones survive. Verification then accepts one PATH through the tree, and the cache has to be rolled back: the accepted tokens' KV \u2014 scattered across the slots the draft occupied, in tree order, not in sequence order \u2014 is compacted to the front of the sequence's region and everything else is discarded. It runs after every verify step, for every layer, on the whole batch." }, { "name": "sta-backward", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 5177.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "backward", "sparse-attention", "video-diffusion", "sliding-tile-attention", "hunyuanvideo", "training" ], "description": "Fine-tuning a video diffusion transformer on a sparse attention pattern needs the pattern's BACKWARD pass, and that is where the 3D tile window stops being convenient: dQ follows the window, but dK and dV have to accumulate from every query tile whose window covers them, and at the boundary the window is shifted inward so the two directions are NOT mirror images. Recompute the scores, never store the (T, T) probabilities, and get the scatter side right." }, { "name": "sta-ragged-tile-boundary", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 570.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "sliding-tile-attention", "ragged", "hunyuanvideo", "wan", "boundary" ], "description": "Real video latents do not divide by the tile: HunyuanVideo at 720p is 33 x 45 x 80 and every tile size anyone actually uses leaves a remainder on all three axes. That single fact removes the two things every tiled attention kernel relies on \u2014 the tile-major reshape and the constant key count \u2014 because the boundary tiles are SHORT, the window that reaches them is short with them, and no two query tiles need the same amount of work. Ceil-divide the grid, clamp the window inward, and attend over a 3D box whose size changes from tile to tile." }, { "name": "step-distill-consistency", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 494.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "consistency-model", "lcm", "step-distillation", "video-generation", "memory-bound" ], "description": "Step-distilled video models (LCM, consistency distillation, Wan/Hunyuan turbo variants) generate in 4-8 steps instead of 50, and each of those steps is a boundary-conditioned combination of the latent and the model output followed by a re-noising to the next sigma. With so few steps the scheduler arithmetic stops being free: it is three full-size reads and two writes of a video latent, and it is now a measurable fraction of the whole generation." }, { "name": "streaming-llm-attention", "family": "KV cache & paging", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "GB/s", "roofline_us": 429.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "streaming-llm", "attention-sink", "sliding-window", "decode", "kv-cache", "memory-bound", "flash-decoding" ], "description": "StreamingLLM (Xiao et al., 2023) keeps an LLM running past its training length by retaining only two pieces of the KV cache: the first few ATTENTION-SINK TOKENS, which hold a disproportionate share of the softmax mass, and a sliding window of the most recent tokens. Decode therefore attends over the UNION of a short prefix and a long suffix of a much longer cache, with a different history length per request. It is a pure BANDWIDTH kernel scored in GB/s, and only the bytes in that union are credited \u2014 a kernel that streams the whole cache is scored against traffic it never needed to move." }, { "name": "svg-head-classify-route", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 2635.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "sparse-videogen", "head-routing", "spatial-temporal", "hunyuanvideo" ], "description": "Sparse VideoGen's central observation is that the attention heads of a video diffusion transformer split into two kinds: SPATIAL heads, whose mass sits in a local window of the flattened token stream, and TEMPORAL heads, whose mass sits at the same spatial position across every frame. Which is which changes with the prompt and the denoising step, so it is decided AT RUN TIME: probe a handful of queries with exact dense attention, score both candidate masks against it, and route each head to the winner. One kernel that does an online profiling pass, an argmin, and then two completely different sparse gather patterns in the same launch." }, { "name": "swiglu-backward", "family": "Training, optimizer & RL", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 520.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "swiglu", "backward", "training", "memory-bound", "elementwise" ], "description": "Every training step of every Llama/Mistral/Qwen-class model runs this: the gradient of `silu(gate) * up` with respect to both halves of the fused gate/up projection. Written with autograd it is half a dozen elementwise kernels, each one a full round trip of a tensor that is several times the hidden size; fused it is a single pass \u2014 three reads and two writes." }, { "name": "swiglu-blockwise-fp8-quant", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 589.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "fp8", "swiglu", "quantization", "moe", "memory-bound", "deepseek", "serving" ], "description": "Between the two GEMMs of an FP8-served MLP there is exactly one elementwise step: split the fused gate/up projection, apply SwiGLU, and immediately quantise the result to FP8 with a per-128-element block scale so the down-projection can consume it directly. Done as separate ops the intermediate \u2014 which is twice the width of the hidden state \u2014 crosses HBM four or five times; fused it is one read of the projection and one four-times-narrower write." }, { "name": "teacache-residual-decision", "family": "Diffusion \u2014 sampling, scheduling, caching", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 593.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "diffusion", "teacache", "caching", "reduction", "video-generation", "memory-bound" ], "description": "TeaCache makes video diffusion 2x faster by SKIPPING denoising steps whose input barely moved: before each transformer call it measures the relative L1 distance between this step's modulated hidden states and the previous step's, pushes it through a calibration polynomial, accumulates, and only runs the transformer when the accumulator crosses a threshold. The measurement is the expensive part \u2014 a full reduction over hundreds of megabytes of hidden states, per request, before every step \u2014 and it must not cost more than the step it saves." }, { "name": "temporal-downsample-strided", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 414.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "downsample", "strided", "temporal", "video", "vae", "wan", "hunyuanvideo", "encoder" ], "description": "The 4x in 4x8x8 comes from two temporal downsamples in the encoder, each a causal Conv3d with a (3,1,1) kernel and stride 2 along time. Because the padding is one-sided, output frame j consumes input frames 2j-2, 2j-1 and 2j \u2014 overlapping windows that stride past each other, so half the input is read by two outputs and half by one. It is a skinny three-tap GEMM over an activation volume that at encode time is the largest tensor in the model, and the stride wrecks every naive tiling." }, { "name": "temporal-strided-attention", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 2761.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "temporal-head", "strided-gather", "sparse-videogen", "hunyuanvideo" ], "description": "The pattern a 'temporal' head of a video diffusion transformer actually wants: follow one patch of the picture through the WHOLE clip \u2014 the same spatial tile in every frame \u2014 and additionally look around inside your own frame. In the raster-ordered latent the temporal comb is a stride-Hh*Ww gather with one tiny contiguous run per frame, the worst access pattern in the whole family, while the in-frame window is a 2D box with row stride Ww. Two different strided gathers feeding one softmax, and the tile they share must not be counted twice." }, { "name": "temporal-upsample-3d", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 517.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "upsample", "temporal", "video", "vae", "wan", "hunyuanvideo", "decoder" ], "description": "A 4x8x8 video tokenizer has to turn 33 latent frames back into 129 pixel frames, and it does it with two temporal 2x upsamples. Wan implements each one as a causal Conv3d with a (3,1,1) kernel that DOUBLES the channel count, followed by an interleave that folds the two halves of the channel axis into consecutive output frames. The convolution is a skinny three-tap GEMM and the interleave is a strided scatter that doubles the size of the largest tensor in the decoder \u2014 done separately, the scatter costs as much as the math." }, { "name": "titans-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "titans", "test-time-training", "backward", "long-term-memory" ], "description": "The training-side counterpart of Titans (Google, 2025): a (D, D) memory updated by gradient descent on an associative-recall loss, with MOMENTUM (a second (D, D) state) and a per-token weight-decay gate, where the inner gradient is itself the backward of a LayerNorm-ed model. The backward therefore differentiates a coupled two-state scan whose per-step coefficients are all data-dependent, plus two LayerNorms \u2014 and returns NINE gradients, including one per gate." }, { "name": "titans-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 294.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "titans", "test-time-training", "long-term-memory", "gpu" ], "description": "Titans (Google, 2025) learns its memory at test time: a (D, D) memory matrix is updated by gradient descent on an associative-recall loss, with MOMENTUM (a second (D, D) state) and a per-token weight-decay gate. The gradient is the backward of a LayerNorm-ed inner model, so the state recurrence is a coupled two-state linear scan whose per-step coefficients are all data-dependent." }, { "name": "trilinear-interpolate-3d", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 371.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "interpolate", "trilinear", "resize", "video", "vae", "latent", "memory-bound", "gather" ], "description": "Video generation pipelines resize 5D volumes constantly: latents are resampled between aspect-ratio buckets, decoded frames are rescaled before a refiner stage, and several tokenizer variants upsample with a plain trilinear interpolate before the convolution rather than after it. It is an eight-tap gather with a different weight at every output voxel, and at video sizes it moves gigabytes \u2014 a pure bandwidth and addressing problem where a naive kernel wastes most of its loads because neighbouring outputs share source voxels it re-fetches." }, { "name": "ttt-linear-backward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 441.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "ttt", "test-time-training", "backward", "linear-attention" ], "description": "The training-side counterpart of Test-Time Training with a linear inner model: the RNN state is the WEIGHTS of a LayerNorm-ed linear map trained by gradient descent while the sequence is read, one mini-batch step every 64 tokens, evaluated in the 'dual form'. The backward has to differentiate through an optimiser step \u2014 a second-order object \u2014 plus two LayerNorms, and return seven gradients including one for the per-token learning rate." }, { "name": "ttt-linear-forward", "family": "Linear attention & SSM", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 392.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "ttt", "test-time-training", "linear-attention", "gpu" ], "description": "Test-Time Training turns the RNN state into the WEIGHTS of a small model that is trained by gradient descent while the sequence is being read. TTT-Linear's inner model is a LayerNorm-ed linear map; one mini-batch gradient step is taken every 64 tokens, and the whole mini-batch is evaluated in the 'dual form' against the weights as they were at its start, which is what turns a sequential optimiser into dense matmuls." }, { "name": "vae-attention-block-highres", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 958.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "flash-attention", "video", "vae", "wan", "hunyuanvideo", "groupnorm", "mid-block", "high-resolution" ], "description": "The mid-block of the Wan / HunyuanVideo tokenizer runs full self-attention over every latent pixel of every frame: GroupNorm, a 1x1x1 QKV projection, softmax attention with ONE head of dimension 384-512, a 1x1x1 output projection, and a residual add. At 720p the latent grid is 90x160, so the sequence is 14400 tokens per frame and the score matrix alone is 830 MB in fp32 \u2014 this is the one operator in the decoder that is quadratic in resolution, and its head dimension is four times anything an LLM kernel is tuned for." }, { "name": "vae-decode-fp8", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 660.1, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "fp8", "quantization", "silu", "fusion", "video", "vae", "decoder", "low-precision" ], "description": "Running a whole video-VAE decoder in FP8 means the activations never widen: each block consumes FP8, convolves it, applies its bias and SiLU, and hands the next block FP8 again along with fresh per-voxel scales. The requantisation is the interesting half \u2014 the amax has to be taken across the OUTPUT CHANNEL axis, which in NCDHW is the slowest-varying one, so the epilogue needs a reduction in exactly the direction the storage layout makes hardest. Fused it is one pass; split into conv, activation, amax and quantise it is five." }, { "name": "vae-decode-tile-feather", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 564.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "vae", "tiling", "blending", "feather", "video", "decode", "wan", "hunyuanvideo", "memory-bound", "scatter" ], "description": "A 720p x 129-frame decode does not fit in memory, so every production video VAE decodes overlapping spatial tiles and stitches them. Because each tile was convolved against its own zero padding, a hard cut leaves visible seams \u2014 the fix is a feathered blend: each tile is weighted by a separable ramp that falls off towards its borders, the weighted tiles are accumulated onto the full canvas, and the canvas is divided by the accumulated weight. It is a scatter-accumulate over gigabytes with a different weight at every pixel of every tile." }, { "name": "vae-encoder-downblock-fused", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 706.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "downsample", "groupnorm", "silu", "fusion", "video", "vae", "wan", "hunyuanvideo", "encoder" ], "description": "The spatial 8x compression of a 4x8x8 video tokenizer comes from three encoder downsample blocks: GroupNorm(32) -> SiLU -> causal Conv3d with stride 2 in H and W and the channel count doubled. The spatial padding is ASYMMETRIC \u2014 zero on the top and left, one on the bottom and right \u2014 which is how Wan keeps the output exactly H/2 x W/2 without an off-by-one, and it quietly breaks every tiling that assumes a centred halo. Fused, the norm and activation disappear into the convolution's prologue instead of costing two more gigabyte round trips." }, { "name": "vae-quant-conv", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 511.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "vae", "decoder", "latent", "fusion", "wan", "hunyuanvideo", "video" ], "description": "The first thing a video-VAE decoder does with a latent is run it through post_quant_conv, a 1x1x1 mixing convolution over the 16 latent channels, and then conv_in, a causal 3x3x3 convolution that explodes those 16 channels into the decoder's 384 or 512. It is the narrowest-to-widest transition in the whole model: the input is a few tens of megabytes and the output is nearly a gigabyte, so the intermediate never deserves to touch HBM and the reduction dimension is far too short for a textbook GEMM tiling." }, { "name": "vae-resblock-fused", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T3", "tier_why": "convolution with custom padding/grouping/tiling: cuDNN's path for this case is not the fast one, so the tiled kernel is the task", "metric": "TFLOP/s", "roofline_us": 1092.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "conv3d", "causal", "groupnorm", "silu", "resblock", "fusion", "video", "vae", "wan", "hunyuanvideo" ], "description": "The residual block is the unit the Wan / HunyuanVideo 3D tokenizer is built from: GroupNorm(32) -> SiLU -> causal Conv3d -> GroupNorm(32) -> SiLU -> causal Conv3d -> add the skip. Run as six separate torch ops it makes six round trips of a multi-hundred-megabyte 5D activation through HBM and stalls the tensor cores between every one. Fused, the norms and activations ride along in the convolution's epilogue and prologue, and the block becomes what it should be: two implicit GEMMs back to back." }, { "name": "varlen-packed-attention", "family": "Attention \u2014 text LLM", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "TFLOP/s", "roofline_us": 1156.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "varlen", "packed", "cu-seqlens", "flash-attention", "ragged" ], "description": "How every real training and prefill batch is actually shaped: sequences of different lengths concatenated into one flat token buffer, delimited by a cu_seqlens offset array, with causal attention INSIDE each sequence and none across the boundaries. Padding everything to the longest sequence would waste most of the batch, so the kernel has to schedule ragged work directly \u2014 the reference loops over sequences one at a time and materialises a dense score matrix for each." }, { "name": "video-attn-active-query-refresh", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 417.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "video-diffusion", "query-sparsity", "caching", "adaptive-compute", "sparse-videogen", "hunyuanvideo", "wan" ], "description": "The other way to make video attention sparse: leave the keys alone and skip the QUERIES. Between two denoising steps most of a video latent barely moves, so a video DiT recomputes attention only for the token tiles that changed and blends the rest out of the previous step's output cache \u2014 a different active set for every head, chosen fresh each step. The kernel gathers a few percent of the query rows, attends them against the whole sequence, blends them with the cache and leaves 90% of the output as a straight copy." }, { "name": "video-attn-head-adaptive-window", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 709.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "per-head", "load-balancing", "sparse-videogen", "hunyuanvideo", "wan" ], "description": "No two attention heads of a video DiT want the same sparsity: some are tight local heads, some track motion across frames, and a few carry global structure and cannot be sparsified at all without visible artefacts. Production sparse video attention therefore runs a PER-HEAD plan \u2014 a different 3D window radius for every head and a dense fallback for the heads the calibrator refused \u2014 inside a single kernel launch. The work per head then differs by two orders of magnitude, and the whole problem is scheduling it." }, { "name": "video-attn-quantized-sparse", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 883.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "int8", "quantization", "block-sparse", "video-diffusion", "sageattention", "hunyuanvideo", "smoothing" ], "description": "The two speed-ups video diffusion deployments actually stack: INT8 attention and 3D block sparsity. INT8 only survives because K's channel outliers are removed first \u2014 here the mean is subtracted PER 3D TILE, so putting it back is not a constant that cancels in the softmax but a rank-1 correction the kernel has to add per (query, key tile). Fold that into an int8 tensor-core QK, a per-tile pair of scales, and a gather over a top-K tile list, all inside one online softmax." }, { "name": "video-attn-sink-frames", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 3926.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "video-diffusion", "attention-sink", "temporal-window", "hunyuanvideo", "wan" ], "description": "The video analogue of an attention sink, and it is not the text one. A bidirectional video transformer keeps the first few frames (which anchor the scene) and the last few (which anchor the ending) globally visible, and lets everything else see only a short temporal window around itself. Three frame regions whose union changes shape along the clip and OVERLAPS near both ends \u2014 so the number of visible frames is different for almost every query frame, and a kernel that walks the three regions independently double-counts keys in the softmax." }, { "name": "video-attn-topk-block-select", "family": "Video \u2014 sparse / efficient attention", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 3926.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "attention", "sparse-attention", "top-k", "video-diffusion", "block-selection", "hunyuanvideo", "wan" ], "description": "Selecting the top-k key tiles GLOBALLY for a video query is a trap: the winners all pile up in the query's own frame and the clip loses temporal coherence. The fix that video sparse-attention systems converged on is a PER-FRAME budget \u2014 take the best k spatial tiles inside every temporal slice, so each frame is guaranteed a seat. This kernel does the selection from a precomputed score table and the attention over the selected 3D tiles in one launch, with no host round trip between them." }, { "name": "video-cfg-zero-star-rescale", "family": "Video \u2014 sparse / efficient attention", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 304.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "video-diffusion", "classifier-free-guidance", "cfg-zero-star", "guidance", "reduction", "dot-product", "sampler", "memory-bound" ], "description": "Every video diffusion sampler runs the transformer twice per step and blends the two predictions. CFG-Zero* replaces the naive blend with a rescaled one: it first projects the unconditional prediction onto the conditional one \u2014 a pair of dot products over the ENTIRE latent of each sample \u2014 and uses that coefficient to shrink the unconditional branch before the guidance extrapolation. So a step that used to be one elementwise pass becomes a whole-tensor reduction followed by a blend that cannot start until the reduction is finished, over a gigabyte of predictions per denoising step." }, { "name": "video-latent-pack-unpack", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 330.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "patchify", "latent", "dit", "video", "vae", "wan", "hunyuanvideo", "layout", "memory-bound" ], "description": "The bridge between a video VAE and its diffusion transformer is a (1,2,2) patchify: the (16, T, H, W) latent grid is cut into 1x2x2 patches, each becoming a 64-value token, and the model's output is unpatchified back the same way. In a training loop this runs on every batch, in both directions, on fp32 latents streamed from a cache and bf16 tokens fed to the transformer \u2014 so it is a dtype conversion and a five-dimensional shuffle over gigabytes, where the naive rearrange makes four strided passes instead of two." }, { "name": "vision-patch-embed-2d", "family": "Multimodal & audio", "tier": "T4", "tier_why": "dense GEMM: cuBLAS/CUTLASS are already at the hardware limit", "metric": "TFLOP/s", "roofline_us": 563.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "vision", "vit", "patch-embed", "implicit-gemm", "multimodal", "compute-bound" ], "description": "The first thing a vision tower does to every image and every video frame is turn raw HWC uint8 pixels into patch tokens: normalise, cut into PxP patches, and project each patch through a (D, 3*P*P) matrix. In a VLM server this runs on hundreds of frames per request and the naive version is three separate passes \u2014 a normalise, an im2col that explodes the image by 3*P*P/1, and a GEMM. Fused, it is one implicit-GEMM kernel that never materialises the patches." }, { "name": "w4a16-dequant-gemm", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "quantised matmul: cuBLAS will not fuse the dequant, so the MMA pipeline is hand-written -- async copy, double buffering, fragment layouts", "metric": "TFLOP/s", "roofline_us": 392.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "int4", "gptq", "w4a16", "quantization", "gemm", "low-precision" ], "description": "W4A16 is how most open-weight LLMs are actually served: weights quantised to 4-bit integers with a group of 128 sharing one fp16 scale and one integer zero-point, activations left in bf16. The weights are a quarter of the bytes, so the win is real \u2014 but only if the unpack and the affine dequant happen inside the GEMM mainloop. Expand the weights to bf16 in HBM first and you have thrown the entire benefit away." }, { "name": "wan-adaln-modulation-backward", "family": "Video \u2014 Wan DiT", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 901.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "adaln", "layernorm", "backward", "training", "memory-bound" ], "description": "Fine-tuning or distilling a Wan video DiT (LoRA, CausVid, self-forcing) has to differentiate the adaLN modulation that opens every block: `y = layernorm(x) * (1 + scale) + shift`. The forward saved nothing, so the backward recomputes the per-token statistics, applies the two centring corrections of the LayerNorm gradient, and \u2014 because shift and scale are per-SAMPLE vectors broadcast over 75,600 video tokens \u2014 reduces the incoming gradient over the entire token axis. One pass over dy and x, a row reduction and a column reduction, at gigabyte scale." }, { "name": "wan-adaln-modulation-fused", "family": "Video \u2014 Wan DiT", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 600.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "adaln", "layernorm", "modulation", "memory-bound" ], "description": "Every block of the Wan 2.1 / 2.2 video diffusion transformer opens by LayerNorm-ing its hidden state (no affine) and then modulating it with a shift/scale pair produced from the timestep embedding: `norm(x) * (1 + scale) + shift`. At 720p/81 frames the hidden state is 75,600 tokens x 5120 channels PER CFG BRANCH, so this 'cheap' elementwise op moves gigabytes twice per block and 40 times per denoising step. Done as separate torch ops it is three round trips through HBM; fused it is one read and one write." }, { "name": "wan-attention-backward-video", "family": "Video \u2014 Wan DiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 8958.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "attention", "backward", "sparse-attention", "sliding-tile", "training" ], "description": "Training or distilling a Wan model with tiled sparse attention (sliding-tile attention, block-sparse 3-D attention) needs the backward of a window that is a 3-D box in a row-major token buffer. Forward, each query tile reads a neighbourhood of key tiles; backward, each KEY tile receives gradient from every query tile whose window contains it \u2014 up to (2R+1)^3 of them \u2014 so dK and dV are overlapping scatter-accumulations while dQ stays tile-local. It is a flash-attention backward, a block-sparse schedule and a reduction, all at once." }, { "name": "wan-cross-attention-backward", "family": "Video \u2014 Wan DiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 5662.3, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "cross-attention", "backward", "training", "attention", "reduction" ], "description": "Fine-tuning, LoRA training and distillation of a Wan video DiT all have to differentiate the cross attention from 75,600 video queries into a 512-token text context. The forward is a tall-skinny attention; the backward is worse than asymmetric \u2014 dQ is one gradient per query and is embarrassingly parallel, while dK and dV are sums of 75,600 rank-one contributions accumulating into a 512-row tensor. Every query block wants to update the same small accumulator, so the whole kernel is a split-reduction problem wearing an attention costume." }, { "name": "wan-cross-attention-text", "family": "Video \u2014 Wan DiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 3401.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "cross-attention", "i2v", "text-conditioning", "clip", "attention" ], "description": "Every Wan block cross-attends its 75,600 video tokens into the conditioning context, and in the image-to-video models there are TWO contexts: the 512 umT5 text tokens and the 257 CLIP image tokens, attended separately and then summed. The shape is the opposite of everything a flash kernel is tuned for \u2014 an enormous query stream against a key/value set small enough to live in shared memory \u2014 so the whole kernel is bound by how many times the query tensor crosses the bus and whether the two contexts share that pass." }, { "name": "wan-ffn-gelu-video", "family": "Video \u2014 Wan DiT", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "TFLOP/s", "roofline_us": 13249.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "ffn", "mlp", "gelu", "gemm", "adaln", "fused-epilogue" ], "description": "The back half of every Wan DiT block: LayerNorm the hidden state, modulate it with the timestep's FFN shift/scale, run a 5120 -> 13824 -> 5120 GELU MLP, multiply by the timestep's gate and add the residual. Unlike an LLM this is a plain tanh-GELU MLP, not SwiGLU \u2014 and unlike an LLM the modulation and the gate are per-sample fp32 vectors that have to be folded into the GEMM prologue and epilogue rather than living in their own kernels. At 75,600 tokens the un-fused version round-trips several gigabytes per block." }, { "name": "wan-moe-expert-switch", "family": "Video \u2014 Wan DiT", "tier": "T3", "tier_why": "attention with custom masking/sparsity: no library kernel applies as-is, so the tiled online-softmax pipeline is written by hand", "metric": "TFLOP/s", "roofline_us": 11777.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "moe", "expert-routing", "ffn", "gemm", "grouped-gemm", "wan2.2" ], "description": "Wan 2.2's A14B is a mixture of two denoising experts: a high-noise expert for the early part of the trajectory and a low-noise expert for the rest, selected by comparing the timestep against a boundary. In a rolling / diffusion-forcing video pipeline the noise level is per FRAME, not per clip, so within a single forward pass some frames are above the boundary and some below \u2014 and the FFN has to route each frame's 1,560-3,600 tokens to the right expert without permuting anything. Two weight sets, one pass, groups that are runs of tokens rather than a sorted batch." }, { "name": "wan-patch-embed-3dconv", "family": "Video \u2014 Wan DiT", "tier": "T4", "tier_why": "plain convolution: cuDNN applies directly and already runs near roofline", "metric": "GB/s", "roofline_us": 608.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "patch-embed", "conv3d", "patchify", "memory-bound" ], "description": "The first thing a Wan DiT does is turn a VAE latent video into tokens: a Conv3d with kernel and stride both (1, 2, 2) over a (16, 21, 90, 160) latent, then a flatten to (75600, 5120). It looks like a convolution but it is a 64-wide GEMM with a strided 3-D gather on one side and a channel-to-token transpose on the other \u2014 cuDNN produces the answer in the wrong layout and the transpose that follows costs a full extra round trip of the largest tensor in the model." }, { "name": "wan-qkv-proj-qknorm-rope", "family": "Video \u2014 Wan DiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 16986.9, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "gemm", "qk-norm", "rmsnorm", "rope", "3d-rope", "fused-epilogue" ], "description": "The front half of every Wan self-attention block: project the modulated hidden state to q, k and v, RMS-normalise q and k \u2014 across the FULL model width, not per head, which is what Wan actually does \u2014 and rotate them with the factorised 3-D (frame/height/width) rotary embedding. At 720p that is three 75,600 x 5120 x 5120 GEMMs whose outputs are immediately consumed by a row reduction and a rotation, so the difference between a fused kernel and the module's six separate ops is several gigabytes of round trips per block, times 40 blocks, times two CFG branches, times every denoising step." }, { "name": "wan-residual-gate-add", "family": "Video \u2014 Wan DiT", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 1201.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "residual", "gate", "layernorm", "adaln", "memory-bound" ], "description": "Halfway through every Wan DiT block there is a seam: the attention branch's output is scaled by the timestep gate and added to the residual, and the result is immediately LayerNorm-ed and modulated again for the FFN branch. As written that is four elementwise kernels over a 75,600 x 5120 tensor and five trips through HBM; the seam only needs two reads and two writes. It runs twice per block (attention seam and cross-attention seam), 40 blocks deep, on both CFG branches, every denoising step." }, { "name": "wan-rope3d-apply", "family": "Video \u2014 Wan DiT", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 1201.6, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "rope", "3d-rope", "rotary", "memory-bound" ], "description": "A video DiT has no 1-D sequence: its 75,600 tokens are a 21x45x80 latent grid, and Wan gives them position by splitting each head's 64 complex channels into three bands \u2014 frame, height and width \u2014 and rotating each band by the frequency of its own axis coordinate. The kernel has to recover (f, h, w) from the flat token index, pick the right band of a shared frequency table for every channel, and rotate interleaved (real, imag) pairs of q and k. Wan's own implementation materialises the whole per-token frequency table in fp64 and does it with complex tensors; at 720p that is gigabytes of avoidable traffic." }, { "name": "wan-sage-qk-int8-quant", "family": "Video \u2014 Wan DiT", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 901.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "sageattention", "int8", "quantization", "smoothing", "attention", "memory-bound" ], "description": "The single most deployed speed-up for Wan video generation is INT8 attention: quantise Q and K to int8 with a scale per attention block, run the QK^T on INT8 tensor cores, and keep PV in bf16. It only works because K's channel-wise outliers are removed first \u2014 subtracting the per-head channel mean of K leaves the softmax unchanged, since a constant per query cancels in the normalisation, but it shrinks K's dynamic range enough that 8 bits is accurate. This kernel is the quantisation front-end: at 720p it streams 3 GiB of Q and K through a per-block amax reduction, and it runs before every one of the 40 attention layers." }, { "name": "wan-spatiotemporal-attention", "family": "Video \u2014 Wan DiT", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 7166.4, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "attention", "sparse-attention", "sliding-tile", "block-sparse", "spatiotemporal" ], "description": "Wan's 75,600-token self attention is quadratic and eats ~80% of a 720p denoising step, but the attention it learns is overwhelmingly LOCAL in 3-D: a token attends to the tokens near it in frame, height and width. Sliding-tile attention exploits that by cutting the (F, H, W) latent grid into tiles and letting every query tile attend to a fixed neighbourhood of key tiles, so the whole thing becomes block-sparse with uniform work per tile. The catch is that a tile is a 3-D box inside a row-major token buffer, so both the query rows and the key window are strided gathers rather than contiguous slices." }, { "name": "wan-sta-tile-permute", "family": "Video \u2014 Wan DiT", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 600.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "sliding-tile", "permutation", "layout", "gather-scatter", "memory-bound" ], "description": "Every tiled video-attention scheme (sliding-tile attention, block-sparse 3-D attention, tile-wise KV compression) needs the 75,600 tokens of a Wan latent grid laid out TILE-MAJOR: all the tokens of a (3, 5, 4) spatio-temporal tile contiguous, so a tile is one coalesced load instead of 15 strided runs. The reorder runs before the attention and its inverse runs after, twice per layer, on tensors of 1.5 GiB. It is a pure permutation, which makes it a pure coalescing problem: the naive gather reads 256 bytes and writes 256 bytes from addresses that share no cache line." }, { "name": "wan-unpatchify-head", "family": "Video \u2014 Wan DiT", "tier": "T3", "tier_why": "grouped / variable-M GEMM: there is no single library call for it, so the per-group tiling and scheduling are the task", "metric": "GB/s", "roofline_us": 608.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wan", "video-diffusion", "dit", "unpatchify", "layernorm", "adaln", "output-head", "memory-bound" ], "description": "The last thing a Wan DiT does per denoising step: LayerNorm the 75,600 x 5120 hidden state, modulate it with the timestep's final shift/scale pair, project it down to 64 numbers per token and scatter those back into a (16, 21, 90, 160) latent video. Three kernels and a six-way permute in the module; one pass over the hidden state if you fuse them \u2014 and the hidden state is the biggest tensor in the model." }, { "name": "warp-specialized-gemv", "family": "Megakernel \u2014 whole-model fusion & primitives", "tier": "T3", "tier_why": "GEMM with a fused activation/gate epilogue: needs a hand-written MMA pipeline", "metric": "tokens/s", "roofline_us": null, "gpus": 1, "keywords": [ "mle", "kernel-generation", "megakernel", "warp-specialization", "producer-consumer", "gemv", "swiglu", "memory-bound", "grid-sync" ], "description": "Three dependent GEMVs against 805 MB of weights, fused into one launch: gate and up feed a SwiGLU, and down cannot start until the whole 16384-wide intermediate exists. Inside each half the shape is the textbook producer/consumer case -- weight tiles must arrive continuously while a separate set of warps consumes them against 8 resident rows. Graded on achieved GB/s against a cuBLAS baseline that already runs at ~70% of HBM peak." }, { "name": "wavelet-transform-3d", "family": "Video \u2014 3D causal VAE / tokenizer", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 373.5, "gpus": 1, "keywords": [ "mle", "kernel-generation", "wavelet", "haar", "video", "vae", "tokenizer", "subband", "memory-bound", "wf-vae" ], "description": "Wavelet-flow video VAEs replace part of the strided-convolution ladder with an orthonormal 3D Haar transform: a 2x2x2 neighbourhood becomes eight subbands, energy-preserving and exactly invertible, so the low-frequency path can be carried straight through the network and only the residual detail has to be learned. The encoder runs the analysis and the decoder the synthesis, both on 5D volumes of hundreds of megabytes \u2014 24 adds per eight voxels and a three-axis strided gather, which makes it pure bandwidth with a nasty access pattern." }, { "name": "whisper-conv-frontend", "family": "Multimodal & audio", "tier": "T4", "tier_why": "plain convolution: cuDNN applies directly and already runs near roofline", "metric": "TFLOP/s", "roofline_us": 566.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "audio", "whisper", "asr", "conv1d", "implicit-gemm", "compute-bound" ], "description": "A Whisper-style audio encoder starts with two dense conv1d layers that turn the 128-channel mel spectrogram into 1280-wide features and halve the time axis: a 128->1280 convolution over 3000 frames followed by a strided 1280->1280 one. The second layer alone is a 3-tap GEMM with a 1280x1280 weight applied at every output frame, and on a batch of 30-second clips the pair is several hundred GFLOP that a serving stack pays before any attention happens." }, { "name": "whisper-cross-attn-decode", "family": "Multimodal & audio", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "GB/s", "roofline_us": 476.8, "gpus": 1, "keywords": [ "mle", "kernel-generation", "audio", "whisper", "asr", "cross-attention", "decode", "beam-search", "memory-bound" ], "description": "An ASR decoder attends to the audio encoder's 1500-frame output at every generated token, in every layer. The encoder KV is fixed for the whole utterance and \u2014 crucially \u2014 SHARED by all the beams of a clip, so the arithmetic is negligible and the entire cost is streaming that cache out of HBM exactly once per clip. A kernel that re-reads it per beam does several times the necessary traffic; the whole task is to read it once and serve every beam from it." }, { "name": "yarn-partial-rope", "family": "Normalization, RoPE & elementwise fusion", "tier": "T2", "tier_why": "bandwidth kernel with a reduction/gather: shared-memory tiling and a warp reduction", "metric": "GB/s", "roofline_us": 390.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "rope", "yarn", "long-context", "memory-bound", "serving" ], "description": "YaRN is how long-context models (DeepSeek-V3, Qwen, Yi-200K, Nous-Hermes) stretch a 4k-trained rotary embedding to 128k: a per-frequency blend of interpolated and extrapolated inverse frequencies plus an attention-magnitude rescale. It is applied to only the first `rotary_dim` channels of each head, with the remaining channels passed through untouched \u2014 so the kernel is a rotation on part of every head and a straight copy on the rest, in one pass." }, { "name": "zamba-shared-attn-lora-backward", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 1932.7, "gpus": 1, "keywords": [ "mle", "kernel-generation", "zamba", "hybrid", "shared-attention", "lora", "multi-adapter", "backward", "training", "gemm", "compute-bound" ], "description": "Fine-tuning a Zamba-style hybrid means differentiating a block that was called at L different depths with one frozen weight and L different rank-64 adapters, over an input that was a concatenation of the depth's residual stream and the model's original embedding. So the embedding's gradient is a sum over EVERY depth, each adapter's gradient is a pair of tall-skinny reductions over the token axis, and the frozen weight is read L times and never updated." }, { "name": "zamba-shared-attn-lora-qkv", "family": "Quantization & low-precision GEMM", "tier": "T3", "tier_why": "multi-GEMM block: needs a hand-written, pipelined MMA sequence to beat", "metric": "TFLOP/s", "roofline_us": 1879.0, "gpus": 1, "keywords": [ "mle", "kernel-generation", "zamba", "hybrid", "shared-attention", "lora", "multi-adapter", "gemm", "fusion", "compute-bound" ], "description": "Zamba-2 does not give every attention layer its own weights \u2014 it has ONE attention block and calls it at several depths of a Mamba stack, feeding it the concatenation of the current residual stream and the original token embedding, and giving each invocation its own low-rank adapter so the shared weights can still specialise. The QKV projection therefore runs L times against the same 50 MB of weights with L different rank-64 deltas, and done as L separate library calls the shared weight is re-read from HBM every time and the adapters get three extra launches each." }, { "name": "zero3-param-regroup", "family": "MoE \u2014 routing & grouped GEMM", "tier": "T1", "tier_why": "elementwise/bandwidth chain: the win is fusing the passes into one", "metric": "GB/s", "roofline_us": 469.2, "gpus": 1, "keywords": [ "mle", "kernel-generation", "zero3", "deepspeed", "fsdp", "bucketing", "all-gather", "moe", "distributed", "training", "layout", "memory-bound" ], "description": "ZeRO-3 does not all-gather 200 expert matrices one at a time \u2014 it coalesces them into fixed-capacity buckets first, walking the parameter list in order and starting a new bucket whenever the next tensor will not fit. Nothing may straddle a bucket, so the tail of every bucket is a zeroed hole, and every parameter needs its (bucket, offset) recorded so the gathered copy can be found again. It moves the whole unit and it decides how many collectives the step issues." } ]