Large language models (LLMs) increasingly run on personal devices, where generating text is slow: producing each token requires reading all of the model's weights from memory. Two techniques reduce this memory traffic. Quantization stores the weights in 4 to 8 bits. Activation sparsity treats near-zero activations as zero and skips the weights they multiply; prior work shows that it skips 40-50% of the weights of modern LLMs without retraining, at little loss in accuracy, also on quantized models. Yet the two do not combine in execution: a quantization format packs the weights that multiply many consecutive activations into one block, and a block can be skipped only if all of these activations are near zero, which rarely happens. Moreover, the near-zero activations change with every token, so balancing the GPU's load and finding them add run-time overhead. We present SpQt, which makes activation sparsity practical for quantized LLMs. SpQt (1) stores each activation's quantized weights contiguously, in a zigzag layout that keeps the quantization formats unchanged; (2) divides the nonzero activations evenly among groups of GPU threads, so the load stays balanced; and (3) finds the nonzero activations inside kernels that each decode step already runs before its matrix products, such as normalization, so that finding them adds no kernel launch. Built into llama.cpp and tested on five devices from a phone to a desktop, with Apple and NVIDIA GPUs and four quantization formats, SpQt generates tokens 1.45-2.15x faster than llama.cpp at 50% sparsity, with up to 2.6x less energy per token. With SpQt, a device can choose a sparsity level in addition to a quantization format, trading a small loss in accuracy for speed and energy.


翻译:暂无翻译

0
下载
关闭预览

相关内容

LLMs与生成式智能体模拟:复杂系统研究的新范式
专知会员服务
30+阅读 · 2025年6月15日
大型语言模型(LLMs),附Slides与视频
专知会员服务
71+阅读 · 2024年6月30日
大型语言模型(LLMs)革新金融:应用与洞察概览
专知会员服务
40+阅读 · 2024年3月22日
《大型语言模型(LLMs): 训练到推理》全面概述技术细节
WSDM 2024| LLMs助力图学习?基于大模型的图数据增强
专知会员服务
27+阅读 · 2023年11月19日
白话attention综述(上)
AINLP
12+阅读 · 2019年12月14日
NLP实践:对话系统技术原理和应用
AI100
34+阅读 · 2019年3月20日
基于attention的seq2seq机器翻译实践详解
黑龙江大学自然语言处理实验室
11+阅读 · 2018年3月14日
【推荐】用TensorFlow实现LSTM社交对话股市情感分析
机器学习研究会
11+阅读 · 2018年1月14日
原创 | Attention Modeling for Targeted Sentiment
黑龙江大学自然语言处理实验室
25+阅读 · 2017年11月5日
达观数据NLP技术的应用实践和案例分析
数据挖掘入门与实战
10+阅读 · 2017年7月27日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Arxiv
0+阅读 · 11月16日
VIP会员
最新内容
乌克兰无人机饱和战场中的错误教训
专知会员服务
17+阅读 · 11月17日
面向最后一战术英里:美军无人机创新尝试
专知会员服务
14+阅读 · 11月17日
《美空军2026条令文件:对海压制作战》
专知会员服务
30+阅读 · 11月9日
人工智能与战争的未来
专知会员服务
14+阅读 · 11月8日
《Agent Mosaic:识别智能体LLM系统中的机密泄露》
专知会员服务
14+阅读 · 11月8日
相关资讯
白话attention综述(上)
AINLP
12+阅读 · 2019年12月14日
NLP实践:对话系统技术原理和应用
AI100
34+阅读 · 2019年3月20日
基于attention的seq2seq机器翻译实践详解
黑龙江大学自然语言处理实验室
11+阅读 · 2018年3月14日
【推荐】用TensorFlow实现LSTM社交对话股市情感分析
机器学习研究会
11+阅读 · 2018年1月14日
原创 | Attention Modeling for Targeted Sentiment
黑龙江大学自然语言处理实验室
25+阅读 · 2017年11月5日
达观数据NLP技术的应用实践和案例分析
数据挖掘入门与实战
10+阅读 · 2017年7月27日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员