According to Dynamic Insights monitoring, the dark side of the moon open-sourced FlashKDA on GitHub, a tool specifically designed to accelerate model inference on NVIDIA's Hopper series GPUs (H100, H20, etc.), under the MIT license. The target of this tool is KDA, a new attention mechanism proposed by the dark side of the moon in last year's Kimi Linear paper. When large models read long texts, the computational cost of the traditional attention mechanism grows quadratically with the length, while linear attention reduces this cost to linear growth. KDA is an improved version along this path. The structure of the Kimi Linear model consists of 3 layers of KDA followed by 1 layer of the traditional attention mechanism.
Prior to FlashKDA, there was already a version written in the Triton language, included in the open-source library flash-linear-attention (referred to as fla). FlashKDA was rewritten using NVIDIA's underlying GPU library CUTLASS, specifically to squeeze out the performance of the Hopper GPUs. Official benchmarks on the H20 show that for the same forward pass calculation, FlashKDA is 1.7 to 2.2 times faster than the Triton version, with the acceleration particularly noticeable in scenarios with varying input lengths and batched inference. However, the official comparison was only made with their own Triton version and not with other linear attention solutions.
This release only open-sources the forward pass calculation, meaning it can only be used for model inference, not model training, which still needs to be done with the original Triton version. The requirements for usage are: GPUs must be Hopper or newer (starting from the SM90 architecture), CUDA 12.9 or higher, and PyTorch 2.4 or higher. FlashKDA has also been merged into the upstream of fla as a new backend (PR #852), so existing users can switch by simply changing one line of configuration.
