limbo018 / DREAMPlace

Deep learning toolkit-enabled VLSI placement
BSD 3-Clause "New" or "Revised" License
681 stars 199 forks source link
deep-learning gpu-acceleration pytorch vlsi vlsi-physical-design vlsi-placement

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 runs on both CPU and GPU. If it is installed on a machine without GPU, only CPU support will be enabled with multi-threading.

Bigblue4 Density Map Electric Potential Electric Field
Density Map Electric Potential Map Electric Field Map

Publications

Dependency

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.

  1. Install Docker on Windows, Mac or Linux.
  2. To enable the GPU features, install NVIDIA-docker; otherwise, skip this step.
  3. Navigate to the repository.
  4. 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
  5. 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
  1. cd /DREAMPlace.
  2. 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.

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

Features

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

DREAMPlace 4.0 DREAMPlace 4.1.0
Iterations HPWL(x10^6) Time(s) Iterations HPWL(x10^6) Time(s)
adaptec1 600 101.3 26.3 748 68.2 27.6
adaptec2 588* 137.5* 40.6* 784 86.3 40.1
adaptec3 765 179.5 54.1 894 144.0 56.1
adaptec4 876 153.3 48.9 872 140.8 57.3
bigblue1 699 86.2 23.5 813 82.0 25.5
bigblue2 1267* 2426.7* 679.4* 869 98.1 193.4
bigblue3 1207 330.2 115.4 1307 288.8 140.1
bigblue4 1581 820.1 239.6 1875 610.0 234.5
average ratio 0.937 4.211 1.258 1.000 1.000 1.000

MMS benchmark (modified from ISPD2005 benchmarks with movable macros and fixed IO pads)

Our modified version can be downloaded from here.

DREAMPlace 4.0 DREAMPlace 4.1.0
Iterations HPWL(x10^6) Time(s) Iterations HPWL(x10^6) Time(s)
adaptec1 607 65.3 17.8 746 64.7 25.8
adaptec2 569 79.3 28.5 734 75.8 35.8
adaptec3 659 158.1 44.6 755 153.3 38.9
adaptec4 735 141.7 46.8 782 142.4 47.5
adaptec5 1053 326.3 63.8 1405 337.6 78.4
bigblue1 646 85.4 21.3 809 85.3 28.9
bigblue2 638 125.3 42.0 773 125.4 48.4
bigblue3 911 279.3 112.5 1097 273.8 136.1
bigblue4 1189 648.8 172.4 1515 643.2 215.4
newblue1 574 62.8 22.5 749 62.0 30.4
newblue2 730 155.5 34.8 861 156.1 43.9
newblue3 1318* 597.3* 55.71* 830 270.6 72.8
newblue4 1009 246.2 52.6 1274 245.8 53.9
newblue5 1254 444.2 99.4 1537 446.4 134.9
newblue6 929 410.6 96.1 1157 409.3 115.1
newblue7 1077 903.6 184.1 1578 903.2 235.1
average ratio 0.855 1.081 0.830 1.000 1.000 1.000

* denotes divergence or legalization failure. Note that if you observe divergence or legalization errors in the log, then the results may not be representative.