Endor:用于卸载式 LLM 推理的硬件友好稀疏格式
Endor: Hardware-Friendly Sparse Format for Offloaded LLM Inference
AI总结:
针对卸载式 LLM 推理中权重传输成为瓶颈的问题,本文提出硬件友好的位图稀疏格式 Endor,以高压缩比、低解压开销压缩非结构化稀疏权重,并显著加速 OPT-66B 与 Llama2-70B。
摘要:
大型语言模型(LLM)不断增长的尺寸给其在资源受限平台上的使用带来挑战。例如,现代 GPU 的内存不足以容纳大小达数百 GB 的 LLM。卸载是一种流行方法,可通过将 LLM 模型的权重存储在主机 CPU 内存和 SSD 中,然后在每次使用前将每个权重加载到 GPU,从而摆脱这一限制。在我们关于卸载式推理的案例研究中,我们发现由于存储设备与 GPU 之间的带宽较低,将庞大的模型权重从其卸载位置传输到 GPU 内存的延迟成为关键瓶颈,而实际计算几乎占运行时的 0%。为有效降低权重传输延迟,我们提出一种新颖的稀疏格式,以高压缩比和低解压开销将剪枝后 LLM 权重的非结构化稀疏模式压缩为非零值。Endor 通过用位图表示非零元素的位置实现这一点。与使用流行的 Huggingface Accelerate 的卸载式推理相比,应用 Endor 可将 OPT-66B 加速 1.70 倍,将 Llama2-70B 加速 1.78 倍。当利用从 SSD 到 GPU 的直接权重传输时,Endor 在 OPT-66B 上实现 2.25 倍加速,在 Llama2-70B 上实现 2.37 倍加速。
英文摘要:
The increasing size of large language models (LLMs) challenges their usage on resource-constrained platforms. For example, memory on modern GPUs is insufficient to hold LLMs that are hundreds of Gigabytes in size. Offloading is a popular method to escape this constraint by storing weights of an LLM model to host CPU memory and SSD, then loading each weight to GPU before every use. In our case study of offloaded inference, we found that due to the low bandwidth between storage devices and GPU, the latency of transferring large model weights from its offloaded location to GPU memory becomes the critical bottleneck with actual compute taking nearly 0% of runtime. To effectively reduce the weight transfer latency, we propose a novel sparse format that compresses the unstructured sparse pattern of pruned LLM weights to non-zero values with high compression ratio and low decompression overhead. Endor achieves this by expressing the positions of non-zero elements with a bitmap. Compared to offloaded inference using the popular Huggingface Accelerate, applying Endor accelerates OPT-66B by 1.70x and Llama2-70B by 1.78x. When direct weight transfer from SSD to GPU is leveraged, Endor achieves 2.25x speedup on OPT-66B and 2.37x speedup on Llama2-70B.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。