TranSQL+: Serving Large Language Models with SQL on Low-Resource Hardware

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Sun, Wenbo, Guo, Qiming, Wang, Wenlu, Hai, Rihan
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866908548619829248
author Sun, Wenbo
Guo, Qiming
Wang, Wenlu
Hai, Rihan
author_facet Sun, Wenbo
Guo, Qiming
Wang, Wenlu
Hai, Rihan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2502_02818
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle TranSQL+: Serving Large Language Models with SQL on Low-Resource Hardware
Sun, Wenbo
Guo, Qiming
Wang, Wenlu
Hai, Rihan
Databases
Machine Learning
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.
title TranSQL+: Serving Large Language Models with SQL on Low-Resource Hardware
topic Databases
Machine Learning
url https://arxiv.org/abs/2502.02818