Foundations of AI Workloads and the Need for Specialized Accelerators
> 📌 Side Note (Digital Edition): For readers new to the AI hardware landscape, this chapter builds a foundational mental model before diving into specific accelerator architectures. Key terms are hyperlinked to their definitions in the book’s online glossary for quick reference.
The modern AI revolution, catalyzed by the 2012 debut of AlexNet[^1], has fundamentally shifted the compute demands of the computing industry. Where traditional workloads like transaction processing or web serving relied on sequential, latency-sensitive operations, modern AI workloads—from image classification to large language model (LLM) inference—are defined by massive parallelism, irregular memory access patterns, and strict constraints on power, latency, and cost. General-purpose central processing units (CPUs), designed over decades to handle a broad range of sequential and lightly parallel tasks, are increasingly unable to meet these demands, creating a market opportunity for specialized AI accelerators. This chapter first characterizes the unique properties of AI workloads, then quantifies the bottlenecks of general-purpose hardware, defines the core performance metrics used to evaluate accelerators, and concludes with a high-level map of the accelerator design space to frame the deep dives into specific architectures in subsequent chapters.
1.1 The Unique Characteristics of Modern AI Workloads
At their core, nearly all modern AI workloads are built on linear algebra operations: matrix multiplications, convolutions, element-wise arithmetic, and non-linear activation functions. While these operations are mathematically simple, their scale and access patterns create unique challenges for hardware design. We break down their defining traits below, with concrete examples from common model families.
1.1.1 Massive Data Parallelism
AI workloads are *embarrassingly parallel* at the operation level: a single matrix multiplication of size $M \times K$ and $K \times N$ requires $M \times N \times K$ multiply-accumulate (MAC) operations that are fully independent of each other, with no control flow dependencies between individual MACs. For context, a single forward pass of the 70-billion parameter LLaMA-2 model requires ~140 trillion FLOPs (floating-point operations) for FP16 precision[^2]. Even for small edge models like MobileNetV3, a single inference requires ~300 million MAC operations.
This parallelism is hierarchical, spanning three levels: 1. Inter-layer parallelism: Different layers of a neural network can be executed in parallel if their input dependencies are satisfied. 2. Intra-layer parallelism: Operations within a single layer (e.g., different output channels of a convolution, different rows of a matrix multiplication) can be parallelized. 3. Operation-level parallelism: Individual MAC operations within a single matrix or convolution can be executed simultaneously.
For general-purpose CPUs, this level of parallelism is poorly matched to their design: even high-end server CPUs have only 40–80 cores, each capable of executing at most 4–8 floating-point operations per cycle via SIMD (Single Instruction, Multiple Data) extensions like AVX-512. A 40-core Xeon CPU, for example, has a theoretical FP16 throughput of ~1.2 TOPS (trillion operations per second), while a single matrix multiplication for a 4096×4096 matrix (common in LLM layers) would require ~134 million MAC operations, taking ~110ms on the CPU even with perfect utilization—far too slow for real-time applications.
1.1.2 Irregular and Memory-Intensive Access Patterns
While the compute operations in AI workloads are regular, their memory access patterns are often highly irregular, creating a bottleneck that is as important as raw compute throughput. We illustrate this with two common layer types:
- **Convolutional layers**: For a standard 2D convolution with kernel size $K \times K$, stride $S$, and padding $P$, each output pixel requires accessing a $K \times K$ region of the input feature map. For layers with small stride (e.g., $S=1$) and large input dimensions (e.g., 224×224 for ImageNet models), this creates strided access patterns that are poorly predicted by CPU hardware prefetchers, which are optimized for sequential access.
- **Transformer self-attention layers**: The core operation of self-attention is the softmax of the product of query ($Q$) and key ($K$) matrices, followed by a multiplication with the value ($V$) matrix. For a sequence length $L$ and hidden dimension $D$, this requires accessing $Q, K, V$ matrices of size $L \times D$, with access patterns that change dynamically based on input sequence length. For long-context LLMs with $L=32,768$, the intermediate attention matrix alone is $32k \times 32k$, requiring 4GB of memory for FP16 precision—far larger than the on-chip caches of most CPUs and even many GPUs.
A key metric to quantify this memory intensity is *arithmetic intensity*, defined as the ratio of FLOPs to bytes of memory accessed per operation: $$I = \frac{\text{Total FLOPs}}{\text{Total memory bytes accessed}}$$ For a matrix multiplication of size $M \times K$ and $K \times N$ with FP16 precision (2 bytes per element), the arithmetic intensity is: $$I = \frac{2 \times M \times N \times K}{2 \times (M \times K + K \times N + M \times N)} = \frac{MNK}{MK + KN + MN}$$ For square matrices of size $N \times N$, this simplifies to $I = \frac{N}{3}$. For a 4096×4096 matrix multiplication, $I = 1365$ FLOP/Byte. For Transformer attention layers, arithmetic intensity can be as low as 10–50 FLOP/Byte for long sequences, meaning the workload is *memory-bound*: performance is limited by memory bandwidth, not raw compute throughput.
1.1.3 Strict Constraints on Latency, Power, and Cost
AI workloads are deployed across three vastly different environments, each with unique constraints: 1. Data centers: For large model training and batch inference, the primary constraints are throughput (requests processed per second) and performance-per-watt, as electricity costs and cooling requirements dominate total cost of ownership (TCO). A typical hyperscale data center has a power budget of ~40kW per rack, so accelerators must maximize useful compute per watt of power consumed. 2. Edge devices: For applications like autonomous driving, smart cameras, and industrial robotics, latency is the primary constraint: inference must complete in <10ms to meet real-time requirements, and power consumption is limited to 10–50W to avoid overheating and reduce battery drain for battery-powered devices. 3. Endpoint devices: For smartphones, wearables, and smart speakers, power consumption is the dominant constraint: inference must complete in <100ms while consuming <1W of power to preserve battery life, and device cost must stay under $10–20 for mass deployment.
These constraints are often mutually exclusive: a data center accelerator optimized for maximum throughput may consume 400W of power and cost $10,000, making it completely unsuitable for edge or endpoint deployment. Specialized accelerators are designed to target one or more of these deployment scenarios, trading off generality for efficiency in their target use case.
1.2 Limitations of General-Purpose CPUs for AI Workloads
The CPU has been the backbone of general-purpose computing for decades, but its design is fundamentally mismatched to the requirements of AI workloads. Three interrelated bottlenecks, known as the *memory wall*, *power wall*, and *instruction wall*, explain why CPUs cannot keep pace with specialized accelerators.
1.2.1 The Memory Wall
The memory wall refers to the growing gap between CPU clock speed (and thus compute throughput) and DRAM access latency/bandwidth. Over the past 20 years, CPU clock speeds have increased from ~1GHz to ~4GHz (4x), while DRAM bandwidth has increased from ~10GB/s to ~400GB/s for DDR5 (40x), but the latency of DRAM access has remained nearly constant a