When serving a large language model (LLM), it is standard practice to quantize the model to improve speed and reduce memory use. Mixed precision assigns different precisions to different layers, because some layers are more sensitive to quantization than others, and is usually chosen to preserve accuracy within a memory budget. But quantizing a layer also changes how fast it runs, so every layer has both an "accuracy impact" and a "speed impact," and the goal is to choose, for each layer, the precision that best balances the two, often within a memory, speed, or accuracy budget. Many existing allocators estimate the accuracy impact of each layer well, but for the speed impact they rely on proxies such as the layer's size. We argue that the speed impact is more nuanced: it can be limited by compute, weight loading, or key-value (KV) cache access, depending on the phase, batch size, and context length, and it also depends on the hardware and on the kernel that runs each format. Across three hardware classes, we find that 375 of 1,242 measured pairs of configurations ran slower with fewer bytes. To address this, we build a cost model, calibrated once per model, device, and serving stack, that predicts the latency of any configuration across operating points and anticipates these slowdowns, which byte-based estimates cannot. We then use it in place of the byte-based time cost inside existing allocators, keeping their accuracy measurements unchanged. Where bytes misjudge speed, the allocators select configurations with up to 52% lower latency. Finally, because the cost model's latency estimates change with the operating point, the allocators choose different configurations at different operating points, and we measure how much is gained by changing precision as the device, batch size, phase, and context change.


翻译:暂无翻译

0
下载
关闭预览

相关内容

ACM/IEEE第23届模型驱动工程语言和系统国际会议,是模型驱动软件和系统工程的首要会议系列,由ACM-SIGSOFT和IEEE-TCSE支持组织。自1998年以来,模型涵盖了建模的各个方面,从语言和方法到工具和应用程序。模特的参加者来自不同的背景,包括研究人员、学者、工程师和工业专业人士。MODELS 2019是一个论坛,参与者可以围绕建模和模型驱动的软件和系统交流前沿研究成果和创新实践经验。今年的版本将为建模社区提供进一步推进建模基础的机会,并在网络物理系统、嵌入式系统、社会技术系统、云计算、大数据、机器学习、安全、开源等新兴领域提出建模的创新应用以及可持续性。 官网链接:http://www.modelsconference.org/
大型语言模型(LLMs),附Slides与视频
专知会员服务
71+阅读 · 2024年6月30日
《将大型语言模型(LLM)整合到海军作战规划中》
专知会员服务
132+阅读 · 2024年6月13日
绝对干货!NLP预训练模型:从transformer到albert
新智元
15+阅读 · 2019年11月10日
超全总结:神经网络加速之量化模型 | 附带代码
一文详解LSTM网络
论智
18+阅读 · 2018年5月2日
干货|从LSTM到Seq2Seq
全球人工智能
15+阅读 · 2018年1月9日
From Softmax to Sparsemax-ICML16(1)
KingsGarden
74+阅读 · 2016年11月26日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
《评估人机编队性能的标准指标》
专知会员服务
8+阅读 · 11月30日
《美陆军装甲排的自动化任务分配模型》59页
专知会员服务
6+阅读 · 11月30日
乌克兰海陆空无人力量
专知会员服务
3+阅读 · 11月30日
超越技术:美战争部的AI变革管理
专知会员服务
7+阅读 · 11月27日
北约400亿美元反无人机能力投资建设
专知会员服务
7+阅读 · 11月25日
反小型无人机系统方案评估(27页)
专知会员服务
15+阅读 · 11月25日
相关资讯
绝对干货!NLP预训练模型:从transformer到albert
新智元
15+阅读 · 2019年11月10日
超全总结:神经网络加速之量化模型 | 附带代码
一文详解LSTM网络
论智
18+阅读 · 2018年5月2日
干货|从LSTM到Seq2Seq
全球人工智能
15+阅读 · 2018年1月9日
From Softmax to Sparsemax-ICML16(1)
KingsGarden
74+阅读 · 2016年11月26日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员