Xingquan-Li commited on
Commit
6eda9fa
·
verified ·
1 Parent(s): 836b2ad

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +237 -51
README.md CHANGED
@@ -1,51 +1,237 @@
1
- ---
2
- license: gpl-3.0
3
- configs:
4
- - config_name: default
5
- data_files:
6
- - split: train
7
- path: data/train-*
8
- - split: validation
9
- path: data/validation-*
10
- dataset_info:
11
- features:
12
- - name: net_name
13
- dtype: string
14
- - name: driver
15
- dtype: string
16
- - name: loads
17
- list: string
18
- - name: tree_seq
19
- list: string
20
- - name: connected_info
21
- list:
22
- - name: driver
23
- dtype: string
24
- - name: loads
25
- list: string
26
- - name: net_name
27
- dtype: string
28
- - name: overlap_volume
29
- dtype: int64
30
- - name: overlap_info
31
- list:
32
- - name: driver
33
- dtype: string
34
- - name: loads
35
- list: string
36
- - name: net_name
37
- dtype: string
38
- - name: overlap_volume
39
- dtype: int64
40
- - name: source_design
41
- dtype: string
42
- splits:
43
- - name: train
44
- num_bytes: 14242624501
45
- num_examples: 6347092
46
- - name: validation
47
- num_bytes: 24439501
48
- num_examples: 10163
49
- download_size: 3468684189
50
- dataset_size: 14267064002
51
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gpl-3.0
3
+ configs:
4
+ - config_name: default
5
+ data_files:
6
+ - split: train
7
+ path: data/train-*
8
+ - split: validation
9
+ path: data/validation-*
10
+ dataset_info:
11
+ features:
12
+ - name: net_name
13
+ dtype: string
14
+ - name: driver
15
+ dtype: string
16
+ - name: loads
17
+ list: string
18
+ - name: tree_seq
19
+ list: string
20
+ - name: connected_info
21
+ list:
22
+ - name: driver
23
+ dtype: string
24
+ - name: loads
25
+ list: string
26
+ - name: net_name
27
+ dtype: string
28
+ - name: overlap_volume
29
+ dtype: int64
30
+ - name: overlap_info
31
+ list:
32
+ - name: driver
33
+ dtype: string
34
+ - name: loads
35
+ list: string
36
+ - name: net_name
37
+ dtype: string
38
+ - name: overlap_volume
39
+ dtype: int64
40
+ - name: source_design
41
+ dtype: string
42
+ splits:
43
+ - name: train
44
+ num_bytes: 14242624501
45
+ num_examples: 6347092
46
+ - name: validation
47
+ num_bytes: 24439501
48
+ num_examples: 10163
49
+ download_size: 3468684189
50
+ dataset_size: 14267064002
51
+ ---
52
+
53
+
54
+ # This is dataset for project [iPCL-R](https://github.com/OSCC-Project/iPCL-R).
55
+
56
+ <p align="center">
57
+ <img src="./figs/iPCL.png" width="27%" alt="iPCL-R" />
58
+ <br>
59
+ A Pre-training foundation model for Chip Layout Routing
60
+ </p>
61
+
62
+ ## Demo of iPCL-R
63
+
64
+ <p align="center">
65
+ <img src="./figs/iPCL-R1.gif" width="100%" alt="iPCL-R Demo" />
66
+ <br>
67
+ A chip layout generation demo by iPCL-R
68
+ </p>
69
+
70
+ ## Project Overview
71
+
72
+ <p align="center">
73
+ <img src="./figs/framework.jpg" width="100%" alt="iPCL-R Framework" />
74
+ <br>
75
+ The framework of iPCL-R. (a) Dataset. (b) Symbolic system. (c) Pre-training. (d) Inference.
76
+ </p>
77
+
78
+ iPCL-R addresses the challenge of automated routing pattern generation in chip design by treating routing patterns as sequences that can be learned and generated by large language models. The project implements a complete pipeline from EDA data extraction to model training and routing generation.
79
+
80
+ ### Table of Contents
81
+ - [Demo of iPCL-R](#demo-of-ipcl-r)
82
+ - [Project Overview](#project-overview)
83
+ - [Table of Contents](#table-of-contents)
84
+ - [Key Innovation](#key-innovation)
85
+ - [Architecture](#architecture)
86
+ - [Core Modules](#core-modules)
87
+ - [Flow Module](#flow-module)
88
+ - [Stage 1: Tokenization](#stage-1-tokenization)
89
+ - [Stage 2: Training](#stage-2-training)
90
+ - [Stage 3: Evaluation](#stage-3-evaluation)
91
+ - [Data Synthesis Module](#data-synthesis-module)
92
+ - [Experiments Module](#experiments-module)
93
+ - [AiEDA Third-Party Module](#aieda-third-party-module)
94
+ - [Quick Start](#quick-start)
95
+ - [Prerequisites](#prerequisites)
96
+ - [Basic Usage](#basic-usage)
97
+ - [Pipeline Execution](#pipeline-execution)
98
+ - [Dataset Construction](#dataset-construction)
99
+ - [Experimental Analysis](#experimental-analysis)
100
+ - [Research Applications](#research-applications)
101
+ - [Evaluation Metrics](#evaluation-metrics)
102
+ - [Contributing](#contributing)
103
+ - [Citation](#citation)
104
+
105
+ ### Key Innovation
106
+ - **Domain-specific tokenization** optimized for spatial reasoning tasks in chip routing
107
+ - **Transformer-based sequence-to-sequence models** for routing pattern generation
108
+ - **Comprehensive evaluation metrics** combining NLP and routing-specific measures
109
+
110
+ ## Architecture
111
+
112
+ The project is organized into four main modules:
113
+
114
+ ```
115
+ iPCL-R/
116
+ ├── flow/ # [Main] 3-stage ML pipeline (tokenization → training → evaluation)
117
+ ├── data_synthesis/ # [Optional] EDA data processing and ML-ready dataset generation
118
+ ├── experiments/ # [Optional] Experimental analysis and validation studies
119
+ └── third_party/ # EDA tool integration and chip design automation
120
+ ```
121
+
122
+ ## Core Modules
123
+
124
+ ### Flow Module
125
+ **Purpose**: Complete 3-stage pipeline for routing pattern generation
126
+
127
+ **Pipeline Stages**:
128
+
129
+ #### Stage 1: Tokenization
130
+ - **UnifiedTokenizer**: Supports 5 algorithms (DecimalWordLevel, Seg-BPE, Concat-BPE, Seg-BBPE, Concat-BBPE)
131
+ - **Direction Encoding**: Converts 3D coordinates to directional tokens (R/L/U/D/T/B)
132
+ - **Tree Structure**: Handles routing trees with PUSH/POP and BRANCH/END tokens
133
+ - **Special Tokens**: BOS/EOS, PAD, DRIVER/LOAD for routing semantics
134
+
135
+ #### Stage 2: Training
136
+ - **Custom Architecture**: T5-Gemma encoder-decoder transformer
137
+ - **Multi-optimizer Support**: AdamW, Adafactor, Lion optimizers
138
+ - **Distributed Training**: HuggingFace Accelerate integration
139
+ - **Monitoring**: TensorBoard and comprehensive logging
140
+
141
+ #### Stage 3: Evaluation
142
+ - **Multi-metric Assessment**: NLP metrics (ROUGE, BLEU) + routing-specific (RED)
143
+ - **Validation Pipeline**: Coordinate parsing, tree structure analysis
144
+ - **EDA Integration**: DEF format output for industry tool verification
145
+
146
+ ### Data Synthesis Module
147
+ **Purpose**: Convert EDA design data into large model learning-ready formats
148
+
149
+ **Key Components**:
150
+ - **MetadataTracker & DataGenerator**: Base infrastructure for data generation with Parquet output
151
+ - **NetPatternProcessor**: Processes wire routing patterns and calculates directions
152
+ - **NetGraphProcessor**: Converts routing networks into NetworkX graphs
153
+ - **DesignGraphProcessor**: Creates design-level graphs with spatial overlap detection
154
+ - **DatasetAggregator**: Consolidates data into HuggingFace Dataset format
155
+
156
+ **Data Types Generated**:
157
+ - `net_seqs`: Network sequence representations with driver/load information
158
+ - `pin2pin_pattern_seqs`: Pin-to-pin routing pattern sequences
159
+ - `pin2pin_loc_seqs`: Spatial location sequences for routing paths
160
+ - `design_graph`: Design-level connectivity and overlap graphs
161
+
162
+ **Ready-made online datasets**:
163
+ - [iPCL-R Dataset](https://huggingface.co/datasets/AiEDA/iPCL-R) on HuggingFace
164
+
165
+ ### Experiments Module
166
+ **Purpose**: Validation and optimization studies for the pipeline
167
+
168
+ **Research Areas**:
169
+ - **Tokenization Comparison**: Statistical analysis of 5 tokenization algorithms across multiple vocabulary sizes
170
+ - **Model Architecture Studies**: Parameter count vs. performance analysis (small/medium/large variants)
171
+ - **LLM Fine-tuning**: Supervised fine-tuning with LoRA, multi-GPU support, comprehensive evaluation
172
+ - **Symbol Analysis**: Domain-specific vs. human language tokenization comparison
173
+ - **Feature Ablation**: Input feature importance analysis (planned)
174
+
175
+ **Key Methodologies**:
176
+ - Multi-stage filtering for coordinate validation
177
+ - Tree structure integrity checking
178
+ - Statistical significance testing
179
+ - Comprehensive visualization and reporting
180
+
181
+ ### AiEDA Third-Party Module
182
+ **Purpose**: Extract features (metadata) from physical design files and write the generated results back to the physical design file (DEF)
183
+
184
+ **Integration**: Provides EDA backend infrastructure and large model data generation for the iPCL-R project.
185
+
186
+ ## Quick Start
187
+
188
+ ### Prerequisites
189
+ ```bash
190
+ # Install dependencies
191
+ pip install -r requirements.txt
192
+
193
+ # Key dependencies include:
194
+ # torch, transformers, datasets, accelerate, networkx, pandas, tqdm
195
+ ```
196
+
197
+ ### Basic Usage
198
+
199
+ #### Pipeline Execution
200
+ ```bash
201
+ # Generate pipeline configuration
202
+ python -m flow.pipeline_init --create-flow-config config.json
203
+
204
+ # Read the config guide in 'flow/README.md'
205
+ vim config.json
206
+
207
+ # Execute 3-stage pipeline
208
+ python -m flow.launch_tokenization --flow-config config.json
209
+ # Configure your accelerate settings as needed (e.g., run 'accelerate config' for initial setup)
210
+ accelerate launch -m flow.launch_training --flow-config config.json
211
+ accelerate launch -m flow.launch_evaluation --flow-config config.json
212
+ ```
213
+
214
+ #### Dataset Construction
215
+ If you wish to build your own dataset, please organize your data following the AiEDA framework (I sincerely do not recommend this, as it involves extensive engineering dependencies), and utilize the 'data_synthesis' module of this project to assist in the construction of the dataset.
216
+ ```bash
217
+ python -m data_synthesis.main_aggregation
218
+ ```
219
+
220
+ #### Experimental Analysis
221
+ The experiments and the code for generating the figures in this work are located in the 'experiments' directory. Due to issues such as log extraction and path dependencies, it is not convenient for users to run them with a single click. Therefore, this module is for reference only.
222
+
223
+ ## Research Applications
224
+
225
+ iPCL-R enables research in:
226
+ - **Spatial AI**: Neural networks for 2D/3D coordinate reasoning
227
+ - **Domain-specific Tokenization**: Optimization for spatial/geometric data
228
+ - **EDA Automation**: AI-driven chip design optimization
229
+ - **Graph Neural Networks**: Routing network topology analysis
230
+ - **Transfer Learning**: Pre-trained models for chip design tasks
231
+
232
+ ## Evaluation Metrics
233
+
234
+ - **NLP Metrics**: ROUGE, BLEU, exact match for sequence similarity
235
+ - **Routing Metrics**: RED (Routing Edit Distance), coordinate accuracy
236
+ - **Structural Metrics**: Tree validation, connectivity analysis
237
+ - **Quality Metrics**: Manufacturability, design rule compliance