TL;DR
This paper introduces the "Program-to-Circuit" problem, framing circuit quality prediction as a graph-based task solvable by Graph Neural Networks (GNNs). They provide a new benchmark of 40k C/C++ programs translated to circuits, analyze existing GNNs, and highlight challenges for future research in this domain.
What Problem Does This Paper Address?
Designing integrated circuits (ICs) is a complex and time-consuming process, especially when it comes to evaluating the quality of the resulting circuit (e.g., its size, speed, power consumption). Traditional methods for this evaluation can take hours or even days, hindering agile hardware development. High-Level Synthesis (HLS) tools automate the translation from high-level programming languages (like C/C++) to hardware description languages (HDLs), but they still require significant time for synthesis and accurate quality estimation. This paper aims to bridge this gap by proposing a way to quickly and accurately predict circuit quality directly from program representations, thereby accelerating the hardware design cycle.
Methods
The core idea is to represent programs as graphs and then use GNNs to learn the mapping from these program graphs to circuit quality metrics. Specifically, they use intermediate representations (IRs) of C/C++ programs, such as Data Flow Graphs (DFGs) and Control Data Flow Graphs (CDFGs), as the input to GNNs. These graphs capture the program's operations, data dependencies, and control flow. The GNNs are trained to predict hardware quality metrics like Digital Signal Processors (DSPs), Flip-Flops (FFs), Look-Up Tables (LUTs), SLICEs (a combination of LUTs and FFs), and Critical Path (CP) timing on FPGAs. The paper analyzes 14 state-of-the-art GNN models to understand their strengths and weaknesses on this task.
Datasets
The authors introduce a new benchmark consisting of 40,000 synthetic C/C++ programs. These programs are translated into corresponding circuit designs, and their hardware quality metrics are collected. This benchmark is divided into two sets:
- DFG dataset: 19,120 programs translated into DFGs.
- CDFG dataset: 18,570 programs translated into CDFGs.
In addition to synthetic data, they also use three sets of real-world benchmarks for evaluating the generalization capabilities of GNNs:
- MachSuite: 16 applications.
- CHStone: 10 applications.
- PolyBench/C: 30 applications.
Key Insights and Ideas
- Program-to-Circuit as a GNN problem: The paper successfully frames circuit quality prediction as a graph-based regression problem, opening up new avenues for applying GNNs in the Electronic Design Automation (EDA) domain.
- IR graphs are rich representations: DFGs and CDFGs, readily available from compiler front-ends, provide a suitable and standardized input for GNNs, abstracting away language-specific details.
- CDFG complexity challenges GNNs: Predicting circuit quality from CDFGs is significantly harder than from DFGs. This is attributed to larger graph sizes, the presence of complex control flow (loops), and the introduction of additional nodes/edges representing control signals, which are less directly related to resource usage.
- Relational information is crucial: Models that effectively leverage edge information (representing data and control dependencies) and employ multiple aggregators (like PNA and RGCN) tend to perform better, highlighting the importance of capturing fine-grained relationships within the program graph.
- Generalization gap exists: GNNs trained on synthetic data show a notable performance degradation when applied to real-world benchmarks, indicating challenges in generalizing to larger, more complex, and potentially out-of-distribution program structures.
Key Results
- The paper provides a comprehensive analysis of 14 GNN models on the Program-to-Circuit task.
- Models like PNA and RGCN demonstrated superior performance on the synthetic datasets, achieving relatively low error rates (e.g., around 6.14% for CP timing on DFGs with RGCN).
- Relative errors on CDFGs were significantly larger than on DFGs, with CP timing errors reaching up to 8.79% for GCN and 14.71% for PNA.
- Generalization to real-world benchmarks showed a large performance degradation compared to synthetic data, with relative errors often exceeding 20-30% for various metrics.
- Despite the challenges, GNN predictions were found to be comparable to, and sometimes better than, commercial HLS tools in timing prediction, while being significantly faster.
Limitations and Future Work
- Generalization to real-world applications: The significant performance drop on real-world benchmarks highlights the need for GNNs that can better generalize across varying graph sizes, complex loop structures, and unusual program operations.
- Handling complex loop structures: The paper identifies loops as a major challenge for GNNs, suggesting that future work should focus on developing GNN architectures that can effectively model and reason about intricate loop topologies.
- Regression vs. Classification: The paper notes that graph-level regression tasks, like predicting exact circuit values, are more demanding than classification tasks, implying a need for GNNs with enhanced representational power.
- Domain-specific insights: The authors suggest that incorporating more domain-specific knowledge into GNN features or architectures could further improve performance.
- Program-to-X framework: The authors envision this work as a stepping stone for the broader "Program-to-X" framework, encouraging research into other program-based analysis tasks using GNNs.
Summary updated