๐ค AI Summary
This study addresses the computational inefficiency in ternary large language model (LLM) inference arising from the lack of synergistic exploitation between sparsity and ternary characteristics. To overcome this limitation, we propose SSR, an acceleration method that introduces a dedicated ternary data format alongside a sparsity-aware scalable computation tree algorithm. By deeply integrating sparse segment reduction with ternary structures to optimize GEMM kernels for the first time, SSR achieves consistent performance gains across all sparsity levels both theoretically and empirically compared to RSR++. Specifically, it delivers 2.1รโ11.3ร GEMM speedups at 45%โ95% sparsity. Furthermore, end-to-end inference on Llama-3 is accelerated by 3.5รโ6.3ร while reducing memory footprint by 4.9%.
๐ Abstract
Large Language Models (LLMs) require substantial computational resources, limiting their deployment on resource-constrained hardware. Ternary LLMs mitigate these demands through weight quantization via ternary values, achieving significant compression often with 50-90% sparsity. However, existing approaches have limitations: methods optimized for ternary weights, such as BitNet, redundant segment reduction (RSR), and its improved version RSR++, do not exploit sparsity structures, while conventional sparse formats neglect ternary characteristics, foregoing dual optimization opportunities.
In this paper, we introduce Sparse Segment Reduction (SSR), a ternary matrix multiplication method designed to accelerate the inference of ternary LLMs and general Ternary Weight Networks (TWNs). SSR has a dedicated optimized ternary data format and an algorithm that systematically exploits sparsity patterns through computation trees that scale with the sparsity. SSR provides theoretical gains with asymptotically faster inference than RSR++ for sparsity above 50%, while practical evaluations reveal performance improvements across all sparsity levels. Evaluation results show that SSR achieves 2.1-11.3x speedup over RSR++ on ternary GEMM with 45-95% sparsity. Furthermore, SSR achieves 3.5-6.3x end-to-end speedup and 4.9% of memory saving over RSR++ on the Llama-3 1B model inference.