PockEngine:口袋中的稀疏高效微调
PockEngine: Sparse and Efficient Fine-tuning in a Pocket
AI总结:
PockEngine提出面向边缘设备的稀疏高效微调引擎,通过稀疏反向传播、编译优先策略和训练图优化,在保持模型质量的同时实现最高15倍加速和5.6倍内存节省,并支持在Jetson AGX Orin上以550 tokens/s微调LLaMav2-7B。
摘要:
设备端学习和高效微调能够实现持续且保护隐私的个性化定制(例如,在个性化数据上本地微调大语言模型)。然而,现有训练框架是为配备强大加速器(如GPU、TPU)的云服务器设计的,缺乏针对边缘端学习的优化,而边缘端面临资源受限和边缘硬件多样性的挑战。我们提出PockEngine:一个微型、稀疏且高效的引擎,用于在各种边缘设备上实现微调。PockEngine支持稀疏反向传播:它剪枝反向图并稀疏更新模型,在保持模型质量的同时实现可测量的内存节省和延迟降低。其次,PockEngine采用编译优先策略:整个训练图(包括前向、反向和优化步骤)在编译时导出,从而降低运行时开销并为图变换带来机会。PockEngine还集成了一组丰富的训练图优化方法,因此可以进一步降低训练成本,包括算子重排和后端切换。PockEngine支持多样化的应用、前端和硬件后端:它灵活地编译和调优在PyTorch/TensorFlow/Jax中定义的模型,并将二进制文件部署到移动CPU/GPU/DSP上。我们在视觉模型和大语言模型上评估了PockEngine。PockEngine相比现成的TensorFlow(Raspberry Pi)实现了最高15倍的加速,反向传播内存节省达5.6倍(Jetson AGX Orin)。值得注意的是,PockEngine在NVIDIA Jetson AGX Orin上以550 tokens/s的速度微调LLaMav2-7B,比PyTorch快7.9倍。
英文摘要:
On-device learning and efficient fine-tuning enable continuous and privacy-preserving customization (e.g., locally fine-tuning large language models on personalized data). However, existing training frameworks are designed for cloud servers with powerful accelerators (e.g., GPUs, TPUs) and lack the optimizations for learning on the edge, which faces challenges of resource limitations and edge hardware diversity. We introduce PockEngine: a tiny, sparse and efficient engine to enable fine-tuning on various edge devices. PockEngine supports sparse backpropagation: it prunes the backward graph and sparsely updates the model with measured memory saving and latency reduction while maintaining the model quality. Secondly, PockEngine is compilation first: the entire training graph (including forward, backward and optimization steps) is derived at compile-time, which reduces the runtime overhead and brings opportunities for graph transformations. PockEngine also integrates a rich set of training graph optimizations, thus can further accelerate the training cost, including operator reordering and backend switching. PockEngine supports diverse applications, frontends and hardware backends: it flexibly compiles and tunes models defined in PyTorch/TensorFlow/Jax and deploys binaries to mobile CPU/GPU/DSPs. We evaluated PockEngine on both vision models and large language models. PockEngine achieves up to 15 $\times$ speedup over off-the-shelf TensorFlow (Raspberry Pi), 5.6 $\times$ memory saving back-propagation (Jetson AGX Orin). Remarkably, PockEngine enables fine-tuning LLaMav2-7B on NVIDIA Jetson AGX Orin at 550 tokens/s, 7.9$\times$ faster than the PyTorch.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。