# FlashMLA

> DeepSeek's optimized Multi-head Latent Attention kernels for LLM inference on NVIDIA GPUs and Ascend NPUs

Source: https://talira.ai/catalog/flashmla-381p09b0
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [ai / ml / gpu kernels](https://talira.ai/categories/ai/ml/gpu-kernels)
- Platforms: linux[^1]
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [DeepSeek](https://talira.ai/orgs/deepseek.md)

FlashMLA is DeepSeek's MIT library of optimized attention kernels, powering inference of the DeepSeek-V4.1 model on NVIDIA GPUs and Huawei Ascend NPUs. It contains token-level sparse attention kernels for prefill and for decoding with an FP8 or FP4 KV cache (the kernels behind DeepSeek Sparse Attention), a fused kernel that combines Q-norm, Q-RoPE, attention, O-RoPE and the cast to FP8, and dense attention kernels for prefill and backward. You build it as a Python package with pip against an installed PyTorch and call it from your inference code; it sits beside [FlashAttention](https://talira.ai/catalog/flashattention-7z5qwqsr.md) for attention kernels.

## Links

- GitHub: https://github.com/deepseek-ai/FlashMLA

## Problems it solves

- speed up Multi-head Latent Attention inference for DeepSeek models on Blackwell GPUs
- run sparse attention decoding with an FP8 KV cache
- get fast attention kernels for DeepSeek models on Huawei Ascend NPUs

## Features

- token-level sparse attention kernels for prefill and decoding
- FP8 and FP4 KV cache decoding
- fused Q-norm, RoPE, attention and FP8-cast kernel
- dense attention kernels for prefill and backward
- NVIDIA SM100/SM103 and Huawei Ascend 950 support

## Limitations

- needs an NVIDIA SM100 or SM103 GPU with CUDA 13.1+, or a Huawei Ascend 950 NPU with CANN 9.2.0+, and PyTorch 2.10+[^1]
- the 2026.09.30 release dropped Hopper GPUs and DeepSeek V3, V3.2 and V4.0, and changed the KV cache format; older use needs a pinned commit[^1]
- built from source with pip; no published package[^1]

## Trust

Overall: 0.58 out of 1.
Signals: maintenance 0.66, adoption 0.82, momentum 0.85, community 0.53, backing 0.30, extensibility 0.00.

- last commit yesterday
- 9 commits in the last 90 days
- 13.3k GitHub stars
- 20 contributors
- backed by DeepSeek

## Alternatives

- [FlashAttention](https://talira.ai/catalog/flashattention-7z5qwqsr.md): Fast, memory-efficient exact attention kernels for training and running transformers on GPUs

## Sources

[^1]: https://github.com/deepseek-ai/FlashMLA/blob/main/README.md (checked 30 Nov 2026)
[^2]: https://github.com/deepseek-ai/FlashMLA/blob/main/LICENSE (checked 30 Nov 2026)
