deepseek-ai/FlashMLA
Machine LearningProduction attention kernels for DeepSeek's MLA and sparse attention, aimed at teams serving DeepSeek models on modern NVIDIA or Ascend hardware.
The problem
Serving DeepSeek-style multi-head latent attention at scale is not something a generic attention implementation handles well. The KV cache is large, the decode path is bandwidth-bound, and the quantized FP8/FP4 formats the model expects are not what stock PyTorch or generic FlashAttention kernels consume. FlashMLA is DeepSeek's own kernel library for this: prefill, decode and backward attention kernels, plus a dense MHA path, tuned for its V4.1 model on NVIDIA SM100/SM103 and Huawei Ascend 950.
What's different
This is a vendor-authored kernel library rather than a general-purpose attention project. Two things stand out. First, it tracks a moving model target: the sparse kernels implement DeepSeek Sparse Attention and only accept FP8 or FP4 KV caches in DeepSeek's own byte layout — unquantized bf16 KV cache is explicitly unsupported. Second, it fuses Q-norm, Q-RoPE, core attention, O-RoPE and the FP8 cast into a single kernel, removing launch overhead from the small surrounding ops at roughly the same throughput. Compared with generic kernels like FlashAttention, you get tighter integration and higher numbers, but you give up model and hardware generality.
Who it's for
Inference engineers running DeepSeek V4.1 (or maintaining a fork for older V3/V4 versions) on B200-class Blackwell GPUs or Ascend 950 NPUs. It fits teams building their own serving stack who are willing to wire metadata and KV-cache layouts themselves. Look elsewhere if you serve other models, run on Hopper or older GPUs, need a plug-and-play library, or use bf16 KV cache — none of those are supported here.
Cost of adoption
Narrow and demanding: SM100/SM103 NVIDIA GPUs with CUDA 13.1+ (13.2+ recommended), or Ascend 950 with CANN 9.2.0+, plus PyTorch 2.10+ and torch_npu on Ascend. The build must run without isolation (pip install -v . --no-build-isolation) because setup.py imports torch at build time, and a register-spill check can fail the CUDA build. The 2026.09.30 release is a hard break: Hopper and V3/V3.2/V4.0 support were removed and the KV cache format changed, so older deployments must pin an earlier commit. The README is detailed but assumes familiarity with attention internals.
Verdict
FlashMLA is a real, actively maintained piece of DeepSeek's inference stack, not a showcase repo: releases have shipped since early 2025 and the project keeps pace with each new model. Interest is steady rather than spiking — about 13.2k stars and a monthly C++ ranking bump of +247, with no daily trending appearance. The 441-point HN thread dates from the first release, so the attention is old and the current activity is incremental. Adopt it if you are serving DeepSeek models on the exact hardware listed; otherwise it is a useful read, not a dependency.
Hacker News
Written by AI from the project's README, updated October 25, 2026. The project's own docs are the source of truth.