TL;DR
Tilus is a novel domain-specific language (DSL) and virtual machine that enables highly efficient GPU programming for arbitrary low-precision data types (from 1 to 8 bits). By exposing a thread-block-level programming model and an algebraic layout system, Tilus eliminates costly shared-memory layout conversions and outperforms state-of-the-art GPU compilers and hand-optimized kernels by up to 2.61×.
What Problem Does This Paper Address?
To serve Large Language Models (LLMs) efficiently, researchers frequently turn to quantization—reducing the bit-width of weights and activations to save memory bandwidth and storage. While 4-bit and 8-bit quantization are widely supported, intermediate bit-widths (like 3, 5, 6, or 7 bits) offer a much better compromise between model accuracy and computational efficiency.
However, writing high-performance GPU kernels for these non-power-of-two bit-widths is notoriously difficult. Existing tile-based compilers like Triton abstract away the GPU memory hierarchy, forcing developers to perform manual bit-unpacking and costly layout conversions in shared memory. On the other hand, schedule-oriented compilers like Ladder rely on type-level packing, which restricts them to powers-of-two and prevents critical optimizations like software pipelining.
Methods
The authors introduce Tilus, a Single-Instruction-Multiple-Block (SIMB) programming language backed by a virtual machine designed specifically for low-precision GPGPU computing. Tilus relies on three core pillars:
- Thread-Block-Level Programming Model: Instead of writing code at the individual thread level (SIMT), Tilus operates at the granularity of thread blocks. It explicitly exposes the GPU memory hierarchy (registers, shared memory, and global memory), giving programmers fine-grained control over data movement and pipelining.
- Algebraic Layout System: Tilus models how tensor elements are distributed across threads using an algebraic formulation. It defines two primitive layouts:
local(elements within a single thread) andspatial(elements distributed across threads). Complex layouts required by hardware Tensor Cores are composed using the Kronecker product ($\otimes$) of these primitives. - Tile-Level Reinterpretation: Instead of packing data at the individual data-type level, Tilus performs reinterpretation at the tile level. If two register tensors share the same number of threads and total bits per thread, Tilus can reinterpret one layout into another at zero cost, entirely within registers.
Datasets
The framework was evaluated on matrix multiplication (GEMM) workloads extracted from three representative LLMs:
- Gemma-2-9B
- Qwen2.5-32B
- Llama-3.3-70B-Instruct
The evaluations cover both the prefill (context processing) and decode (token generation) stages across various batch sizes.
Key Insights and Ideas
- Ditch Shared Memory for Layout Conversions: Traditional compilers load low-precision data, unpack it, and then write it back to shared memory to rearrange the layout for Tensor Cores. Tilus proves that by mathematically tracking layouts using Kronecker products, these conversions can happen entirely within registers via vectorized casting instructions (like CUDA's
PRMTandLOP3), bypassing the shared memory bottleneck. - Tile-Level vs. Type-Level Packing: Instead of trying to force a 6-bit integer into a standard type container, Tilus packs the entire tensor tile contiguously in global memory. When loaded into registers, the bits are reinterpreted based on the total bit budget per thread (e.g., reinterpreting 3 bytes of
uint8into 4 elements ofint6).
Key Results
Tilus was benchmarked on NVIDIA L40S, A100, and H100 GPUs against vendor libraries (cuBLAS), compilers (Triton, Ladder), and hand-optimized kernels (QuantLLM, Marlin).
- Operator-Level Speedups: Tilus consistently outperforms all baselines across a full spectrum of quantized types (from 1-bit to 8-bit, including integers and floats). Compared to Triton, Ladder, QuantLLM, and Marlin, Tilus achieves average performance improvements of 1.75×, 2.61×, 1.29×, and 1.03×, respectively.
- End-to-End LLM Serving: When integrated into the vLLM serving framework, Tilus significantly reduces latency during the decode stage for batch sizes greater than one, where memory bandwidth is the primary bottleneck.
- Cross-Architecture Robustness: Tilus successfully generated highly efficient kernels across Ampere (A100), Ada Lovelace (L40S), and Hopper (H100) architectures, whereas compilers like Ladder failed to generate valid kernels on Hopper.
Limitations and Future Work
- Focus on GEMM: The current implementation and evaluation of Tilus focus primarily on quantized matrix multiplications, which dominate LLM execution time. Extending the algebraic layout system to other irregular or ragged tensor operations remains future work.
- Compilation Overhead: Auto-tuning a Tilus program involves exploring around 200 configurations per operator, taking about one minute to compile. While acceptable for ahead-of-time compilation, further optimization of the compiler pass could improve development velocity.
Summary updated