Attention in SRAM on Tenstorrent Grayskull
Moritz Th\"uning

TL;DR
This paper demonstrates how utilizing SRAM in the Tenstorrent Grayskull architecture for Transformer attention operations significantly speeds up computation, especially for Softmax, and compares its cost-effectiveness to GPUs.
Contribution
It introduces a fused kernel that maximizes SRAM use for attention, including a dedicated Softmax kernel and a CPU baseline, achieving notable speedups.
Findings
Softmax kernel speedup up to 10x over CPU
Fused kernel is 1.8x faster than dedicated Softmax
Grayskull is 30x cheaper than Nvidia H100 and has 1.5x more SRAM
Abstract
When implementations of the Transformer's self-attention layer utilize SRAM instead of DRAM, they can achieve significant speedups. The Tenstorrent Grayskull architecture provides a large SRAM, distributed across a grid of cores. This work presents a fused kernel for Grayskull, that exclusively utilizes its large SRAM by combining matrix multiplication, attention score scaling and Softmax operations. Additionally, a dedicated Softmax kernel utilizing the SRAM and a CPU implementation serving as a baseline are presented. The Softmax operation consumes most of the runtime in the computation of attention weights from queries and keys on Grayskull. The speedup of the dedicated Softmax kernel compared to the CPU implementation is up to , and the Softmax implementation inside the fused kernel is approximately faster than the dedicated Softmax kernel. The time and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComputer Science and Engineering · Low-power high-performance VLSI design · VLSI and FPGA Design Techniques
MethodsAttention Is All You Need · Softmax
