ECE 647 TERM PROJECT MiniSAT parallelization Shahadat Hossain Saud Wasly.

Slides:



Advertisements
Similar presentations
Boolean Satisfiability
Advertisements

Threads Relation to processes Threads exist as subsets of processes Threads share memory and state information within a process Switching between threads.
Time-Space Tradeoffs in Resolution: Superpolynomial Lower Bounds for Superlinear Space Chris Beck Princeton University Joint work with Paul Beame & Russell.
Presented by Monissa Mohan 1.  A highly optimized BCP algorithm  Two watched literals  Fast Backtracking  Efficient Decision Heuristic  Focused on.
Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Presenting:
CSCI 4717/5717 Computer Architecture
Practical techniques & Examples
Introduction to MiniSat v1.14 Presented by Yunho Kim Provable Software Lab, KAIST.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View SAT.
1/30 SAT Solver Changki PSWLAB SAT Solver Daniel Kroening, Ofer Strichman.
IBM Labs in Haifa © 2005 IBM Corporation Adaptive Application of SAT Solving Techniques Ohad Shacham and Karen Yorav Presented by Sharon Barner.
Hrinking hrinking A signment tack tack. Agenda Introduction Algorithm Description Heuristics Experimental Results Conclusions.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
Efficient SAT Solving for Non- clausal Formulas using DPLL, Graphs, and Watched-cuts Himanshu Jain Edmund M. Clarke.
State-of-the-art in SAT solvers
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
SAT Solving Presented by Avi Yadgar. The SAT Problem Given a Boolean formula, look for assignment A for such that.  A is a solution for. A partial assignment.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 21: April 21, 2008 Modern SAT Solvers ({z}Chaff, GRASP,miniSAT)
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Introduction to Symmetric Multiprocessors Süha TUNA Bilişim Enstitüsü UHeM Yaz Çalıştayı
Computer System Architectures Computer System Software
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
Boolean Satisfiability and SAT Solvers
Threads, Thread management & Resource Management.
Large-scale Hybrid Parallel SAT Solving Nishant Totla, Aditya Devarakonda, Sanjit Seshia.
MBSat Satisfiability Program and Heuristics Brief Overview VLSI Testing B Marc Boulé April 2001 McGill University Electrical and Computer Engineering.
Motivation & Goal SAT and Constraint Processing (CP) are fundamental areas of Computer Science that address the same computational questions. Compare SAT.
1 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and.
Games Development 2 Concurrent Programming CO3301 Week 9.
Parallelizing MiniSat I-Ting Angelina Lee Justin Zhang May 05, Final Project Presentation.
Christopher Moh 2005 Competition Programming Analyzing and Solving problems.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
CAS 721 Course Project Implementing Branch and Bound, and Tabu search for combinatorial computing problem By Ho Fai Ko ( )
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
Boolean Satisfiability Present and Future
Department of Computer Science and Software Engineering
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
Operating Systems: Internals and Design Principles
Threads, Thread management & Resource Management.
SAT Solver Heuristics. SAT-solver History Started with David-Putnam-Logemann-Loveland (DPLL) (1962) –Able to solve variable problems Satz (Chu Min.
Threads. Readings r Silberschatz et al : Chapter 4.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
Custom Computing Machines for the Set Covering Problem Paper Written By: Christian Plessl and Marco Platzner Swiss Federal Institute of Technology, 2002.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
REU 2007-ParSat: A Parallel SAT Solver Christopher Earl, Mentor: Dr. Hao Zheng Department of Computer Science & Engineering Introduction Results and Conclusions.
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
CS137: Electronic Design Automation
Hardware Acceleration of A Boolean Satisfiability Solver
Inference and search for the propositional satisfiability problem
Introduction to MiniSAT
Parallel Programming By J. H. Wang May 2, 2017.
Parallelism in SAT Solvers
Threads and Cooperation
SAT-Based Area Recovery in Technology Mapping
Introduction to the Boolean Satisfiability Problem
Unit Propagation and Variable Ordering in MiniSAT
A Progressive Approach for Satisfiability Modulo Theories
Unit Propagation and Variable Ordering in MiniSAT
Resolution Proofs for Combinational Equivalence
Introduction to the Boolean Satisfiability Problem
Solving Non-clausal Formulas with DPLL search
GRASP-an efficient SAT solver
Presentation transcript:

ECE 647 TERM PROJECT MiniSAT parallelization Shahadat Hossain Saud Wasly

A GENDA Introduction MiniSAT Background MiniSAT Algorithm Objectives Difficulties Implemented changes Results Conclusion Questions

T HE SAT P ROBLEM + M INI SAT Boolean Satisfiablity is a mathematical problem to find if a given set of variables can be assigned in a such a way that all given constraints are met SAT problems commonly arise in EDA applications MiniSAT is an open source SAT solver created in 2003 Designed to be extensible; Original code was ~700 lines Current code ~1k lines SAT competition Main track: Optimize any SAT solver Parallel track: parallelize any SAT solver MiniSAT Hack track: minor changes to miniSAT

F ORMAT AND T ERMINOLOGY SAT problems are presented in Conjunctive Normal Form (CNF) F=(x1 v ¬x2 v ¬x3) ∧ (¬ x1 x5 ¬x7 x20) ∧ (...) ∧... Variables: x1, x2, x3,... Literals: A variable and its negation x1 AND ¬ x1, x2 AND ¬ x2,... Clause: A collection of variables that have an OR relationship (x1 v ¬x2 v ¬x3) A clause can be true, false, free, or asserting

I NTERNAL S TRUCTURES Clause Database: Contains all clauses (input constraints) and all assigned literals Learnts: Vector of literals that have been learnt from assertions Trail: Literal path taken so far Watches: Vector of literals to watch since they are closely related to those that have been changed Order Heap: Priority heap Decision Level: The level an assertion has been propagated to; used for backtracking c simple_v3_c2.cnf c p cnf

M INI SAT A LGORITHM MiniSAT uses 2 methods to solve a SAT problem: Conflict-driven backtracking Program makes assertions on variables When clause becomes asserting, MiniSAT ‘learns’ a literal When a conflict arises, backtrack and ‘unlearn’ literals Dynamic Variable Ordering* When literal is asserted, related literal is moved to top of stack Exit Condition All literals assigned (SAT), no conflicts Backtracked to root of tree (UNSAT)

P ARALLELIZATION Why Parallelize? Large problems can take hours to solve On modern multi-core computers, MiniSAT isn’t taking advantage of total processing power MiniSAT is essentially a trial-and-error algorithm, should benefit from multiple copies of same program MiniSAT occasionally learns constraints, data that be shared between threads

P ROPOSED I MPROVEMENTS Parallelize base program Task parallel vs. Data parallel Parallelize tasks (with synchronization) or copy entire program Assign different heuristics to different threads Current MiniSAT uses activity based (dynamic) prioritization Excellent for single thread, but cannot be extended Divide Literal branches and assign a sequential heuristic* Assign a random heuristic within a given solution space* Hybrid heuristic combining all 3 Share common database between threads** Difficult to implement because of backtracking Only clauseDB is global, and frequent R/W will become a bottleneck

I MPLEMENTATION Currently have multiple threads working in parallel Threads are synchronized for exit Thread creation is dynamic, based on the number of cores in the system Preventing OS from changing core assignment Currently have 3 working heuristics Single processor execution results in original miniSAT (activity based stack heuristic) 2 nd thread will be a FIFO search algorithm Following threads will be random search heuristics* All new heuristics are activity based, but have different prioritization Random decisions are randomized based on thread When there is no chain activity to follow, miniSAT makes a random decision Random decision is seeded with thread ID and is thus unrelated from thread to thread

C HALLENGES Testing CNF files can be extremely large and time consuming to solve SAT competition benchmark files can have over 200,000 variables and take 30+ mins to solve Poorly Written Code Algorithms are clearly defined in documentation, but actual code has very few comments Variable names are not always descriptive Thread and data synchronization Data structures are large and smaller structures are prone to ‘backtracking’ Multiple solutions A SAT problem may have more than 1 possible solution Verifying a solution?

T RADEOFFS - A LGORITHM Initial activity based heuristic has variable performance Because of the way MiniSAT is programmed, changing the input variable order has a significant impact on processing time Ordered Heap is a stack implementation, so removing from the bottom adds considerable processing time Virtually requires a rebuilding of the stack every time Ideally, a few threads will execute sequentially, while other threads “learn” randomly for the main threads Requires a moderate level of communication between threads

T RADEOFFS - P ARALLELIZATION Frequent access to shared/protected data reduces processing speed For long literals and deep propagations, parallelization should be useful More threads result in more memory usage Leads to frequent garbage collection Reduces work space of every thread

W ORK R EMAINING Introduce data sharing/synchronization Small data structures (e.g: learnts list)cannot be shared because of backtracking Sharing learnt would require tracking of which thread has learned what, so the appropriate part can be ‘unlearnt’ After unlearning, the entire list would have to be recreated Requires substantial changes to existing code and algorithm Large data structures (e.g: clauseDB) are ideal for sharing Would reduce the overall memory usage Would slow down processing time because of frequent access Actual database structure is not well defined

I DEAL I MPLEMENTATION Functions currently built to search branches independently With data synchronization, separate branches can help each other by learning new information and introducing new constraints

P RELIMINARY R ESULTS The sequential heuristic can beat the miniSAT heuristic in some cases Because of random variables introduced, the execution time of multiple threads is variable Tested small problem on 2 cores Execution time depends on particular CNF file used Sequential heuristic is occasionally better (by as much as 20%) Tested small problem on 6 cores (ecelinux), but system has memory/quota issues Time tracking is potentially incorrect on multicore Re-implemented to reflect actual time

P RELIMINARY R ESULTS 2 Parallelized miniSAT output Original miniSAT output

C ONCLUSION Synchronization of parallel miniSAT is an extremely complex problem Provides excellent exposure to SAT solving algorithm (DPLL algorithm) and practical problems faced while implementing 4 competitors in 2009 SAT competition No solver could solve hard difficulty SAT problems within time limit

SAT COMPETITION R ESULTS MiniSAT performance is hard to beat!! Only 1 contestant from the parallel group placed in the top 20 (ManySAT) Modifications can result in previously solvable problems becoming unsolvable

R EFERENCE 2009 Sat Competition Results slides.pdf slides.pdf POSIX thread (pthread) libraries hreads.html

Q UESTIONS