arXiv:2503.10725cs.LGcs.AI2025-03被引 10

通过同时稀疏化激活与参数,提升MoE模型在稀疏硬件上的推理效率。

Samoyeds: Accelerating MoE Models with Structured Sparsity Leveraging Sparse Tensor Cores

  • 同时对模型参数和激活实现结构化稀疏,适配稀疏张量核心硬件。
  • 在内核级提升1.99倍性能,模型级提速1.58倍,批量处理能力提升4.41倍。
  • 兼顾精度与跨硬件兼容性,适合部署于支持稀疏计算的新型AI芯片。

基于混合专家(MoE)的大语言模型规模持续扩大,带来显著的计算与内存挑战,亟需创新方案在不牺牲准确率的前提下提升效率。结构化稀疏成为应对这一挑战的有力策略,可借助新兴稀疏计算硬件实现加速。以往工作主要关注模型参数的稀疏性,忽略了激活中的固有稀疏模式,可能导致激活相关的额外计算开销,影响整体性能。本文提出Samoyeds,一种针对MoE大模型的加速系统,利用稀疏张量核心(SpTCs)。Samoyeds是首个同时对激活与模型参数应用稀疏性的方法,设计了专用于MoE计算的稀疏数据格式,并开发了专用的稀疏-稀疏矩阵乘法内核。此外,针对双侧结构化稀疏MoE模型在SpTC上的执行,引入系统级优化,进一步提升性能。评估显示,Samoyeds在内核级别相比最先进方法最高提升1.99倍,在模型级别提升1.58倍;同时显著提升内存效率,平均使最大支持批量大小增加4.41倍。此外,其在模型精度与硬件可移植性方面均优于现有最先进结构化稀疏方案。

原文摘要 · Abstract (English)

The escalating size of Mixture-of-Experts (MoE) based Large Language Models (LLMs) presents significant computational and memory challenges, necessitating innovative solutions to enhance efficiency without compromising model accuracy. Structured sparsity emerges as a compelling strategy to address these challenges by leveraging the emerging sparse computing hardware. Prior works mainly focus on the sparsity in model parameters, neglecting the inherent sparse patterns in activations. This oversight can lead to additional computational costs associated with activations, potentially resulting in suboptimal performance. This paper presents Samoyeds, an innovative acceleration system for MoE LLMs utilizing Sparse Tensor Cores (SpTCs). Samoyeds is the first to apply sparsity simultaneously to both activations and model parameters. It introduces a bespoke sparse data format tailored for MoE computation and develops a specialized sparse-sparse matrix multiplication kernel. Furthermore, Samoyeds incorporates systematic optimizations specifically designed for the execution of dual-side structured sparse MoE LLMs on SpTCs, further enhancing system performance. Evaluations show that Samoyeds outperforms SOTA works by up to 1.99$\times$ at the kernel level and 1.58$\times$ at the model level. Moreover, it enhances memory efficiency, increasing maximum supported batch sizes by 4.41$\times$ on average. Additionally, Samoyeds surpasses existing SOTA structured sparse solutions in both model accuracy and hardware portability.

MoE模型稀疏计算张量核心高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。