Breaking the Memory Wall: The Rise of In-Memory Computing for AI #
💸 The Economic Barrier of AI Inference #
Generative AI provides massive commercial opportunities by improving efficiency. However, a significant hurdle remains: the high cost of running inference.
We already see the staggering expenses associated with training Large Language Models (LLMs). Massive GPU clusters and high electricity bills define the current landscape. Analysts estimate that Meta could spend $15 billion on GPUs in 2024 alone. Generative AI requires immense memory and bandwidth to calculate weights and process data. This creates a massive barrier to large-scale model deployment. Even Sam Altman of OpenAI has noted that without a breakthrough, these goals remain out of reach, leading to increased investment in nuclear fusion to power the demand.
While CPUs, GPUs, and custom accelerators are the current standards, even the most advanced solutions are hampered by traditional Von Neumann architecture. Custom ASICs, FPGAs, and APUs provide specialized controllers with higher memory bandwidth, but they still require massive amounts of RAM to store models. This makes economically delivering generative AI at scale nearly impossible with current designs.
🧱 The Von Neumann Bottleneck and the “Memory Wall” #
As enterprises deploy more AI models, the demand for inference capacity will surge. Today’s models are significantly larger than previous non-generative machine learning models, requiring more computation and memory.
Inference costs depend on both model size and input prompt length. For instance, increasing a prompt from 8K to 32K can double the running cost of GPT-4. Conversely, the speed at which a model generates output tokens is a key metric for user experience. Memory bandwidth is essential here, but the limitations of legacy architectures exacerbate both inference costs and power consumption.
The “Memory Wall” is a term coined by William Wulf and Sally McKee in 1995. It describes both limited capacity and the bandwidth of storage transfers. While distributed inference can bypass the memory limits of a single accelerator, it introduces new communication bottlenecks. Moving data between accelerators is slower and less efficient than moving data within a single chip.
⚡ The Energy Cost of Data Movement #
Generating content from trained weights requires a high volume of tiny calculations. These usually involve General Matrix Multiply (GEMM) operations. GEMM does not require massive processors, but it does require fast, efficient, small-scale computation.
This is where the memory wall creates a bottleneck. For every operation, data must travel between DDR RAM and the processor, and between different processors. Even if this journey is only a few millimeters, the separation of storage and computation in Von Neumann architecture consumes time and energy.
The energy disparity is stark. Every time data moves across the memory bus, a DRAM access consumes approximately 60 picojoules per byte. In contrast, the actual calculation requires only 50-60 femtojoules. This means moving data consumes 1,000 times more energy than using the data itself. When these costs accumulate across millions of user prompts and thousands of servers in global data centers, the need for radical hardware shifts becomes clear.
🧠 In-Memory Computing (IMC) as a Solution #
If moving data between storage and processing is so inefficient, the logical step is to move the computation into the memory itself. In-Memory Computing (IMC) has emerged as a promising alternative by performing Multiply-Accumulate (MAC) operations directly within or near memory units.
Research from Purdue University indicates that IMC architectures can reduce energy consumption to 0.12x compared to established machine learning inference baselines. The MICAS center at KU Leuven supports IMC, highlighting its ability to reduce access overhead and enable massive parallelization. These capabilities can lead to orders of magnitude improvements in energy efficiency and throughput.
🔢 Digital vs. Analog IMC #
Early exploration in this field often viewed analog IMC as an effective way to evaluate weights and run inference on pre-trained LLMs. However, analog methods require expensive analog-to-digital converters (ADCs) and additional error-checking mechanisms.
Digital In-Memory Computing (DIMC) offers a different path. It avoids the challenges of analog IMC by providing noise-free computation and greater spatial mapping flexibility. While DIMC may sacrifice some area efficiency compared to analog, it provides the flexibility and reliability needed for future AI demands. Research from KU Leuven also suggests SRAM as a preferred solution for IMC. Compared to Non-Volatile Memory (NVM) solutions, SRAM offers higher reliability and stability.
DIMC has the potential to transform AI inference by lowering costs and improving performance. As generative AI adoption accelerates, shifting computation into memory is a practical path to reducing power and costs. By eliminating unnecessary data movement, we can significantly improve AI efficiency and the economic viability of future AI systems.
For developers working on high-performance embedded systems where real-time constraints and hardware efficiency are critical, exploring these architectural shifts is essential. You can find more information on high-performance real-time systems at https://www.vxworks.net or explore specific hardware integration notes at https://www.vxworks7.com.