Flash Communication: Reducing Tensor Parallelization Bottleneck for Fast Large Language Model Inference

Qingyuan Li, Bo Zhang, Liang Ye, Yifan Zhang, Wei Wu, Yerui Sun, Lin Ma, Yuchen XiearXiv 2024 · DOI

Introduction: The Communication Wall in LLM Inference

As Large Language Models (LLMs) scale to hundreds of billions of parameters, they exceed the memory capacity of individual GPUs. To address this, researchers employ Tensor Parallelism (TP), which distributes a model's layers across multiple accelerators. However, this architectural choice introduces a significant "communication wall." Every layer processed requires the GPUs to synchronize data via an All-Reduce operation.

While high-end clusters with NVLink (like H100s) can manage this overhead, inference-focused deployments on hardware like NVIDIA L40 GPUs face severe bottlenecks. Analysis of the LLaMA-3-70B model reveals that communication can account for up to 65% of total latency during the prefill stage on lower-bandwidth interconnects.

Latency breakdown of LLaMA-3-70B across different hardware and precision settings, highlighting the significant cost of communication (AllReduce).

Flash Communication Methodology

Flash Communication is a novel low-bit compression technique designed to eliminate this bottleneck without sacrificing model accuracy. It is built upon three technical pillars:

  1. Fine-grained Low-bit Quantization: Instead of standard 16-bit (FP16) activations, Flash Communication compresses data to 4, 6, or 8 bits. By using small block sizes (e.g., 128 elements), it maintains high precision where coarse quantization typically fails.
  2. Two-step All-Reduce Strategy: Traditional "Ring All-Reduce" requires $N-1$ communication steps and multiple quantization cycles, leading to error accumulation. Flash Communication replaces this with a streamlined two-step process: All2All (sending data to responsible peers for reduction) followed by All-Gather (broadcasting results). This reduces the quantization hops to just two.
  3. Fused CUDA Kernels: To minimize computational overhead, custom kernels fuse quantization, peer-to-peer memory access, and dequantization into a single efficient pass.
The two-step All-Reduce strategy: data is first redistributed via All2All for local reduction, then broadcast back to all GPUs via All-Gather.

Key Insights and Performance Results

The "Down Projection" Challenge

A critical finding in this research is that the "down projection" layer in Transformer blocks is significantly more sensitive to quantization than the "output projection." The higher Mean Squared Error (MSE) in these activations explains why naive quantization often degrades model performance. Flash Communication's fine-grained approach specifically mitigates this sensitivity.

Latency and Accuracy

Evaluation across the LLaMA-2 and LLaMA-3 families demonstrates substantial gains:

  • Speedups: On NVIDIA L40 GPUs, Flash Communication achieved up to a 2.06× reduction in Time-To-First-Token (TTFT) for LLaMA-3-8B. Intra-node communication speeds improved by over 3× using 4-bit quantization.
  • Accuracy: The "INT6" configuration (using INT8 for All-Gather and INT4 for reduction) emerged as a sweet spot, providing significant speedups with virtually no measurable accuracy loss compared to FP16 baselines. For LLaMA-3-70B, average benchmark accuracy only shifted from 80.00% to 79.29%.

Conclusion

Flash Communication effectively breaks the communication barrier in Tensor Parallelism. By optimizing the All-Reduce pipeline through fine-grained quantization and a two-step communication strategy, it enables high-speed LLM inference on cost-effective hardware, making massive models more accessible for real-time deployment.

Summary updated

BibTeX
@misc{li2024flash,
  author = {Qingyuan Li and Bo Zhang and Liang Ye and Yifan Zhang and Wei Wu and Yerui Sun and Lin Ma and Yuchen Xie},
  title = {{Flash Communication: Reducing Tensor Parallelization Bottleneck for Fast Large Language Model Inference}},
  year = {2024},
  eprint = {2412.04964},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.04964},
}
Figure