/CircuitFormer

[NeurIPS 2023] CircuitFormer: Circuit as Set of Points

Primary LanguagePython

CircuitFormer

Circuit as Set of Points

Jialv Zou1 , Xinggang Wang1 📧 , Jiahao Guo1 , Wenyu Liu1 , Qian Zhang2 , Chang Huang2

1 School of EIC, HUST, 2 Horizon Robotics

(📧) corresponding author.

NeurIPS 2023

ArXiv Preprint

Abstract

As the size of circuit designs continues to grow rapidly, artificial intelligence technologies are being extensively used in Electronic Design Automation (EDA) to assist with circuit design. Placement and routing are the most time-consuming parts of the physical design process, and how to quickly evaluate the placement has become a hot research topic. Prior works either transformed circuit designs into images using hand-crafted methods and then used Convolutional Neural Networks (CNN) to extract features, which are limited by the quality of the hand-crafted methods and could not achieve end-to-end training, or treated the circuit design as a graph structure and used Graph Neural Networks (GNN) to extract features, which require time-consuming preprocessing. In our work, we propose a novel perspective for circuit design by treating circuit components as point clouds and using Transformer-based point cloud perception methods to extract features from the circuit. This approach enables direct feature extraction from raw data without any preprocessing, allows for end-to-end training, and results in high performance. Experimental results show that our method achieves state-of-the-art performance in congestion prediction tasks on both the CircuitNet and ISPD2015 datasets, as well as in design rule check (DRC) violation prediction tasks on the CircuitNet dataset. Our method establishes a bridge between the relatively mature point cloud perception methods and the fast-developing EDA algorithms, enabling us to leverage more collective intelligence to solve this task.

Installation

a. Create a conda virtual environment and activate it.

conda create -n circuitformer python=3.9 -y
conda activate circuitformer

b. Install PyTorch and torchvision following the official instructions.

pip install torch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 -f https://download.pytorch.org/whl/torch_stable.html

c. Install torch_scatter and spconv.

  • You could install torch_scatter with pip, see the official documents of torch_scatter.
  • You could install latest spconv v2.x with pip, see the official documents of spconv.

d. Install other requirements.

pip install -r requirement.txt

e. Prepare pretrained models.

mkdir ckpts

cd ckpts 
wget https://download.pytorch.org/models/resnet18-f37072fd.pth

Prepare Dataset

Please download CircuitNet-N28 dataset follow the guide of CircuitNet

Folder structure

circuitformer
├── dataset/
│   ├── CircuitNet/
│   │   ├── graph_features/
|   |   |   ├── instance_placement/
│   │   ├── train_congestion/
│   │   │   ├── congestion/
│   │   │   |   ├── feature/
│   │   │   |   ├── label/
│   │   ├── train_DRC/
│   │   │   ├── DRC/
│   │   │   |   ├── feature/
│   │   │   |   ├── label/

Train and Test

Train circuitformer

python train.py

Please download our pretrain model Baidu or Google and put it in 'ckpts/'

Test circuitformer

python test.py

Acknowledgment

The dataset is provided by CircuitNet. Our code is developed based on VoxSeT and segmentation_models.pytorch

Citation

If you find CircuitFormer is useful in your research or applications, please consider giving us a star 🌟 and citing it by the following BibTeX entry.

@inproceedings{zou2023circuit,
  title={Circuit as Set of Points},
  author={Zou, Jialv and Wang, Xinggang and Guo, JiaHao and Liu, Wenyu and Zhang, Qian and Huang, Chang},
  booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
  year={2023}
}