Hermes: Memory-Efficient Pipeline Inference for Large Models on Edge Devices
Xueyuan Han, Zinuo Cai, Yichu Zhang, Chongxin Fan, Junhan Liu, Ruhui Ma, Rajkumar Buyya
TL;DR
PipeLoad introduces a memory-efficient, per-layer pipeline that overlaps model loading with inference to reduce peak memory and mitigate stalls on edge devices. Hermes builds a complete framework around PipeLoad, comprising Layer Profiler, Pipeline Planner, and Execution Engine, to automatically optimize execution under tight memory constraints. Empirical results show substantial speedups (up to $4.24\times$) and major memory reductions (up to $90.3\%$) across BERT, ViT, GPT-2, and GPT-J, enabling practical CPU-based edge deployment of large Transformer models. The work demonstrates how memory-aware pipeline strategies can achieve low-latency, high-accuracy inference without resorting to aggressive model pruning or GPU usage, advancing edge AI scalability.
Abstract
The application of Transformer-based large models has achieved numerous success in recent years. However, the exponential growth in the parameters of large models introduces formidable memory challenge for edge deployment. Prior works to address this challenge mainly focus on optimizing the model structure and adopting memory swapping methods. However, the former reduces the inference accuracy, and the latter raises the inference latency. This paper introduces PIPELOAD, a novel memory-efficient pipeline execution mechanism. It reduces memory usage by incorporating dynamic memory management and minimizes inference latency by employing parallel model loading. Based on PIPELOAD mechanism, we present Hermes, a framework optimized for large model inference on edge devices. We evaluate Hermes on Transformer-based models of different sizes. Our experiments illustrate that Hermes achieves up to 4.24 X increase in inference speed and 86.7% lower memory consumption than the state-of-the-art pipeline mechanism for BERT and ViT models, 2.58 X increase in inference speed and 90.3% lower memory consumption for GPT-style models.
