nncase:一种面向异构存储架构高效大语言模型部署的端到端编译器
nncase: An End-to-End Compiler for Efficient LLM Deployment on Heterogeneous Storage Architectures
AI总结:
nncase通过端到端编译框架实现高效大语言模型部署,整合三个核心模块提升异构存储架构下的性能表现。
摘要:
大语言模型(LLMs)的高效部署受到内存架构异质性阻碍,传统编译器面临流程碎片化和高适应成本问题。我们提出了nncase,一种开源的端到端编译框架,旨在统一不同目标的优化。nncase的核心是一个基于e-graph的术语重写引擎,通过缓解相序问题,实现计算和数据移动策略的全局探索。该框架集成了三个关键模块:Auto Vectorize用于适应异构计算单元,Auto Distribution用于搜索并行策略并进行成本感知的通信优化,Auto Schedule用于最大化芯片上缓存局部性。此外,一个缓冲区感知的Codegen阶段确保了高效的内核实例化。评估显示,nncase在Qwen3系列模型上优于主流框架如MLC LLM和Intel IPEX,并在CPU上达到与手工优化的llama.cpp相当的性能,证明了自动化编译在高性能LLM部署中的可行性。源代码可在https://github.com/kendryte/nncase获取。
英文摘要:
The efficient deployment of large language models (LLMs) is hindered by memory architecture heterogeneity, where traditional compilers suffer from fragmented workflows and high adaptation costs. We present nncase, an open-source, end-to-end compilation framework designed to unify optimization across diverse targets. Central to nncase is an e-graph-based term rewriting engine that mitigates the phase ordering problem, enabling global exploration of computation and data movement strategies. The framework integrates three key modules: Auto Vectorize for adapting to heterogeneous computing units, Auto Distribution for searching parallel strategies with cost-aware communication optimization, and Auto Schedule for maximizing on-chip cache locality. Furthermore, a buffer-aware Codegen phase ensures efficient kernel instantiation. Evaluations show that nncase outperforms mainstream frameworks like MLC LLM and Intel IPEX on Qwen3 series models and achieves performance comparable to the hand-optimized llama.cpp on CPUs, demonstrating the viability of automated compilation for high-performance LLM deployment. The source code is available at https://github.com/kendryte/nncase.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。