Skip to content

Commit

Permalink
[Docs] update installation instructions; beautify; news
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebotu committed Dec 7, 2024
1 parent f54299b commit e74ae21
Showing 1 changed file with 34 additions and 18 deletions.
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
<div align="center">

# DevFormer
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_red.svg)](https://dppbench.streamlit.app/)![example workflow](https://github.com/kaist-silab/DPPBench/actions/workflows/pytest.yml/badge.svg) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)[![python_sup](https://img.shields.io/badge/python-3.7+-blue.svg?)](https://www.python.org/downloads/release/python-370/)

[![arXiv](https://img.shields.io/badge/arXiv-paper-b31b1b.svg)](https://arxiv.org/abs/2205.13225) [![Slack](https://img.shields.io/badge/slack-chat-611f69.svg?logo=slack)](https://join.slack.com/t/rl4co/shared_invite/zt-1ytz2c1v4-0IkQ8NQH4TRXIX8PrRmDhQ)
![example workflow](https://github.com/ai4co/devformer/actions/workflows/pytest.yml/badge.svg) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)[![python_sup](https://img.shields.io/badge/python-3.9+-blue.svg?)](https://www.python.org/downloads/release/python-390/)

<p align="center">
<img src="pages/assets/objective.png" width="500"/>
</p>
</p>

</div>

This repository contains the benchmark for the decoupling capacitor placement problem (DPP) and the accompanying paper "DevFormer: A Symmetric Transformer for Context-Aware Device Placement", accepted at ICML 2023. The benchmark is designed to evaluate the performance of the proposed DevFormer architecture and to facilitate future research in hardware design optimization.

> The DPP and its multi-port variants are now available as environments in [RL4CO](https://github.com/kaist-silab/rl4co)! 🚀

## Setup
## 📰 News
- September 2024: the DPP has been featured in the NeurIPS 2024 paper [ReEvo](https://github.com/ai4co/reevo), where a new SOTA heuristic was discovered by LLMs
- September 2023: The DPP and its multi-port variants are now available as environments in [RL4CO](https://github.com/ai4co/rl4co)
- May 2023: The paper "DevFormer: A Symmetric Transformer for Context-Aware Device Placement" has been accepted at ICML 2023 🎉

## 📦 Setup

### Install dependencies
```bash
# Clone the repository and cd into it
git clone https://github.com/kaist-silab/DPP_benchmark.git && cd DPP_benchmark

# Automatically install dependencies with light the torch
pip install light-the-torch && python3 -m light_the_torch install --upgrade -r requirements.txt
After cloning the repository, you can install the dependencies with the following commands:
```bash
git clone https://github.com/ai4co/devformer.git && cd devformer
pip install -e ".[app,dev]"
```
The above script will [automatically install](https://github.com/pmeier/light-the-torch) PyTorch with the right GPU version for your system. Alternatively, you can use `pip install -r requirements.txt`

## Usage
This will also install the development dependencies, which include the necessary packages for running the tests and the Streamlit application.

## 🚀 Usage
### Simulator
* Using the simulator to obtain the cost of a solution:

Expand All @@ -47,9 +53,9 @@ You may also have a look at the arguments under [src/options.py](src/options.py)
```bash
python3 run.py --problem dpp --model devformer --resume data/dpp/pretrained/CSE_2000_epoch-50.pt --eval_only
```

* How to train DevFormer

```bash
python3 run.py --problem dpp --model devformer --N_aug 4 --training_mode IL --train_dataset data/dpp/training_2000_new.pkl --guiding_action data/dpp/guiding_2000_new.pkl --EE --SE --batch_size 200
```
Expand All @@ -60,12 +66,12 @@ Additionally, the folder [scripts/](scripts/) contains scripts to reproduce the
- There may be problems on multiple GPUs due to the current handling of DataParallel. You may run `export CUDA_VISIBLE_DEVICES=0` to use only one GPU.
- When running the `run.py` script, if data has not been download it will start downloading automatically. If you want to download the data manually, or if there are any issues with Google Drive, you may access the data at the [following link](https://drive.google.com/file/d/1cANSJRW7STCl_7cWacDajWMXcEUQG1SK/view) and place extract the content of the `.zip` archive at this repository root `.`.

---
---

## DPP Simulator GUI
## DPP Simulator GUI 🎨
<p align="center">
<img src="pages/assets/catchy.png" width="500"/>
</p>
</p>


The application is based on [Streamlit](https://streamlit.io/) which allows for web GUIs in Python. To run the application locally, run the following command:
Expand Down Expand Up @@ -94,9 +100,10 @@ Most radical modifications are not supported in Streamlit, so we hack our way an
There are many ways to deploy the app, among which on our own server. However, Streamlit provides a [free hosting service](https://docs.streamlit.io/streamlit-cloud/get-started/deploy-an-app) that is sufficient for our purposes. To deploy the app, simply follow the instructions there or click the "deploy" button after running the app locally!

---
### Cite us

If you find this repository useful, please consider citing our paper:

### 🤩 Citation
If you find DevFormer valuable for your research or applied projects:

```
@article{kim2023devformer,
Expand All @@ -107,3 +114,12 @@ If you find this repository useful, please consider citing our paper:
organization={PMLR}
}
```


---

<div align="center">
<a href="https://github.com/ai4co">
<img src="https://raw.githubusercontent.com/ai4co/assets/main/svg/ai4co_animated_full.svg" alt="AI4CO Logo" style="width: 30%; height: auto;">
</a>
</div>

0 comments on commit e74ae21

Please sign in to comment.