Flover:一种用于高效自回归模型并行推理的时间融合框架
Flover: A Temporal Fusion Framework for Efficient Autoregressive Model Parallel Inference
AI总结:
本文提出 Flover 时间融合框架,通过请求级 token 生成调度、缓冲区重排序与张量并行,提升自回归模型并行推理效率。
摘要:
自回归模型尽管在众多生成任务中表现出色,却因其固有的顺序结构而面临挑战。按照设计,这些模型上的推理利用时间依赖关系,即当前 token 的概率分布以先前 token 为条件。这一固有特征严重阻碍了推理期间的计算效率,因为典型推理请求可能需要数千个以上 token,而生成每个 token 都需要加载完整模型权重,使推理更受内存限制。在实际部署中,请求随机到达并需要不同生成长度,巨大开销因此变得尤为突出。现有解决方案(如动态批处理和并发实例)会引入显著响应延迟和带宽争用,无法实现最佳延迟和吞吐量。为解决这些不足,我们提出 Flover——一种用于高效并行推理多个请求的时间融合框架。我们将通用生成流程解构为预处理和 token 生成,并为该框架配备专用工作调度器,用于在所有请求之间按时间融合生成过程。通过编排 token 级并行,Flover 展现出最佳硬件效率,并显著节省系统资源。通过进一步采用快速缓冲区重排序算法以允许对已完成任务进行内存驱逐,与 NVIDIA FasterTransformer 提供的尖端解决方案相比,它在 GPT 上带来超过 11 倍的推理加速,在 LLAMA 上带来 16 倍加速。关键在于,通过利用先进的张量并行技术,Flover 被证明在从单 GPU 设置到分布式场景的多种计算环境中均有效,从而提供可适应不同用例的稳健性能优化。
英文摘要:
Autoregressive models, despite their commendable performance in a myriad of generative tasks, face challenges stemming from their inherently sequential structure. Inference on these models, by design, harnesses a temporal dependency, where the current token's probability distribution is conditioned on preceding tokens. This inherent characteristic severely impedes computational efficiency during inference as a typical inference request can require more than thousands of tokens, where generating each token requires a load of entire model weights, making the inference more memory-bound. The large overhead becomes profound in real deployment where requests arrive randomly, necessitating various generation lengths. Existing solutions, such as dynamic batching and concurrent instances, introduce significant response delays and bandwidth contention, falling short of achieving optimal latency and throughput. To address these shortcomings, we propose Flover -- a temporal fusion framework for efficiently inferring multiple requests in parallel. We deconstruct the general generation pipeline into pre-processing and token generation, and equip the framework with a dedicated work scheduler for fusing the generation process temporally across all requests. By orchestrating the token-level parallelism, Flover exhibits optimal hardware efficiency and significantly spares the system resources. By further employing a fast buffer reordering algorithm that allows memory eviction of finished tasks, it brings over 11x inference speedup on GPT and 16x on LLAMA compared to the cutting-edge solutions provided by NVIDIA FasterTransformer. Crucially, by leveraging the advanced tensor parallel technique, Flover proves efficacious across diverse computational landscapes, from single-GPU setups to distributed scenarios, thereby offering robust performance optimization that adapts to variable use cases.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。