Tree Attention: Topology-aware Decoding for Long-Context Attention on GPU clusters

Vasudev Shyam, Jonathan Pilault, Emily Shepperd, Quentin Anthony, Beren Millidge
8/7/2024
19 citations
cs.LGcs.CL

Official code: Zyphra/tree_attention (139 stars, Python, last commit 2024-12-03).

Abstract

Our formulation reveals that the reduction across the sequence axis can be efficiently computed in parallel through a tree reduction. Our algorithm, called Tree Attention, for parallelizing exact attention computation across multiple GPUs enables cross-device decoding to be performed asymptotically faster (up to 8x faster in our experiments) than state-of-the-art approaches such as Ring Attention, while also requiring significantly less communication volume and incurring 2x less peak memory.

Show full abstract

We demonstrate that Tree Attention speeds up decoding up to 4x on Llama 3.1-8B and can be applied to a variety of hardware and networking setups such as H100 DGX nodes, AMD MI300x nodes, and PCIe connected NVIDIA RTX 4090s. Our code is publicly available here: https://github.com/Zyphra/tree_attention

View on arXivView PDF

Code Implementations(1)

Tree Attention: Topology-aware Decoding for Long-Context Attention on GPU clusters

1395PythonAug 6, 20241 years ago

Similar Papers

Cite this paper

@article{shyam2024tree,
  title  = {Tree Attention: Topology-aware Decoding for Long-Context Attention on GPU clusters},
  author = {Vasudev Shyam and Jonathan Pilault and Emily Shepperd and Quentin Anthony and Beren Millidge},
  year   = {2024},
  eprint = {2408.04093},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.04093v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.04093.svg)](https://codeofpaper.com/paper/2408.04093)

Discussion