Introduction
Dense Matrix Multiply (MM) operations are the cornerstone of modern deep learning, representing approximately 90% of the inference workload in data centers. To meet the computational demands of these operations, hardware design has shifted toward heterogeneous architectures. A prime example is the AMD Versal ACAP, which integrates general-purpose CPUs, programmable logic (FPGA), and dedicated ASIC-like AI Engines (AIE).
However, a significant "mismatch bottleneck" exists in current deployment strategies. Real-world models like BERT or Vision Transformers (ViT) are composed of diverse layers with varying matrix dimensions. Traditional "monolithic" accelerators—designed as a single, large compute block—excel at processing large matrices but suffer from extreme inefficiency when handling smaller ones. In these cases, compute units often sit idle or spend cycles on "padding" data, sometimes achieving less than 5% of their theoretical peak performance. Conversely, a fleet of small, identical accelerators fails to exploit the data reuse opportunities inherent in large matrices.
The CHARM Framework
To address this efficiency gap, we present CHARM (Composing Heterogeneous Accelerators for Matrix Multiply). CHARM is a comprehensive framework that automatically composes multiple, specialized accelerators on a single chip to match the diverse requirements of modern neural networks. The framework consists of four primary layers:
1. CDSE: Single-Accelerator Design Space Exploration
Before composing multiple units, CHARM optimizes the individual building blocks. The CDSE module uses an analytical model-based search to determine the optimal tiling and hardware parameters for a single accelerator. This ensures that each sub-accelerator can achieve near-peak efficiency (up to 95%) for its specific target matrix shape.
2. CDAC: Diverse Accelerator Composer
The CDAC is the framework's core innovation. It utilizes a sort-based, two-step algorithm to partition the chip's available resources. Instead of a one-size-fits-all approach, CDAC groups matrix operations by size and assigns them to specialized "sub-accelerators" of varying shapes and sizes that operate concurrently on the silicon.
3. CACG: Automatic Code Generation
Programming heterogeneous architectures is notoriously difficult, often requiring expertise in C++, hardware description languages (HLS), and host-side management. CACG automates this entire stack, generating the AIE kernel code, the HLS for the programmable logic, and the host-side control code, effectively turning a hardware design problem into a software compilation task.
4. CRTS: Runtime Scheduler
The CRTS manages the execution of the model's dependency graph. By scheduling tasks across the diverse set of generated accelerators, it ensures maximum hardware overlap and minimizes overall latency during inference.
Evaluation and Results
We evaluated the CHARM framework using an AMD/Xilinx Versal ACAP VCK190 board across four representative deep learning workloads: BERT (NLP), ViT (Vision), NCF (Recommendation), and MLP (Classification).
Performance Gains
CHARM demonstrated substantial throughput improvements over traditional monolithic designs:
- Vision Transformer (ViT): Achieved a 32.51× increase in throughput.
- BERT: Achieved a 5.29× increase in throughput.
- Peak Performance: Reached up to 2.94 TFLOPs for MLP workloads.
Efficiency and Utilization
Beyond raw speed, CHARM significantly improved hardware utilization. Single-kernel efficiency reached 95%, a marked improvement over previous state-of-the-art implementations. Furthermore, the framework provided a 1.93× gain in energy efficiency (GFLOPs/W) compared to traditional FPGA-only designs that rely solely on DSP blocks.
Key Insights
Our research highlights that the "padding tax" is a critical barrier to performance; running small BERT layers on a monolithic accelerator can be over 6,000 times slower than large layers relative to theoretical peaks. By allowing large accelerators (optimized for data reuse) and small accelerators (optimized for parallelism) to coexist, CHARM bridges the gap between theoretical hardware potential and real-world model performance.
Future Work
While CHARM represents a significant advancement, future iterations will focus on dynamic bandwidth partitioning to better allocate off-chip memory resources between sub-accelerators. Additionally, we aim to expand the framework beyond dense Matrix Multiply to include support for convolutions and sparse matrix operations, creating a more universal acceleration solution for the evolving landscape of AI models.
Summary updated