Meta-algorithmic techniques in SAT solving: Automated configuration, selection and beyond
Holger H. Hoos
BETA Lab Department of Computer Science University of British Columbia Canada
Meta-algorithmic techniques in SAT solving: Automated - - PowerPoint PPT Presentation
Meta-algorithmic techniques in SAT solving: Automated configuration, selection and beyond Holger H. Hoos BETA Lab Department of Computer Science University of British Columbia Canada SAT/SMT Summer School Trento, Italy, 2012/06/12 What
BETA Lab Department of Computer Science University of British Columbia Canada
◮ Insights into SAT (theory) ◮ Creativity of algorithm designers
◮ Advanced debugging techniques
◮ Principled experimentation
◮ SAT competitions
Holger Hoos: Meta-algorithmic techniques in SAT solving 2
Holger Hoos: Meta-algorithmic techniques in SAT solving 3
◮ algorithms that operate upon other algorithms (SAT solvers)
◮ here: algorithms whose inputs include one or more SAT solvers
◮ configurators (e.g., ParamILS, GGA, SMAC) ◮ selectors (e.g., SATzilla, 3S) ◮ schedulers (e.g., aspeed; also: 3S, SATzilla) ◮ (parallel) portfolios (e.g., ManySAT, ppfolio) ◮ run-time predictors ◮ experimentation platforms (e.g., EDACC, HAL) Holger Hoos: Meta-algorithmic techniques in SAT solving 4
◮ no one knows how to best solve SAT (or any other
◮ state-of-the-art performance often achieved by combinations
◮ performance can be tricky to assess due to
◮ differences in behaviour across problem instances ◮ stochasticity
Holger Hoos: Meta-algorithmic techniques in SAT solving 5
◮ human intuitions can be misleading, abilities are limited
◮ use of fully specified procedures (rather than intuition /
Holger Hoos: Meta-algorithmic techniques in SAT solving 6
◮ Drosophila problem for computing science (and beyond)
◮ prototypical NP-hard problem ◮ prominent in various areas of CS and beyond ◮ important applications ◮ conceptual simplicity aids solver design / development
◮ active and diverse community ◮ SAT competitions
Holger Hoos: Meta-algorithmic techniques in SAT solving 7
Holger Hoos: Meta-algorithmic techniques in SAT solving 8
◮ iterative, manual process ◮ designer gradually introduces/modifies components or
◮ performance is tested on benchmark instances ◮ design often starts from generic or broadly applicable
Holger Hoos: Meta-algorithmic techniques in SAT solving 9
◮ During the design process, many decisions are made. ◮ Some choices take the form of parameters,
◮ Design decisions interact in complex ways.
Holger Hoos: Meta-algorithmic techniques in SAT solving 10
◮ Design process is labour-intensive. ◮ Design decisions often made in ad-hoc fasion,
◮ Human designers typically over-generalise observations,
◮ Implicit assumptions of independence, monotonicity
◮ Number of components and mechanisms tends to grow
Holger Hoos: Meta-algorithmic techniques in SAT solving 11
◮ Key idea: expose design choices as parameters,
◮ Given: algorithm A with parameters ¯
◮ Objective: find configuration c∗ ∈ C for which A performs
Holger Hoos: Meta-algorithmic techniques in SAT solving 12
Lo Hi
Holger Hoos: Meta-algorithmic techniques in SAT solving 13
Hutter, Babic, HH, Hu (2007) ◮ Goal: Solve suite of SAT-encoded software verification
◮ new DPLL-style SAT solver Spear (by Domagoj Babic)
◮ manual configuration by algorithm designer ◮ automated configuration using ParamILS, a generic
Hutter, HH, St¨ utzle (2007)
Holger Hoos: Meta-algorithmic techniques in SAT solving 14
◮ ≈ 500-fold speedup through use automated algorithm
◮ new state of the art (winner of 2007 SMT Competition, QF BV category)
Holger Hoos: Meta-algorithmic techniques in SAT solving 15
10
−2 10 −1 10 0 10 1 10 2 10 3 10 4
10
−2
10
−1
10 10
1
10
2
10
3
10
4
default config. [CPU sec] auto-config. [CPU sec]
Holger Hoos: Meta-algorithmic techniques in SAT solving 16
◮ enables better exploration of larger design spaces
◮ lets human designer focus on higher-level issues
◮ uses principled, fully formalised methods to find
◮ can be used to customise algorithms for use in
Holger Hoos: Meta-algorithmic techniques in SAT solving 17
◮ Standard optimisation techniques (e.g., CMA-ES – Hansen & Ostermeier 2001; MADS – Audet & Orban 2006) ◮ Advanced sampling methods (e.g., REVAC – Nannen & Eiben 2006–9) ◮ Racing (e.g., F-Race – Birattari, St¨ utzle, Paquete, Varrentrapp 2002; Iterative F-Race – Balaprakash, Birattari, St¨ utzle 2007) ◮ Model-free search (e.g., ParamILS – Hutter, HH, St¨ utzle 2007; Hutter, HH, Leyton-Brown, St¨ utzle 2009; GGA – Ans´
◮ Sequential model-based optimisation (e.g., SPO – Bartz-Beielstein 2006; SMAC – Hutter, HH, Leyton-Brown 2011–12)
Holger Hoos: Meta-algorithmic techniques in SAT solving 18
Holger Hoos: Meta-algorithmic techniques in SAT solving 19
Holger Hoos: Meta-algorithmic techniques in SAT solving 19
Holger Hoos: Meta-algorithmic techniques in SAT solving 19
Holger Hoos: Meta-algorithmic techniques in SAT solving 19
Holger Hoos: Meta-algorithmic techniques in SAT solving 19
Holger Hoos: Meta-algorithmic techniques in SAT solving 19
Holger Hoos: Meta-algorithmic techniques in SAT solving 19
◮ iterated local search in configuration space ◮ initialisation: pick best of default + R random configurations ◮ subsidiary local search: iterative first improvement,
◮ perturbation: change s randomly chosen parameters ◮ acceptance criterion: always select better configuration ◮ number of runs per configuration increases over time;
Holger Hoos: Meta-algorithmic techniques in SAT solving 20
KhudaBukhsh, Xu, HH, Leyton-Brown (2009)
◮ components from GSAT, WalkSAT, dynamic local search and
◮ flexible SLS framework (derived from UBCSAT) ◮ find performance-optimising instantiations using ParamILS
Holger Hoos: Meta-algorithmic techniques in SAT solving 21
◮ 41 parameters (mostly categorical) ◮ over 2 · 1011 configurations ◮ 6 well-known distributions of SAT instances
(QCP, SW-GCP, R3SAT, HGEN, FAC, CBMC-SE)
◮ 11 challenger algorithms
(includes all winning SLS solvers from SAT competitions 2003–2008)
Holger Hoos: Meta-algorithmic techniques in SAT solving 22
◮ factor 70–1000 performance improvements over best
◮ factor 1.4–2 performance improvement over best challengers
Holger Hoos: Meta-algorithmic techniques in SAT solving 23
10
−2
10
−1
10 10
1
10
2
10
3
10
−2
10
−1
10 10
1
10
2
10
3
SATenstein−LS[CBMC−SE] median runtime (CPU sec) VW median runtime (CPU sec)
SOLVED BY BOTH SOLVED BY ONE Holger Hoos: Meta-algorithmic techniques in SAT solving 24
10
−2
10
−1
10 10
1
10
2
10
3
10
−2
10
−1
10 10
1
10
2
10
3
SATenstein−LS[CBMC−SE] median runtime (CPU sec) Oracle median runtime (CPU sec)
SOLVED BY BOTH SOLVED BY ONE Holger Hoos: Meta-algorithmic techniques in SAT solving 25
◮ Given: set S of algorithms for a problem, representative
◮ Objective: select from S the algorithm expected to solve
Holger Hoos: Meta-algorithmic techniques in SAT solving 26
◮ exhaustive evaluation: run all solvers on all instances ◮ racing methods: eliminate solvers as soon as they
(Maron & Moore 1994; Birattari, St¨ utzle, Paquete, Varrentrapp 2002)
Holger Hoos: Meta-algorithmic techniques in SAT solving 27
algorithms problem instances
Holger Hoos: Meta-algorithmic techniques in SAT solving 28
algorithms problem instances
Holger Hoos: Meta-algorithmic techniques in SAT solving 28
algorithms problem instances
Holger Hoos: Meta-algorithmic techniques in SAT solving 28
◮ use sets of instances at each stage of the race ◮ racing within (reasonably) homogenous subsets ◮ order instances according to difficulty (ordered racing)
(Styles & HH – in preparation)
(Balaprakash, Birattari, St¨ utzle 2007)
Holger Hoos: Meta-algorithmic techniques in SAT solving 29
◮ Given: set S of algorithms for a problem, problem instance π ◮ Objective: select from S the algorithm expected to solve π
Holger Hoos: Meta-algorithmic techniques in SAT solving 30
selector component algorithms feature extractor
Holger Hoos: Meta-algorithmic techniques in SAT solving 31
◮ set of (state-of-the-art) solvers ◮ set of cheaply computable, informative features ◮ efficient procedure for mapping features to solvers (selector) ◮ training data ◮ procedure for building good selector based on training data
Holger Hoos: Meta-algorithmic techniques in SAT solving 32
◮ classification-based: predict the best solver,
◮ decision trees
(Guerri & Milano 2004)
◮ case-based reasoning
(Gebruers, Guerri, Hnich, Milano 2004)
◮ (weighted) k-nearest neighbours
(Malitsky, Sabharwal, Samulowitz, Sellmann 2011; Kadioglu, Malitsky, Sabharwal, Samulowitz, Sellmann 2011)
◮ pairwise cost-sensitive decision forests + voting
(Xu, Hutter, HH, Leyton-Brown 2012) ◮ regression-based: predict running time for each solver,
(Leyton-Brown, Nudelman, Shoham 2003; Xu, Hutter, HH, Leyton-Brown 2007–9)
Holger Hoos: Meta-algorithmic techniques in SAT solving 33
◮ Use generic and problem-specific features that correlate with
◮ number of clauses, variables, . . . ◮ constraint graph features ◮ local & complete search probes
◮ Use as features statistics of distributions,
◮ Consider combinations of features (e.g., pairwise products
Holger Hoos: Meta-algorithmic techniques in SAT solving 34
◮ use state-of-the-art complete (DPLL/CDCL) and incomplete
◮ extract (up to) 84 polytime-computable instance features ◮ use ridge regression on selected features to predict solver
◮ run solver with best predicted performance
Holger Hoos: Meta-algorithmic techniques in SAT solving 35
◮ use pre-solvers to solve ‘easy’ instances quickly ◮ build run-time predictors for various types of instances,
◮ predict time required for feature computation; if that time
◮ use method by Schmee & Hahn (1979) to deal with
Holger Hoos: Meta-algorithmic techniques in SAT solving 36
◮ uninformative features ◮ correlated features ◮ feature normalisation (tricky!) ◮ cost of misclassification
Holger Hoos: Meta-algorithmic techniques in SAT solving 37
◮ uses cost-based decision forests to directly select solver
◮ one predictive model for each pair of solvers (which is better?) ◮ majority voting (over pairwise predictions) to select
Holger Hoos: Meta-algorithmic techniques in SAT solving 38
Xu, HH, Leyton-Brown (2010)
◮ SATenstein builds solvers that work well on average on a given
◮ SATzilla builds algorithm selector based on given set
Holger Hoos: Meta-algorithmic techniques in SAT solving 39
parametric algorithm (multiple configurations) selector feature extractor Holger Hoos: Meta-algorithmic techniques in SAT solving 40
◮ generic, highly configurable solver (e.g., SATenstein) ◮ instance features (as used in SATzilla)
Holger Hoos: Meta-algorithmic techniques in SAT solving 41
10
10 10
2
10
10
10 10
1
10
2
10
3
Hydra[BM, 1] PAR Score Hydra[BM, 7] PAR Score
Holger Hoos: Meta-algorithmic techniques in SAT solving 42
1 2 3 4 5 6 7 8 50 100 150 200 250 300 Number of Hydra Steps PAR Score Hydra[BM] training Hydra[BM] test SATenFACT on training SATenFACT on test
Holger Hoos: Meta-algorithmic techniques in SAT solving 43
◮ Hydra can use arbitrary algorithm configurators,
◮ different approaches are possible: e.g., ISAC, based on
(Kadioglu, Malitsky, Sellmann, Tierney 2010)
Holger Hoos: Meta-algorithmic techniques in SAT solving 44
∗ Kadioglu, Malitsky, Sabharwal, Samulowitz, Sellmann (2011) Holger Hoos: Meta-algorithmic techniques in SAT solving 45
schedule Holger Hoos: Meta-algorithmic techniques in SAT solving 46
Holger Hoos: Meta-algorithmic techniques in SAT solving 47
◮ exhaustive search (as done SATzilla)
◮ based on optimisation procedure
◮ using integer programming (IP) techniques
3S – Kadioglu et al. (2011)
◮ using answer-set-programming (ASP) formulation + solver
aspeed – HH, Kaminski, Schaub, Schneider (2012)
Holger Hoos: Meta-algorithmic techniques in SAT solving 48
(HH, Kaminski, Schaub, Schneider – in preparation; Xu, Hutter, HH, Leyton-Brown – in preparation)
Holger Hoos: Meta-algorithmic techniques in SAT solving 49
◮ the ASP solver clasp used by aspeed is powered by a
◮ pure algorithm scheduling (e.g., aspeed) does not require
◮ sequential schedules can be parallelised easily and effectively (HH, Kaminski, Schaub, Schneider – 2012)
Holger Hoos: Meta-algorithmic techniques in SAT solving 50
Holger Hoos: Meta-algorithmic techniques in SAT solving 51
Holger Hoos: Meta-algorithmic techniques in SAT solving 51
Huberman, Lukose, Hogg (1997); Gomes & Selman (1997,2000)
◮ can be realised through time-sharing / multi-tasking ◮ particularly attractive for multi-core / multi-processor
Holger Hoos: Meta-algorithmic techniques in SAT solving 51
◮ ManySAT (Hamadi, Jabbour, Sais 2009; Guo, Hamadi,
◮ Plingeling (Biere 2010–11) ◮ ppfolio (Roussel 2011)
Holger Hoos: Meta-algorithmic techniques in SAT solving 52
◮ static vs instance-based vs dynamic ◮ with or without communication (SAT: clause sharing)
◮ manual (by human expert, based on experimentation) ◮ classification maximisation (Petrik & Zilberstein 2006) ◮ case-based reasoning + greedy construction heuristic (Yun &
Holger Hoos: Meta-algorithmic techniques in SAT solving 53
HH, Leyton-Brown, Schaub, Schneider (under review)
◮ global optimisation:
◮ greedy construction:
Holger Hoos: Meta-algorithmic techniques in SAT solving 54
Holger Hoos: Meta-algorithmic techniques in SAT solving 55
Lo Hi
Holger Hoos: Meta-algorithmic techniques in SAT solving 56
Lo Hi
Holger Hoos: Meta-algorithmic techniques in SAT solving 56
HH (2010–12)
◮ specify large, rich design spaces of solver for given problem
◮ avoid premature, uninformed, possibly detrimental
◮ active development of promising alternatives for
◮ automatically make choices to obtain solver optimised
Holger Hoos: Meta-algorithmic techniques in SAT solving 57
application context solver
solver design space
Holger Hoos: Meta-algorithmic techniques in SAT solving 58
application context planner planner solver
solver parallel portfolio instance- based selector design space
Holger Hoos: Meta-algorithmic techniques in SAT solving 58
application context planner planner
solver parallel portfolio instance- based selector design space
Holger Hoos: Meta-algorithmic techniques in SAT solving 58
Holger Hoos: Meta-algorithmic techniques in SAT solving 59
Application, Design choices Speedup PbO level SAT-based software verification (Spear), 41
Hutter, Babi´ c, HH, Hu (2007)
4.5–500 × 2–3 AI Planning (LPG), 62
Vallati, Fawcett, Gerevini, HH, Saetti (2011)
3–118 × 1 Mixed integer programming (CPLEX), 76
Hutter, HH, Leyton-Brown (2010)
2–52 ×
University timetabling, 18 design choices, PbO level 2–3 new state of the art; UBC exam scheduling
Fawcett, Chiarandini, HH (2009) Holger Hoos: Meta-algorithmic techniques in SAT solving 60
use context
PbO-<L> source(s) parametric <L> source(s) instantiated <L> source(s) deployed executable design space description PbO-<L> weaver PbO design
benchmark inputs Holger Hoos: Meta-algorithmic techniques in SAT solving 61
◮ command-line parameters ◮ conditional execution ◮ conditional compilation (ifdef)
◮ exposing parameters ◮ specifying alternative blocks of code
Holger Hoos: Meta-algorithmic techniques in SAT solving 62
◮ reduced overhead for programmer ◮ clean separation of design choices from other code ◮ dedicated PbO support in software development environments
◮ augmented sources: PbO-Java = Java + PbO constructs, . . . ◮ tool to compile down into target language: weaver
Holger Hoos: Meta-algorithmic techniques in SAT solving 63
use context
PbO-<L> source(s) parametric <L> source(s) instantiated <L> source(s) deployed executable design space description PbO-<L> weaver PbO design
benchmark input Holger Hoos: Meta-algorithmic techniques in SAT solving 64
... numerator -= (int) (numerator / (adjfactor+1) * 1.4); ... ... ##PARAM(float multiplier=1.4) numerator -= (int) (numerator / (adjfactor+1) * ##multiplier); ... ◮ parameter declarations can appear at arbitrary places
◮ access to parameters is read-only (values can only be
Holger Hoos: Meta-algorithmic techniques in SAT solving 65
◮ Choice: set of interchangeable fragments of code
◮ Choice point:
Holger Hoos: Meta-algorithmic techniques in SAT solving 66
◮ Choice: set of interchangeable fragments of code
◮ Choice point:
Holger Hoos: Meta-algorithmic techniques in SAT solving 66
◮ Choice: set of interchangeable fragments of code
◮ Choice point:
Holger Hoos: Meta-algorithmic techniques in SAT solving 66
◮ Choice: set of interchangeable fragments of code
◮ Choice point:
Holger Hoos: Meta-algorithmic techniques in SAT solving 66
67
◮ parametric mode:
◮ expose parameters ◮ make choices accessible via (conditional, categorical)
◮ (partial) instantiation mode:
◮ hardwire (some) parameters into code
◮ hardwire (some) choices into code
Holger Hoos: Meta-algorithmic techniques in SAT solving 68
69
◮ automated algorithm configuration (e.g., ParamILS, . . . ) ◮ instance-based selector construction (e.g., Hydra) ◮ parallel portfolio construction (e.g., Schneider, )
◮ better optimisation procedures (e.g., for configuration) ◮ meta-optimisation (optimising the optimisers) ◮ scenario-based optimiser selection ◮ parallel portfolios of design optimisation procedures
Holger Hoos: Meta-algorithmic techniques in SAT solving 70
◮ Computational complexity? ◮ Cost of development? ◮ Limitations of scope?
Holger Hoos: Meta-algorithmic techniques in SAT solving 71
◮ total configuration time on software verification benchmarks:
◮ wall-clock time on 10 CPU cluster:
◮ cost on Amazon Elastic Compute Cloud (EC2):
◮ 61.20 USD pays for ...
◮ 1:45 hours of average software engineer ◮ 8:26 hours at minimum wage Holger Hoos: Meta-algorithmic techniques in SAT solving 72
◮ tradeoff between performance/flexibility and overhead ◮ overhead depends on level of PbO ◮ traditional approach: cost from manual exploration of
◮ design alternatives for individual mechanisms and components
Holger Hoos: Meta-algorithmic techniques in SAT solving 73
◮ computing-platform-specific performance optimisation
(Whaley et al. 2001) ◮ optimisation of sorting algorithms
(Li et al. 2005) ◮ compiler optimisation (Pan & Eigenmann 2006, Cavazos et al. 2007) ◮ database server configuration (Diao et al. 2003)
Holger Hoos: Meta-algorithmic techniques in SAT solving 74
◮ Support for PbO-based software development
◮ Weavers for PbO-C, PbO-C++, PbO-Java ◮ PbO-aware development platforms ◮ Improved / integrated PbO design optimiser
◮ Best practices ◮ Many further applications ◮ Scientific insights
Holger Hoos: Meta-algorithmic techniques in SAT solving 75
◮ leverage computational power to construct
◮ liberate human designers from boring, menial tasks and
◮ facilitates principled design of heuristic algorithms ◮ profoundly changes how we build and use algorithms
Holger Hoos: Meta-algorithmic techniques in SAT solving 76
◮ Meta-algorithmic techniques will become indispensable
◮ Programming by Optimisation (or a closely related approach)
◮ Driven by SAT, SMT, PbO and advances in automated
Holger Hoos: Meta-algorithmic techniques in SAT solving 77