Article(id=1251480537668465256, tenantId=1146029695717560320, journalId=1251234078029037663, issueId=1251480531381207309, articleNumber=null, orderNo=null, doi=10.11887/j.issn.1001-2486.25050035, pmid=null, cstr=null, oa=null, hot=null, price=null, onlineType=0, articleFormat=0, articleType=null, articleTypeStr=null, receivedDate=1748016000000, receivedDateStr=2025-05-24, revisedDate=null, revisedDateStr=null, acceptedDate=null, acceptedDateStr=null, onlineDate=1776305811563, onlineDateStr=2026-04-16, pubDate=1766851200000, pubDateStr=2025-12-28, doiRegisterDate=null, doiRegisterDateStr=null, onlineIssueDate=1776305811563, onlineIssueDateStr=2026-04-16, onlineJustAcceptDate=null, onlineJustAcceptDateStr=null, onlineFirstDate=null, onlineFirstDateStr=null, sourceXml=null, magXml=null, createTime=1776305811563, creator=13701087609, updateTime=1776305811563, updator=13701087609, issue=Issue{id=1251480531381207309, tenantId=1146029695717560320, journalId=1251234078029037663, year='2025', volume='47', issue='6', pageStart='1', pageEnd='306', issueExtLink='null', onlineDate='null', pubDate='null', beforeIssueId=null, nextIssueId=null, price=null, status=1, issueComplete=1, articleOrder=1, issueType=1, specialIssue=null, createTime=1776305810065, creator=13701087609, updateTime=1776305899308, updator=13701087609, preIssue=null, nextIssue=null, ext={EN=IssueExt(id=1251480905865446141, tenantId=1146029695717560320, journalId=1251234078029037663, issueId=1251480531381207309, language=EN, specialIssueTitle=, coverIllustrator=null, specialIssueEditor=, specialIssueAbout=), CN=IssueExt(id=1251480905865446142, tenantId=1146029695717560320, journalId=1251234078029037663, issueId=1251480531381207309, language=CN, specialIssueTitle=, coverIllustrator=null, specialIssueEditor=, specialIssueAbout=)}, issueFiles=null}, startPage=60, endPage=70, ext={EN=ArticleExt(id=1251480539379741348, articleId=1251480537668465256, tenantId=1146029695717560320, journalId=1251234078029037663, language=EN, title=Operator-aware tensor offloading approach for large language model inference in resource-constrained scenarios, columnId=1251480536670220899, journalTitle=Journal of National Niversity of Defense Technology, columnName=Computer System and technology, runingTitle=null, highlight=null, articleAbstract=

Efficient inference deployment of large language models faces severe challenges in resource-constrained scenarios.Although current mainstream inference optimization techniques have improved model inference efficiency to some extent, they still suffer from issues like coarse-grained deployment and poor inference accuracy.Based on the discovery that different operators exhibit varying degrees of GPU affinity, an OATO(operator-aware tensor offloading)approach was proposed.OATO could extract operators′semantic knowledge and used it to design an intelligent scheduling algorithm, which further yielded a globally optimal model-deployment plan.Meanwhile, the OATO approach was integrated into the latest large model inference framework Llama.cpp to implement an operator-aware tensor offloading enhanced inference engine, referred to as OALlama.cpp.Experimental results show that compared with the state-of-the-art inference engines Llama.cpp and FlexGen, OALlama.cpp achieves the best inference performance on three large models.Notably, in the scenario where 75% of the LlaMA3-8B model weights are loaded on the GPU, the first-token generation speed of OALlama.cpp is nearly doubled compared with FlexGen and Llama.cpp.

, correspAuthors=Songlei JIAN, authorNote=null, correspAuthorsNote=null, copyrightStatement=null, copyrightOwner=null, extLink=null, articleAbsUrl=null, sourceXml=null, magXml=null, pdfUrl=null, pdf=null, pdfFileSize=null, pdfExtLink=null, richHtmlUrl=null, mobilePdfUrl=null, reviewReport=null, pdfFirstPage=null, abstractGraph=null, abstractGraphContent=null, abstractVideo=null, citation=null, cebUrl=null, magXmlContent=null, mapNumber=null, authorCompany=null, fund=null, authors=null, authorsList=Jianfeng ZHANG, Dong XIE, Songlei JIAN, Bao LI, Xiaochuan WANG, Yong GUO, Jie YU), CN=ArticleExt(id=1251480545302098840, articleId=1251480537668465256, tenantId=1146029695717560320, journalId=1251234078029037663, language=CN, title=资源受限场景下基于算子感知的大模型推理张量卸载方法, columnId=1251480538381496943, journalTitle=国防科技大学学报, columnName=计算机系统与技术, runingTitle=null, highlight=null, articleAbstract=

在一些资源受限场景下,大语言模型的高效推理部署面临严峻挑战。当前主流的模型推理优化技术,虽然在一定程度上提高了模型推理效率,但是仍然存在部署粒度较为粗糙、推理精度较差等问题。根据不同算子对GPU亲和度不同的发现,提出算子感知张量卸载(operator-aware tensor offloading,OATO)方法。OATO能够提取算子的语义知识,并基于此设计了智能算子调度算法,可以生成全局最优模型部署方案。同时,将OATO方法集成进最新的大模型推理框架Llama.cpp中,实现了算子感知的张量卸载增强推理引擎OALlama.cpp。实验结果表明,相比于业内最先进的推理引擎Llama.cpp和FlexGen,OALlama.cpp在3种大模型上均取得最好的推理性能,尤其是在LlaMA3-8B模型GPU加载75%权重的场景下,OALlama.cpp的首词生成速度相比FlexGen和Llama.cpp提升近1倍。

, correspAuthors=蹇松雷, authorNote=null, correspAuthorsNote=
蹇松雷(1991—),女,贵州遵义人,副研究员,博士,硕士生导师,E-mail:
, copyrightStatement=null, copyrightOwner=null, extLink=null, articleAbsUrl=null, sourceXml=TYnlBYq2+/w/Kxyja845zQ==, magXml=AFTGqiYW/qLeeS7VTdPFcg==, pdfUrl=null, pdf=35KwPYpwGPELgorSW+pFsg==, pdfFileSize=5429351, pdfExtLink=null, richHtmlUrl=null, mobilePdfUrl=null, reviewReport=null, pdfFirstPage=null, abstractGraph=mrok1ikjnN1rLjLrdUWi6Q==, abstractGraphContent=null, abstractVideo=null, citation=null, cebUrl=null, magXmlContent=wwLKOuoCBnXOrUq/7UE0jQ==, mapNumber=null, authorCompany=null, fund=null, authors=

张建锋(1984—),男,陕西宝鸡人,副研究员,博士,E-mail:

, authorsList=张建锋, 谢栋, 蹇松雷, 李宝, 王晓川, 郭勇, 余杰)}, authors=[Author(id=1251480547185341367, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, orderNo=0, firstName=null, middleName=null, lastName=null, nameCn=null, orcid=null, stid=null, country=null, authorPic=null, dead=0, email=jfzhang@nudt.edu.cn, emailSecond=null, emailThird=null, correspondingAuthor=0, authorType=1, ext={EN=AuthorExt(id=1251480547290198971, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480547185341367, language=EN, stringName=Jianfeng ZHANG, firstName=Jianfeng, middleName=null, lastName=ZHANG, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null), CN=AuthorExt(id=1251480547395056580, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480547185341367, language=CN, stringName=张建锋, firstName=null, middleName=null, lastName=null, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=国防科技大学 计算机学院,湖南 长沙 410073, bio={"content":"

张建锋(1984—),男,陕西宝鸡人,副研究员,博士,E-mail:

"}, bioImg=null, bioContent=

张建锋(1984—),男,陕西宝鸡人,副研究员,博士,E-mail:

, aboutCorrespAuthor=null)}, companyList=[AuthorCompany(id=1251480545616671657, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, xref=null, ext=[AuthorCompanyExt(id=1251480545625060266, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=EN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China), AuthorCompanyExt(id=1251480545633448875, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=CN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=国防科技大学 计算机学院,湖南 长沙 410073)])]), Author(id=1251480547537662919, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, orderNo=1, firstName=null, middleName=null, lastName=null, nameCn=null, orcid=null, stid=null, country=null, authorPic=null, dead=0, email=null, emailSecond=null, emailThird=null, correspondingAuthor=0, authorType=1, ext={EN=AuthorExt(id=1251480547629937612, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480547537662919, language=EN, stringName=Dong XIE, firstName=Dong, middleName=null, lastName=XIE, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null), CN=AuthorExt(id=1251480547747378132, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480547537662919, language=CN, stringName=谢栋, firstName=null, middleName=null, lastName=null, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=国防科技大学 计算机学院,湖南 长沙 410073, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null)}, companyList=[AuthorCompany(id=1251480545616671657, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, xref=null, ext=[AuthorCompanyExt(id=1251480545625060266, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=EN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China), AuthorCompanyExt(id=1251480545633448875, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=CN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=国防科技大学 计算机学院,湖南 长沙 410073)])]), Author(id=1251480547848041434, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, orderNo=2, firstName=null, middleName=null, lastName=null, nameCn=null, orcid=null, stid=null, country=null, authorPic=null, dead=0, email=jiansonglei@nudt.edu.cn, emailSecond=null, emailThird=null, correspondingAuthor=1, authorType=1, ext={EN=AuthorExt(id=1251480547973870565, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480547848041434, language=EN, stringName=Songlei JIAN, firstName=Songlei, middleName=null, lastName=JIAN, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=*, address=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null), CN=AuthorExt(id=1251480548066145259, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480547848041434, language=CN, stringName=蹇松雷, firstName=null, middleName=null, lastName=null, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=*, address=国防科技大学 计算机学院,湖南 长沙 410073, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null)}, companyList=[AuthorCompany(id=1251480545616671657, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, xref=null, ext=[AuthorCompanyExt(id=1251480545625060266, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=EN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China), AuthorCompanyExt(id=1251480545633448875, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=CN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=国防科技大学 计算机学院,湖南 长沙 410073)])]), Author(id=1251480548145837041, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, orderNo=3, firstName=null, middleName=null, lastName=null, nameCn=null, orcid=null, stid=null, country=null, authorPic=null, dead=0, email=null, emailSecond=null, emailThird=null, correspondingAuthor=0, authorType=1, ext={EN=AuthorExt(id=1251480548238111736, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480548145837041, language=EN, stringName=Bao LI, firstName=Bao, middleName=null, lastName=LI, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null), CN=AuthorExt(id=1251480548313609214, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480548145837041, language=CN, stringName=李宝, firstName=null, middleName=null, lastName=null, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=国防科技大学 计算机学院,湖南 长沙 410073, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null)}, companyList=[AuthorCompany(id=1251480545616671657, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, xref=null, ext=[AuthorCompanyExt(id=1251480545625060266, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=EN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China), AuthorCompanyExt(id=1251480545633448875, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=CN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=国防科技大学 计算机学院,湖南 长沙 410073)])]), Author(id=1251480548405882884, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, orderNo=4, firstName=null, middleName=null, lastName=null, nameCn=null, orcid=null, stid=null, country=null, authorPic=null, dead=0, email=null, emailSecond=null, emailThird=null, correspondingAuthor=0, authorType=1, ext={EN=AuthorExt(id=1251480548498157578, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480548405882884, language=EN, stringName=Xiaochuan WANG, firstName=Xiaochuan, middleName=null, lastName=WANG, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null), CN=AuthorExt(id=1251480548603015184, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480548405882884, language=CN, stringName=王晓川, firstName=null, middleName=null, lastName=null, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=国防科技大学 计算机学院,湖南 长沙 410073, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null)}, companyList=[AuthorCompany(id=1251480545616671657, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, xref=null, ext=[AuthorCompanyExt(id=1251480545625060266, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=EN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China), AuthorCompanyExt(id=1251480545633448875, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=CN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=国防科技大学 计算机学院,湖南 长沙 410073)])]), Author(id=1251480548703678488, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, orderNo=5, firstName=null, middleName=null, lastName=null, nameCn=null, orcid=null, stid=null, country=null, authorPic=null, dead=0, email=null, emailSecond=null, emailThird=null, correspondingAuthor=0, authorType=1, ext={EN=AuthorExt(id=1251480548804341791, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480548703678488, language=EN, stringName=Yong GUO, firstName=Yong, middleName=null, lastName=GUO, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null), CN=AuthorExt(id=1251480548913393703, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480548703678488, language=CN, stringName=郭勇, firstName=null, middleName=null, lastName=null, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=国防科技大学 计算机学院,湖南 长沙 410073, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null)}, companyList=[AuthorCompany(id=1251480545616671657, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, xref=null, ext=[AuthorCompanyExt(id=1251480545625060266, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=EN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China), AuthorCompanyExt(id=1251480545633448875, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=CN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=国防科技大学 计算机学院,湖南 长沙 410073)])]), Author(id=1251480549035028528, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, orderNo=6, firstName=null, middleName=null, lastName=null, nameCn=null, orcid=null, stid=null, country=null, authorPic=null, dead=0, email=null, emailSecond=null, emailThird=null, correspondingAuthor=0, authorType=1, ext={EN=AuthorExt(id=1251480549156663352, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480549035028528, language=EN, stringName=Jie YU, firstName=Jie, middleName=null, lastName=YU, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null), CN=AuthorExt(id=1251480549248938049, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, authorId=1251480549035028528, language=CN, stringName=余杰, firstName=null, middleName=null, lastName=null, prefix=null, suffix=null, authorComment=null, nameInitials=null, affiliation=null, department=null, xref=null, address=国防科技大学 计算机学院,湖南 长沙 410073, bio=null, bioImg=null, bioContent=null, aboutCorrespAuthor=null)}, companyList=[AuthorCompany(id=1251480545616671657, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, xref=null, ext=[AuthorCompanyExt(id=1251480545625060266, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=EN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China), AuthorCompanyExt(id=1251480545633448875, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=CN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=国防科技大学 计算机学院,湖南 长沙 410073)])])], keywords=[Keyword(id=1251480549395738695, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, orderNo=1, keyword=large language models), Keyword(id=1251480549471236172, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, orderNo=2, keyword=resource constraints), Keyword(id=1251480549542539345, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, orderNo=3, keyword=model inference), Keyword(id=1251480549626425432, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, orderNo=4, keyword=GPU affinities of operators), Keyword(id=1251480549739671644, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, orderNo=5, keyword=operator-aware tensor offloading approach), Keyword(id=1251480549848723554, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, orderNo=1, keyword=大语言模型), Keyword(id=1251480549932609639, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, orderNo=2, keyword=资源受限), Keyword(id=1251480550024884332, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, orderNo=3, keyword=模型推理), Keyword(id=1251480551585165427, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, orderNo=4, keyword=算子GPU亲和度), Keyword(id=1251480551677440121, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, orderNo=5, keyword=算子感知张量卸载方法)], refs=[Reference(id=1251480554466652478, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[1], rfOrder=0, authorNames=ZHAO W X, ZHOU K, LI J Y, journalName=null, refType=null, unstructuredReference=ZHAO W X, ZHOU K, LI J Y, et al.A survey of large language models[EB/OL].(2025-03-11)[2025-05-01].https://arxiv.org/abs/2303.18223., articleTitle=A survey of large language models, refAbstract=null), Reference(id=1251480556064682311, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[2], rfOrder=1, authorNames=YUAN Z H, SHANG Y Z, ZHOU Y, journalName=null, refType=null, unstructuredReference=YUAN Z H, SHANG Y Z, ZHOU Y, et al.LLM inference unveiled:survey and roofline model insights[EB/OL].(2024-05-01)[2025-05-01]. https://arxiv.org/abs/2402.16363., articleTitle=LLM inference unveiled:survey and roofline model insights, refAbstract=null), Reference(id=1251480556169539917, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[3], rfOrder=2, authorNames=MIAO X P, OLIARO G, ZHANG Z H, journalName=null, refType=null, unstructuredReference=MIAO X P, OLIARO G, ZHANG Z H, et al.Towards efficient generative large language model serving:a survey from algorithms to systems[EB/OL].(2023-12-23)[2025-05-01].https://arxiv.org/abs/2312.15234., articleTitle=Towards efficient generative large language model serving:a survey from algorithms to systems, refAbstract=null), Reference(id=1251480556270203223, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2017, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[4], rfOrder=3, authorNames=VASWANI A, SHAZEER N M, PARMAR N, journalName=null, refType=null, unstructuredReference=VASWANI A, SHAZEER N M, PARMAR N, et al. Attention is all you need[C]//Proceedings of 31 st Conference on Neural Information Processing Systems, 2017., articleTitle=Attention is all you need, refAbstract=null), Reference(id=1251480556349895014, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2020, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[5], rfOrder=4, authorNames=BROWN T B, MANN B, RYDER N, journalName=null, refType=null, unstructuredReference=BROWN T B, MANN B, RYDER N, et al.Language models are few-shot learners[C]//Proceedings of 34th Conference on Neural Information Processing Systems, 2020., articleTitle=Language models are few-shot learners, refAbstract=null), Reference(id=1251480556458946925, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2022, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[6], rfOrder=5, authorNames=OUYANG L, WU J, JIANG X, journalName=null, refType=null, unstructuredReference=OUYANG L, WU J, JIANG X, et al.Training language models to follow instructions with human feedback[C]//Proceedings of 36th Conference on Neural Information Processing Systems, 2022., articleTitle=Training language models to follow instructions with human feedback, refAbstract=null), Reference(id=1251480556588970361, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[7], rfOrder=6, authorNames=OpenAI, journalName=null, refType=null, unstructuredReference=OpenAI.GPT-4 technical report[EB/OL].(2024-03-04)[2025-05-01].https://arxiv.org/abs/2303.08774., articleTitle=GPT-4 technical report, refAbstract=null), Reference(id=1251480556693827972, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[8], rfOrder=7, authorNames=TOUVRON H, LAVRIL T, IZACARD G, journalName=null, refType=null, unstructuredReference=TOUVRON H, LAVRIL T, IZACARD G, et al.LLAMA:open and efficient foundation language models[EB/OL]. (2023-02-27)[2025-05-01].https://arxiv.org/abs/2302.13971., articleTitle=LLAMA:open and efficient foundation language models, refAbstract=null), Reference(id=1251480556794491280, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[9], rfOrder=8, authorNames=TOUVRON H, MARTIN L, STONE K, journalName=null, refType=null, unstructuredReference=TOUVRON H, MARTIN L, STONE K, et al.LLAMA 2:open foundation and fine-tuned chat models[EB/OL].(2023-07-19)[2025-05-01]. https://arxiv.org/abs/2307.09288., articleTitle=LLAMA 2:open foundation and fine-tuned chat models, refAbstract=null), Reference(id=1251480556899348890, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[10], rfOrder=9, authorNames=HU S D, TU Y G, HAN X, journalName=null, refType=null, unstructuredReference=HU S D, TU Y G, HAN X, et al.MiniCPM:unveiling the potential of small language models with scalable training strategies[EB/OL].(2024-06-03)[2025-05-01]. https://arxiv.org/abs/2404.06395., articleTitle=MiniCPM:unveiling the potential of small language models with scalable training strategies, refAbstract=null), Reference(id=1251480557000012192, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[11], rfOrder=10, authorNames=YAO Y, YU T Y, ZHANG A, journalName=null, refType=null, unstructuredReference=YAO Y, YU T Y, ZHANG A, et al.MiniCPM-V:a GPT-4V level mllm on your phone[EB/OL].(2024-08-03)[2025-05-01].https://arxiv.org/abs/2408.01800., articleTitle=MiniCPM-V:a GPT-4V level mllm on your phone, refAbstract=null), Reference(id=1251480557100675493, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[12], rfOrder=11, authorNames=GUO D Y, ZHU Q H, YANG D J, journalName=null, refType=null, unstructuredReference=GUO D Y, ZHU Q H, YANG D J, et al.DeepSeek-Coder:when the large language model meets programming-the rise of code intelligence[EB/OL].(2024-01-26)[2025-05-01].https://arxiv.org/abs/2401.14196., articleTitle=DeepSeek-Coder:when the large language model meets programming-the rise of code intelligence, refAbstract=null), Reference(id=1251480557184561581, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[13], rfOrder=12, authorNames=LU H Y, LIU W, ZHANG B, journalName=null, refType=null, unstructuredReference=LU H Y, LIU W, ZHANG B, et al.DeepSeek-VL:towards real-world vision-language understanding[EB/OL].(2024-03-11)[2025-05-01]. https://arxiv.org/abs/2403.05525., articleTitle=DeepSeek-VL:towards real-world vision-language understanding, refAbstract=null), Reference(id=1251480557293613494, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[14], rfOrder=13, authorNames=DeepSeek-AI, journalName=null, refType=null, unstructuredReference=DeepSeek-AI. DeepSeek-V2: a strong, economical, and efficient mixture-of-experts language model[EB/OL].(2024-06-19)[2025-05-01]. https://arxiv.org/abs/2405.04434., articleTitle=DeepSeek-V2: a strong, economical, and efficient mixture-of-experts language model, refAbstract=null), Reference(id=1251480557394276800, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[15], rfOrder=14, authorNames=CHEN M, TWOREK J, JUN H, journalName=null, refType=null, unstructuredReference=CHEN M, TWOREK J, JUN H, et al.Evaluating large language models trained on code[EB/OL].(2021-07-14)[2025-05-01].https://arxiv.org/abs/2107.03374., articleTitle=Evaluating large language models trained on code, refAbstract=null), Reference(id=1251480557528494538, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[16], rfOrder=15, authorNames=LIAN L, LI B Y, YALA A, journalName=null, refType=null, unstructuredReference=LIAN L, LI B Y, YALA A, et al.LLM-grounded diffusion:enhancing prompt understanding of text-to-image diffusion models with large language models[EB/OL].(2024-03-04)[2025-05-01].https://arxiv.org/abs/2305.13655., articleTitle=LLM-grounded diffusion:enhancing prompt understanding of text-to-image diffusion models with large language models, refAbstract=null), Reference(id=1251480557608186323, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2023, volume=null, issue=null, pageStart=5792, pageEnd=5793, url=null, language=null, rfNumber=[17], rfOrder=16, authorNames=DONG X L, MOON S, XU Y E, journalName=null, refType=null, unstructuredReference=DONG X L, MOON S, XU Y E, et al.Towards next generation intelligent assistants leveraging LLM techniques[C]//Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2023:5792-5793., articleTitle=Towards next generation intelligent assistants leveraging LLM techniques, refAbstract=null), Reference(id=1251480557717238233, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[18], rfOrder=17, authorNames=XU D L, ZHANG H, YANG L M, journalName=null, refType=null, unstructuredReference=XU D L, ZHANG H, YANG L M, et al.Empowering 1000 tokens/second on-device LLM prefilling with mllm-NPU[EB/OL].(2024-07-08)[2025-05-01].https://arxiv.org/html/2407.05858v1., articleTitle=Empowering 1000 tokens/second on-device LLM prefilling with mllm-NPU, refAbstract=null), Reference(id=1251480557805318624, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2024, volume=null, issue=null, pageStart=590, pageEnd=606, url=null, language=null, rfNumber=[19], rfOrder=18, authorNames=SONG Y X, MI Z Y, XIE H T, journalName=null, refType=null, unstructuredReference=SONG Y X, MI Z Y, XIE H T, et al.PowerInfer:fast large language model serving with a consumer-grade GPU[C]//Proceedings of the ACM SIGOPS 30th Symposium on Operating Systems Principles, 2024:590-606., articleTitle=PowerInfer:fast large language model serving with a consumer-grade GPU, refAbstract=null), Reference(id=1251480558019228138, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2024, volume=null, issue=null, pageStart=12562, pageEnd=12584, url=null, language=null, rfNumber=[20], rfOrder=19, authorNames=ALIZADEH K, MIRZADEH S I, BELENKO D, journalName=null, refType=null, unstructuredReference=ALIZADEH K, MIRZADEH S I, BELENKO D, et al.LLM in a flash:efficient large language model inference with limited memory[C]//Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1:Long Papers), 2024:12562-12584., articleTitle=LLM in a flash:efficient large language model inference with limited memory, refAbstract=null), Reference(id=1251480558170223093, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2018, volume=null, issue=null, pageStart=2704, pageEnd=2713, url=null, language=null, rfNumber=[21], rfOrder=20, authorNames=JACOB B, KLIGYS S, CHEN B, journalName=null, refType=null, unstructuredReference=JACOB B, KLIGYS S, CHEN B, et al.Quantization and training of neural networks for efficient integer-arithmetic-only inference[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2018:2704-2713., articleTitle=Quantization and training of neural networks for efficient integer-arithmetic-only inference, refAbstract=null), Reference(id=1251480558321218046, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2019, volume=null, issue=null, pageStart=1325, pageEnd=1334, url=null, language=null, rfNumber=[22], rfOrder=21, authorNames=NAGEL M, BAALEN MV, BLANKEVOORT T, journalName=null, refType=null, unstructuredReference=NAGEL M, BAALEN MV, BLANKEVOORT T, et al.Data-free quantization through weight equalization and bias correction[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2019:1325-1334., articleTitle=Data-free quantization through weight equalization and bias correction, refAbstract=null), Reference(id=1251480558438658567, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2019, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[23], rfOrder=22, authorNames=ZHAO R, HU Y W, DOTZEL J, journalName=null, refType=null, unstructuredReference=ZHAO R, HU Y W, DOTZEL J, et al.Improving neural network quantization without retraining using outlier channel splitting[C]//Proceedings of the 36th International Conference on Machine Learning, 2019., articleTitle=Improving neural network quantization without retraining using outlier channel splitting, refAbstract=null), Reference(id=1251480558660956693, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[24], rfOrder=23, authorNames=NVIDIA, journalName=null, refType=null, unstructuredReference=NVIDIA.NVIDIA TensorRT-LLM:a TensorRT toolbox for optimized large language model inference[EB/OL].[2025-05-01].https://github.com/NVIDIA/TensorRT-LLM., articleTitle=NVIDIA TensorRT-LLM:a TensorRT toolbox for optimized large language model inference, refAbstract=null), Reference(id=1251480558782591517, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2023, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[25], rfOrder=24, authorNames=LIU Z C, WANG J, DAO T, journalName=null, refType=null, unstructuredReference=LIU Z C, WANG J, DAO T, et al.Deja Vu:contextual sparsity for efficient LLMs at inference time[C]//Proceedings of the 40th International Conference on Machine Learning, 2023., articleTitle=Deja Vu:contextual sparsity for efficient LLMs at inference time, refAbstract=null), Reference(id=1251480558845506085, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2024, volume=582, issue=null, pageStart=127468, pageEnd=null, url=null, language=null, rfNumber=[26], rfOrder=25, authorNames=FARINA M, AHMAD U, TAHA A, journalName=Neurocomputing, refType=null, unstructuredReference=FARINA M, AHMAD U, TAHA A, et al. Sparsity in transformers:a systematic literature review[J].Neurocomputing, 2024, 582:127468., articleTitle=Sparsity in transformers:a systematic literature review, refAbstract=null), Reference(id=1251480558946169387, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2024, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[27], rfOrder=26, authorNames=LI L J, DONG P J, TANG Z H, journalName=null, refType=null, unstructuredReference=LI L J, DONG P J, TANG Z H, et al.Discovering sparsity allocation for layer-wise pruning of large language models[C]//Proceedings of 38th Conference on Neural Information Processing Systems, 2024., articleTitle=Discovering sparsity allocation for layer-wise pruning of large language models, refAbstract=null), Reference(id=1251480560460313135, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2024, volume=null, issue=null, pageStart=2813, pageEnd=2819, url=null, language=null, rfNumber=[28], rfOrder=27, authorNames=YI C X, JIAN S L, TAN Y S, journalName=null, refType=null, unstructuredReference=YI C X, JIAN S L, TAN Y S, et al.HMO:host memory optimization for model inference acceleration on edge devices[C]//Proceedings of the IEEE International Conference on Systems, Man, and Cybernetics (SMC), 2024:2813-2819., articleTitle=HMO:host memory optimization for model inference acceleration on edge devices, refAbstract=null), Reference(id=1251480560548393529, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[29], rfOrder=28, authorNames=GERGANOV G, journalName=null, refType=null, unstructuredReference=GERGANOV G. Ggml-org/llama.cpp: LLM inference in C/C++[EB/OL].[2025-05-01].https://github.com/ggerganov/Llama.cpp., articleTitle=Ggml-org/llama.cpp: LLM inference in C/C++, refAbstract=null), Reference(id=1251480560653251133, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025-05-01, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[30], rfOrder=29, authorNames=LEE W, LEE J, SEO J, journalName=null, refType=null, unstructuredReference=LEE W, LEE J, SEO J, et al.InfiniGen:efficient generative inference of large language models with dynamic KV cache management[EB/OL].(2024-06-28)[2025-05-01].https://arxiv.org/abs/2406.19707., articleTitle=InfiniGen:efficient generative inference of large language models with dynamic KV cache management, refAbstract=null), Reference(id=1251480560762303043, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2023, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[31], rfOrder=30, authorNames=SHENG Y, ZHENG L M, YUAN B H, journalName=null, refType=null, unstructuredReference=SHENG Y, ZHENG L M, YUAN B H, et al.FlexGen:high-throughput generative inference of large language models with a single GPU[C]//Proceedings of the 40th International Conference on Machine Learning, 2023., articleTitle=FlexGen:high-throughput generative inference of large language models with a single GPU, refAbstract=null), Reference(id=1251480560883937869, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2022, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[32], rfOrder=31, authorNames=AMINABADI R Y, RAJBHANDARI S, AWAN A A, journalName=null, refType=null, unstructuredReference=AMINABADI R Y, RAJBHANDARI S, AWAN A A, et al. DeepSpeed-inference: enabling efficient inference of transformer models at unprecedented scale[C]//Proceedings of the SC22:International Conference for High Performance Computing,Networking,Storage and Analysis, 2022., articleTitle=DeepSpeed-inference: enabling efficient inference of transformer models at unprecedented scale, refAbstract=null), Reference(id=1251480560988795475, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2023, volume=null, issue=null, pageStart=611, pageEnd=626, url=null, language=null, rfNumber=[33], rfOrder=32, authorNames=KWON W, LI Z H, ZHUANG S Y, journalName=null, refType=null, unstructuredReference=KWON W, LI Z H, ZHUANG S Y, et al.Efficient memory management for large language model serving with PagedAttention[C]//Proceedings of the 29th Symposium on Operating Systems Principles, 2023:611-626., articleTitle=Efficient memory management for large language model serving with PagedAttention, refAbstract=null), Reference(id=1251480561110430296, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2024, volume=null, issue=null, pageStart=1250, pageEnd=1255, url=null, language=null, rfNumber=[34], rfOrder=33, authorNames=YI C X, JIAN S L, TAN Y S, journalName=null, refType=null, unstructuredReference=YI C X, JIAN S L, TAN Y S, et al.MACA:memory-aware convolution accelerating for CNN inference on edge devices[C]//Proceedings of the 27th International Conference on Computer Supported Cooperative Work in Design (CSCWD), 2024:1250-1255., articleTitle=MACA:memory-aware convolution accelerating for CNN inference on edge devices, refAbstract=null), Reference(id=1251480561232065121, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025, volume=62, issue=3, pageStart=545, pageEnd=562, url=null, language=null, rfNumber=[35], rfOrder=34, authorNames=葛旭冉, 欧洋, 王博, journalName=计算机研究与发展, refType=null, unstructuredReference=葛旭冉, 欧洋, 王博, .大语言模型推理中的存储优化技术综述[J].计算机研究与发展, 2025, 62(3):545-562., articleTitle=大语言模型推理中的存储优化技术综述, refAbstract=null), Reference(id=1251480561324339816, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025, volume=62, issue=3, pageStart=545, pageEnd=562, url=null, language=null, rfNumber=[35], rfOrder=35, authorNames=GE X R, OU Y, WANG B, journalName=Journal of Computer Research and Development, refType=null, unstructuredReference=GE X R, OU Y, WANG B, et al.Survey of storage optimization techniques in large language model inference[J]. Journal of Computer Research and Development, 2025, 62(3):545-562.(in Chinese), articleTitle=Survey of storage optimization techniques in large language model inference, refAbstract=null), Reference(id=1251480561462751855, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[36], rfOrder=36, authorNames=梁绪宁, 王思琪, 杨海龙, journalName=计算机工程, refType=null, unstructuredReference=梁绪宁, 王思琪, 杨海龙, .基于自适应张量交换和重算的大模型推理优化[J/OL].计算机工程, 2025.(2025-04-14)[2025-05-01].https://link.cnki.net/doi/10.19678/j.issn.1000-3428.0070644., articleTitle=基于自适应张量交换和重算的大模型推理优化, refAbstract=null), Reference(id=1251480561580192371, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, doi=null, pmid=null, pmcid=null, year=2025, volume=null, issue=null, pageStart=null, pageEnd=null, url=null, language=null, rfNumber=[36], rfOrder=37, authorNames=LIANG X N, WANG S Q, YANG H L, journalName=Computer Engineering, refType=null, unstructuredReference=LIANG X N, WANG S Q, YANG H L, et al.Adaptive tensor swapping and re-computation for efficient large language model inference[J/OL].Computer Engineering, 2025.(2025-04-14)[2025-05-01].https://link.cnki.net/doi/10.19678/j.issn.1000-3428.0070644.(in Chinese), articleTitle=Adaptive tensor swapping and re-computation for efficient large language model inference, refAbstract=null)], funds=null, companyList=[AuthorCompany(id=1251480545616671657, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, xref=null, ext=[AuthorCompanyExt(id=1251480545625060266, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=EN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China), AuthorCompanyExt(id=1251480545633448875, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, companyId=1251480545616671657, language=CN, country=null, province=null, city=null, postcode=null, companyName=null, departmentName=null, remark=国防科技大学 计算机学院,湖南 长沙 410073)])], figs=[ArticleFig(id=1251480551820046463, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.1, caption=Model memory usage, figureFileSmall=5VTf3kfg1pmufPGH7QpfbQ==, figureFileBig=mrok1ikjnN1rLjLrdUWi6Q==, tableContent=null), ArticleFig(id=1251480551937486982, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图1, caption=模型内存占用情况, figureFileSmall=5VTf3kfg1pmufPGH7QpfbQ==, figureFileBig=mrok1ikjnN1rLjLrdUWi6Q==, tableContent=null), ArticleFig(id=1251480552163979412, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.2, caption=Latency of varying mul-mat operations, figureFileSmall=n9VgU88rpxSb/IxIe7aXEA==, figureFileBig=kMsAOUHJkQkrZqGrucIbQA==, tableContent=null), ArticleFig(id=1251480552252059804, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图2, caption=不同矩阵乘法算子操作的延迟, figureFileSmall=n9VgU88rpxSb/IxIe7aXEA==, figureFileBig=kMsAOUHJkQkrZqGrucIbQA==, tableContent=null), ArticleFig(id=1251480552348528804, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.3, caption=GPU affinities of operators, figureFileSmall=ouCbvSt18xZPHArVQhGs9A==, figureFileBig=D8Q4jMu9efb4CkbusYfrjQ==, tableContent=null), ArticleFig(id=1251480552461775019, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图3, caption=算子的GPU亲和度, figureFileSmall=ouCbvSt18xZPHArVQhGs9A==, figureFileBig=D8Q4jMu9efb4CkbusYfrjQ==, tableContent=null), ArticleFig(id=1251480552545661107, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.4, caption=System overview of OALlama.cpp, figureFileSmall=Zb2IisUQWZTXj9Ufp6c0pA==, figureFileBig=uQVfgkdFJf6JwMUKtD1qyw==, tableContent=null), ArticleFig(id=1251480552642130105, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图4, caption=OALlama.cpp系统概览, figureFileSmall=Zb2IisUQWZTXj9Ufp6c0pA==, figureFileBig=uQVfgkdFJf6JwMUKtD1qyw==, tableContent=null), ArticleFig(id=1251480552763764927, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.5, caption=An example of operator flow, figureFileSmall=wNwlGTKcoYRVE0p2WZ270Q==, figureFileBig=zDnPq9133g+uS4HRTiqWUA==, tableContent=null), ArticleFig(id=1251480552872816837, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图5, caption=算子流示例, figureFileSmall=wNwlGTKcoYRVE0p2WZ270Q==, figureFileBig=zDnPq9133g+uS4HRTiqWUA==, tableContent=null), ArticleFig(id=1251480552960897228, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Alg.1, caption=Smart operator scheduling algorithm, figureFileSmall=wPJHrH8q1NEnLGLpCn8Ltg==, figureFileBig=BOonUsrDGb/59LoYS1kFbQ==, tableContent=null), ArticleFig(id=1251480553061560530, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=算法1, caption=智能算子调度算法, figureFileSmall=wPJHrH8q1NEnLGLpCn8Ltg==, figureFileBig=BOonUsrDGb/59LoYS1kFbQ==, tableContent=null), ArticleFig(id=1251480553170612442, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.6, caption=Mapping between target operator and backend device, figureFileSmall=Ev7WaLTKAYSgMWW2FEWIdQ==, figureFileBig=Wy8m5hwByWuUffQaHs2uZA==, tableContent=null), ArticleFig(id=1251480553296441571, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图6, caption=目标算子-后端设备映射关系, figureFileSmall=Ev7WaLTKAYSgMWW2FEWIdQ==, figureFileBig=Wy8m5hwByWuUffQaHs2uZA==, tableContent=null), ArticleFig(id=1251480553409687788, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.7, caption=End-to-end inference performance of varing models, figureFileSmall=WO6aRsDYkEH+XWGeqaqz9A==, figureFileBig=hNkuNBoCl5nIsbxVEWr9ew==, tableContent=null), ArticleFig(id=1251480553510351091, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图7, caption=不同模型端到端推理性能, figureFileSmall=WO6aRsDYkEH+XWGeqaqz9A==, figureFileBig=hNkuNBoCl5nIsbxVEWr9ew==, tableContent=null), ArticleFig(id=1251480553619403006, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.8, caption=Inference performance of prefill stage with varying prompt length, figureFileSmall=tP+yEzl1JTcSMgMUcQhs6Q==, figureFileBig=ArBzqK/xBU4OTH9Pclh84w==, tableContent=null), ArticleFig(id=1251480553703289095, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图8, caption=不同提示长度下预填充阶段的推理性能, figureFileSmall=tP+yEzl1JTcSMgMUcQhs6Q==, figureFileBig=ArBzqK/xBU4OTH9Pclh84w==, tableContent=null), ArticleFig(id=1251480553803952399, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.9, caption=Inference performance of decode stage with varying output length, figureFileSmall=wWX/bEA13JWVXyrhtWwnOQ==, figureFileBig=4rumhHcSu8WMl9DOZ6IdyA==, tableContent=null), ArticleFig(id=1251480553917198615, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图9, caption=不同输出长度下解码阶段的推理性能, figureFileSmall=wWX/bEA13JWVXyrhtWwnOQ==, figureFileBig=4rumhHcSu8WMl9DOZ6IdyA==, tableContent=null), ArticleFig(id=1251480554030444832, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Fig.10, caption=Inference performance of LlaMA3-8B under varying resource constraints scenarios, figureFileSmall=DYz13z3uhSEzo5+EIC7Vtg==, figureFileBig=AAhSy3fSpKi3bUT5gL3gWA==, tableContent=null), ArticleFig(id=1251480554135302436, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=图10, caption=不同资源受限场景中LlaMA3-8B的推理性能, figureFileSmall=DYz13z3uhSEzo5+EIC7Vtg==, figureFileBig=AAhSy3fSpKi3bUT5gL3gWA==, tableContent=null), ArticleFig(id=1251480554256937263, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=EN, label=Tab.1, caption=

Operator latency of different models in inference scenarios

, figureFileSmall=null, figureFileBig=null, tableContent=
算子MiniCPM3-4BLlaMA3-8 BQWQ-32B
GCGCGC
mul-mat111390285592213110469
add4246310205964
Mul435435175817
Norm428934595557
Softmax427332746322
), ArticleFig(id=1251480554345017651, tenantId=1146029695717560320, journalId=1251234078029037663, articleId=1251480537668465256, language=CN, label=表1, caption=

不同模型推理场景下算子延迟

, figureFileSmall=null, figureFileBig=null, tableContent=
算子MiniCPM3-4BLlaMA3-8 BQWQ-32B
GCGCGC
mul-mat111390285592213110469
add4246310205964
Mul435435175817
Norm428934595557
Softmax427332746322
)], attaches=null, journal=Journal(id=1251231494090305632, delFlag=0, nameCn=国防科技大学学报, nameEn=Journal of National Niversity of Defense Technology, nameHistory1=null, nameHistory2=null, issn=1001-2486, eissn=, cn=43-1067/T, coden=null, periodic=双月刊, language=CN, oaType=1, ccby=null, superviseOffice=null, ownerOffice=null, pubOffice=null, editorOffice=null, officeType=null, aims=null, clcCode=null, officeProv=null, officeCity=null, officeAddr=null, officeZip=null, officeEmail=, officePhone=, editDirector=null, officeDirector=null, officeDirectorPhone=null, officeStaffNum=null, officeEmpNum=null, coverPicUrl=h+HgOUssQ5XqPoD980XNIA==, journalPrice=null, startedYear=null, abbrevIsoEn=Journal of National Niversity of Defense Technology, journalRemark=null, publicationField=null, createdTime=1776246434950, updatedTime=1776251967711, createdBy=18614031015, updatedBy=13701087609, firstLetterCn=J, firstLetterEn=J, subjectCode=Engineering, subjectName=工程, subjectCodeEn=Engineering, subjectNameEn=null, picCn=h+HgOUssQ5XqPoD980XNIA==, picEn=hJx8onaXftcX9VtGkHdjDA==, jcr=null, cjcr=null, exts=[JournalExt(id=1251254700306285546, language=CN, name=国防科技大学学报, nameHistory1=null, nameHistory2=null, managedBy=, sponsoredBy=, publishedBy=, editorOffice=, officeProv=null, officeCity=null, officeAddr=, officeZip=, editDirector=, officeDirector=null, officePhone=null, coverPicUrl=null, journalRemark=, submitArticleUrl=null, websiteUrl=, createdTime=1776251967741, updatedTime=1776251967741, createdBy=13701087609, updatedBy=13701087609, submissionGuidelinesUrl=, submissionAuthorUrl=http://journal.nudt.edu.cn/gfkjdxxb/author/login, submissionEditorUrl=http://journal.nudt.edu.cn/gfkjdxxb/editor/login, submissionReviewUrl=http://journal.nudt.edu.cn/gfkjdxxb/reviewer/login, submissionCeEditorUrl=, submissionAeEditorUrl=, option={"copyright":""}), JournalExt(id=1251254700356617195, language=EN, name=Journal of National Niversity of Defense Technology, nameHistory1=null, nameHistory2=null, managedBy=, sponsoredBy=, publishedBy=, editorOffice=, officeProv=null, officeCity=null, officeAddr=, officeZip=, editDirector=, officeDirector=null, officePhone=null, coverPicUrl=null, journalRemark=, submitArticleUrl=null, websiteUrl=, createdTime=1776251967753, updatedTime=1776251967753, createdBy=13701087609, updatedBy=13701087609, submissionGuidelinesUrl=, submissionAuthorUrl=http://journal.nudt.edu.cn/gfkjdxxb/author/login, submissionEditorUrl=http://journal.nudt.edu.cn/gfkjdxxb/editor/login, submissionReviewUrl=http://journal.nudt.edu.cn/gfkjdxxb/reviewer/login, submissionCeEditorUrl=, submissionAeEditorUrl=, option={"copyright":""})], databaseList=null, tenantJournalId=1251234078029037663, websiteList=[Website(id=1251257283485843500, webName=null, webTitle=null, webDomain=null, webCopyrigh=null, webIpcNo=null, seoTitle=null, seoKeywords=null, seoDescription=null, tenantJournalId=null, journalId=1251234078029037663, journalNameCn=null, journalNameEn=null, grayFlag=null, tenantId=1146029695717560320, platformId=null, journalGroupId=null, journalGroupNameCn=null, journalGroupNameEn=null, type=1, domain=https://castjournals.cast.org.cn/joweb/gfkjdxxb/CN, language=CN, createTime=1776252583619, createBy=18614031015, updateTime=1776253414371, updateBy=18614031015, name=国防科技大学学报-中文, tplId=1146099689490845704, title=国防科技大学学报, delFlag=0, indexPage=/home, props=[WebsiteProps(id=1251260875290653228, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=articleTextType, value=kx, createTime=1776253439972, updateTime=1776253439972, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875273876009, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=banner, value=null, createTime=1776253439968, updateTime=1776253439968, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875311624751, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=grayFlag, value=0, createTime=1776253439977, updateTime=1776253439977, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875261293096, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=logo, value=https://castjournals.cast.org.cn/joweb/gfkjdxxb/CN/file/pic?fileId=WpHzMFTSHy8AuOKzUbYrdw==, createTime=1776253439965, updateTime=1776253439965, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875382927921, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=minRunFlag, value=0, createTime=1776253439994, updateTime=1776253439994, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875286458923, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=picServerUrl, value=https://castjournals.cast.org.cn/joweb/gfkjdxxb/CN/file/pic, createTime=1776253439971, updateTime=1776253439971, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875320013360, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=silenceFlag, value=0, createTime=1776253439979, updateTime=1776253439979, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875278070314, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=staticResourcePath, value=https://castjournals.cast.org.cn/joweb/cast_kjdb_cn_619/, createTime=1776253439969, updateTime=1776253439969, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875299041837, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=themeColor, value=null, createTime=1776253439974, updateTime=1776253439974, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260875303236142, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283485843500, code=themeStyle, value=null, createTime=1776253439975, updateTime=1776253439975, creator=18614031015, updator=18614031015)]), Website(id=1251257283599089718, webName=null, webTitle=null, webDomain=null, webCopyrigh=null, webIpcNo=null, seoTitle=null, seoKeywords=null, seoDescription=null, tenantJournalId=null, journalId=1251234078029037663, journalNameCn=null, journalNameEn=null, grayFlag=null, tenantId=1146029695717560320, platformId=null, journalGroupId=null, journalGroupNameCn=null, journalGroupNameEn=null, type=1, domain=https://castjournals.cast.org.cn/joweb/gfkjdxxb/EN, language=EN, createTime=1776252583646, createBy=18614031015, updateTime=1776253409915, updateBy=18614031015, name=国防科技大学学报-英文, tplId=1146101810881728533, title=Journal of National Niversity of Defense Technology, delFlag=0, indexPage=/home, props=[WebsiteProps(id=1251260846312210678, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=articleTextType, value=kx, createTime=1776253433063, updateTime=1776253433063, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846232518899, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=banner, value=null, createTime=1776253433044, updateTime=1776253433044, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846396096761, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=grayFlag, value=0, createTime=1776253433083, updateTime=1776253433083, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846219935986, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=logo, value=https://castjournals.cast.org.cn/joweb/gfkjdxxb/EN/file/pic?fileId=WpHzMFTSHy8AuOKzUbYrdw==, createTime=1776253433041, updateTime=1776253433041, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846442234107, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=minRunFlag, value=0, createTime=1776253433094, updateTime=1776253433094, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846282850549, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=picServerUrl, value=https://castjournals.cast.org.cn/joweb/gfkjdxxb/EN/file/pic, createTime=1776253433056, updateTime=1776253433056, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846417068282, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=silenceFlag, value=0, createTime=1776253433088, updateTime=1776253433088, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846257684724, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=staticResourcePath, value=https://castjournals.cast.org.cn/joweb/cast_kjdb_en_623/, createTime=1776253433050, updateTime=1776253433050, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846337376503, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=themeColor, value=null, createTime=1776253433070, updateTime=1776253433070, creator=18614031015, updator=18614031015), WebsiteProps(id=1251260846362542328, tenantId=1146029695717560320, journalId=null, journalGroupId=null, siteId=1251257283599089718, code=themeStyle, value=null, createTime=1776253433075, updateTime=1776253433075, creator=18614031015, updator=18614031015)])], journalTitle=国防科技大学学报, weixinUrl=null, journalUrl=http://journal.nudt.edu.cn/, iacademicId=null, status=1, seqNo=null, journalTitleEn=Journal of National Niversity of Defense Technology, journalPhotoCn=h+HgOUssQ5XqPoD980XNIA==, journalPhotoEn=hJx8onaXftcX9VtGkHdjDA==, journalFirstLetter=J, journalRecommend=null, journalNew=null, journalCollection=null, jcrJf=null, cjcrJf=null, jcrJfStr=null, cjcrJfStr=null, submissionFirstDecision=null, sciSubjectClassification=null, casSubjectClassification=null, citeScore=null, totalCitationFrequency=null, icpCode=null, psCode=null, advertisingLicenseCode=null, copyrightInformation=null, country=null, option=, provinceCode=null, provinceName=null, collectFlag=false), detailUrlCn=https://castjournals.cast.org.cn/joweb/gfkjdxxb/CN/10.11887/j.issn.1001-2486.25050035, detailUrlEn=https://castjournals.cast.org.cn/joweb/gfkjdxxb/EN/10.11887/j.issn.1001-2486.25050035, pdfUrlCn=https://castjournals.cast.org.cn/joweb/gfkjdxxb/CN/PDF/10.11887/j.issn.1001-2486.25050035, pdfUrlEn=https://castjournals.cast.org.cn/joweb/gfkjdxxb/EN/PDF/10.11887/j.issn.1001-2486.25050035, aliStartDate=null, aliEndDate=null, collectionFlag=false, citedCount=null, citedUrl=null, reference=null)
收藏切换
资源受限场景下基于算子感知的大模型推理张量卸载方法
收藏切换
PDF下载
张建锋 , 谢栋 , 蹇松雷 * , 李宝 , 王晓川 , 郭勇 , 余杰
国防科技大学学报 | 计算机系统与技术 2025,47(6): 60-70
收起
收藏切换
国防科技大学学报 | 计算机系统与技术 2025, 47(6): 60-70
资源受限场景下基于算子感知的大模型推理张量卸载方法
全屏
张建锋 , 谢栋, 蹇松雷* , 李宝, 王晓川, 郭勇, 余杰
作者信息
  • 国防科技大学 计算机学院,湖南 长沙 410073
  • 张建锋(1984—),男,陕西宝鸡人,副研究员,博士,E-mail:

通讯作者:

蹇松雷(1991—),女,贵州遵义人,副研究员,博士,硕士生导师,E-mail:
Operator-aware tensor offloading approach for large language model inference in resource-constrained scenarios
Jianfeng ZHANG , Dong XIE, Songlei JIAN* , Bao LI, Xiaochuan WANG, Yong GUO, Jie YU
Affiliations
  • College of Computer Science and Technology, National University of Defense Technology, Changsha 410073, China
出版时间: 2025-12-28 doi: 10.11887/j.issn.1001-2486.25050035
文章导航
收藏切换

在一些资源受限场景下,大语言模型的高效推理部署面临严峻挑战。当前主流的模型推理优化技术,虽然在一定程度上提高了模型推理效率,但是仍然存在部署粒度较为粗糙、推理精度较差等问题。根据不同算子对GPU亲和度不同的发现,提出算子感知张量卸载(operator-aware tensor offloading,OATO)方法。OATO能够提取算子的语义知识,并基于此设计了智能算子调度算法,可以生成全局最优模型部署方案。同时,将OATO方法集成进最新的大模型推理框架Llama.cpp中,实现了算子感知的张量卸载增强推理引擎OALlama.cpp。实验结果表明,相比于业内最先进的推理引擎Llama.cpp和FlexGen,OALlama.cpp在3种大模型上均取得最好的推理性能,尤其是在LlaMA3-8B模型GPU加载75%权重的场景下,OALlama.cpp的首词生成速度相比FlexGen和Llama.cpp提升近1倍。

大语言模型  /  资源受限  /  模型推理  /  算子GPU亲和度  /  算子感知张量卸载方法

Efficient inference deployment of large language models faces severe challenges in resource-constrained scenarios.Although current mainstream inference optimization techniques have improved model inference efficiency to some extent, they still suffer from issues like coarse-grained deployment and poor inference accuracy.Based on the discovery that different operators exhibit varying degrees of GPU affinity, an OATO(operator-aware tensor offloading)approach was proposed.OATO could extract operators′semantic knowledge and used it to design an intelligent scheduling algorithm, which further yielded a globally optimal model-deployment plan.Meanwhile, the OATO approach was integrated into the latest large model inference framework Llama.cpp to implement an operator-aware tensor offloading enhanced inference engine, referred to as OALlama.cpp.Experimental results show that compared with the state-of-the-art inference engines Llama.cpp and FlexGen, OALlama.cpp achieves the best inference performance on three large models.Notably, in the scenario where 75% of the LlaMA3-8B model weights are loaded on the GPU, the first-token generation speed of OALlama.cpp is nearly doubled compared with FlexGen and Llama.cpp.

large language models  /  resource constraints  /  model inference  /  GPU affinities of operators  /  operator-aware tensor offloading approach
张建锋, 谢栋, 蹇松雷, 李宝, 王晓川, 郭勇, 余杰. 资源受限场景下基于算子感知的大模型推理张量卸载方法. 国防科技大学学报, 2025 , 47 (6) : 60 -70 . DOI: 10.11887/j.issn.1001-2486.25050035
Jianfeng ZHANG, Dong XIE, Songlei JIAN, Bao LI, Xiaochuan WANG, Yong GUO, Jie YU. Operator-aware tensor offloading approach for large language model inference in resource-constrained scenarios[J]. Journal of National Niversity of Defense Technology, 2025 , 47 (6) : 60 -70 . DOI: 10.11887/j.issn.1001-2486.25050035
近年来,生成式大语言模型(large language models,LLMs)已成为推动人工智能发展的核心力量。凭借其卓越的语言理解和生成能力,LLMs在语言相关领域表现出色,并在自动化编程、图像生成和个性化助理等多领域广泛应用[1-3]。基于Transformer架构[4]的LLMs,如生成式预训练模型(generative pre-trained transformer,GPT)系列[5-7]、LlaMA系列[8-9]、MiniCPM系列[10-11]以及DeepSeek系列[12-14]等,进一步重塑了机器学习和自然语言处理的格局[15-17]
然而,这些模型通常规模庞大,只能部署在配备大量昂贵服务器级图形处理器(graphics processing unit,GPU)的数据中心[18]。与此同时,随着数据隐私保护、模型定制化和降低推理成本的需求增加,本地部署LLMs(如在配备消费级GPU的个人计算机上)成为一种新的趋势[18]。与数据中心部署所需高吞吐量不同,本地部署更侧重于处理小批量数据时的低延迟需求[19-20]
与此同时,由于LLMs的规模、复杂性以及对内存和计算资源的高需求,消费级GPU上的部署仍面临较大挑战。特别是,LLMs采用自回归迭代方式生成文本,每次生成都需要访问包含数千亿参数的整个模型,这使得推理过程受到GPU内存的严格限制,尤其是在资源受限的消费级GPU场景中。目前,常用的解决方案主要包括模型压缩和模型卸载。
模型压缩是降低模型内存占用、加速大语言模型推理的一种重要思路,当前模型压缩的方法主要有量化、剪枝或稀疏化等。量化技术[21-24]主要通过降低模型中的数据精度,以减少内存占用和计算量,如英伟达的TensorRT[24]推理优化器在图像识别大语言模型的推理过程中,能够将原本32位的浮点数精度降低至16位甚至8位,从而将高精度的复杂计算转化为低精度运算。剪枝或稀疏化[1925-28]则是从模型结构入手,去除对模型输出影响较小的部分,如Dejavu证明了大模型存在上下文稀疏性,并使用小的预测模型对模型的稀疏性进行提取预测,大大减少模型推理的计算量,以提高推理速度[25]。虽然模型压缩技术可以减小模型规模,但仍然存在两大问题:一是即使经过深度压缩,模型对消费级GPU而言仍过于庞大;二是压缩不可避免地会降低模型推理精度。
模型卸载[29-36]也是大语言模型推理优化领域的另一种重要思路,尤其是在一些内存受限的场景下,发挥尤为出色。这种方法不改变模型本身,在GPU内存不充足的情况下,通过借用中央处理器(central processing unit,CPU)内存完成推理,例如,Llama.cpp[29]采取了分层卸载的方法,将一部分层卸载到GPU,一部分层卸载到CPU,从而实现资源受限环境中CPU和GPU混合推理。斯坦福大学的研究者在FlexGen[31]中提供了一种方法,在考虑GPU、CPU和磁盘可用硬件资源限制的情况下,实现了不同的工作负载卸载方式。类似地,苹果公司的研究者将模型参数存储在更大容量的闪存中,通过需要时再将其传输至速度更快的内存的方式[20],提升了推理执行的效率。上述这些混合推理方法都给资源受限环境中运行大语言模型提供了很好的思路和解决方案,然而,这些方法受限于外围组件互联高速总线(peripheral component interconnect express,PCIe)互联速度和CPU计算能力,导致推理效率低下,延迟较高。此外,由于LLMs中每层的算子具有不同的特点:有些算子内存占用小但计算量大,而有些则相反,简单地按层分配模型无法充分利用GPU的强大计算能力。
理想状态下,模型卸载需依据LLMs中每层算子的内存需求与计算特性,将其按需部署至CPU或GPU,从而充分发挥硬件效能。为此需攻克三项关键技术挑战:①算子特性表征与分析,需要深入理解LLMs中不同算子的内存需求以及在不同设备上的性能表现;②智能调度算法设计,需要开发自适应算法来决定如何根据算子特性进行放置;③透明化部署机制,需要构建对开发者透明的算子放置机制,无须开发人员手动干预。
为解决上述挑战,针对资源受限的大模型推理场景,在研究分析了大语言模型算子特性的基础上,提出了算子感知张量卸载(operator-aware tensor offloading,OATO)方法,并将其集成于Llama.cpp中,构建了算子感知增强的大模型推理引擎OALlama.cpp(OATO-enhanced Llama.cpp)。通过在不同内存限制和提示长度场景下的测试表明,相比于Llama.cpp和FlexGen[31]等典型推理引擎,OALlama.cpp均显著提升了LLMs在资源受限环境中的推理效率。
在大语言模型推理过程中,每层的算子操作基于不同的计算和存储需求,主要分为需要加载权重、需要中间张量以及需要缓存的算子这三种类型,以下是对其具体情况的详细阐述。
需要加载权重的算子:权重是大语言模型的核心参数,它记录了模型在训练过程中学习到的知识和模式。对于需要加载权重的算子,其在推理开始前,必须从存储设备(如硬盘、显存等)中读取预训练好的权重参数。以Decoder-only架构中的注意力机制和前馈神经网络层为例,在计算注意力分数、进行矩阵乘法运算等操作时,都需要加载相应的权重矩阵。这些权重参数加载过程可能会受到存储设备读写速度的影响,从而对推理速度产生一定限制。
需要中间张量的算子:中间张量是算子在计算过程中产生的临时数据,用于记录中间计算结果,以便后续操作使用。这类算子在执行计算任务时,首先会生成中间张量。然而,中间张量具有临时性,在完成其对应的计算任务,即不再被后续计算步骤所需要时,就会被释放。这是因为中间张量通常占用大量的内存空间,如果不被及时释放,会导致内存资源的过度消耗,甚至引发内存溢出等问题,影响模型推理的正常进行。
需要缓存的算子:需要缓存的算子主要是为了优化推理性能,减少重复计算。在推理过程中,某些算子的计算结果在后续步骤中可能会被多次使用,为避免重复计算,将计算结果进行缓存。在自注意力机制的计算中,键值缓存(key-value cache,KV Cache)机制可以保存已经计算好的键值矩阵,当处理后续输入序列的不同位置时,如果需要用到相同的键值对计算注意力分数,可直接从缓存中读取,而无须重新计算。
为了了解大语言模型推理过程中内存占用的相关情况,对MiniCPM3-4B、LlaMA3-8B和QWQ-32B模型在推理过程中的内存占用情况进行了分析,由于面向的资源受限场景以短文本交互为主要形式,因此将文本长度的上限统一设定为1024。模型内存占用情况如图1所示,在MiniCPM3-4B模型的推理过程中,模型权重、键值缓存和其他(中间张量等)的内存占用分别为8129.66MB、775 MB、155.74 MB。对于LlaMA3-8B和QWQ-32B而言,模型权重、键值缓存和其他的内存占用分别为15137.02MB、128 MB、258MB和62494.27MB、256 MB、1792 MB。通过上述对比可以看出,在模型推理进程中,尽管键值缓存与其他内存部分在内存占比上存在差异,但模型权重的内存始终都占据了几乎所有的份额,其中MiniCPM3-4B中的模型权重内存占比89.7%,LlaMA3-8B中的模型权重内存占比97.5%,QWQ-32B中的模型权重内存占比96.8%。
发现1:在资源受限的大模型推理场景下,当提示长度不超过1024时,模型权重占据内存空间的主体部分,因此,优化权重张量的放置策略具有关键意义。
为了深入了解模型推理过程中CPU算子和GPU算子的性能表现情况,提取了不同模型在推理过程中算子级别的语义知识,表1展示了MiniCPM3-4B、LlaMA3-8B和QWQ-32B模型在GPU和CPU上单独运行时的不同算子的性能表现,其中C指的是CPU,G指的是GPU。可以明显观察到,无论是哪个模型,相较于GPU上的算子计算延迟,同样的算子在CPU上的计算延迟会有上百甚至上千倍的增加,因此,将算子卸载到CPU上会严重影响推理延迟。
此外,在三个模型中,矩阵乘法(mul-mat)算子CPU执行时间都相对较长,如QWQ-32B模型下CPU执行矩阵乘法算子耗时约110.5 ms,而GPU执行时间则短很多。这是因为矩阵乘法计算量极大,CPU受限于其架构,串行处理能力在应对大规模矩阵运算时效率低下;而GPU拥有大量计算核心,能并行处理矩阵元素计算,大幅缩短执行时间。同时,可推断出在CPU设备上,mulmat算子因计算量极大,成为CPU计算的主要瓶颈,是提升整体运算效率的亟待突破的关键。
发现2:在CPU参与模型推理的场景中,mulmat算子已成为影响模型推理延迟的核心瓶颈,其单次推理耗时显著高于其他类型算子。
为深入剖析mul-mat算子的性能特性,对其内部不同矩阵乘法算子操作进行了细致拆解与分析。如图2所示,该图清晰呈现了CPU与GPU设备上不同mul-mat算子操作的延迟表现差异。数据显示,MiniCPM3-4B、LlaMA3-8B和QWQ-32B模型的mul-mat算子在GPU平台的执行延迟分别约为11 μs、8 μs和13μs,且各算子间波动范围极小,体现出GPU计算资源的高效与稳定;反观CPU平台,不同mul-mat算子的延迟表现呈现显著分化,在MiniCPM3-4B、LlaMA3-8 B和QWQ-32B模型中,其数值区间跨度分别为2822.23 μs至28676.96 μs、2510.11 μs至122479.01 μs和2574.95 μs至327259.25 μs。这一结果充分表明,将不同mul-mat算子从CPU迁移至GPU时,所带来的性能增益存在显著差异。
为深入探究GPU加速与权重内存之间的内在关联,对需要加载权重张量的mul-mat算子进行更进一步分析,以mul-mat算子在CPU和GPU平台的执行时间差值作为算子加速度量指标,继而将该差值除以算子运行所需权重张量的内存容量,并通过归一化处理得到单位内存加速比。这一量化指标精准刻画了单位内存对推理速度的优化效能,即数值越高,意味着将算子卸载至GPU执行后,推理速度的提升幅度越显著。以下将该指标正式定义为算子的“GPU亲和度”,用以系统性评估算子与GPU计算资源的适配程度。
图3分别展示了在MiniCPM3-4B、LlaMA3-8B和QWQ-32B三个模型架构下,不同mul-mat算子操作的内存占用、时间加速、GPU亲和度等特征,其中圆圈大小表示算子在CPU和GPU设备上的运行延迟的差值,圆圈越大说明算子延迟差距越大;圆圈的颜色表示GPU亲和度,颜色越浅说明算子GPU亲和度越高。从图中可以明显看出,无论哪个模型,算子的GPU亲和度都呈现显著差异。这一发现为算子卸载策略的制定提供了重要依据。以图3(a)为例,将q_a算子操作和q_b算子操作进行比较,前者的GPU亲和度为0.4,而后者仅为0.1。这表明在内存资源受限的场景中,优先将q_a算子操作卸载至GPU执行,能够相较于将q_b算子操作卸载至GPU执行实现更为显著的推理加速效果。该结论对于优化计算资源分配、提升模型推理效率具有重要的实践指导意义。
发现3:对于不同的mul-mat算子操作,它们的GPU亲和度是不同的,优化GPU亲和度更高的算子对模型推理的性能提升会更大。
面向资源受限场景设计了一个基于算子感知的模型张量卸载方法,并将该方法集成于Llama.cpp之上,从而实现了基于算子混合卸载的模型推理引擎,即算子感知增强的大模型推理引擎OALlama.cpp。OALlama.cpp充分利用2.3节中的发现3,即mul-mat算子操作具有GPU亲和度不同的特点,通过对模型进行算子级的重新部署,即使是超出内存容量的大语言模型,也能实现更加高效的推理。简单来说,OALlama.cpp对mul-mat算子操作的GPU亲和度进行排序,将GPU亲和度高的算子部署在GPU中,其余部署在CPU中。对于部署在CPU上的算子,直接在CPU上计算,无须将算子移动到GPU上。
图4展示了OALlama.cpp的系统概览。它主要由三个模块组成:算子解析器、算子调度器和算子放置器。其中:算子解析器用于提取大语言模型推理过程中算子的语义知识;算子调度器基于算子语义知识,对算子进行GPU亲和度排序;算子放置器用于简化算子管理并实现自动化的算子放置。
给定一个大语言模型,算子解析器会提取模型中每一层算子的语义知识,即量化算子操作的计算量、所需张量的大小(内存占用)及其相关性等。利用这些语义知识,算子调度器将会生成每个算子的GPU亲和度,并对其进行排序,从而规划算子的优化部署方案。之后,算子放置器将通过维护一张表来区分算子的后端,完成算子在CPU和GPU后端的自动化卸载。下述为具体的组件分析。
算子解析器负责采集算子在CPU/GPU上执行的计算时间、张量内存占用及跨设备通信延迟,为资源受限场景下的异构部署提供数据支撑。图5展示了算子流示例,其中,橙色表示算子被卸载到GPU,蓝色表示算子被卸载到CPU。AI为中间张量,W为模型权重张量。系统中存在三种算子连接方式(CPU-CPU、GPU-GPU、CPU-GPU),需考虑以上连接方式并量化中间结果传输产生的额外延迟(如GPU→CPU的数据迁移)。此外,像mul-mat2算子这种需要加载模型权重W1进行张量计算的算子称为目标算子。仅加载中间张量I1进行计算的mul-mat1算子,以及不需要其余张量就能执行算子操作的算子(如scale算子)或add算子这种只需要加载中间张量I2执行算子操作的都归为非目标算子。
基于2.1~2.2节的发现1和发现2,本系统聚焦于需要加载模型权重张量的mul-mat算子(目标算子),因其主导大语言模型推理的内存消耗(权重张量)和计算延迟。因此,算子解析器在推理预加载阶段,首先根据算子在大语言模型推理迭代(一轮前向传播)中是否为目标算子进行分类。然后,采集目标算子的相关语义知识,包括在所有支持的后端设备执行计算所需的时间(指加载算子所需张量到指定后端寄存器的时间以及张量计算的时间之和),以及对应权重张量所需的内存大小等。此外,算子解析器仅在模型首次部署的预加载阶段完成相关语义知识的采集工作,后续所有推理过程均无须重复执行知识获取操作。因此,该环节的耗时特性不会对后续的模型推理产生影响。
这些参数构成算子调度器的优化依据,通过量化目标算子的异构执行成本,生成全局最优的算子部署方案。该机制有效平衡了权重密集型计算的设备资源分配与通信开销的矛盾。
在资源受限场景中,内存资源的有限性成为制约大语言模型高效推理的关键瓶颈。为实现内存资源的全局优化配置与算子的合理部署,设计一种高效的智能算子调度算法势在必行。基于2.3节发现3中揭示的mul-mat算子操作GPU亲和度差异现象,传统随机放置或按层划分的算子部署策略存在显著弊端。该类策略可能导致高GPU亲和度算子被错误分配至CPU,致使GPU计算资源利用率不足,进而增加系统推理延迟。而简单地将高GPU亲和度算子部署至GPU,又会因CPU与GPU间频繁的数据传输产生高额开销,同样会对系统性能造成负面影响。因此,提出的智能算子调度算法聚焦两大核心目标:其一,最大限度利用有限的GPU内存资源,优先存储具有最高GPU亲和度的算子;其二,充分考量数据传输对算子GPU亲和度的影响,有效平衡计算与数据传输开销。
提出的智能算子调度算法通过三个核心步骤实现全局最优的算子放置方案。算法1展示了算子调度器中使用的智能算子调度算法的核心逻辑。
首先,基于算子解析器获取的计算延迟参数,量化评估各算子单位GPU内存资源可获得的延迟优化效益:Bi=(Tci-Tgi)/Mi,其中TciTgi分别表示算子i在CPU、GPU的执行延迟,Mi为算子i的权重张量内存占用量。进行最小最大归一化处理:Gi=(Bi-Bmin)/(Bmax-Bmin),将B映射成0~1区间的数值,以该数值来表征算子的GPU亲和度,建立内存-效率的边际效益评估模型。如算法1第2~5行所示,系统对所有算子按G值降序排列,建立初步优先级队列。
其次,为消除传输延迟对计算增益的负向影响,构建迭代式亲和度修正机制。针对每个候选算子,引入跨设备张量加载延迟T′,更新延迟优化效益的计算公式为:Bi=(Tci-Tgi-)/Mi,对原始计算结果进行修正。通过循环执行“计算增益评估→传输延迟补偿→优先级重排”的迭代过程(算法1第6~15行),动态调整算子部署顺序,确保优先级排序能够真实反映网络传输约束下的综合优化效益。
最后,为了预留空间给框架自身开销、潜在内存溢出(out of memory,OOM)风险或其他系统级需求,以GPU显存容量的90%为资源约束边界,选择迭代优化后G′值最高的算子子集部署于GPU设备,将其余算子分配至CPU。该阈值设置既保证显存安全余量,又能最大化资源利用率(算法1第16~31行)。最终生成的部署方案在计算效率、传输开销、内存占用三个维度实现帕累托最优,有效解决了传统方法在硬件异构环境下容易出现的局部最优问题。
算法总述:为了生成最优的放置方案,它会迭代式地为算子的GPU亲和度排序,直到找出算子最佳的GPU亲和度序列。该算法在整个搜索过程中主要跟踪算子是否存在CPU和GPU之间的数据传递。在算法的每次迭代中,它会相应地更新算子的GPU亲和度。
细粒度的算子放置策略虽然能够提升系统资源利用效率,但不可避免地增加了系统内存管理的复杂度。由于该策略涉及大量精细化操作,使得系统难以精准追踪每个目标算子对应的内存空间。为有效应对这一挑战,算子放置器的核心任务聚焦于解决目标算子的合理放置问题。
目标算子-后端设备映射关系如图6所示,对于目标算子,算子放置器着重关注其权重张量、中间张量及操作类型这三个关键信息。其中,权重张量作为模型参数的重要载体,具有后端设备类型和内存大小等属性,并直接映射至实际物理设备。因此,研究目标算子的放置问题本质上是探讨权重张量如何放置。
在实际的算子部署过程中,算子放置器首先通过算子解析器获取全局最优的算子放置方案,进而构建并维护一张算子-后端设备映射表。该映射表清晰呈现了权重张量与后端设备之间的对应关系,成为系统识别权重张量物理位置的关键依据。通过动态修改这张映射表,系统能够灵活决定权重张量的实际部署设备,并在相应后端设备上准确加载张量,顺利完成计算任务。
性能评测的云服务器配置参数:CPU为英特尔至强(Intel Xeon)系列的Silver 4314处理器,配备了128 GB的内存;GPU为英伟达GeForce RTX 4090,拥有24 GB的GPU内存,GPU通过PCIe Gen5 x16接口与主板相连。
将OATO方法集成进现有推理引擎Llama.cpp中,实现了算子感知增强的大模型推理引擎OALlama.cpp。
实验中,将OALlama.cpp与行业最先进的推理引擎Llama.cpp和FlexGen进行了比较。其中Llama.cpp是资源受限的本地场景中应用最广泛的推理引擎。在模型选择方面,挑选了MiniCPM-4B、LlaMA3-8B和QWQ-32B三个具有代表性的大语言模型。这三个模型在架构设计上各具特色,在参数量级上存在显著差异,并且是国内外大语言模型领域的典型产品,能够充分覆盖不同规模和类型的模型场景。需要说明的是,MiniCPM3-4B模型的注意力层采用多头潜在注意力(multihead latent attention,MLA)架构,与FlexGen中的部分加速方式存在兼容性问题,导致无法在FlexGen框架下进行有效推理,因此未纳入该模型在FlexGen框架下的评估。
鉴于本方法聚焦于资源受限环境中的短文本应用场景,在整体实验设计中,输入输出均以短文本为主。具体而言:在端到端的性能评估实验(4.2节)和不同资源受限情况下的性能评估实验(4.5节)中统一设置提示长度为64,生成长度为32,模拟资源受限环境下的典型短文本交互场景;在探究不同提示长度下的预填充阶段性能评估实验(4.3节)中设置提示长度为32、64、128、256和512,通过梯度化的参数设置,分析预填充阶段在不同文本长度下的性能表现;在评估不同生成长度下的解码阶段性能评估实验(4.4节)中设置生成长度为32、64和128,针对性地考察解码阶段在不同文本生成需求下的效率与效果。
为了评估不同框架在模型推理中的性能表现,针对FlexGen、Llama.cpp和OALlama.cpp展开了一系列对比实验。实验选取了LlaMA3-8B和QWQ-32B这两个具有代表性的模型,对它们的端到端推理性能进行了深入分析。
为了更贴近实际应用中的资源受限场景,在对LlaMA3-8B模型进行推理时,将其权重的50%卸载至GPU进行计算。实验结果清晰地显示,OALlama.cpp在这两类模型上均展现出了卓越的性能优势。不同模型端到端推理性能如图7所示,从中可以直观地看到,与Llama.cpp相比,OALlama.cpp在LlaMA3-8B和QWQ-32B模型上的推理速度分别提升了17.4%和6.3%。而与FlexGen相比,这一优势更加明显,OALlama.cpp在LlaMA3-8B和QWQ-32B模型上的推理速度分别实现了46.2%和36.2%的显著提升。这是由于FlexGen采用将CPU端权重加载至GPU执行计算的策略,而Llama.cpp通过将部分层权重卸载至CPU本地计算,有效降低了权重加载延迟。相比之下,OALlama.cpp因选用了GPU亲和度更高的算子,从而实现了更优的推理性能。
为了研究预填充阶段OALlama.cpp的性能表现,对不同场景中模型推理的首词生成时间(time to first token,TTFT)进行了实验,以MiniCPM3-4B、LlaMA3-8B和QWQ-32B模型为研究对象,收集首词生成时间,对FlexGen、OALlama.cpp和Llama.cpp的推理效果进行对比分析,此外,由于本实验场景GPU内存大于MiniCPM3-4B和LlaMA3-8B模型的需求,为了模拟资源受限场景,分别设置加载25%的MiniCPM3-4B模型和75%的LlaMA3-8B模型。
不同提示长度下预填充阶段的推理性能如图8所示,在MiniCPM3-4B模型推理仅能加载25%权重的情况下,在较长提示长度范围内,OALlama.cpp在首词生成的速度上显著优于Llama.cpp,最多有41.8%的速度提升,Llama.cpp的首词生成时间随提示长度增加而明显增长,而OALlama.cpp稳定性好,受提示长度影响小。
在LlaMA3-8B模型推理加载75%权重的情况下,OALlama.cpp在首词生成的速度上依旧领先,大约能有接近1倍的提升。FlexGen和Llama.cpp相对接近,但Llama.cpp随提示长度增加首词生成时间有一定上升,FlexGen相对稳定。
在QWQ-32B模型推理的不同提示长度下,OALlama.cpp在首词生成的速度上相对更快,Llama.cpp次之,FlexGen最慢。且随着提示长度增加,OALlama.cpp和FlexGen的TTFT有上升也有下降,但FlexGen波动相对较大,Llama.cpp和OALlama.cpp变化较为平缓。尤其是,相较于FlexGen,OALlama.cpp实现了28%的TTFT提升。
随着提示长度的增加,所有推理引擎的性能整体都是下降的,但OALlama.cpp仍优于其他引擎。这是由于OALlama.cpp将对CPU运算影响较大的算子调度至GPU执行计算,尽管保留在CPU端的算子仍会受提示长度影响,但该影响已被控制在相对最小范围内。
为了研究解码阶段OALlama.cpp的性能表现,对不同场景中模型推理的每个输出token的时间(time per output token,TPOT)进行了实验。以MiniCPM3-4B、LlaMA3-8B和QWQ-32B模型为研究对象,收集每个输出token的时间,对FlexGen、OALlama.cpp和Llama.cpp的推理效果进行对比分析,实验结果如图9所示。
从三张图呈现的TPOT数据来看:在不同生成长度条件下,相比较FlexGen和Llama.cpp,OALlama.cpp的TPOT始终处于低位,且表现最稳定。这些结果充分说明即使在解码阶段,CPU计算量很小的情况下,OALlama.cpp的算子放置策略仍然有效降低了每个输出token的时间。
为了研究不同资源受限情况下OALlama.cpp的表现,将LlaMA3-8B模型权重加载至GPU的比例分别设定为25%、50%和75%。实验结果如图10所示,随着权重比例从25%提升到75%,OALlama.cpp的推理时间均显著低于FlexGen和Llama.cpp。在25%权重比例时,OALlama. cpp较FlexGen快了约43%,较Llama. cpp快了约15.5%;当权重比例提升到50%时,OALlama. cpp较FlexGen的提效幅度达到约47.4%,较Llama. cpp快约20.7%;到75%权重比例时,OALlama.cpp较FlexGen提效高达约64.5%,较Llama. cpp提效约40.8%,优势越发明显。这是由于随着权重比例的增加,OALlama. cpp能够将更多GPU亲和度更高的算子卸载到GPU上计算,从而实现更优的效果。
实验结果表明,在模型推理性能的评估中,通过对比不同模型在不同权重比例下使用不同推理框架的表现,能够清晰地看出OALlama.cpp的显著优势。
在资源受限场景下,研究通过剖析大语言模型的算子特性,发现算子操作间存在差异化的GPU亲和度,为算子粒度的模型卸载提供了关键依据。基于此,提出算子感知的模型自动卸载技术OATO,并将其集成于Llama.cpp,构建了算子感知的模型推理系统OALlama.cpp。实验结果表明,OALlama.cpp在不同场景的大模型推理中,均能在不同程度上提升推理效率,验证了该技术在资源受限环境下的有效性与实用性。
参考文献 引证文献
排序方式:
[1]
ZHAO W X, ZHOU K, LI J Y, et al.A survey of large language models[EB/OL].(2025-03-11)[2025-05-01].https://arxiv.org/abs/2303.18223.
[2]
YUAN Z H, SHANG Y Z, ZHOU Y, et al.LLM inference unveiled:survey and roofline model insights[EB/OL].(2024-05-01)[2025-05-01]. https://arxiv.org/abs/2402.16363.
[3]
MIAO X P, OLIARO G, ZHANG Z H, et al.Towards efficient generative large language model serving:a survey from algorithms to systems[EB/OL].(2023-12-23)[2025-05-01].https://arxiv.org/abs/2312.15234.
[4]
VASWANI A, SHAZEER N M, PARMAR N, et al. Attention is all you need[C]//Proceedings of 31 st Conference on Neural Information Processing Systems, 2017.
[5]
BROWN T B, MANN B, RYDER N, et al.Language models are few-shot learners[C]//Proceedings of 34th Conference on Neural Information Processing Systems, 2020.
[6]
OUYANG L, WU J, JIANG X, et al.Training language models to follow instructions with human feedback[C]//Proceedings of 36th Conference on Neural Information Processing Systems, 2022.
[7]
OpenAI.GPT-4 technical report[EB/OL].(2024-03-04)[2025-05-01].https://arxiv.org/abs/2303.08774.
[8]
TOUVRON H, LAVRIL T, IZACARD G, et al.LLAMA:open and efficient foundation language models[EB/OL]. (2023-02-27)[2025-05-01].https://arxiv.org/abs/2302.13971.
[9]
TOUVRON H, MARTIN L, STONE K, et al.LLAMA 2:open foundation and fine-tuned chat models[EB/OL].(2023-07-19)[2025-05-01]. https://arxiv.org/abs/2307.09288.
[10]
HU S D, TU Y G, HAN X, et al.MiniCPM:unveiling the potential of small language models with scalable training strategies[EB/OL].(2024-06-03)[2025-05-01]. https://arxiv.org/abs/2404.06395.
[11]
YAO Y, YU T Y, ZHANG A, et al.MiniCPM-V:a GPT-4V level mllm on your phone[EB/OL].(2024-08-03)[2025-05-01].https://arxiv.org/abs/2408.01800.
[12]
GUO D Y, ZHU Q H, YANG D J, et al.DeepSeek-Coder:when the large language model meets programming-the rise of code intelligence[EB/OL].(2024-01-26)[2025-05-01].https://arxiv.org/abs/2401.14196.
[13]
LU H Y, LIU W, ZHANG B, et al.DeepSeek-VL:towards real-world vision-language understanding[EB/OL].(2024-03-11)[2025-05-01]. https://arxiv.org/abs/2403.05525.
[14]
DeepSeek-AI. DeepSeek-V2: a strong, economical, and efficient mixture-of-experts language model[EB/OL].(2024-06-19)[2025-05-01]. https://arxiv.org/abs/2405.04434.
[15]
CHEN M, TWOREK J, JUN H, et al.Evaluating large language models trained on code[EB/OL].(2021-07-14)[2025-05-01].https://arxiv.org/abs/2107.03374.
[16]
LIAN L, LI B Y, YALA A, et al.LLM-grounded diffusion:enhancing prompt understanding of text-to-image diffusion models with large language models[EB/OL].(2024-03-04)[2025-05-01].https://arxiv.org/abs/2305.13655.
[17]
DONG X L, MOON S, XU Y E, et al.Towards next generation intelligent assistants leveraging LLM techniques[C]//Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2023:5792-5793.
[18]
XU D L, ZHANG H, YANG L M, et al.Empowering 1000 tokens/second on-device LLM prefilling with mllm-NPU[EB/OL].(2024-07-08)[2025-05-01].https://arxiv.org/html/2407.05858v1.
[19]
SONG Y X, MI Z Y, XIE H T, et al.PowerInfer:fast large language model serving with a consumer-grade GPU[C]//Proceedings of the ACM SIGOPS 30th Symposium on Operating Systems Principles, 2024:590-606.
[20]
ALIZADEH K, MIRZADEH S I, BELENKO D, et al.LLM in a flash:efficient large language model inference with limited memory[C]//Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1:Long Papers), 2024:12562-12584.
[21]
JACOB B, KLIGYS S, CHEN B, et al.Quantization and training of neural networks for efficient integer-arithmetic-only inference[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2018:2704-2713.
[22]
NAGEL M, BAALEN MV, BLANKEVOORT T, et al.Data-free quantization through weight equalization and bias correction[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2019:1325-1334.
[23]
ZHAO R, HU Y W, DOTZEL J, et al.Improving neural network quantization without retraining using outlier channel splitting[C]//Proceedings of the 36th International Conference on Machine Learning, 2019.
[24]
NVIDIA.NVIDIA TensorRT-LLM:a TensorRT toolbox for optimized large language model inference[EB/OL].[2025-05-01].https://github.com/NVIDIA/TensorRT-LLM.
[25]
LIU Z C, WANG J, DAO T, et al.Deja Vu:contextual sparsity for efficient LLMs at inference time[C]//Proceedings of the 40th International Conference on Machine Learning, 2023.
[26]
FARINA M, AHMAD U, TAHA A, et al. Sparsity in transformers:a systematic literature review[J].Neurocomputing, 2024, 582:127468.
[27]
LI L J, DONG P J, TANG Z H, et al.Discovering sparsity allocation for layer-wise pruning of large language models[C]//Proceedings of 38th Conference on Neural Information Processing Systems, 2024.
[28]
YI C X, JIAN S L, TAN Y S, et al.HMO:host memory optimization for model inference acceleration on edge devices[C]//Proceedings of the IEEE International Conference on Systems, Man, and Cybernetics (SMC), 2024:2813-2819.
[29]
GERGANOV G. Ggml-org/llama.cpp: LLM inference in C/C++[EB/OL].[2025-05-01].https://github.com/ggerganov/Llama.cpp.
[30]
LEE W, LEE J, SEO J, et al.InfiniGen:efficient generative inference of large language models with dynamic KV cache management[EB/OL].(2024-06-28)[2025-05-01].https://arxiv.org/abs/2406.19707.
[31]
SHENG Y, ZHENG L M, YUAN B H, et al.FlexGen:high-throughput generative inference of large language models with a single GPU[C]//Proceedings of the 40th International Conference on Machine Learning, 2023.
[32]
AMINABADI R Y, RAJBHANDARI S, AWAN A A, et al. DeepSpeed-inference: enabling efficient inference of transformer models at unprecedented scale[C]//Proceedings of the SC22:International Conference for High Performance Computing,Networking,Storage and Analysis, 2022.
[33]
KWON W, LI Z H, ZHUANG S Y, et al.Efficient memory management for large language model serving with PagedAttention[C]//Proceedings of the 29th Symposium on Operating Systems Principles, 2023:611-626.
[34]
YI C X, JIAN S L, TAN Y S, et al.MACA:memory-aware convolution accelerating for CNN inference on edge devices[C]//Proceedings of the 27th International Conference on Computer Supported Cooperative Work in Design (CSCWD), 2024:1250-1255.
[35]
葛旭冉, 欧洋, 王博, .大语言模型推理中的存储优化技术综述[J].计算机研究与发展, 2025, 62(3):545-562.
GE X R, OU Y, WANG B, et al.Survey of storage optimization techniques in large language model inference[J]. Journal of Computer Research and Development, 2025, 62(3):545-562.(in Chinese)
[36]
梁绪宁, 王思琪, 杨海龙, .基于自适应张量交换和重算的大模型推理优化[J/OL].计算机工程, 2025.(2025-04-14)[2025-05-01].https://link.cnki.net/doi/10.19678/j.issn.1000-3428.0070644.
LIANG X N, WANG S Q, YANG H L, et al.Adaptive tensor swapping and re-computation for efficient large language model inference[J/OL].Computer Engineering, 2025.(2025-04-14)[2025-05-01].https://link.cnki.net/doi/10.19678/j.issn.1000-3428.0070644.(in Chinese)
2025年第47卷第6期
PDF下载
131
63
引用本文
BibTeX
文章信息
doi: 10.11887/j.issn.1001-2486.25050035
  • 接收时间:2025-05-24
  • 首发时间:2026-04-16
  • 出版时间:2025-12-28
补充材料
相关文章
文章信息
作者
出版历史
  • 收稿日期:2025-05-24
基金
作者信息
    国防科技大学 计算机学院,湖南 长沙 410073

通讯作者:

蹇松雷(1991—),女,贵州遵义人,副研究员,博士,硕士生导师,E-mail:
参考文献
分享链接
https://castjournals.cast.org.cn/joweb/gfkjdxxb/CN/10.11887/j.issn.1001-2486.25050035
分享至
全文二维码

扫描看全文

引用本文
BibTeX
本文的引用情况
2种不同金属材料的力学参数

Family
属数
Number of
genus
种数
Number of
species
占总种数比例
Percentage of
total species (%)

Genus
种数
Number of
species
占总种数比例
Percentage of total
species (%)
鹅膏菌科Amanitaceae 2 11 5.26 鹅膏菌属 Amanita 10 4.78
小菇科 Mycenaceae 2 12 5.74 丝盖伞属 Inocybe 5 2.39
多孔菌科 Polyporaceae 8 14 6.70 蜡蘑属 Laccaria 5 2.39
红菇科 Russulaceae 3 23 11.00 小皮伞属 Marasmius 6 2.87
小菇属 Mycena 11 5.26
光柄菇属 Pluteus 5 2.39
红菇属 Russula 17 8.13
栓菌属 Trametes 5 2.39
关闭全屏