20
INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin, Texas, USA Tom ´ s Balyo, Peter Sanders, and Carsten Sinz | September 22, 2015 KIT – University of the State of Baden-Wuerttemberg and National Laboratory of the Helmholtz Association www.kit.edu

HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II

HordeSat: A Massively Parallel Portfolio SAT SolverSAT 2015, Austin, Texas, USA

Tomas Balyo, Peter Sanders, and Carsten Sinz | September 22, 2015

KIT – University of the State of Baden-Wuerttemberg and

National Laboratory of the Helmholtz Association

www.kit.edu

Page 2: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Definitions

CNF FormulaA Boolean variable has two values: True and False

A literal is Boolean variables or its negation

A clause is a disjunction (or) of literals

A CNF formula is a conjunction (and) of clauses

F = (x1 ∨ x2 ∨ x4) ∧ (x3 ∨ x1) ∧ (x1) ∧ (x2 ∨ x4)

SatisfiabilityA CNF formula is satisfiable if it has a satisfying assignment.

The problem of satisfiability (SAT) is to determine whether a givenCNF formula is satisfiable

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 2/20

Page 3: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

IntroductionGoalDesign a massively parallel SAT solver that runs well on clusters withthousands of processors (for industrial benchmarks)

ResultsHordeSat – new parallel solver

Experiments with industrial benchmarks with up to 2048 processors

Significant speedups, especially for hard instances

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 3/20

Page 4: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Parallel Sat Solving

Explicit Search Space Partitioningclassical approach, search space does not overlapeach solver starts with a different fixed partial assignmentlearned clauses are exchangedused in solvers for grids and clusters

Pure Portfoliomodern approach, simple but strongdifferent solver( configuration)s work on the same problemlearned clauses are exchangedoften used in solvers for multi-core PCs

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 4/20

Page 5: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Parallel Sat Solving

Explicit Search Space Partitioningclassical approach, search space does not overlapeach solver starts with a different fixed partial assignmentlearned clauses are exchangedused in solvers for grids and clusters

Pure Portfoliomodern approach, simple but strongdifferent solver( configuration)s work on the same problemlearned clauses are exchangedoften used in solvers for multi-core PCs

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 5/20

Page 6: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Design Principles

Modular Designblackbox approach to SAT solversany solver implementing a simple interface can be used

Decentralizationall nodes are equivalent, no central/master nodes

Overlapping Search and Communicationsearch procedure (SAT solver) never waits for clause exchangeat the expense of losing some shared clauses

Hierarchical Parallelizationrunning on clusters of multi-cpu nodesshared memory inter-node clause sharingmessage passing between nodes

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 6/20

Page 7: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Modular Design

Portfolio Solver Interface

void addClause(vector <int > clause );

SatResult solve (); // {SAT , UNSAT , UNKNOWN}

void setSolverInterrupt ();

void unsetSolverInterrupt ();

void setPhase(int var , bool phase);

void diversify(int rank , int size);

void addLearnedClause(vector <int > clause );

void setLearnedClauseCallback(LCCallback* clb);

void increaseClauseProduction ();

Lingeling implementation with just glue code

MiniSat implementation, small modification for learned clause stuff

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 7/20

Page 8: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Diversification

Setting Phases – ”void setPhase(int var, bool phase)”Random – each variable random phase on each node

Sparse – each variable random phase on exactly one node

Sparse Random – each variable random phase with prob. 1#solvers

Native Diversification – ”void diversify(int rank, int size)”Each solver implements in its own way

Example: random seed, restart/decision heuristic

For lingeling we used plingeling diversification

Best is to use Sparse Random together with Native Diversification.

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 8/20

Page 9: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Clause Sharing

Regular (every 1 second) collective all-to-all clause exchange

Exporting ClausesDuplicate clauses filtered using Bloom filters

Clause stored in a fixed buffer, when full clauses are discarded, whenunderfilled solvers are asked to produce more clauses

Shorter clauses are preferred

Concurrent Access – clauses are discarded

Importing ClausesFiltering duplicate clauses (Bloom filter)

Bloom filters are regularly cleared – the same clauses can beimported after some timeUseful since solvers seem to ”forget” important clauses

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 9/20

Page 10: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Overall Algorithm

The Same Code for Each Process

SolveFormula(F, rank , size) {

for i = 1 to #threads do {

s[i] = new PortfolioSolver(Lingeling );

s[i]. addClauses(F);

diversify(s[i], rank , size);

new Thread(s[i]. solve ());

}

forever do {

sleep (1) // 1 second

if (anySolverFinished) break;

exchangeLearnedClauses(s, rank , size);

}

}

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 10/20

