Unverified Commit bce4a661 by Yucheng Wang Committed by GitHub

Update README.md

parent fc7b030e
# PlacementCost # PlacementCost
`plc_client_os` is a reversed-engineered work to provide almost the same functionaility with Google's plc_client API. The codebase is available in Cython for faster runtime while being easily accessible. While Circuit Training repository does provide [documentation](https://github.com/google-research/circuit_training/blob/main/docs/PLACEMENT_COST.md) for their plc_client, we provide complete functions and detailed documentations in our codebase.
## Quick Start ## Quick Start
Under `MACROPLACEMENT/CodeElements` directory, run the following command: Under `MACROPLACEMENT/CodeElements` directory, run the following command:
``` ```
...@@ -11,6 +11,9 @@ sudo curl https://storage.googleapis.com/rl-infra-public/circuit-training/placem ...@@ -11,6 +11,9 @@ sudo curl https://storage.googleapis.com/rl-infra-public/circuit-training/placem
# Run plc testbench # Run plc testbench
# python -m Plc_client.plc_client_os_test [-h] [--helpfull] --netlist NETLIST [--plc PLC] --width WIDTH --height HEIGHT --col COL --row ROW [--rpmh RPMH] [--rpmv RPMV] [--marh MARH] [--marv MARV] [--smooth SMOOTH] # python -m Plc_client.plc_client_os_test [-h] [--helpfull] --netlist NETLIST [--plc PLC] --width WIDTH --height HEIGHT --col COL --row ROW [--rpmh RPMH] [--rpmv RPMV] [--marh MARH] [--marv MARV] [--smooth SMOOTH]
# Compile Cython
python Plc_client.setup.py build_ext --inplace
# Example # Example
python -m Plc_client.plc_client_os_test --netlist ./Plc_client/test/ariane/netlist.pb.txt\ python -m Plc_client.plc_client_os_test --netlist ./Plc_client/test/ariane/netlist.pb.txt\
--plc ./Plc_client/test/ariane/initial.plc\ --plc ./Plc_client/test/ariane/initial.plc\
...@@ -27,13 +30,6 @@ python -m Plc_client.plc_client_os_test --netlist ./Plc_client/test/ariane/netli ...@@ -27,13 +30,6 @@ python -m Plc_client.plc_client_os_test --netlist ./Plc_client/test/ariane/netli
You may uncomment any available tests and even run your own test dataset. We do not handle all corner cases since during RL placement, they are unlikely to occur. Our aim here is to reproduce Google's code as much as possible and be able to plug into Circuit Training Flow. You may uncomment any available tests and even run your own test dataset. We do not handle all corner cases since during RL placement, they are unlikely to occur. Our aim here is to reproduce Google's code as much as possible and be able to plug into Circuit Training Flow.
## How to run our code in Circuit Training?
Once you have downloaded Google's Circuit Training code, replace the environment.py with environment_ct.py (**you do need to change the name of the file**). Then, copy `plc_client_os.py` under the same directory (**you should not replace it with `plc_client.py` and should not change the name of the file**).
Since Force Directed Placer for the soft macros is not implemented yet, our code is essentially running Google's `plc_client.py` in parallel with our `plc_client_os.py` but extracting input from our code only except for soft macro positions. The memory usage will double and the runtime tends to be longer. However, with this "more open sourced" version of Circuit Training, we do see comparable training quality as using Google's API.
If you wish to find any discrepancies between these outputs, toggle `DEBUG` to `True` [here](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/e634766f6aa53510c3fe8062896a6020f7ff18d1/CodeElements/Plc_client/environment_ct.py#L42) at the beginning of `environment_ct.py`. This will save all discrepancies into the corresponding folders.
## Implementation Details ## Implementation Details
For complete information on how the proxy cost is computed in our code, please refer to [Proxy Cost Documentation](https://tilos-ai-institute.github.io/MacroPlacement/Docs/ProxyCost/). Below is a quick overview of the formulation. For complete information on how the proxy cost is computed in our code, please refer to [Proxy Cost Documentation](https://tilos-ai-institute.github.io/MacroPlacement/Docs/ProxyCost/). Below is a quick overview of the formulation.
...@@ -97,6 +93,11 @@ $$ ...@@ -97,6 +93,11 @@ $$
Notice a smoothing range can be set for congestion. This is only applied to congestion due to net routing which by counting adjacent cells and adding the averaged congestion to these adjacent cells. More details are provided in the document above. Notice a smoothing range can be set for congestion. This is only applied to congestion due to net routing which by counting adjacent cells and adding the averaged congestion to these adjacent cells. More details are provided in the document above.
## FD Placement
To enable FD placement, please forward to [FD Placement section](https://github.com/TILOS-AI-Institute/MacroPlacement/tree/main/CodeElements/FDPlacement) where we provide full implementation in C++ for faster runtime. Our Cython codebase is fully integrated with our FD implementation. Once you generated the FD executable `fd_placer`, move it under the same directory as your `plc_client_os.pyx` source code directory. Then, FD functionailty should be enabled without extra steps.
For Details on how FD works, we provide documentation [here](https://github.com/TILOS-AI-Institute/MacroPlacement/blob/main/CodeElements/FDPlacement/README.md).
## DISCLAIMER ## DISCLAIMER
**We DO NOT own the original content of placement_util_os.py, observation_extractor_os.py, environment_os.py, environment_ct.py, coordinate_descent_placer.py. All rights belong to Google Authors. These are modified version of the original code and we are including in the repo for the sake of testing. Original Code can be viewed [here](https://github.com/google-research/circuit_training/blob/main/circuit_training/environment/placement_util.py)**. **We DO NOT own the original content of placement_util_os.py, observation_extractor_os.py, environment_os.py, environment_ct.py, coordinate_descent_placer.py. All rights belong to Google Authors. These are modified version of the original code and we are including in the repo for the sake of testing. Original Code can be viewed [here](https://github.com/google-research/circuit_training/blob/main/circuit_training/environment/placement_util.py)**.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment