Optimizing the arithmetic circuits at the heart of our CPUs and GPUs—like adders and multipliers—is a classic "needle in a haystack" problem. With a design space that grows exponentially with bit-width, finding the perfect balance between speed (delay) and size (area) is incredibly difficult. A new paper, AC-Refiner, proposes a radical shift: treating circuit optimization as a conditional image generation task using diffusion models.
TL;DR
AC-Refiner leverages conditional diffusion models to generate high-performance arithmetic circuits (multipliers and adders) by representing them as image-like bitmaps. By using a neural cost predictor to guide the "denoising" process toward specific performance targets, it achieves up to a 15% reduction in delay and a 10% reduction in area compared to state-of-the-art reinforcement learning methods.
What Problem Does This Paper Address?
In digital design, there is often a "reality gap" between theoretical logic optimization and actual physical implementation. A circuit that looks fast on paper might suffer from massive routing congestion or capacitive loading once it's actually laid out on a chip.
Existing automated approaches have significant drawbacks:
- Reinforcement Learning (RL): While powerful, RL agents require expensive, iterative "trial-and-error" with physical synthesis tools, making them computationally prohibitive for large circuits.
- Variational Autoencoders (VAEs): These can generate designs quickly but often struggle with the fine-grained structural constraints required for valid hardware, leading to "broken" circuits.
The authors sought a method that could explore the design space more efficiently than RL while maintaining higher structural integrity than VAEs.
Methods
The core innovation of AC-Refiner is reframing circuit structures as multi-dimensional binary bitmaps.
- Circuit-to-Image Mapping: Compressor trees (for multipliers) and prefix trees (for adders) are encoded into tensors. For example, a compressor tree is represented as a 3D tensor where different layers represent different stages of compression.
- Conditional Diffusion: The framework uses a standard Denoising Diffusion Probabilistic Model (DDPM). It starts with random noise and gradually "denoises" it into a valid circuit bitmap.
- Gradient-Guided Sampling: To ensure the model generates good circuits, not just valid ones, the authors train a Neural Cost Predictor (a 3-layer CNN). During the denoising process, the gradient from this predictor steers the generation toward a specific target Quality-of-Result (QoR).
- Self-Reflection: To prevent the guidance gradients from pushing the design into "invalid" territory, the authors implement a "self-reflection" step that re-injects a small amount of noise, keeping the intermediate states within the learned distribution of valid designs.
- Iterative Fine-Tuning: The best designs discovered during exploration are added back into the training set. This "closes the loop," focusing the diffusion model's attention on the Pareto frontier (the set of optimal trade-offs between area and delay).
Datasets
The authors generated their own training data using heuristic algorithms to modify manual designs:
- Initial Unlabeled Dataset ($D_0$): ~15,000 unlabeled circuit samples.
- Initial Labeled Dataset ($\hat{D}_0$): 1,000 designs evaluated using a full VLSI flow (Yosys and OpenROAD) to obtain ground-truth delay and area metrics.
- Technology Node: All evaluations were performed using the NanGate 45nm technology process library.
Key Insights and Ideas
- The Power of Parallelism: Unlike RL, which is inherently sequential (one action after another), diffusion models allow for "massively parallel sampling." You can generate 1,000 candidate designs simultaneously and then pick the best ones to synthesize.
- Bitmaps as a Universal Language: By converting complex tree structures into bitmaps, the authors can leverage powerful computer vision architectures (like U-Nets) that are already highly optimized for capturing spatial patterns.
- Guided Denoising vs. Search: Instead of searching for a design, AC-Refiner sculpts one. The cost predictor acts like a sculptor's guide, telling the model which "bits" of noise to remove to reveal a high-speed circuit.
- Heuristic Legalization: Even with diffusion, the model occasionally makes minor mistakes (e.g., over-compressing a column). The authors use a lightweight heuristic "legalizer" to fix these small errors, ensuring every generated design is functionally correct.
Key Results
The authors compared AC-Refiner against several baselines, including the Wallace tree, GOMIL (ILP-based), and RL-based methods like ArithmeticTree.
- Pareto Dominance: AC-Refiner consistently found designs that were both smaller and faster than all baselines across 8-bit to 64-bit multipliers.
- Performance Gains: Compared to the previous state-of-the-art (ArithmeticTree), AC-Refiner achieved:
- Up to 15% reduction in delay.
- Up to 10% reduction in area.
- Efficiency: The framework significantly reduces the bottleneck of invoking heavy EDA tools by focusing synthesis efforts only on the most promising candidates generated by the model.
Limitations and Future Work
- Fixed Bit-Widths: Currently, the models are trained for specific bit-widths (e.g., a model for 32-bit multipliers). The authors suggest that future work could explore variable-width components or more generalized architectures.
- Legalization Dependency: While the diffusion model is highly accurate, it still relies on a heuristic post-processing step to guarantee 100% functional correctness.
- Broader Application: The current work focuses on multipliers and adders. Extending this "circuit-as-image" approach to other complex logic blocks (like floating-point units or custom accelerators) remains an open challenge.
Summary updated