Matrix-Vector (MVM) and Matrix-Matrix Multiplications (MMM) are critical kernels in LLM inference. While prefill processes multiple tokens concurrently and is dominated by compute-intensive MMM, decode repeatedly executes memory-intensive MVM for single-token generation. This work investigates the memory-hierarchy and scalability of SIMD based LLM inference on multicore systems without GPUs. We propose LinScaleLLM, a memory hierarchy organization for SIMD multicore architectures, featuring private L1 and L2 caches per core and shared L3 cache and DRAM controller or channel resources among clusters of four cores. We characterize SIMDized MVM and show that reduced arithmetic work increases weight-consumption rates, making L2 latency a primary scaling bottleneck. To address this, we investigate a lightweight, latency aware private L2 prefetching strategy that decouples prefetch lookahead from degree. For regular MVM access streams, deeper lookahead with a low prefetch degree improves timeliness without substantially increasing DRAM traffic. The D12/K1 configuration (12 cache lines ahead, degree 1) achieves an L2 demand-miss rate of approximately 3.3% up to 16 cores. With improved prefetch timeliness, memory bandwidth becomes the dominant scalability constraint. Scaling memory-controller resources with core count restores scalability, achieving up to 127.55x speedup on 64 cores, with MVM performance comparable to standard and high-end GPUs. For complete llama.cpp decode steps of Llama3.21B simulated in Sniper simulator, LinScaleLLM achieves 114.0x speedup on 64 cores over a single scalar core without prefetching. We also characterize SIMDized prefill, demonstrating substantial MMM data-reuse benefits, with up to 12.20x SIMD speedup on a single core and 71.23x overall speedup on 64 cores over the single-core non-SIMD baseline.
翻译:暂无翻译