FlashKDA icon indicating copy to clipboard operation
FlashKDA copied to clipboard

FlashKDA: high-performance Kimi Delta Attention kernels

Results FlashKDA issues
Sort by recently updated
recently updated
newest added

## Summary - add a differentiable recurrent KDA backend with a portable PyTorch reference path and an optional C++/ATen CPU operator - provide analytical first-order CPU gradients, variable-length sequence handling,...

## Motivation FlashKDA currently focuses on high-performance CUTLASS CUDA inference. Researchers who want to introduce KDA into conventional PyTorch models also need an accessible CPU path for architecture exploration, correctness...

## TL;DR Fail at the operation that caused a setup or CUDA configuration error instead of continuing to a later, less actionable failure. Closes #15. ## Motivation Two initialization boundaries...

## TL;DR Test FlashKDA directly against FLA's independent Triton `chunk_kda` implementation using the matching raw-gate, raw-beta, and state-layout contract. ## Motivation The existing FLA comparison does not directly assert FlashKDA...

## TL;DR Keep output-pipeline and TMA ownership on the elected STORE-warp lane while distributing the boundary-safe partial-tile copy across all 32 lanes. Closes #14. ## Motivation Full 16-row output tiles...

## TL;DR Replace bitwise BF16 kernel/reference assertions with a one-ULP comparison while keeping FP32 state checks exact. Relates to #12. ## Motivation Issue #12 reports that the forward test passes...

## Problem The C++ function requires an externally-managed `workspace` tensor, but the Python `flash_kda/__init__.py` is essentially empty — it just imports the C extension with no Pythonic wrapper. Users currently...

## Problem `bench_fwd.py` generates random inputs on every run with no seed control, making benchmarks non-reproducible across runs. This makes it difficult to compare performance across commits or verify optimization...

## Problem The README only shows integration via FLA's `chunk_kda` interface. There is no standalone example showing direct usage of the `flash_kda.fwd` API, and no minimal reproduction script. ## Recommendation...

## Problem `CHUNK=16` and `D=128` appear as magic numbers in multiple locations: - `csrc/flash_kda.cpp` — `static_assert` and workspace size calculation - `csrc/smxx/fwd_kernel1.cuh` — kernel constants - `csrc/smxx/fwd_kernel2.cuh` — kernel constants...