Efficient LLM Pruning with Global Token-Dependency Awareness and Hardware-Adapted Inference

Oshin Dutta, Ritvik Gupta, Sumeet AgarwalES-FoMo-II @ ICML 2024

TL;DR

This paper introduces TVA-Prune, a novel structured pruning method for Large Language Models (LLMs) that significantly speeds up inference by intelligently removing redundant components while considering global token dependencies. A key innovation is a post-pruning step that aligns model dimensions with GPU Tensor Cores, achieving up to 60% inference speedup.

What Problem Does This Paper Address?

Deploying massive LLMs on resource-constrained devices is a major hurdle due to their high computational and memory demands. While structured pruning (removing entire layers or attention heads) offers a solution, existing methods often struggle with:

  • Long pruning times: Some methods require extensive computation (e.g., 40 GPU hours) for evaluating sub-models.
  • Overlooking token embedding dimensions: This crucial aspect for inference acceleration is often ignored.
  • Interdependencies in Grouped Query Attention (GQA): Pruning heads in GQA is complex because multiple query heads share a single key-value head, making individual pruning disruptive.
  • Suboptimal hardware utilization: Pruned models may not align with hardware-specific optimizations (like GPU Tensor Cores), limiting actual speedup.

Methods

The paper proposes TVA-Prune (Token Dependency-aware Variational Information Bottleneck-based pruning), a structured pruning method with several key innovations:

  • Global Token-Dependency Awareness: It extends the Variational Information Bottleneck (VIB) principle to capture the influence of all preceding layers on the current layer's compressed representation. This ensures a more informed reduction of token embedding dimensions.
  • GQA Head Pruning: TVA-Prune handles the interdependencies in GQA by pruning all query heads that share a key-value head when that head is selected for pruning.
  • Efficient Pruning Process: The method focuses on training masks to prune LLM modules while keeping model parameters frozen, drastically reducing pruning time (up to 90% reduction reported).
  • Hardware-Adapted Inference: A crucial post-pruning step adjusts the pruned model's dimensions to be multiples of GPU Tensor Core block sizes (e.g., 128x256). This alignment maximizes parallelism and computational efficiency on GPUs, leading to significant inference speedups.

Datasets

The paper evaluates its method on the Wikitext-2 benchmark for language modeling tasks. It also mentions using C4 for pruning the models.

Key Insights and Ideas

  • Global context is key for LLM pruning: Simply compressing representations layer-by-layer isn't enough; understanding how information flows across the entire model is vital for effective pruning.
  • Hardware alignment is a game-changer for inference speed: Even with a well-pruned model, if its dimensions don't match the hardware's processing units (like Tensor Cores), you won't see the full potential speedup. The post-pruning dimension adaptation is a critical, often overlooked, step.
  • Structured pruning can be fast: By focusing on mask training and freezing weights, the authors demonstrate that significant pruning can be achieved in hours, not days or weeks.
  • GQA pruning is feasible with careful handling of dependencies: The proposed method shows a way to tackle the intricate interdependencies within GQA without sacrificing performance.

Key Results

  • Significant Pruning Time Reduction: TVA-Prune reduces pruning time by up to 90% compared to methods like Bonsai.
  • Substantial Inference Speedup: The post-pruning dimension adaptation achieves up to 60% inference speedup on NVIDIA A100 GPUs.
  • Competitive Performance: The pruned models maintain competitive performance (perplexity) on benchmarks like Wikitext-2, often outperforming other structured pruning methods. For example, TVA-Prune achieves a 1.75x speedup on LLaMA-7B with a 43.43% reduction in perplexity.
  • Effective GQA Pruning: On Mistral-7B with GQA, TVA-Prune offers higher inference speed than other approaches while maintaining low perplexity.

Limitations and Future Work

  • Hardware Specificity: The post-pruning adaptation is tailored to specific GPU architectures and their Tensor Core block sizes. While effective, this might require re-tuning for different hardware.
  • Generalization to Diverse Tasks: While evaluated on language modeling and zero-shot tasks, further exploration on a wider range of downstream applications could be beneficial.
  • Exploration of other hardware optimizations: The paper focuses on Tensor Cores; future work could explore other hardware-specific optimizations.
  • Further investigation into GQA complexities: While the paper addresses GQA, deeper analysis of its impact on various GQA configurations could be valuable.

Summary updated

BibTeX
@inproceedings{dutta2024efficient,
  author = {Oshin Dutta and Ritvik Gupta and Sumeet Agarwal},
  title = {{Efficient LLM Pruning with Global Token-Dependency Awareness and Hardware-Adapted Inference}},
  booktitle = {ES-FoMo-II @ ICML},
  year = {2024},
  url = {https://openreview.net/forum?id=cqhAzteLzc},
}
Figure