Understanding the compute-bound nature of the MLA kernel
mainThe FlashMLA kernel is primarily optimized for compute-bound scenarios. While decoding-stage attention kernels are often memory-bound, the MLA algorithm becomes compute-bound when the number of query heads ($h_q$) and query tokens per request ($s_q$) satisfy a specific threshold relative to the GPU's compute-to-memory ratio.
For an NVIDIA H800 SXM5 GPU, the kernel is considered compute-bound when:
$h_q s_q \ge 128$
In DeepSeek's inference systems, where Tensor Parallelism is not used for decoding instances, $h_q$ is typically 128, placing the workload in the compute-bound regime. Consequently, FlashMLA focuses on maximizing Tensor Core utilization through advanced scheduling.