TranSQL+:在低资源硬件上使用 SQL 服务大语言模型
TranSQL+: Serving Large Language Models with SQL on Low-Resource Hardware
AI总结:
本文提出 TranSQL+,将大语言模型计算图转换为纯 SQL 查询在关系数据库中执行,并通过行转列优化提升矩阵运算效率,在低资源 CPU 环境下实现预填充延迟最多降低 20 倍、解码速度最多提高 4 倍。
摘要:
在资源受限设备上部署大语言模型(LLMs)仍然具有挑战性,原因包括内存有限、缺乏 GPU 以及现有运行时的复杂性。本文提出了 TranSQL+,一个基于模板的代码生成器,将 LLM 计算图转换为纯 SQL 查询,以便在关系数据库中执行。TranSQL+ 不依赖外部库,利用成熟的数据库特性(如向量化执行和核外处理)实现高效推理。我们进一步提出了一种行转列(ROW2COL)优化,以提高矩阵运算中的连接效率。在 Llama3-8B 和 DeepSeekMoE 模型上的评估表明,在低内存和仅 CPU 配置下,与 DeepSpeed Inference 和 Llama.cpp 相比,TranSQL+ 的预填充延迟最多降低 20 倍,解码速度最多提高 4 倍。我们的结果凸显了关系数据库作为低资源硬件上 LLM 的实用环境。
英文摘要:
Deploying Large Language Models (LLMs) on resource-constrained devices remains challenging due to limited memory, lack of GPUs, and the complexity of existing runtimes. In this paper, we introduce TranSQL+, a template-based code generator that translates LLM computation graphs into pure SQL queries for execution in relational databases. Without relying on external libraries, TranSQL+, leverages mature database features, such as vectorized execution and out-of-core processing, for efficient inference. We further propose a row-to-column (ROW2COL) optimization that improves join efficiency in matrix operations. Evaluated on Llama3-8B and DeepSeekMoE models, TranSQL+ achieves up to 20x lower prefill latency and 4x higher decoding speed compared to DeepSpeed Inference and Llama.cpp in low-memory and CPU-only configurations. Our results highlight relational databases as a practical environment for LLMs on low-resource hardware.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。