Abstract
The past year has witnessed the increasing popularity of Large Language Models (LLMs). Their unprecedented scale and associated high hardware cost have impeded their broader adoption, calling for efficient hardware designs. With the large hardware needed to simply run LLM inference, evaluating different hardware designs becomes a new bottleneck. This work introduces LLMCompass, a hardware evaluation framework for LLM inference workloads. LLMCompass is fast, accurate, versatile, and able to describe and evaluate different hardware designs. LLMCompass includes a mapper to automatically find performance-optimal mapping and scheduling. It also incorporates an area-based cost model to help architects reason about their design choices. Compared to real-world hardware, LLMCompass' estimated latency achieves an average 10.4% error rate across various operators with various input sizes and an average 4.1% error rate for LLM inference. With LLMCompass, simulating a 4-NVIDIA A100 GPU node running GPT-3 175B inference can be done within 16 minutes on commodity hardware, including 26,400 rounds of the mapper's parameter search. With the aid of LLMCompass, this work draws architectural implications and explores new cost-effective hardware designs. By reducing the compute capability or replacing High Bandwidth Memory (HBM) with traditional DRAM, these new designs can achieve as much as 3.41x improvement in performance/cost compared to an NVIDIA A100, making them promising choices for democratizing LLMs. LLMCompass is planned to be fully open-source.
Introduction
The rapid advancement of Large Language Models (LLMs) like GPT-4 has fundamentally changed the landscape of artificial intelligence. However, the massive scale of these models presents a significant hardware challenge. Serving a single instance of a model like GPT-3 (175B parameters) requires multiple high-end GPUs, such as the NVIDIA A100, just to accommodate the model weights. For computer architects, the design space for specialized LLM hardware is vast, yet current evaluation tools are either too simplistic (like Roofline models) or prohibitively slow (like cycle-level simulators). LLMCompass, developed by researchers at Princeton, addresses this gap by providing a fast, accurate, and versatile framework for evaluating LLM inference hardware.
The LLMCompass Framework
LLMCompass is designed to be a "Goldilocks" tool—balancing speed and accuracy. It consists of four primary components that work together to evaluate a hardware design's performance and cost.
Hardware Description Template
The framework uses a hierarchical template to describe hardware architectures. This hierarchy spans from the system level (e.g., a multi-GPU node) down to individual devices, cores, and lanes containing vector units and systolic arrays. This structured approach allows architects to easily define and modify hardware parameters.
Performance and Area Models
Instead of cycle-by-cycle simulation, LLMCompass employs a "tile-by-tile" performance model. It partitions the LLM's computational graph into blocks that fit within the hardware's memory hierarchy (Global and Local Buffers). The Mapper serves as the framework's optimization engine, performing an automated parameter search to find the most efficient mapping and scheduling for a given workload. Simultaneously, an Area and Cost Model estimates the silicon die area and dollar cost, incorporating factors like transistor counts for 7nm processes and the price difference between HBM and traditional DRAM.
Validation and Workloads
The framework was validated using the GPT-3 175B model as the primary workload. The authors compared LLMCompass's predictions against three major commercial platforms: the NVIDIA A100 (80GB), AMD MI210, and Google TPUv3. Validation focused on standard LLM operators—such as Matmul, Softmax, LayerNorm, and GELU—as well as communication primitives like All-reduce.
Architectural Insights
LLMCompass enables architects to explore design trade-offs that were previously difficult to quantify:
- Prefill vs. Decoding: LLM inference consists of a compute-bound "prefill" phase and an IO-bound "decoding" phase. While prefill benefits from large systolic arrays, decoding is almost entirely limited by memory bandwidth.
- Compute Over-provisioning: During the decoding phase, much of the compute power in high-end GPUs like the A100 remains idle. LLMCompass shows that reducing compute capability by half results in less than a 5% performance drop for decoding.
- Memory Hierarchy Trade-offs: While High Bandwidth Memory (HBM) is the industry standard, LLMCompass suggests that for throughput-oriented background tasks, traditional DRAM can be more cost-effective. By utilizing many PCIe/CXL channels, DRAM allows for larger batch sizes that offset its lower individual bandwidth.
Key Results and Implications
LLMCompass demonstrates remarkable efficiency and accuracy. Simulating a 4-GPU node running GPT-3 inference takes only 16 minutes on a standard desktop, achieving a 4.1% error rate for full LLM inference compared to real-world measurements.
Using the framework, the researchers identified two novel hardware designs:
- Latency-Oriented Design: Reduces die area by 42.1% while maintaining over 95% of the A100's performance.
- Throughput-Oriented Design: By substituting HBM with DRAM, this design achieves a 3.41x improvement in performance-per-cost compared to the NVIDIA A100.
Conclusion
LLMCompass provides a much-needed bridge for hardware architects navigating the complex requirements of LLM inference. By enabling rapid iteration and accurate performance/cost modeling, it paves the way for more accessible and efficient AI hardware. The researchers plan to open-source the framework and expand its capabilities to include LLM fine-tuning workloads.
Summary updated