Update flashMLA implementation on MACA Update flashMLA implementation on MACA for C500 and C600
Update flashMLA implementation on MACA
Update flashMLA implementation on MACA for C500 and C600
We provide the implementation of FlashMLA from FlashAttention-2(version 2.6.3), based on MACA toolkit and C500 and C600 chips.
FlashAttention-2 currently supports:
Requirements:
To install in conda env:
export MACA_PATH=/your/maca/path export CUDA_PATH=$MACA_PATH/tools/cu-bridge export MACA_CLANG_PATH=$MACA_PATH/mxgpu_llvm/bin export LD_LIBRARY_PATH=$MACA_PATH/lib:$MACA_PATH/mxgpu_llvm/lib:$MACA_PATH/ompi/lib:$LD_LIBRARY_PATH
python setup.py install
python tests/test_flash_mla.py
from flash_mla import get_mla_metadata, flash_mla_with_kvcache tile_scheduler_metadata, num_splits = get_mla_metadata(cache_seqlens, s_q * h_q // h_kv, h_kv) for i in range(num_layers): ... o_i, lse_i = flash_mla_with_kvcache( q_i, kvcache_i, block_table, cache_seqlens, dv, tile_scheduler_metadata, num_splits, causal=True, ) ...
FlashMLA is inspired by FlashAttention 2&3 and cutlass projects.
@misc{flashmla2025, title={FlashMLA: Efficient MLA decoding kernel}, author={Jiashi Li}, year={2025}, publisher = {GitHub}, howpublished = {\url{https://github.com/deepseek-ai/FlashMLA}}, }
Fast and efficient attention method exploration and implementation.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号
FlashMLA on MXMACA
We provide the implementation of FlashMLA from FlashAttention-2(version 2.6.3), based on MACA toolkit and C500 and C600 chips.
FlashAttention-2 currently supports:
How to run on MXMACA Device
Installation
Requirements:
To install in conda env:
Set environment variables
Install
Benchmark
Usage
Requirements
Acknowledgement
FlashMLA is inspired by FlashAttention 2&3 and cutlass projects.
Citation