rachelselinar / DREAMPlaceFPGA

An Open-Source Analytical Placer for Large Scale Heterogeneous FPGAs using Deep-Learning Toolkit
BSD 3-Clause "New" or "Revised" License
75 stars 18 forks source link

Support `torch==1.13` #2

Closed makslevental closed 2 years ago

makslevental commented 2 years ago

pytorch changed a part of their dispatch API recently (see https://github.com/limbo018/DREAMPlace/pull/82) so some changes needed to be made in order to support torch==1.13 and thereby take advantage of newer CUDA gencodes. With these changes I can build in this env

(dreamplaceasic) mlevental@mlevental-CORSAIR-ONE-PRO-a200:~/dev_projects/DREAMPlace$ pip freeze
torch==1.13.0.dev20220812
torchaudio==0.13.0.dev20220812
torchtext==0.14.0.dev20220812
torchvision==0.14.0.dev20220812

(dreamplaceasic) mlevental@mlevental-CORSAIR-ONE-PRO-a200:~/dev_projects/DREAMPlace$ nvidia-smi
Fri Aug 12 17:06:44 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:06:00.0  On |                  N/A |
|  0%   30C    P8    35W / 320W |    961MiB / 10240MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1463      G   /usr/lib/xorg/Xorg                525MiB |
|    0   N/A  N/A      1940      G   ...ome-remote-desktop-daemon        3MiB |
|    0   N/A  N/A      4683      G   gnome-control-center               67MiB |
|    0   N/A  N/A    166784      G   /usr/bin/gnome-shell              142MiB |
|    0   N/A  N/A    171137      G   ...528177628034215241,131072      219MiB |
+-----------------------------------------------------------------------------+

and tests pass:


PYTHONPATH=install python dreamplacefpga/Placer.py test/FPGA-example1.json

[INFO   ] DREAMPlaceFPGA - iter:  658, HPWL 8.925862E+03, Overflow [1.105E-01, 1.984E-02, 0.000E+00, 0.000E+00], time 1.467ms
[INFO   ] DREAMPlaceFPGA - iter:  659, HPWL 8.772681E+03, Overflow [1.047E-01, 1.883E-02, 0.000E+00, 0.000E+00], time 1.494ms
[INFO   ] DREAMPlaceFPGA - iter:  660, HPWL 8.994490E+03, Overflow [1.046E-01, 1.779E-02, 0.000E+00, 0.000E+00], time 1.464ms
[INFO   ] DREAMPlaceFPGA - iter:  661, HPWL 8.895871E+03, Overflow [1.008E-01, 1.673E-02, 0.000E+00, 0.000E+00], time 1.992ms
[INFO   ] DREAMPlaceFPGA - iter:  662, HPWL 8.828119E+03, Overflow [9.929E-02, 1.630E-02, 0.000E+00, 0.000E+00], time 1.459ms
[INFO   ] DREAMPlaceFPGA - iter:  663, HPWL 8.795461E+03, Overflow [9.738E-02, 1.653E-02, 0.000E+00, 0.000E+00], time 1.453ms
[INFO   ] DREAMPlaceFPGA - iter:  664, HPWL 8.795823E+03, Overflow [9.447E-02, 1.617E-02, 0.000E+00, 0.000E+00], time 1.484ms
[INFO   ] DREAMPlaceFPGA - Lgamma stopping criteria: 664 > 100 and (( OVFL: 0.0944678 < 0.1; 0.0161708 < 0.1; 0 < 0.2; 0 < 0.2 and HPWL 8795.82 > 8795.46 ) or 1.61905 < 1.0) and DSP/RAM block legal iter 90 >= 5
[INFO   ] DREAMPlaceFPGA - Global Placement completed in 9.24 seconds
[INFO   ] DREAMPlaceFPGA - write placement solution to results/design/design.gp.pl took 0.005 seconds
[INFO   ] DREAMPlaceFPGA - Legalization and Detailed Placement run using elfPlace (CPU): ./thirdparty/elfPlace_LG_DP --aux benchmarks/FPGA-example1/design.aux --numThreads 1 --pl results/design/design_final.pl
[INF 2022-08-12 17:53:08    0.00 sec]  ----- Command-Line Options -----
[INF 2022-08-12 17:53:08    0.00 sec]  numThreads = 1
[INF 2022-08-12 17:53:08    0.00 sec]  --------------------------------
[INF 2022-08-12 17:53:08    0.00 sec]  Parsing file benchmarks/FPGA-example1/design.aux
[INF 2022-08-12 17:53:08    0.00 sec]  Parsing file benchmarks/FPGA-example1/design.lib
[INF 2022-08-12 17:53:08    0.00 sec]  Parsing file benchmarks/FPGA-example1/design.scl
[INF 2022-08-12 17:53:08    0.01 sec]  Parsing file benchmarks/FPGA-example1/design.nodes
[INF 2022-08-12 17:53:08    0.01 sec]  Parsing file benchmarks/FPGA-example1/design.pl
[INF 2022-08-12 17:53:08    0.01 sec]  Parsing file benchmarks/FPGA-example1/design.nets
[INF 2022-08-12 17:53:08    0.02 sec]  GP instance stddev = 0.18, trunc = 2.50
[INF 2022-08-12 17:53:08    0.02 sec]  Import placement from file gp.pl
[INF 2022-08-12 17:53:09    1.72 sec]  Export solution to file results/design/design_final.pl
[INFO   ] DREAMPlaceFPGA - Legalization and detailed placement completed in 1.729 seconds
[INFO   ] DREAMPlaceFPGA - Completed Placement in 11.093 seconds