Communication Compression for Tensor Parallel LLM Inference

Jan Hansen-Palmus, Michael Truong Le, Oliver Hausdörfer, Alok VermaCompression @ NeurIPS 2024

TL;DR

This paper tackles the communication bottleneck in Tensor Parallel LLM inference by proposing a method to compress intermediate activation data. By leveraging fine-grained quantization techniques, they achieve significant reductions in communication volume (3.5-4.5x) and up to a 2x speedup in time-to-first-token (TTFT) with minimal impact on model performance.

What Problem Does This Paper Address?

Large Language Models (LLMs) are becoming incredibly powerful but also enormous, requiring massive computational resources for inference. To handle these models, techniques like Tensor Parallelism (TP) are used, where different parts of the model are distributed across multiple hardware accelerators (like GPUs). While TP helps manage model size and reduce latency, it introduces a significant communication overhead. Specifically, during the "prefill" phase of inference (when the model is generating the initial part of a response), accelerators need to exchange large amounts of activation data. This communication can become a major bottleneck, especially on hardware with slower inter-accelerator bandwidth, negating the benefits of TP and slowing down inference. The paper aims to alleviate this bottleneck by compressing the data being communicated.

Methods

The core of the proposed solution is communication compression applied to the activations exchanged between accelerators in a Tensor Parallel setup. Instead of sending raw activation data, the authors compress it using fine-grained quantization techniques. They specifically leverage methods inspired by the OCP Specification [2023] and Rouhani et al. [2023], which focus on block-wise quantization. This involves grouping activation values into blocks and representing them with fewer bits.

The key innovation lies in:

  • Targeting specific layers: The compression is applied to activations after row-wise TP linear layers and before the reduction step. This is crucial because compression/decompression needs to be very fast to avoid offsetting the communication gains.
  • Fine-grained quantization: They explore various low-bit data types (e.g., FP5, FP4, FP2, INT3, INT4, INT5) and block sizes to find a balance between compression ratio and accuracy. This is important because activations can have outliers that are critical for model performance.
  • Model-dependent hyper-parameter selection: They developed a procedure to select the optimal quantization parameters (data type, block size) for each specific model and hardware setup to minimize performance degradation while maximizing compression.

Datasets

The paper evaluates its method on the Wikitext2 dataset. They use 10% of the training set for hyper-parameter search and the full test set for final evaluation. They also mention using the Llama 2 model family for profiling.

Key Insights and Ideas

  • Communication is the bottleneck, not just computation: For certain hardware configurations (especially those with slower interconnects), the time spent communicating activation data can be more significant than the computation itself.
  • Outliers are tricky but manageable: While outliers in activations can cause significant performance degradation if not handled properly, fine-grained quantization methods can effectively compress most of the data while preserving accuracy.
  • Not all hardware benefits equally: The speedup from communication compression is highly dependent on the inter-accelerator bandwidth. Systems with slower links see substantial gains, while those with very fast links might see less benefit or even a slight slowdown due to compression overhead.
  • A delicate balance: Achieving effective compression requires a careful trade-off between compression ratio (how much data is saved) and quantization accuracy (how much the model's performance is affected).

Key Results

  • Compression Ratio: The proposed method achieves activation compression by a factor of 3.5x to 4.5x.
  • Time-to-First-Token (TTFT) Speedup: Up to a 2x reduction in TTFT was observed, particularly on hardware with slower inter-accelerator bandwidths. For example, setups with more than two L4 GPUs showed significant benefits.
  • Performance Degradation: The model performance degradation (measured by Perplexity) was negligible, with an increase of less than 3% in most cases.
  • Comparison to SOTA: Compared to other non-learned compression methods like channel-wise INT quantization and TopK compression, their method shows significantly less Perplexity degradation while still offering substantial speedups.

Limitations and Future Work

  • Hardware Dependency: The effectiveness of the compression is highly dependent on the inter-accelerator bandwidth. For systems with very high bandwidth, the overhead of compression/decompression can outweigh the benefits.
  • Compression Overhead: The latency introduced by the compression and decompression algorithms themselves can be a limiting factor. If these algorithms are too slow, they can negate the communication speedup.
  • Future Directions:
    • Investigating specialized hardware to accelerate compression/decompression.
  • Exploring other parallelism strategies (e.g., in-flight batching) and their interaction with communication compression.
  • Further improving model quantization techniques and adopting 8-bit matrix multiplications to reduce communication size without explicit compression.

Summary updated

BibTeX
@inproceedings{hansenpalmus2024communication,
  author = {Jan Hansen-Palmus and Michael Truong Le and Oliver Hausdörfer and Alok Verma},
  title = {{Communication Compression for Tensor Parallel LLM Inference}},
  booktitle = {Compression @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=YkttwLldEb},
}
Figure