Awesome
DREAMPlace
Deep learning toolkit-enabled VLSI placement.
With the analogy between nonlinear VLSI placement and deep learning training problem, this tool is developed with deep learning toolkit for flexibility and efficiency.
The tool runs on both CPU and GPU.
Over 30X
speedup over the CPU implementation (RePlAce) is achieved in global placement and legalization on ISPD 2005 contest benchmarks with a Nvidia Tesla V100 GPU.
DREAMPlace also integrates a GPU-accelerated detailed placer, ABCDPlace, which can achieve around 16X
speedup on million-size benchmarks over the widely-adopted sequential placer NTUPlace3 on CPU.
- DREAMPlace
- Publications
- Dependency
- How to Install Python Dependency
- How to Build
- How to Get Benchmarks
- How to Run
- Configurations
- Authors
- Features
DREAMPlace runs on both CPU and GPU. If it is installed on a machine without GPU, only CPU support will be enabled with multi-threading.
- Animation
Bigblue4 | Density Map | Electric Potential | Electric Field |
---|---|---|---|
<img src=/images/bigblue4-nofiller_SLD.gif width=250> |
- Reference Flow
<img src=images/DREAMPlace4.1_flow.png width=600>
Publications
-
Yibo Lin, Shounak Dhar, Wuxi Li, Haoxing Ren, Brucek Khailany and David Z. Pan, "DREAMPlace: Deep Learning Toolkit-Enabled GPU Acceleration for Modern VLSI Placement", ACM/IEEE Design Automation Conference (DAC), Las Vegas, NV, Jun 2-6, 2019 (preprint) (slides)
-
Yibo Lin, Zixuan Jiang, Jiaqi Gu, Wuxi Li, Shounak Dhar, Haoxing Ren, Brucek Khailany and David Z. Pan, "DREAMPlace: Deep Learning Toolkit-Enabled GPU Acceleration for Modern VLSI Placement", IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems (TCAD), 2020
-
Yibo Lin, Wuxi Li, Jiaqi Gu, Haoxing Ren, Brucek Khailany and David Z. Pan, "ABCDPlace: Accelerated Batch-based Concurrent Detailed Placement on Multi-threaded CPUs and GPUs", IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems (TCAD), 2020 (preprint)
-
Yibo Lin, David Z. Pan, Haoxing Ren and Brucek Khailany, "DREAMPlace 2.0: Open-Source GPU-Accelerated Global and Detailed Placement for Large-Scale VLSI Designs", China Semiconductor Technology International Conference (CSTIC), Shanghai, China, Jun, 2020 (preprint)(Invited Paper)
-
Jiaqi Gu, Zixuan Jiang, Yibo Lin and David Z. Pan, "DREAMPlace 3.0: Multi-Electrostatics Based Robust VLSI Placement with Region Constraints", IEEE/ACM International Conference on Computer-Aided Design (ICCAD), Nov 2-5, 2020 (preprint)
-
Peiyu Liao, Siting Liu, Zhitang Chen, Wenlong Lv, Yibo Lin and Bei Yu, "DREAMPlace 4.0: Timing-driven Global Placement with Momentum-based Net Weighting", IEEE/ACM Proceedings Design, Automation and Test in Eurpoe (DATE), Antwerp, Belgium, Mar 14-23, 2022 (preprint)
-
Yifan Chen, Zaiwen Wen, Yun Liang, Yibo Lin, "Stronger Mixed-Size Placement Backbone Considering Second-Order Information", IEEE/ACM International Conference on Computer-Aided Design (ICCAD), San Francisco, CA, Oct, 2023 (preprint)
Dependency
-
Python 3.5/3.6/3.7/3.8/3.9
-
Pytorch 1.6/1.7/1.8/2.0
- Other versions may also work, but not tested
-
- Recommend GCC 7.5 (with
c++17
support). - Do not recommend GCC 9 or later due to backward compatibility issues.
- Other compilers may also work, but not tested.
- Recommend GCC 7.5 (with
-
Boost >= 1.55.0
- Need to install and visible for linking
-
Bison >= 3.3
- Need to install
-
- Integrated as a git submodule
-
- Integrated as a submodule
-
- Modified version for timing optimization
- Integrated as a submodule
-
- Integrated as a git submodule
-
- Integrated as a git submodule
-
CUDA 9.1 or later (Optional)
- If installed and found, GPU acceleration will be enabled.
- Otherwise, only CPU implementation is enabled.
-
GPU architecture compatibility 6.0 or later (Optional)
- Code has been tested on GPUs with compute compatibility 6.0, 7.0, and 7.5.
- Please check the compatibility of the GPU devices.
- The default compilation target is compatibility 6.0. This is the minimum requirement and lower compatibility is not supported for the GPU feature.
- For compatibility 7.0, it is necessary to set the CMAKE_CUDA_FLAGS to -gencode=arch=compute_70,code=sm_70.
-
Cairo (Optional)
- If installed and found, the plotting functions will be faster by using C/C++ implementation.
- Otherwise, python implementation is used.
-
NTUPlace3 (Optional)
- If the binary is provided, it can be used to perform detailed placement.
To pull git submodules in the root directory
git submodule init
git submodule update
Or alternatively, pull all the submodules when cloning the repository.
git clone --recursive https://github.com/limbo018/DREAMPlace.git
How to Install Python Dependency
Go to the root directory.
pip install -r requirements.txt
How to Build
Two options are provided for building: with and without Docker.
Build with Docker
You can use the Docker container to avoid building all the dependencies yourself.
- Install Docker on Windows, Mac or Linux.
- To enable the GPU features, install NVIDIA-docker; otherwise, skip this step.
- Navigate to the repository.
- Get the docker container with either of the following options.
- Option 1: pull from the cloud limbo018/dreamplace.
docker pull limbo018/dreamplace:cuda
- Option 2: build the container.
docker build . --file Dockerfile --tag your_name/dreamplace:cuda
- Enter bash environment of the container. Replace
limbo018
with your name if option 2 is chosen in the previous step.
Run with GPU on Linux.
docker run --gpus 1 -it -v $(pwd):/DREAMPlace limbo018/dreamplace:cuda bash
Run with GPU on Windows.
docker run --gpus 1 -it -v /dreamplace limbo018/dreamplace:cuda bash
Run without GPU on Linux.
docker run -it -v $(pwd):/DREAMPlace limbo018/dreamplace:cuda bash
Run without GPU on Windows.
docker run -it -v /dreamplace limbo018/dreamplace:cuda bash
cd /DREAMPlace
.- Go to next section to complete building within the container.
Build without Docker
CMake is adopted as the makefile system. To build, go to the root directory.
mkdir build
cd build # we call this <build directory>
cmake .. -DCMAKE_INSTALL_PREFIX=<installation directory> -DPython_EXECUTABLE=$(which python)
make
make install
Where <build directory>
is the directory where you compile the code, and <installation directory>
is the directory where you want to install DREAMPlace (e.g., ../install
).
Third party submodules are automatically built except for Boost.
To clean, go to the root directory.
rm -r build
<build directory>
can be removed after installation if you do not need incremental compilation later.
Here are the available options for CMake.
- CMAKE_INSTALL_PREFIX: installation directory
- Example
cmake -DCMAKE_INSTALL_PREFIX=path/to/your/directory
- Example
- CMAKE_CUDA_FLAGS: custom string for NVCC (default -gencode=arch=compute_60,code=sm_60)
- Example
cmake -DCMAKE_CUDA_FLAGS=-gencode=arch=compute_60,code=sm_60
- Example
- CMAKE_CXX_ABI: 0|1 for the value of _GLIBCXX_USE_CXX11_ABI for C++ compiler, default is 0.
- Example
cmake -DCMAKE_CXX_ABI=0
- It must be consistent with the _GLIBCXX_USE_CXX11_ABI for compling all the C++ dependencies, such as Boost and PyTorch.
- PyTorch in default is compiled with _GLIBCXX_USE_CXX11_ABI=0, but in a customized PyTorch environment, it might be compiled with _GLIBCXX_USE_CXX11_ABI=1.
- Example
How to Get Benchmarks
To get ISPD 2005 and 2015 benchmarks, run the following script from the directory.
python benchmarks/ispd2005_2015.py
How to Run
Before running, make sure the benchmarks have been downloaded and the python dependency packages have been installed. Go to the install directory and run with JSON configuration file for full placement.
cd <installation directory>
python dreamplace/Placer.py test/ispd2005/adaptec1.json
Test individual pytorch
op with the unit tests in the root directory.
cd <installation directory>
python unittest/ops/hpwl_unittest.py
Configurations
Descriptions of options in JSON configuration file can be found by running the following command.
cd <installation directory>
python dreamplace/Placer.py --help
The list of options as follows will be shown.
JSON Parameter | Default | Description |
---|---|---|
aux_input | required for Bookshelf | input .aux file |
lef_input | required for LEF/DEF | input LEF file |
def_input | required for LEF/DEF | input DEF file |
verilog_input | optional for LEF/DEF | input VERILOG file, provide circuit netlist information if it is not included in DEF file |
gpu | 1 | enable gpu or not |
...
Authors
- Yibo Lin, supervised by David Z. Pan, composed the initial release.
- Zixuan Jiang and Jiaqi Gu improved the efficiency of the wirelength and density operators on GPU.
- Yibo Lin and Jiaqi Gu developed and integrated ABCDPlace for detailed placement.
- Peiyu Liao and Siting Liu developed and integrated timing optimization in global placement for DREAMPlace 4.0.
- Yifan Chen developed the 2-stage flow and improved the optimizer for macro placement in DREAMPlace 4.1.
- Pull requests to improve the tool are more than welcome. We appreciate all kinds of contributions from the community.
Features
-
- Multi-threaded CPU and optional GPU acceleration support
-
- Net weighting support through .wts files in Bookshelf format
- Incremental placement support
-
- LEF/DEF support as input/output
- Python binding and access to C++ placement database
-
- Improved efficiency for wirelength and density operators from TCAD extension
-
- Docker container for building environment
-
- Integrate ABCDPlace: multi-threaded CPU and GPU acceleration for detailed placement
- Support independent set matching, local reordering, and global swap with run-to-run determinism on one machine
- Support movable macros with Tetris-like macro legalization and min-cost flow refinement
-
- Support deterministic mode to ensure run-to-run determinism with minor runtime overhead
-
- Integrate routability optimization relying on NCTUgr from TCAD extension
- Improved robustness on parallel CPU version
-
- Support fence regions as published at ICCAD 2020
- Add quadratic penalty to accelerate gradient descent at plateau during global placement
- Inject noise to escape from saddle points during global placement
-
- Support timing optimization in global placement as published at DATE 2022
- Add momentum-based net weighting strategy
- Integrate OpenTimer for static timing analysis
- Tested under ICCAD 2015 contest benchmarks (see test/iccad2015.ot)
-
- Support BB step and 2-stage macro placement flow as published at ICCAD 2023
- Tested under ISPD 2005 with all fixed macros and IO pads regarded as movable macros (see test/ispd2005free) and MMS benchmarks (see test/mms)
Reference Results for Macro Placement
Recently, many studies chose DREAMPLace for macro placement, e.g., [Cheng+, NeurIPS2021], [Lai+, NeurIPS2023], etc. However, the results reported on the same benchmarks vary significantly from one work to another. For better comparison, we provide the results collected from our GPU machine for reference. If your results deviate significantly (i.e., >5% longer HPWL) from the following numbers, something may be wrong. We recommend you to contact us with logs for validation.
Note that DREAMPlace 4.1.0 only implements the BB step and 2-stage flow proposed in [Chen+, ICCAD2023].
ISPD2005 benchmark with all fixed macros and IO pads regarded as movable macros. It can be downloaded from here.
<table> <thead> <tr> <th></th> <th colspan="3">DREAMPlace 4.0</th> <th colspan="3">DREAMPlace 4.1.0</th> </tr> </thead> <tbody> <tr> <td></td> <td>Iterations</td> <td>HPWL(x10^6)</td> <td>Time(s)</td> <td>Iterations</td> <td>HPWL(x10^6)</td> <td>Time(s)</td> </tr> <tr> <td>adaptec1</td> <td>600</td> <td>101.3</td> <td>26.3</td> <td>748</td> <td>68.2 </td> <td>27.6</td> </tr> <tr> <td>adaptec2</td> <td>588*</td> <td>137.5*</td> <td>40.6*</td> <td>784</td> <td>86.3 </td> <td>40.1</td> </tr> <tr> <td>adaptec3</td> <td>765</td> <td>179.5</td> <td>54.1</td> <td>894</td> <td>144.0 </td> <td>56.1</td> </tr> <tr> <td>adaptec4</td> <td>876</td> <td>153.3</td> <td>48.9</td> <td>872</td> <td>140.8 </td> <td>57.3</td> </tr> <tr> <td>bigblue1</td> <td>699</td> <td>86.2</td> <td>23.5</td> <td>813</td> <td>82.0 </td> <td>25.5</td> </tr> <tr> <td>bigblue2</td> <td>1267*</td> <td>2426.7*</td> <td>679.4*</td> <td>869</td> <td>98.1 </td> <td>193.4</td> </tr> <tr> <td>bigblue3</td> <td>1207</td> <td>330.2</td> <td>115.4</td> <td>1307</td> <td>288.8 </td> <td>140.1</td> </tr> <tr> <td>bigblue4</td> <td>1581</td> <td>820.1</td> <td>239.6</td> <td>1875</td> <td>610.0 </td> <td>234.5</td> </tr> <tr> <td>average ratio</td> <td>0.937</td> <td>4.211</td> <td>1.258</td> <td>1.000</td> <td>1.000</td> <td>1.000</td> </tr> </tbody> </table>MMS benchmark (modified from ISPD2005 benchmarks with movable macros and fixed IO pads)
Our modified version can be downloaded from here.
<table> <thead> <tr> <th></th> <th colspan="3">DREAMPlace 4.0</th> <th colspan="3">DREAMPlace 4.1.0</th> </tr> </thead> <tbody> <tr> <td></td> <td>Iterations</td> <td>HPWL(x10^6)</td> <td>Time(s)</td> <td>Iterations</td> <td>HPWL(x10^6)</td> <td>Time(s)</td> </tr> <tr> <td>adaptec1</td> <td>607</td> <td>65.3 </td> <td>17.8 </td> <td>746</td> <td>64.7 </td> <td>25.8</td> </tr> <tr> <td>adaptec2</td> <td>569</td> <td>79.3 </td> <td>28.5 </td> <td>734</td> <td>75.8 </td> <td>35.8</td> </tr> <tr> <td>adaptec3</td> <td>659</td> <td>158.1 </td> <td>44.6 </td> <td>755</td> <td>153.3 </td> <td>38.9</td> </tr> <tr> <td>adaptec4</td> <td>735</td> <td>141.7 </td> <td>46.8 </td> <td>782</td> <td>142.4 </td> <td>47.5</td> </tr> <tr> <td>adaptec5</td> <td>1053</td> <td>326.3</td> <td>63.8</td> <td>1405</td> <td>337.6 </td> <td>78.4</td> </tr> <tr> <td>bigblue1</td> <td>646</td> <td>85.4 </td> <td>21.3 </td> <td>809</td> <td>85.3 </td> <td>28.9</td> </tr> <tr> <td>bigblue2</td> <td>638</td> <td>125.3 </td> <td>42.0 </td> <td>773</td> <td>125.4 </td> <td>48.4</td> </tr> <tr> <td>bigblue3</td> <td>911</td> <td>279.3 </td> <td>112.5 </td> <td>1097</td> <td>273.8 </td> <td>136.1</td> </tr> <tr> <td>bigblue4</td> <td>1189</td> <td>648.8 </td> <td>172.4 </td> <td>1515</td> <td>643.2 </td> <td>215.4</td> </tr> <tr> <td>newblue1</td> <td>574</td> <td>62.8 </td> <td>22.5 </td> <td>749</td> <td>62.0 </td> <td>30.4</td> </tr> <tr> <td>newblue2</td> <td>730</td> <td>155.5 </td> <td>34.8 </td> <td>861</td> <td>156.1 </td> <td>43.9</td> </tr> <tr> <td>newblue3</td> <td>1318*</td> <td>597.3*</td> <td>55.71*</td> <td>830</td> <td>270.6 </td> <td>72.8</td> </tr> <tr> <td>newblue4</td> <td>1009</td> <td>246.2</td> <td>52.6</td> <td>1274</td> <td>245.8 </td> <td>53.9</td> </tr> <tr> <td>newblue5</td> <td>1254</td> <td>444.2 </td> <td>99.4 </td> <td>1537</td> <td>446.4 </td> <td>134.9</td> </tr> <tr> <td>newblue6</td> <td>929</td> <td>410.6 </td> <td>96.1 </td> <td>1157</td> <td>409.3 </td> <td>115.1</td> </tr> <tr> <td>newblue7</td> <td>1077</td> <td>903.6 </td> <td>184.1 </td> <td>1578</td> <td>903.2 </td> <td>235.1</td> </tr> <tr> <td>average ratio</td> <td>0.855</td> <td>1.081</td> <td>0.830</td> <td>1.000</td> <td>1.000</td> <td>1.000</td> </tr> </tbody> </table> `*` denotes divergence or legalization failure. Note that if you observe divergence or legalization errors in the log, then the results may not be representative.