EdgeMoE: Fast On-Device Inference of MoE-based Large Language Models

要約

GPT や LLaMa などの大規模言語モデル (LLM) は、幅広い機械学習タスクにおける優れた機能により、機械インテリジェンスに革命をもたらしました。
ただし、データセンターからエッジデバイスへの LLM の移行には、一連の課題と機会が伴います。
この移行によりプライバシーと可用性が向上する可能性がありますが、これらのモデルのパラメーター サイズが膨大であることが妨げとなり、実行時間コストが非現実的になります。
これらの考慮事項を考慮して、パラメータ サイズのスケールに応じてほぼ一定の計算複雑性を示すスパース LLM の一般的なバリアントである、混合エキスパート (MoE) LLM 向けに調整された初のオンデバイス推論エンジンである EdgeMoE を紹介します。
EdgeMoE は、ストレージ階層全体でモデルを戦略的に分割することで、メモリと計算効率の両方を実現します。
具体的には、非エキスパートの重みはデバイスのメモリに保存されますが、エキスパートの重みは外部ストレージに保持され、アクティブ化された場合にのみメモリにフェッチされます。
この設計は、エキスパートの重みは膨大ではあるものの、活性化パターンがまばらなため、アクセスされる頻度が低いという重要な洞察によって支えられています。
エキスパート I/O スワッピングに関連するオーバーヘッドをさらに軽減するために、EdgeMoE には 2 つの革新的な技術が組み込まれています。 (1) エキスパートごとのビット幅適応: この方法は、許容レベルの精度損失でエキスパートの重みのサイズを削減します。
(2) エキスパート管理: アクティブ化されるエキスパートを事前に予測し、コンピューティング I/O パイプラインにプリロードすることで、プロセスをさらに最適化します。
確立された MoE LLM およびさまざまなエッジ デバイスに対して実施された実証評価では、EdgeMoE は、競合するベースライン ソリューションと比較して、大幅なメモリの節約とパフォーマンスの向上を示しています。

要約(オリジナル)

Large Language Models (LLMs) such as GPTs and LLaMa have ushered in a revolution in machine intelligence, owing to their exceptional capabilities in a wide range of machine learning tasks. However, the transition of LLMs from data centers to edge devices presents a set of challenges and opportunities. While this shift can enhance privacy and availability, it is hampered by the enormous parameter sizes of these models, leading to impractical runtime costs. In light of these considerations, we introduce EdgeMoE, the first on-device inference engine tailored for mixture-of-expert (MoE) LLMs, a popular variant of sparse LLMs that exhibit nearly constant computational complexity as their parameter size scales. EdgeMoE achieves both memory and computational efficiency by strategically partitioning the model across the storage hierarchy. Specifically, non-expert weights are stored in the device’s memory, while expert weights are kept in external storage and are fetched into memory only when they are activated. This design is underpinned by a crucial insight that expert weights, though voluminous, are infrequently accessed due to sparse activation patterns. To further mitigate the overhead associated with expert I/O swapping, EdgeMoE incorporates two innovative techniques: (1) Expert-wise bitwidth adaptation: This method reduces the size of expert weights with an acceptable level of accuracy loss. (2) Expert management: It predicts the experts that will be activated in advance and preloads them into the compute-I/O pipeline, thus further optimizing the process. In empirical evaluations conducted on well-established MoE LLMs and various edge devices, EdgeMoE demonstrates substantial memory savings and performance improvements when compared to competitive baseline solutions.

arxiv情報

著者 Rongjie Yi,Liwei Guo,Shiyun Wei,Ao Zhou,Shangguang Wang,Mengwei Xu
発行日 2023-08-28 06:56:08+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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