Page 11: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments

BenchmarksSat Competition 2014+2011 Application track instances (545 inst.)Phase Transition Random 3-SAT (200 SAT + 200 UNSAT inst.)

Computers128 Nodes of the IC2 cluster

each with two octa-core Intel Xeon E5-2670 2.6GHz CPU, 64GB RAMconnected by InfiniBand 4X QDR Interconnect

In total 256 CPUs and 2048 cores

SetupEach node runs 4 processes each with 4 threads with Lingeling1000 seconds time limit (16.7 minutes) for parallel solvers50000 seconds (13.9 hours) for sequential solvers

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 11/20

Page 12: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments – Random 3-SAT

0

100

200

300

400

500

600

700

800

900

1000

0 20 40 60 80 100 120 140 160 180 200

Tim

e in s

eco

nd

s

Problems

Satisfiable Instances

No Diversification, No SharingOnly Sharing

Only DiversificationDiversification and Sharing

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 12/20

Page 13: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments – Random 3-SAT

0

100

200

300

400

500

600

700

800

900

1000

0 20 40 60 80 100 120 140 160

Tim

e in s

eco

nd

s

Problems

Unsatisfiable Instances

No Diversification, No SharingOnly Sharing

Only DiversificationDiversification and Sharing

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 13/20

Page 14: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments – (P)lingeling Comparison

0

100

200

300

400

500

600

700

800

900

1000

0 50 100 150 200 250 300 350 400

Tim

e in s

eco

nd

s

Problems

Lingeling (1 thread)Plingeling (8 threads)

HordeSat 1x8x1 (8 threads)Plingeling (16 threads)

HordeSat 1x16x1 (16 threads)

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 14/20

Page 15: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments – (P)lingeling Comparison

0

100

200

300

400

500

600

700

800

900

1000

0 50 100 150 200 250 300 350 400

Tim

e in s

eco

nd

s

Problems

Lingeling (1 thread)Plingeling (8 threads)

HordeSat 1x8x1 (8 threads)Plingeling (16 threads)

HordeSat 1x16x1 (16 threads)

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 15/20

Page 16: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments – Scalability on SAT 2011

0

200

400

600

800

1000

1200

0 50 100 150 200 250

Tim

e in s

eco

nd

s

Problems

Lingeling1x4x42x4x44x4x48x4x4

16x4x432x4x464x4x4

128x4x4

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 16/20

Page 17: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments – SAT 2011+2014

0

200

400

600

800

1000

1200

0 50 100 150 200 250 300 350 400 450 500

Tim

e in s

eco

nd

s

Problems

Lingeling1x4x42x4x44x4x48x4x4

16x4x432x4x464x4x4

128x4x4

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 17/20

Page 18: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments – Speedups

Big Instance = solved after 10 · (#threads) seconds by Lingeling

Core Parallel Both Speedup All Speedup BigSolvers Solved Solved Avg. Tot. Med. Avg. Tot. Med.

1x4x4 385 363 303 25.01 3.08 524 26.83 4.922x4x4 421 392 310 30.38 4.35 609 33.71 9.554x4x4 447 405 323 41.30 5.78 766 49.68 16.928x4x4 466 420 317 50.48 7.81 801 60.38 32.55

16x4x4 480 425 330 65.27 9.42 1006 85.23 63.7532x4x4 481 427 399 83.68 11.45 1763 167.13 162.2264x4x4 476 421 377 104.01 13.78 2138 295.76 540.89

128x4x4 476 421 407 109.34 13.05 2607 352.16 867.00

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 18/20

Page 19: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Experiments – Speedups on Big Inst.Big Instance = solved after 10 · (#threads) seconds by Lingeling

0.1

1

10

100

1000

10000

100000

0 50 100 150 200 250

Sp

eed

up

s

Problems

2x4x44x4x48x4x4

16x4x432x4x464x4x4

128x4x4

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 19/20

Page 20: HordeSat: A Massively Parallel Portfolio SAT Solver - SAT ...INSTITUTE OF THEORETICAL INFORMATICS, ALGORITHMICS II HordeSat: A Massively Parallel Portfolio SAT Solver SAT 2015, Austin,

Conclusion

HordeSat is scalable in highly parallel environments.

Superlinear and nearly linear scaling in average, total, and medianspeedups, particularly on hard instances.Runtimes of difficult SAT instances are reduced from hours tominutes on commodity clusters

This may open up new interactive applications

On a single machine we match the state-of-the-art performance ofPlingeling

Tomas Balyo, Peter Sanders, and Carsten Sinz – HordeSat September 22, 2015 20/20