Autoregressive inference is typically assumed to scale predictably with decoding length, and key-value (KV) caching is widely regarded as a universally beneficial optimization for accelerating decoding. In this work, we identify unexpected non-monotonic latency behavior in the Apple MPS backend, where latency changes abruptly across nearby decoding configurations. Using transformer models from multiple families (GPT-2, BLOOM, and OPT), we observe latency spikes of up to 21x within specific decoding-budget intervals, followed by recovery at neighboring configurations. Controlled experiments show that these anomalies are not explained by memory pressure or prefill cost, but are instead consistent with backend execution dynamics, while CPU and NVIDIA T4 (CUDA) exhibit smooth monotonic scaling under identical conditions. Our findings highlight the importance of hardware-aware evaluation for autoregressive inference and caution against relying on aggregated decoding-budget benchmarks, as performance can vary discontinuously across nearby configurations.


翻译:自回归推理通常被认为会随解码长度呈现可预测的缩放行为,而键值(KV)缓存被广泛视为加速解码的通用优化手段。在本工作中,我们发现了苹果MPS后端中意想不到的非单调延迟现象——在临近解码配置间延迟出现突变。通过使用多系列变压器模型(GPT-2、BLOOM和OPT),我们在特定解码预算区间内观察到高达21倍的延迟尖峰,而邻近配置却能恢复至正常水平。控制实验表明,这些异常现象既非内存压力或预填充成本所致,反而与后端执行动力学特征高度吻合;而在相同条件下,CPU和NVIDIA T4(CUDA)展现出平滑的单调缩放特性。本研究揭示了硬件感知评估对自回归推理的重要性,并提醒研究者切勿过度依赖聚合型解码预算基准测试,因为性能可能在不同邻近配置间呈现不连续性变化。

0
下载
关闭预览

相关内容

TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
【NeurIPS2024】将视频掩蔽自编码器扩展到128帧
专知会员服务
13+阅读 · 2024年11月27日
EMNLP 2021 | 学习改写非自回归机器翻译的翻译结果
专知会员服务
17+阅读 · 2021年12月25日
【反馈循环自编码器】FEEDBACK RECURRENT AUTOENCODER
专知会员服务
23+阅读 · 2020年1月28日
iOS如何区分App和SDK内部crash
CocoaChina
11+阅读 · 2019年4月17日
【资源推荐】模型压缩与加速相关资源汇总
一文读懂图像压缩算法
七月在线实验室
17+阅读 · 2018年5月2日
【干货】深入理解自编码器(附代码实现)
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
最新内容
一种考虑资源机动性的武器目标分配混合算法
专知会员服务
1+阅读 · 38分钟前
博士论文 | 大动作空间中的在线与离线策略学习
专知会员服务
0+阅读 · 45分钟前
综述 | Autonomous Research Agents:AI 科学家与验证缺口
《多域冲突比较支持模型》60页
专知会员服务
9+阅读 · 8月7日
面向2027年及未来的海军情报改革
专知会员服务
6+阅读 · 8月5日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员