Efficient LLM Inference using Dynamic Input Pruning and Cache-Aware Masking

要約

モバイル・デバイスの計算能力はますます向上しているが、DRAM帯域幅の改善はかなり遅れている。これは、大規模言語モデル(LLM)のトークン生成にとって不運なことである。これまでの研究では、ReLU活性化LLMの自然な動的活性化スパース性を利用して、トークンあたりの実効DRAMバンド幅を削減することが提案されています。しかし、最近のLLMはReLUの代わりにSwiGLUを使用しているため、固有のスパース性はほとんどありません。SwiGLUの有効性は大きさに基づいて刈り込むことができますが、その結果生じるスパース性のパターンを予測することは困難であり、従来のアプローチは有効ではありませんでした。この問題を回避するために、我々の研究では動的入力刈り込み(DIP:Dynamic Input Pruning)を導入する:予測器を使わない動的スパース化アプローチであり、最小限の微調整で精度を維持する。DIPはさらに、軽量LoRAアダプタを使用することで、スパース化の際に失われた性能を取り戻すことができる。最後に、キャッシュヒット率をさらに向上させるために、キャッシュの状態と活性化の大きさを考慮する新しいキャッシュアウェアマスキング戦略を説明し、モバイルデバイス上のLLMトークン率を改善する。DIPは、シミュレートされたハードウェア設定において、精度、メモリ、スループットのトレードオフの点で、他の手法よりも優れています。Phi-3-Medium上で、DIPは、Flashから密なモデルをストリーミングする場合と比較して、$<$ 0.1のプレプレキシティ損失で、46%のメモリ削減と40%のスループット向上を達成した。本論文のHWシミュレータ、手法、実験のオープンソースコードは、https://github.com/Qualcomm-AI-research/dynamic-sparsity 。

要約(オリジナル)

While mobile devices provide ever more compute power, improvements in DRAM bandwidth are much slower. This is unfortunate for large language model (LLM) token generation, which is heavily memory-bound. Previous work has proposed to leverage natural dynamic activation sparsity in ReLU-activated LLMs to reduce effective DRAM bandwidth per token. However, more recent LLMs use SwiGLU instead of ReLU, which results in little inherent sparsity. While SwiGLU activations can be pruned based on magnitude, the resulting sparsity patterns are difficult to predict, rendering previous approaches ineffective. To circumvent this issue, our work introduces Dynamic Input Pruning (DIP): a predictor-free dynamic sparsification approach, which preserves accuracy with minimal fine-tuning. DIP can further use lightweight LoRA adapters to regain some performance lost during sparsification. Lastly, we describe a novel cache-aware masking strategy, which considers the cache state and activation magnitude to further increase cache hit rate, improving LLM token rate on mobile devices. DIP outperforms other methods in terms of accuracy, memory and throughput trade-offs across simulated hardware settings. On Phi-3-Medium, DIP achieves a 46\% reduction in memory and 40\% increase in throughput with $<$ 0.1 loss in perplexity when compared to streaming the dense model from Flash. The open source code for HW simulator, methods, and experiments in this paper is available at https://github.com/Qualcomm-AI-research/dynamic-sparsity .

arxiv情報

著者 Marco Federici,Davide Belli,Mart van Baalen,Amir Jalalirad,Andrii Skliar,Bence Major,Markus Nagel,Paul Whatmough
発行日 2025-04-03 13:28:51+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.CL, cs.LG パーマリンク