fast sampling of perfectly uniform satisfying assignments
play

Fast Sampling of Perfectly Uniform Satisfying Assignments & - PowerPoint PPT Presentation

Fast Sampling of Perfectly Uniform Satisfying Assignments & Panos Theodoropoulos 2 1 University of California, Santa Cruz Santa Cruz, CA, USA {dimitris, zayd}@ucsc.edu 2 University of Athens Athens, Greece ptheodor@di.uoa.gr July 10, 2018


  1. Fast Sampling of Perfectly Uniform Satisfying Assignments & Panos Theodoropoulos 2 1 University of California, Santa Cruz Santa Cruz, CA, USA {dimitris, zayd}@ucsc.edu 2 University of Athens Athens, Greece ptheodor@di.uoa.gr July 10, 2018 Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 1 / 25 Zayd Hammoudeh 1 ( � ) Dimitris Achlioptas 1 , 2

  2. Introduction Setting Primary Application: Constrained Random Verifjcation (CRV) Basic Idea: Input test vector into hardware design and verify outputs Problem: Too many valid inputs to test all of them Standard Approach: Select valid test inputs u.a.r. Key Contribution We discuss approximate counting in the next session Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 2 / 25 From Boolean Formula F , select s ≥ 1 satisfying assignments u.i.r. SPUR : Perfectly uniform SAT sampler > 400 × faster than the state-of-the-art

  3. Exact Model Counting Exact Model Counting Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 3 / 25

  4. Exact Model Counting sharpSAT sharpSAT sharpSAT : State-of-the-art exact model counter [1] Developed by Marc Thurley First published at SAT-06 and iteratively improved since. DPLL-based Integrates both SAT techniques like CDCL, UP, two-watch literals, VS heuristics and counting specifjc optimizations e.g., component decomposition, subformula caching New Caching Paradigm : sharpSAT ’s primary difgerentiator Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 4 / 25

  5. Exact Model Counting sharpSAT July 10, 2018 Fast SAT Sampling Achlioptas et. al. (UCSC & Univ. Athens) If yes, sharpSAT uses the stored model count and backtracks 5 / 25 Structure : Set of key-value pairs Benefjt : Prevents re-analysis of duplicate residual formulas Caching : Analogue of CDCL for SAT residual formulas CDCL : Memoizes UNSAT assignments in new, implied clauses Caching Key : Boolean formula F ′ Value : Model count of F ′ sharpSAT places all SAT residual formulas, F ( σ ) , into the cache Before analyzing any F ( σ ) , sharpSAT checks if F ( σ ) is in the cache. Otherwise, sharpSAT analyzes F ( σ ) as normal

  6. Exact Model Counting sharpSAT July 10, 2018 Fast SAT Sampling Achlioptas et. al. (UCSC & Univ. Athens) . . . . . . . . . . . . The sharpSAT Tree 6 / 25 · · ·

  7. Reservoir Sampling Reservoir Sampling Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 7 / 25

  8. Reservoir Sampling Framing the Sampling Problem July 10, 2018 Fast SAT Sampling Achlioptas et. al. (UCSC & Univ. Athens) Storage Capacity: s 3 “No looking back” on the stream 2 1 Additional Constraints : 8 / 25 Setting : From arbitrary, fjnite set P select s elements u.i.r. P 1 ∪ P 2 ∪ . . . ∪ P j ∪ . . . P m is an arbitrary partition of P ’s elements P is revealed as a stream of disjoint subsets (bundles) P 1 P 2 . . . P m |P| and m are unknown Solution : Reservoir Sampling Select s bundles P j with replacement where Pr[ Select P j ] ∝ | P j | From each selected bundle P j , select one member element p ∈ P j u.i.r.

  9. Reservoir Sampling Let’s Build an Intuition about Reservoir Sampling Question : What is a reservoir? Answer : A multiset ( think memory ) of fjxed size s and m are unknown? Answer : Invariant – After analyzing each bundle P k , the statistical Question : Is reservoir sampling an iterative procedure? Answer : Yes. Identical iterative procedure for each stream bundle. An example will help clarify... Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 9 / 25 Question : How can reservoir sampling provide statistical guarantees if | P | guarantees are satisfjed w.r.t. ∪ k j = 1 P j (i.e., everything seen so far ).

  10. Reservoir Sampling Reservoir July 10, 2018 Fast SAT Sampling Achlioptas et. al. (UCSC & Univ. Athens) k successes s times Z Bent Coin Total Weight Next Total Weight Partition : Reservoir Already Processed s 1 P 1 P 2 P 3 P 4 P 5 2 4 3 5 10 / 25 · · · Pr[ Success ] = | P 5 | 6 · · · Z = � 4 j = 1 | P j | Z = � 5 i = 1 | P i |

  11. Bringing Together Model Counting & Reservoir Sampling Bringing Together Model Counting & Reservoir Sampling Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 11 / 25

  12. Bringing Together Model Counting & Reservoir Sampling Overview SPUR – Satisfying Perfectly Uniform Random assignment sampler Reservoir sampling performed on the stream of leaves encountered by sharpSAT during its normal execution Probability a particular leaf selected is proportional to its model count with sharpSAT . Low overhead – If sharpSAT can count the models, SPUR can sample them Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 12 / 25 SPUR := sharpSAT + Reservoir Sampling Rule of Thumb : Generating 1,000 samples takes ∼ 10 × as long as counting

  13. Bringing Together Model Counting & Reservoir Sampling Implementation C++ Based and Open Source Repository : https://github.com/ZaydH/spur implementation sharpSAT ’s caching interferes with reservoir sampling Necessitates change to caching paradigm Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 13 / 25 sharpSAT + Reservoir Sampling : Straightforward idea, complex

  14. Experimental Results Experimental Results Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 14 / 25

  15. Experimental Results Overview State-of-the-Art SAT Sampler : UniGen2 [2] Developed by Chakraborty, Fremont, Meel, Seshia, Vardi Probabilistic “ almost-independent ,” “ almost uniform ” Dataset : 373 formulas from diverse domains Exclusively all the formulas in the UniGen2 and sharpSAT [1] papers # Clauses : 43 to 1.7M We compare SPUR and UniGen2 in two sets of experiments: Uniformity of selected samples Execution time to generate 1K samples Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 15 / 25 # Variables : 17 to > 300K

  16. Experimental Results 400 July 10, 2018 Fast SAT Sampling Achlioptas et. al. (UCSC & Univ. Athens) Figure 1: Uniformity comparison between the ideal distribution, SPUR and UniGen2 UniGen2 SPUR Ideal Occurrences 500 300 Sampler Uniformity 200 100 0 280 260 240 220 200 Uniformity – Both About the Same in Practice 16 / 25

  17. Experimental Results 1hr July 10, 2018 Fast SAT Sampling Achlioptas et. al. (UCSC & Univ. Athens) SPUR Time Out UniGen2 Time Out SPUR UniGen2 7hr 1min Execution Time Comparison 10sec 1sec 10hr 1hr 1min 10sec 1sec 17 / 25 0 . 1sec 0 . 1sec

  18. Experimental Results Execution Time Comparison Execution Time Results Summary SPUR is faster than state-of-the-art on 371/373 benchmarks sharpSAT takes to count Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 18 / 25 Average speed-up : > 400 × Takeaway : 7 hours → 1 minute > 10 × faster on 369/373 benchmarks > 100 × faster on > 2 / 3 benchmarks On > 70 % of benchmarks, SPUR generated 1K samples within 10 × the time SPUR is 3 × more likely than UniGen2 to successfully generate 1K samples for formulas of > 10 K variables

  19. Inner Workings of SPUR Inner Workings of SPUR Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 19 / 25

  20. Inner Workings of SPUR Inter-leaf dependencies undermines sample independence July 10, 2018 Fast SAT Sampling Achlioptas et. al. (UCSC & Univ. Athens) In only this case, caching satisfying assignments is safe dependencies leaves in the sharpSAT tree Turning sharpSAT into a Sampler Sharing cached satisfying assignments induces dependencies between cache hit Key Observation #1 : “ Model counts are reusable but samples are not. ” Problem : This simply doesn’t work... Enables trivially building complete assignments even at cache hit leaves assignments A First Idea : Enhance sharpSAT to cache model counts and satisfying 20 / 25 Key Observation #2 : If only sampling s = 1 model, there are no

  21. Inner Workings of SPUR The sharpSAT Tree Meets Reservoir Sampling Procedure : Perform reservoir sampling on each leaf P j k : Number of samples to be selected from P j Since the reservoir only has partial assignments, SPUR must convert them to complete assignments eventually. Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 21 / 25 P : Set of satisfying assignments for Boolean formula F P j ∈ P : A leaf in the sharpSAT tree If k > 0 , store k and P j ’s partial assignment in the reservoir

  22. Inner Workings of SPUR Top-Level SPUR Algorithm July 10, 2018 Fast SAT Sampling Achlioptas et. al. (UCSC & Univ. Athens) Preserves sample independence Recursion terminates faster Advantages : 22 / 25 Input : Boolean formula F and sample count s Output : S = { < s i , σ i > } s i : Sample count where � i s i = s σ i : Sample partial variable assignment For each < s i , σ i > ∈ S : a. F ( σ i ) is empty Set remaining bits in σ i u.a.r. b. F ( σ i ) is non -empty s i > 1 : Invoke SPUR recursively with formula F ( σ i ) and s i as normal s i = 1 : Invoke SPUR recursively with sample caching using key observation #2

  23. Conclusions Conclusions Achlioptas et. al. (UCSC & Univ. Athens) Fast SAT Sampling July 10, 2018 23 / 25

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend