Logic Synthesis Meets Machine Learning: Trading Exactness for Generalization

Shubham Rai, Walter Lau Neto, Yukio Miyasaka, Xinpei Zhang, Mingfei Yu, Qingyang Yi, Masahiro Fujita, Guilherme B. Manske, Matheus F. Pontes, Leomar S. da Rosa Jr., Marilton S. de Aguiar, Paulo F. Butzen, Po-Chun Chien, Yu-Shan Huang, Hoa-Ren Wang, Jie-Hong R. Jiang, Jiaqi Gu, Zheng Zhao, Zixuan Jiang, David Z. Pan, Brunno A. Abreu, Isac de Souza Campos, Augusto Andre Souza Berndt, Cristina Meinhardt, Jonata T. Carvalho, Mateus Grellert, Sergio Bampi, Aditya Lohana, Akash Kumar, Wei Zeng, Azadeh Davoodi, Rasit Onur Topaloglu, Yuan Zhou, Jordan Dotzel, Yichi Zhang, Hanyu Wang, Zhiru Zhang, Valerio Tenace, Pierre-Emmanuel Gaillardon, Alan Mishchenko, Satrajit Chatterjee

TL;DR

This paper explores the convergence of hardware logic synthesis and machine learning by challenging researchers to build small Boolean circuits that generalize from incomplete data. The results demonstrate that by sacrificing a tiny fraction of exactness, designers can achieve massive reductions in circuit area, paving the way for highly efficient approximate computing and hardware-accelerated AI.

What Problem Does This Paper Address?

In traditional hardware design, logic synthesis is an exact science: a circuit must perfectly implement a Boolean function for every possible input in its "care set." Conversely, machine learning (ML) is the art of generalization: a model learns from a subset of data (training set) to predict outcomes for unseen inputs (test set).

The authors address the gap between these fields. As we move toward an era of approximate computing and embedded AI, do we always need 100% exact hardware? If we treat logic synthesis as a machine learning problem—where the goal is to find the smallest circuit that generalizes well—can we significantly reduce power and area? To answer this, the authors organized a competition at the IWLS 2020 workshop, tasking participants to synthesize And-Inverter Graphs (AIGs) with fewer than 5,000 nodes that maximize accuracy on hidden test sets.

Methods

The competition drew ten teams from six countries, each employing a unique blend of Electronic Design Automation (EDA) and ML techniques. The general workflow involved:

  1. Learning the Function: Teams used models like Decision Trees (DT), Random Forests (RF), Neural Networks (NN), and even Cartesian Genetic Programming (CGP) to "learn" the Boolean behavior from training samples.
  2. Conversion to Logic: A critical step was translating these models into hardware descriptions. For example, Decision Trees were mapped to multiplexer chains, and Neural Networks were pruned and converted into Look-Up Tables (LUTs).
  3. Logic Optimization: Standard EDA tools like Berkeley’s ABC and ESPRESSO were used to minimize the resulting circuits to fit within the 5,000-gate budget.
Fig. 1: Representation used by various teams

Datasets

The authors introduced a diverse suite of 100 benchmarks divided into ten categories to test different aspects of logic learning:

  • Arithmetic: MSBs and middle bits of adders, dividers, multipliers, and square-rooters.
  • Random Logic: Logic cones extracted from real-world designs like the PicoJava processor and MCNC benchmarks.
  • Machine Learning Tasks: Binary classification problems derived from the famous MNIST (handwritten digits) and CIFAR-10 (images) datasets.
Table I: Overview of the 100 benchmarks, spanning arithmetic, design logic, and image classification.

Key Insights and Ideas

  • Ensembles are King: No single algorithm won every benchmark. The most successful teams (like the winning Team 1) used a "portfolio approach," selecting the best-performing model (e.g., RF vs. ESPRESSO) for each specific task.
  • The Power of Random Forests: RFs emerged as a surprisingly robust baseline for logic synthesis, offering a good balance between generalization and circuit size.
  • Function Matching: For arithmetic benchmarks, some teams used "explanatory analysis" (like SHAP values) to identify if a training set looked like an adder or comparator, then substituted a known-good structural implementation.
  • Smoothness Assumption: In high-dimensional Boolean spaces, assuming that unseen inputs are "don't cares" allows synthesis tools much more freedom to optimize and reduce gate counts.

Key Results

The competition proved that "learning logic" is highly effective. Most teams achieved over 80% average accuracy across all benchmarks.

The most striking finding was the Pareto frontier between accuracy and area. As shown in Figure 2, achieving ~91% accuracy required roughly 1,141 gates. However, by accepting a mere 2% drop in accuracy (to ~89%), the required circuit size was slashed by half. This "insightful observation" suggests that for many applications, we are over-designing hardware at a massive cost in area and power.

Fig. 2: Acc-size trade-off across teams and for virtual best

Limitations and Future Work

Despite the success, some "boss level" challenges remain:

  • Complex Arithmetic: Learning large multipliers (e.g., 32x32) from a small number of samples remains extremely difficult for standard ML models.
  • Multi-Output Circuits: The current benchmarks focused on single-output functions. Real-world hardware is multi-output, which adds significant complexity to the synthesis and optimization process.
  • Generalization Gaps: While most teams achieved good generalization (1-2% gap between validation and test sets), some benchmarks still resulted in "negligible performance" when the training data wasn't representative enough.

The authors conclude that this intersection of fields is ripe for exploration, particularly in using ML to automate the design of approximate hardware for power-constrained edge devices.

Summary updated

BibTeX
@inproceedings{rai2020logic,
  author = {Shubham Rai and Walter Lau Neto and Yukio Miyasaka and Xinpei Zhang and Mingfei Yu and Qingyang Yi and Masahiro Fujita and Guilherme B. Manske and Matheus F. Pontes and Leomar S. da Rosa Jr. and Marilton S. de Aguiar and Paulo F. Butzen and Po-Chun Chien and Yu-Shan Huang and Hoa-Ren Wang and Jie-Hong R. Jiang and Jiaqi Gu and Zheng Zhao and Zixuan Jiang and David Z. Pan and Brunno A. Abreu and Isac de Souza Campos and Augusto Andre Souza Berndt and Cristina Meinhardt and Jonata T. Carvalho and Mateus Grellert and Sergio Bampi and Aditya Lohana and Akash Kumar and Wei Zeng and Azadeh Davoodi and Rasit Onur Topaloglu and Yuan Zhou and Jordan Dotzel and Yichi Zhang and Hanyu Wang and Zhiru Zhang and Valerio Tenace and Pierre-Emmanuel Gaillardon and Alan Mishchenko and Satrajit Chatterjee},
  title = {{Logic Synthesis Meets Machine Learning: Trading Exactness for Generalization}},
  booktitle = {DATE},
  year = {2020},
  doi = {10.23919/date51398.2021.9473972},
}
Figure