AdaFuse: 通过令牌级预门控和融合内核优化加速动态适配器推断
AdaFuse: Accelerating Dynamic Adapter Inference via Token-Level Pre-Gating and Fused Kernel Optimization
AI总结:
AdaFuse通过令牌级预门控和融合内核优化,显著降低动态适配器推断延迟,提升LLM的推理效率。
摘要:
动态稀疏结构如混合专家(MoE)与参数高效适配器(如LoRA)的整合是增强大语言模型(LLMs)的强大技术。然而,这种架构增强带来了高昂的成本:尽管计算负载的增加很小,推断延迟却常常激增,导致解码速度减慢超过2.5倍。通过细粒度性能分析,我们发现瓶颈不在于计算本身,而在于传统动态路由所需的碎片化、顺序化的CUDA内核调用带来的严重开销。为解决这一挑战,我们引入AdaFuse,该框架基于算法与底层硬件系统的紧密协同设计,以实现高效的动态适配器执行。不同于传统的层级或块级路由,AdaFuse采用令牌级预门控策略,在处理每个令牌之前为所有适配器层做出单一全局路由决策。这种
英文摘要:
The integration of dynamic, sparse structures like Mixture-of-Experts (MoE) with parameter-efficient adapters (e.g., LoRA) is a powerful technique for enhancing Large Language Models (LLMs). However, this architectural enhancement comes at a steep cost: despite minimal increases in computational load, the inference latency often skyrockets, leading to decoding speeds slowing by over 2.5 times. Through a fine-grained performance analysis, we pinpoint the primary bottleneck not in the computation itself, but in the severe overhead from fragmented, sequential CUDA kernel launches required for conventional dynamic routing. To address this challenge, we introduce AdaFuse, a framework built on a tight co-design between the algorithm and the underlying hardware system to enable efficient dynamic adapter execution. Departing from conventional layer-wise or block-wise routing, AdaFuse employs a token-level pre-gating strategy, which makes a single, global routing decision for all adapter layers before a token is processed. This "decide-once, apply-everywhere" approach effectively staticizes the execution path for each token, creating an opportunity for holistic optimization. We capitalize on this by developing a custom CUDA kernel that performs a fused switching operation, merging the parameters of all selected LoRA adapters into the backbone model in a single, efficient pass. Experimental results on popular open-source LLMs show that AdaFuse achieves accuracy on par with state-of-the-art dynamic adapters while drastically cutting decoding latency by a factor of over 2.4x, thereby bridging the gap between model capability and inference efficiency.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。