针对低带宽内存设备,提出动态分配策略提升大模型推理效率。
ODMA: On-Demand Memory Allocation Strategy for LLM Serving on LPDDR-Class Accelerators
- 根据请求长度动态调整内存分块边界,避免静态分配浪费
- 在真实场景下将预测准确率提升至99.55%,内存利用率提高19.25%
- 适合部署在LPDDR类加速器上的大模型服务,如寒武纪MLU系列
现有内存管理技术严重制约了在随机访问带宽受限的加速器上高效运行大语言模型。静态预分配虽能保持内存连续性,但因按最坏情况预留而造成显著开销;细粒度分页虽可缓解此问题,却依赖HBM的高随机访问容忍度,不适用于非顺序访问会快速降低带宽的LPDDR系统。以往工作通常假设静态分布和HBM特性,无法解决LPDDR硬件固有的碎片化与带宽瓶颈。本文提出ODMA,一种面向随机访问受限加速器(如寒武纪MLU系列)的动态内存分配策略。该策略通过轻量级长度预测器与自适应分块机制,解决生产环境中的两个关键问题:(i) 分布漂移导致静态分块边界失效,(ii) 在重尾请求模式下的性能脆弱性。通过在线直方图动态校准分块边界,并引入安全后备池以应对预测误差。在Alpaca和Google-NQ基准测试中,ODMA将S3的预测准确率分别从98.60%和82.68%提升至99.55%和93.36%。在寒武纪MLU370-X4上部署DeepSeek-R1-Distill-Qwen-7B模型时,相比静态基线,ODMA使KV缓存利用率最高提升19.25%(绝对值),吞吐量(TPS)提升23%-27%,验证了预测驱动连续分配在LPDDR类设备上的有效性。
原文摘要 · Abstract (English)
Existing memory management techniques severely hinder efficient Large Language Model serving on accelerators constrained by poor random-access bandwidth.While static pre-allocation preserves memory contiguity,it incurs significant overhead due to worst-case provisioning.Conversely,fine-grained paging mitigates this overhead but relies on HBM's high random-access tolerance, making it unsuitable for LPDDR systems where non-sequential access rapidly degrades bandwidth. Furthermore, prior works typically assume static distributions and HBM characteristics, thereby failing to resolve the critical fragmentation and bandwidth constraints inherent to LPDDR hardware. We present ODMA, an on-demand memory allocation strategy tailored for random-access-constrained accelerators, such as the Cambricon MLU series.ODMA advances generation-length prediction by addressing two critical limitations in production workloads: (i) distribution drift that invalidates static bucket boundaries, and (ii) performance fragility under heavy-tailed request patterns. ODMA integrates a lightweight length predictor with adaptive bucket partitioning and a fallback safety pool. Bucket boundaries are dynamically recalibrated via online histograms to maximize utilization, while the safety pool ensures robustness against prediction errors. On Alpaca and Google-NQ benchmarks, ODMA improves S3's prediction accuracy from 98.60% to 99.55% and 82.68% to 93.36%, respectively. Deployment with DeepSeek-R1-Distill-Qwen-7B on Cambricon MLU370-X4 accelerators demonstrates that ODMA increases KV-cache utilization by up to 19.25% (absolute) and throughput (TPS) by 23-27% over static baselines, validating the efficacy of predictor-driven contiguous allocation for LPDDR-class devices.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。