Giter VIP home page Giter VIP logo

drills's Introduction

DRiLLS

Deep Reinforcement Learning for Logic Synthesis Optimization

Abstract

Logic synthesis requires extensive tuning of the synthesis optimization flow where the quality of results (QoR) depends on the sequence of opti-mizations used. Efficient design space exploration ischallenging due to the exponential number of possible optimization permutations. Therefore, automating the optimization process is necessary. In this work, we propose a novel reinforcement learning-based methodology that navigates the optimization space without human intervention. We demonstrate the training of an Advantage Actor Critic (A2C) agent that seeks to minimize area subject to a timing constraint. Using the proposed framework, designs can be optimized autonomously with no-humans in-loop.

Paper

DRiLLS has been presented at ASP-DAC 2020 and the manuscript is available on IEEE Xplore. A pre-print version is available on arXiv.

Setup

DRiLLS requires Python 3.6, pip3 and virtualenv installed on the system.

  1. virtualenv .venv --python=python3
  2. source .venv/bin/activate
  3. pip install -r requirements.txt

⚠️ WARNING ⚠️

Since TensorFlow 2.x is not compatible with TensorFlow 1.x, this implementation is tested only on Python 3.6. If you have a newer version of Python, pip won't be able to find tensorflow==1.x.

Run the agent

  1. Edit params.yml file. Comments in the file illustrate the individual fields.
  2. Run python drills.py train scl

For help, python drills.py -help

How It Works

There are two major components in DRiLLS framework:

  • Logic Synthesis environment: a setup of the design space exploration problem as a reinforcement learning task. The logic synthesis environment is implemented as a session in drills/scl_session.py and drills/fpga_session.py.
  • Reinforcement Learning environment: it employs an Advantage Actor Critic agent (A2C) to navigate the environment searching for the best optimization at a given state. It is implemented in drills/model.py and uses drills/features.py to extract AIG features.

DRiLLS agent exploring the design space of Max design.

For more details on the inner-workings of the framework, see Section 4 in the paper.

Reporting Bugs

Please, use ISSUE_TEMPLATE/bug_report.md to create an issue and describe your bug.

Contributing

Below is a list of suggested contributions you can make. Before you work on any, it is advised that you create an issue using the ISSUE_TEMPLATE/contribution.md to tell us what you plan to work on. This ensures that your work can be merged to the master branch in a timely manner.

Modernize Tensorflow Implementation

Google has recently released Dopamine which sets up a framework for researching reinforcement learning algorithms. A new version of DRiLLS would adopt Dopamine to make it easier to implement the model and session classes. If you are new to Dopamine and want to try it on a real use case, it would be a great fit for DRiLLS and will add a great value to our repository.

Better Integration

The current implementation interacts with the logic synthesis environment using files. This affects the run time of the agent training as it tries to extract features and statistics through files. A better integrations keeps a session of yosys and abc where the design is loaded once in the beginning and the feature extraction (and results extraction) are retrieved through this open session.

Study An Enhanced Model

The goal is to enhance the model architecture used in [drills/model.py]. An enhancement should give better results (less area AND meets timing constraints):

  • Deeper network architecure.
  • Changing gamma rate.
  • Changing learning rate.
  • Improve normalization.

Citation

@INPROCEEDINGS{9045559,
    author={A. {Hosny} and S. {Hashemi} and M. {Shalan} and S. {Reda}},
     booktitle={2020 25th Asia and South Pacific Design Automation Conference (ASP-DAC)},
     title={DRiLLS: Deep Reinforcement Learning for Logic Synthesis},
     year={2020},
     volume={},
     number={},
     pages={581-586},}

License

BSD 3-Clause License. See LICENSE file

drills's People

Contributors

abdelrahmanhosny avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drills's Issues

Where/How was the ASAP7 library obtained?

Hey,

Sorry for asking so bluntly:
I'm working on something similar using the Mockturtle library and I'm wondering where/how the ASAP7.lib file was obtained and if there is a GENLIB version of it.

thanks for your help!

Best,
Roman

Tensorflow v2 upgrade for DRiLLS Framework

Issue Faced and Potential Risks for the future

  • DRiLLS is currently based on tensorflow==1.12.0 , and when tried to be installed on windows with command:
    pip install tensorflow==1.12.0, returns an error of package not being found for python3.7.
  • Although the support for tensorflow 1.12 for linux/debian based OS still remains, it will not be the case in the near future.

I would recommend to upgrading to tensorflow v2.

Changes to DRiLLS Framework

  • The tensorflow's import statement will change as follows, to support all instances of v1 functions:
    import tensorflow.compat.v1 as tf.
  • The version of tensorflow in requirements.txt will change.

I would like to take up this issue, once the Dopamine implementation is complete.

The current version of Tensorflow installed via pip uses the AVX instruction set at compile time.

Tensorflow installed via pip uses the AVX instruction set at compile time.

To Reproduce
Steps to reproduce the behavior:

  1. Clone the latest DRiLLS
  2. Follow steps in setup,
  3. python3.6 drills.py -help
  4. Failure message
F tensorflow/core/platform/cpu_feature_guard.cc:37] The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine.
Aborted (core dumped)

Expected behavior
Expected to display drills.py help

Additional context
Found this online. The suggested fix is to get a TensorFlow that doesn't use AVX but it hasn't worked for me yet.

Where to download `tech.lib` and `design.v` files ?

Hi,
Thank you for such great work. Currently, I'm trying to reproduce the result from your paper. But when I run your source code, I have noticed that there is no tech.lib and design.v file. Could you give me a link to download the sample files ?
I have tried to use the standard cell library and examples from this repository but it doesn't work. https://github.com/The-OpenROAD-Project/asap7 (error: http://i.imgur.com/foeMq5x.png)

Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.