IntelligentSoftwareSystems / Galois

Galois: C++ library for multi-core and multi-node parallelization
http://iss.ices.utexas.edu/?p=projects/galois
Other
315 stars 133 forks source link

AIG rewriting #132

Closed yishanlu closed 4 years ago

yishanlu commented 4 years ago
  1. Move from lonestar/experimental/aigRewriting to lonestar/eda/aigRewriting
  2. Sync with changes for galois::graphs::First_SepInOut_Graph as in #115.
  3. Testcases
  4. Webpage
yishanlu commented 4 years ago

Thanks @insertinterestingnamehere for taking care of point 2.

Point 1. will be done along with other app reorg; now it is in lonestar/

The warnings are fixed except for 40 -Wunused-functions and 1 -Wunused-but-set-variable (actually used in assert()).

We can use EPFL combinational circuits as test cases for sanity check. This is available on ohm, and the compiled executable runs normally with one of the circuits there. So what is required for test cases?

yishanlu commented 4 years ago

Confirmed using ABC from UC Berkeley that mem_ctrl.aig from EPFL benchmark suite is equivalent to mem_ctrl_rewritten.aig, the output generated by aigRewriting. This circuit is available at /net/ohm/export/iss/inputs/eda/logic-synthesis/EPFL/random_control/mem_ctrl/aiger/mem_ctrl.aig.

Will add a test for AIG rewriting using this circuit and the generated output after #159 is merged back to master branch.

insertinterestingnamehere commented 4 years ago

A test is the only thing still needed here.

yishanlu commented 4 years ago

The following changes are available in our private master branch:

  1. Converted the command line parsing to using LonestarStart() for uniform testing commands.
  2. Added a test (using /net/ohm/export/iss/inputs/eda/logic-synthesis/EPFL/arithmetic/adder/aiger/adder.aig).

In case you need the input path for test setup, the input AIGs are available at /net/ohm/export/iss/inputs/eda/logic-synthesis/EPFL/*/*/aiger/*.

roshandathathri commented 4 years ago

Many CI builds are failing due to aigRewriting. Failures can be seen in this PR: https://github.com/IntelligentSoftwareSystems/Galois/pull/199

insertinterestingnamehere commented 4 years ago

I'll just disable that test in CI until we get it fixed.

insertinterestingnamehere commented 4 years ago

WRT the crashes not fixed in https://github.com/IntelligentSoftwareSystems/Galois/pull/200: I can now reproduce these crashes on an Ubuntu 18.04 VM, just not on our development machines. The cause is still not clear.

insertinterestingnamehere commented 4 years ago

Here's the backtrace. Fortunately it doesn't lead through a pile of Galois library code so it may be something we can fix easily:

#0  0x0000555555593dc7 in algorithm::PreCompGraphManager::addForestNode (
    this=0x7fffffffd2b0, p0=0x555555a04f60, p1=0x555555a04f30, fExor=0, 
    Level=1, Volume=1)
    at /home/me/Galois/lonestar/eda/cpu/aigRewriting/algorithms/PreCompGraphManager.cpp:510
#1  0x0000555555593d19 in algorithm::PreCompGraphManager::loadPreCompGraphFromArray (this=0x7fffffffd2b0)
    at /home/me/Galois/lonestar/eda/cpu/aigRewriting/algorithms/PreCompGraphManager.cpp:496
#2  0x000055555556e2f1 in aigRewriting (aig=..., fileName="adder", nThreads=1, 
    verbose=true) at /home/me/Galois/lonestar/eda/cpu/aigRewriting/main.cpp:128
#3  0x000055555556dedf in main (argc=3, argv=0x7fffffffdfc8)
    at /home/me/Galois/lonestar/eda/cpu/aigRewriting/main.cpp:91
yishanlu commented 4 years ago

Which compiler are you using to reproduce this? And which input graph? I may be able to reproduce this using a virtual machine on my laptop running w/ one thread.

insertinterestingnamehere commented 4 years ago

I'm using an Ubuntu 18.04 virtual machine on my laptop. After configuring, running make input, changing to the aigRewriting folder, and building, the command I'm running is ./aigRewriting "../../../../inputs/eda/logic-synthesis/EPFL/arithmetic/adder/aiger/adder.aig" -v, or, if you just want to copy-paste the command for running it in gdb: gdb -ex=r --args ./aigRewriting "../../../../inputs/eda/logic-synthesis/EPFL/arithmetic/adder/aiger/adder.aig" -v.

insertinterestingnamehere commented 4 years ago

The compiler is the ubuntu 18.04 default gcc/g++ (version 7.5.0). The crash shows up in Release and Debug builds.

yishanlu commented 4 years ago

The crash was caused by operand size mismatch in logic op on pointers. I fixed the bugs in my virtual machine setting; and tested to be working in both my virtual machine and our 56-core machine, and for both release and debug builds. Confirmed using ABC that the rewriting results are equivalent for both adder.aig and voter.aig.

The fix is available in our private master branch. Please take a look.

insertinterestingnamehere commented 4 years ago

Just confirmed that it works on my VM. I'll re-enable the test in CI as well.

yishanlu commented 4 years ago

Fixed in #226. Closed.