DCC: Data-Centric Compilation of Machine Learning Kernels for Processing-In-Memory Architectures
This paper presents DCC, the first data-centric compiler for Processing-In-Memory (PIM) systems that jointly optimizes data rearrangements and compute code to overcome memory access mismatches, achieving significant speedups in machine learning kernels and large language model inference across diverse PIM architectures.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are running a massive library (a Machine Learning model) where you need to find specific books (data) to answer questions.
The Problem: Two Different Librarian Styles
In a traditional computer, you have a super-fast librarian (the GPU) who works in a huge central office. To work fast, this librarian needs books arranged in a specific way: Book 1, Book 2, and Book 3 must be on different shelves so the librarian can grab them all at the same time from different aisles.
However, you also have a new, super-efficient assistant (the PIM device) who works right next to the bookshelves. This assistant is incredibly fast at reading, but they can only reach the books on their own specific shelf. If the books are scattered across different aisles, the assistant has to run back and forth, which is slow.
To use this new assistant, you have to take the books, rearrange them so Books 1, 2, and 3 are all on the same shelf for the assistant, let them do the work, and then rearrange the books again to put them back in the central office format for the main librarian.
The Old Way: Doing it by Hand
Previously, programmers had to manually figure out the best way to shuffle these books. They had to guess: "Should I put 10 books on this shelf? Or 20?" If they guessed wrong, the assistant spent more time shuffling books than actually reading them. This was like trying to organize a library by hand while the clock is ticking—it was slow, error-prone, and different libraries (different hardware) required completely different shuffling rules.
The Solution: DCC (The Smart Librarian's Assistant)
The paper introduces DCC, a new "smart system" that acts like a master planner for this library. Instead of just telling the assistant what to read, DCC figures out the best way to arrange the books and the best way to tell the assistant to read them, all at the same time.
Here is how DCC works, using simple metaphors:
The Universal Translator (Multi-Layer Abstraction):
Different libraries have different layouts (some have 4 aisles, some have 8). DCC speaks a universal language. It doesn't care if you are using a Samsung library or an SK Hynix library; it translates the "book arrangement rules" into a format it understands, so it can work with any hardware.The "What-If" Simulator (Data-Centric Schedule Generator):
Instead of guessing, DCC runs thousands of simulations in its head. It asks: "What if we put 4 books on Shelf A? What if we put 8?" It looks at the entire process—the shuffling time plus the reading time.- The Old Way: "Let's make the reading super fast!" (Ignoring that the shuffling takes forever).
- DCC's Way: "If we change the reading plan slightly, we can cut the shuffling time in half. That's the real winner." It finds the perfect balance between moving books and reading them.
The Speed Predictor (Coupled Performance Predictor):
DCC is like a seasoned coach who has watched thousands of games. It doesn't need to run every single simulation to know which one will win. It uses a "learning model" to predict the fastest plan instantly. This means it doesn't waste time testing bad ideas.The Traffic Controller (Code Optimizer):
Once DCC picks the best plan, it organizes the traffic. It ensures that when the assistant grabs books, they grab them in perfect batches (like grabbing a whole stack of books at once) so no time is wasted waiting for the next book.
The Results: How Much Faster?
The paper tested this system on real-world tasks, like running Large Language Models (the AI that writes text or answers questions).
- The Speed Boost: On one type of hardware (AttAcc), DCC made the AI 13 times faster than using just the main computer (GPU). On another type (HBM-PIM), it was 7.7 times faster.
- The Real-World Test: When running a full conversation with an AI (like GPT-3 or LLaMA-2), DCC made the whole process 4.5 times faster on average.
- The "Magic" Trick: The biggest surprise was that the old methods focused only on making the "reading" part fast. DCC realized that the "shuffling" part was actually the bottleneck. By fixing the shuffling and the reading together, it unlocked massive speed gains.
In Summary
Think of DCC as the ultimate traffic controller for a busy city. Before, traffic lights were set based only on how fast cars could drive, ignoring the traffic jams at the intersections. DCC looks at the whole map, realizes the jams are the problem, and changes the traffic light timing and the road layout simultaneously to make the whole city move much faster.
The paper claims this is the first system to do this "joint optimization" for AI tasks on these new memory devices, making them practical and incredibly fast for the future of AI.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.