Parallelizing Mini Sat ITing Angelina Lee Justin Zhang



















- Slides: 19
Parallelizing Mini. Sat I-Ting Angelina Lee Justin Zhang May 05, 2010 6. 884 Final Project Presentation
Bottomline Ok, so we parallelized Mini. Sat … § Parallel Mini. Sat executing on single worker seems to exhibit the same behavior as the original Mini. Sat. § Paralell Mini. Sat running on single worker runs 3~4 times slower than the original Mini. Sat. § Parallel Mini. Sat running on multiple workers is still buggy. § But regardless, we manage to collect some data … 6. 884 Final Project Presentation
Normalized “Speedup” 6. 884 Final Project Presentation
Normalized #Inspects / Second 6. 884 Final Project Presentation
What Is A SAT Solver? f SAT Solver SAT / UNSAT f: Boolean formula written in Conjunctive Normal Form (CNF) e. g. ( x 1∨x 2∨¬x 3 ) ∧ ( y 1∨y 2) Variables: x 1, x 2, x 3, y 1, y 2 Literals: a variable or negation of a variable Clauses: Literals OR-ed together A SAT Solver solves the Boolean satisfiability (SAT) problem. 6. 884 Final Project Presentation
Terminology f: Boolean formula written in Conjunctive Normal Form (CNF) e. g. ( x 1∨x 2∨x 3 ) ∧ ( y 1∨y 2) Variables: x 1, x 2, x 3, y 1, y 2 Literals: a variable or negation of a variable A literal can be either true, false, or free. Clauses: Literals OR-ed together A clause is true if it contains a least one true literal. A clause is false if it contains all false literals. A clause is asserting if it contains one free literal, and the rest of its literals are false. A clause is free if it is not true, not false, and not asserting. 6. 884 Final Project Presentation
Mini. Sat Overview § Mini. Sat uses the following two strategies: § Conflict-driven backtracking § Dynamic variable ordering
Assume VS. Propagate trail x 7 T ¬ x 7 F x 3 , x 1 ¬ 9 ¬x Clause DB ¬x 3 x 2, 17 x 9 F x 3 F x 4 ¬x 17 x 4 x 8 , 8 x ¬x 4 assume x 15 T x 77 x 8 F x 77 x 4 x 77
Conflict-Driven Backtracking trail Clause DB ¬x 7 x 2 reasons ¬x 1 ¬x 3 x 8 assume x 4 ¬x 7 x 15 ¬x 3 x 15 x 1 ¬ , F x 7 x 2 x 4 , x 8 x 15 T F x 3 ¬x 2 X
Conflict-Driven Backtracking trail ¬x 7 x 2 ¬x 1 ¬x 23 Clause DB reasons assume ¬x 7 ¬x 1 , x 2 3, 2 x ¬ F x 7
Dynamic Variable Ordering trail ¬x 7 x 2 ¬x 1 ¬x 23 Clause DB reasons assume ¬x 7 activities ¬x 1 , x 2 order ? , 23 x ¬ F x 7
Parallelizing Mini. Sat x 7 F x 3 F F x 5 T X T T F F x 4 T abort F x 11 T x 2 T F x 8 T
How to Handle Various Data § Mini. Sat uses the following two strategies: § Conflict-driven backtracking § Assume: list of assumptions in chronological order § Clause DB: input constraints + learned clauses § Watch literals: used to quickly figure out which clauses are asserting. § Reasons: remembers why a variable assignment is made § Dynamic variable ordering § Activities: scores on how often variables are involved in conflicts § Order: variable ordering array sorted based on activity
How to Handle Various Data Generate order trail reasons watch list Context assume Copy upon successful steal Local copy per worker Gets updated by replaying assumes upon successful steal activities Clause DB Local copy per worker
Mini. Sat Overview while(no result yet) confl = propagate(); if(confl) then if( at root level ) then /* nothing to backtrack */ return UNSAT; (blevel, learnt) = analyze(confl); update_DB(learnt); cancel_assignmts(blevel); else /*no conflict*/ if( all vars assigned ) then return SAT; var = select_next(); assume( ~var ); 6. 884 Final Project Presentation
Recursive Mini. Sat Overview while(no result yet) else /*no conflict*/ if(all vars assigned) then confl = propagate(); set_result(SAT); if(confl) then blevel = -1; if(at root level) then break; set_result(UNSAT); var = select_next(); blevel = -1; assume(~var); break; blevel = search(depth+1); (blevel, learnt) = analyze(confl); if(blevel<depth) update_DB(learnt); break; cancel_assignmts(blevel); /*end of while*/ break; return blevel; int search (int depth); /*returns blevel*/ 6. 884 Final Project Presentation
Parallel Mini. Sat Overview while(no results yet) confl = propagate(); if(confl) then if( at root level ) then set_result(UNSAT); blevel = -1; break; (blevel, learnt) = analyze(confl); update_DB(learnt); cancel_assignmts(blevel); if(blevel > depth) break; else /*no conflict*/ if( all vars assigned ) then set_result(SAT); blevel = -1; break; var = select_next(); assume(~var , assumes); catch( spawn search(assumes) ); if(stolen and !aborting) then blevel = replay(assumes, new_assumes); if(blevel == depth) then assume(var, new_assumes); catch( spawn search(new_assumes) ); sync; if(blevel<depth) break; blevel = replay(assumes, new_assumes); 6. 884 Final Project Presentation
Parallel Mini. Sat Overview while(no results yet) fetch_from_global. DB(); process_fetch_clauses(); confl = propagate(); if(confl) then if( at root level ) then set_result(UNSAT); blevel = -1; break; (blevel, learnt) = analyze(confl); update_DB(learnt); cancel_assignmts(blevel); if(blevel > depth) break; else /*no conflict*/ if( all vars assigned ) then …… var = select_next(); assume(~var , assumes); catch( spawn search(assumes) ); if(stolen and !aborting) then blevel = replay(assumes, new_assumes); if(blevel == depth) then assume(var, new_assumes); catch( spawn search(new_assumes) ); sync; if(blevel<depth) break; blevel = replay(assumes, new_assumes); 6. 884 Final Project Presentation
Conclusion • Our design is nondeterministic and workeraware • An alternative design that is worker oblivious: – snapshot at every level – ignore learned clause from other worker • It seems challenging to make a deterministic parallel solver with the learning. 6. 884 Final Project Presentation



















