Less is More: Hop-Wise Graph Attention for Scalable and Generalizable Learning on Circuits

Chenhui Deng,Zichao Yue,Cunxi Yu,Gokce Sarar,Ryan Carey,Rajeev Jain,Zhiru Zhang
2024-04-11
Abstract:While graph neural networks (GNNs) have gained popularity for learning circuit representations in various electronic design automation (EDA) tasks, they face challenges in scalability when applied to large graphs and exhibit limited generalizability to new designs. These limitations make them less practical for addressing large-scale, complex circuit problems. In this work we propose HOGA, a novel attention-based model for learning circuit representations in a scalable and generalizable manner. HOGA first computes hop-wise features per node prior to model training. Subsequently, the hop-wise features are solely used to produce node representations through a gated self-attention module, which adaptively learns important features among different hops without involving the graph topology. As a result, HOGA is adaptive to various structures across different circuits and can be efficiently trained in a distributed manner. To demonstrate the efficacy of HOGA, we consider two representative EDA tasks: quality of results (QoR) prediction and functional reasoning. Our experimental results indicate that (1) HOGA reduces estimation error over conventional GNNs by 46.76% for predicting QoR after logic synthesis; (2) HOGA improves 10.0% reasoning accuracy over GNNs for identifying functional blocks on unseen gate-level netlists after complex technology mapping; (3) The training time for HOGA almost linearly decreases with an increase in computing resources.
Machine Learning,Hardware Architecture
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: **How to achieve more scalable and more generalized circuit representation learning on large - scale circuit diagrams**. Specifically, although existing graph neural networks (GNNs) perform well in electronic design automation (EDA) tasks, they face scalability issues when applied to large - scale graphs and have limited generalization ability on new designs. These problems make GNNs less practical when dealing with large - scale and complex circuit problems. ### Specific manifestations of the problem: 1. **Scalability challenges**: Existing GNNs face huge challenges in computational resources and communication overhead when dealing with large graphs, especially on large - scale circuit diagrams. 2. **Insufficient generalization ability**: Existing GNNs have weak generalization ability between different circuit designs and are difficult to capture the key structural information of different functional blocks, resulting in poor performance on unseen designs. ### Solution: To solve the above problems, the authors propose HOGA (Hop - Wise Graph Attention), a new model based on the hop - wise attention mechanism. The main features of HOGA are as follows: 1. **Hop - wise feature generation**: HOGA pre - computes the hop - wise features of each node, avoiding recursive neighbor aggregation, thereby achieving independent learning of node representations and facilitating distributed training. 2. **Gated self - attention module**: Through the gated self - attention mechanism, HOGA can adaptively capture the key high - order structures at different hop levels, improving the generalization ability of the model. ### Experimental verification: To verify the effectiveness of HOGA, the authors conducted experiments on two representative EDA tasks: 1. **Quality of Result (QoR) prediction**: Predict the number of optimized gates after logic synthesis optimization. 2. **Functional reasoning**: Identify the sum and carry output nodes in the adder block. The experimental results show that HOGA significantly outperforms traditional GNNs on these two tasks, especially on unseen designs. In addition, the training time of HOGA decreases almost linearly with the increase of computational resources, demonstrating its good scalability. ### Summary: By introducing the hop - wise attention mechanism, HOGA improves the scalability and generalization ability of circuit representation learning while maintaining efficient parallel computing, providing new ideas for solving the challenges in large - scale circuit design.