用FPGA加速线性注意力解码,实现4.5倍于GPU的吞吐和60倍能效提升
A Persistent-State Dataflow Accelerator for Memory-Bound Linear Attention Decode on FPGA
- 将递归状态持久存于片上内存,仅需单次读写完成每步计算
- 最快达63微秒/标记,比H100 GPU快4.5倍,能效高60倍
- 适合对延迟和功耗敏感的边缘部署场景,如实时推理
Gated DeltaNet(GDN)是一种线性注意力机制,用固定大小的循环状态替代不断增长的键值缓存。混合大模型如Qwen3-Next采用75%的GDN层,性能可媲美纯注意力模型。然而在批量为1时,由于完整循环状态需每标记往返一次高带宽内存(HBM),GDN解码在GPU上成为内存瓶颈。我们发现该瓶颈源于架构而非算法:所有亚二次序列模型在解码时算力密度低于1 FLOP/B,比标准Transformer更依赖内存。本文提出一种FPGA加速器,通过将2 MB的完整循环状态持久存储于片上BRAM,使工作负载从内存密集转为计算密集。设计融合了五阶段流水线数据通路,每标记仅对每个状态矩阵执行一次读写操作,利用分组值注意力实现成对头并行,并通过数据流流水线重叠准备、计算与输出存储。我们在AMD Alveo U55C上探索了四种配置,头级并行度从2到16个值头/迭代不等。最快速配置达到63 μs/标记,比NVIDIA H100 PCIe参考模型快4.5倍。后综合功耗分析显示芯片功耗为9.96 W,每标记能量效率最高达60倍。
原文摘要 · Abstract (English)
Gated DeltaNet (GDN) is a linear attention mechanism that replaces the growing KV cache with a fixed-size recurrent state. Hybrid LLMs like Qwen3-Next use 75% GDN layers and achieve competitive accuracy to attention-only models. However, at batch-1, GDN decode is memory-bound on GPUs since the full recurrent state must be round-tripped through HBM every token. We show that this bottleneck is architectural, not algorithmic, as all subquadratic sequence models exhibit arithmetic intensities below 1 FLOP/B at decode time, making them more memory-bound than standard Transformers. We present an FPGA accelerator that eliminates this bottleneck by holding the full 2 MB recurrent state persistently in on-chip BRAM, converting the workload from memory-bound to compute-bound. Our design fuses the GDN recurrence into a five-phase pipelined datapath that performs only one read and one write pass over each state matrix per token, exploits Grouped Value Attention for paired-head parallelism, and overlaps preparation, computation, and output storage via dataflow pipelining. We explore four design points on an AMD Alveo U55C using Vitis HLS, varying head-level parallelism from 2 to 16 value-heads per iteration. Our fastest configuration achieves 63 $μ$s per token, 4.5$\times$ faster than the GPU reference on NVIDIA H100 PCIe. Post-implementation power analysis reports 9.96 W on-chip, yielding up to 60$\times$ greater energy efficiency per token decoded.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。