用屋顶模型评估设备端大模型性能,发现深度和序列长度影响推理效率。
RooflineBench: A Benchmarking Framework for On-Device LLMs via Roofline Analysis
- 基于操作强度统一建模软硬件约束,提出相对推理潜力新指标。
- 发现模型深度增加导致操作强度显著下降,序列越长性能差异越大。
- 揭示硬件异构引发的效率陷阱,适合做边缘AI软硬协同设计的研究者。
通过小型语言模型(SLMs)实现本地化智能的趋势,加剧了在资源受限的边缘硬件上对性能精确表征的需求。然而,在异构平台间客观衡量不同架构的理论性能上限仍具挑战性。本文提出一种基于屋顶模型的系统性框架,通过操作强度(OI)统一建模架构原语与硬件约束。通过定义推理潜能区域,引入相对推理潜力作为新指标,用于比较同一硬件上大型语言模型(LLMs)间的效率差异。跨多种计算层级的实证分析显示,性能与操作强度的变化显著受序列长度影响。进一步发现,随着模型深度增加,操作强度出现关键下降。此外,研究揭示了由硬件异构引起的效率陷阱,并表明结构优化(如多头潜在注意力,MLA)可有效释放各类硬件上的潜在推理能力。这些发现为面向设备端智能的软硬件协同设计提供了可操作方向。代码已发布于附录C。
原文摘要 · Abstract (English)
The transition toward localized intelligence through Small Language Models (SLMs) has intensified the need for rigorous performance characterization on resource-constrained edge hardware. However, objectively measuring the theoretical performance ceilings of diverse architectures across heterogeneous platforms remains a formidable challenge. In this work, we propose a systematic framework based on the Roofline model that unifies architectural primitives and hardware constraints through the lens of operational intensity (OI). By defining an inference-potential region, we introduce the Relative Inference Potential as a novel metric to compare efficiency differences between Large Language Models (LLMs) on the same hardware substrate. Extensive empirical analysis across diverse compute tiers reveals that variations in performance and OI are significantly influenced by sequence length. We further identify a critical regression in OI as model depth increases. Additionally, our findings highlight an efficiency trap induced by hardware heterogeneity and demonstrate how structural refinements, such as Multi-head Latent Attention (MLA), can effectively unlock latent inference potential across various hardware substrates. These insights provide actionable directions for hardware-software co-design to align neural structures with physical constraints in on-device intelligence. The released code is available in the Appendix C.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。