1 / 45

Correct-by-Decision Reduction to Constraint Solving

Learn about the Correct-by-Decision approach in constraint solving with L-solvers and the benefits of problem-aware and optimization-aware decision strategies.

cwhitley
Download Presentation

Correct-by-Decision Reduction to Constraint Solving

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Correct-by-Decision Reduction to Constraint Solving Alexander Nadel Intel, Israel SAT/SMT Seminar Intel, Israel January 20, 2019

  2. Outline

  3. A Problem in Human Language  Constraint Solving Requirements in Human Language Solve with an L-solver Constraints in some logic L (e.g., SAT, LIA, CSP)

  4. A Problem in Human Language  Constraint Solving The Correct-by-Decision approach: design your decision strategy wisely! Solve with an L-solver,enhanced by a customdecision strategy • Many of the constraints not required  scalable • Problem-aware  substantially faster • Optimization-aware  excellent quality Requirements in Human Language Constraints in some logic L (e.g., SAT, LIA, CSP) Requirements guaranteed to hold by problem-specific L-decision strategy

  5. CBD at Work • Incremental SAT solving under assumptions (Eén&Sörensson, SAT’03) • Clock routing (Erez&Nadel, CAV’15) • First intentional usage • Routing under constraints (Nadel, FMCAD’16) • Simultaneous Place & Route under Constraints (Nadel, CAV’17)

  6. Incremental SAT Solving under Assumptions Input: {}, {}, … , {} , … : formula in CNF = {} – set of assumptions – aliteral (unit clause) Semantics: Invocation decides the satisfiability of

  7. Incremental SAT Solving under Assumptions as a CBD Application Input: {} , {} , … , {} , … Semantics: Invocation decides the satisfiability of • Pre-Minisat @ invocation i: • Create a new SAT solver instance containing • Model the assumptions as unit clauses • Since Minisat @ invocation i: • Use a single SAT solver instance, updated each time with • Model assumptions as the first decisions • Minisat applies CBD, since: • the decision strategy is emulating constraints • the decision strategy is essential for guaranteeing correctness

  8. Clock Routing Find a path of a user-given weight from s to t in a grid graph (NP-Hard): • Reduction to SAT doesn’t scale. • Custom decision strategy in the SAT solver: • Reduces 98.5% of the constraints  industrial-level scalability • Problem-awareness  substantially faster • Optimization-awareness  excellent quality • Problem-aware enhanced conflict analysis  prevents hangs(self-locks)

  9. Routing "PhysicalDesign" by Linear77 - Own work. Licensed under CC BY 3.0 via Wikimedia Commons - https://commons.wikimedia.org/wiki/File:PhysicalDesign.png#/media/File:PhysicalDesign.png

  10. Routing: Input Input A grid graph G(V,E) Disjoint Nets Ni V Terminals

  11. Routing: Output NP-hard! Output Input Each net is spanned by a tree, called the net routing Net routings can’t intersect Optimization: minimize the totalrouting length

  12. Design Rules • Routing is to satisfy design rules • Originating in the manufacturing requirement • Example “short” rule: • The 2 vertices of any edge can’t belong to two distinct net routings (even for edges not used for routing) Short rule is violated for these edges How can one model design rules?

  13. Edge Variables for Modelling Design Rules Bool e: edge activity

  14. 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 1 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

  15. Vertex Variables for Modelling Design Rules Bool v: activity status Bit-vector nid(v): net id ( for inactive vertices)

  16. 0, 0, 0, 0, 1,0 1,0 1,0 0, 0, 0, 0, 0, 0, 0, 1,0 1,1 1,0 0, 0, 0, 0, 0, 0, 0, 1,0 1,1 1,0 0, 0, 0, 0, 0, 0, 0, 1,0 1,1 1,0 0, 0, 0, 1,0 1,0 1,0 1,0 1,0 1,1 1,0 1,0 1,0 1,0 0, 0, 0, 0, 0, 1,1 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,1 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,1 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,1 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,1 0, 0, 0, 0,

  17. Modeling Routing under Constraints • Design rules can be easily expressed in BV logic • Variables: • Edge & vertex activities • Vertex nids • Any auxiliary variables • “Short” rule example • For every edge e=(v,u): (v u)(nid(v)=nid(u)) Short rule is violated for these edges

  18. Routing under Constraints (RUC): Problem Formulation Input Graph G(V,E) Disjoint Nets Ni V • A quantifier-free bit-vector formula F(V  E  N  A) • V : vertex activity • E : edge activity • N : vertex net id • A : any auxiliary variables • (represents the design rules) • Output: a model to F, which satisfies: • Edgeconsistency: e(v,u) vunid(v)=nid(u) • Net routing: for each net i, active vertices with nidi and active edges span the net’s terminals • Soft optimization requirement: minimize the overall weight of active edges

  19. Solving Attempt: Encoding into Bitvector Logic / SAT • For 2-terminal nets: • Edgeconsistency: e(v,u) vunid(v)=nid(u) • A terminal has one active neighbor edge • An active non-terminal has two active neighbor edges • For n-terminal nets: • Encode directed trees • Using edge directions

  20. CBD-based BV/SAT Solution for RUC: Constraints + Decision Strategy • Constraints • Edge consistency • e(v,u) vunid(v)=nid(u) • User-provided constraints modelling design rules • A*-based decision strategy • Every net is routed significantly fewer constraints! • Routing-aware  converges quickly! • Routing length is small optimization goal met! • Enhanced conflict analysis • Problem-aware restart strategy

  21. 1-Net Example: Connect s to t 2 s: (0, 0) t: (3, 0) ¬(1,0)  ¬(2,0) ¬(1,0)  ¬(1,1) ¬(3,2)  ¬(3,1) x Design rules 1 SAT Decision x 0 1 2 3 • The algorithm (implemented inside a SAT solver): • Connect s to t with the shortest path whenever possible

  22. 1-Net Example BCP 2 s: (0, 0) t: (3, 0) ¬(1,0)  ¬(2,0) ¬(1,0)  ¬(1,1) ¬(3,2)  ¬(3,1) x 1 x 0 1 2 3 • The algorithm (implemented inside a SAT solver): • Connect s to t with the shortest path whenever possible

  23. 1-Net Example 2 s: (0, 0) t: (3, 0) ¬(1,0)  ¬(2,0) ¬(1,0)  ¬(1,1) ¬(3,2)  ¬(3,1) x x 1 x 0 1 2 3 • The algorithm (implemented inside a SAT solver): • Connect s to t with the shortest path whenever possible

  24. 1-Net Example x 2 s: (0, 0) t: (3, 0) ¬(1,0)  ¬(2,0) ¬(1,0)  ¬(1,1) ¬(3,2)  ¬(3,1) x x 1 (2,0) (3,1) (2,0)  ¬(3,2) x 0 1 2 3 • The algorithm (implemented inside a SAT solver): • Connect s to t with the shortest path whenever possible • st path blocked  add a blocking clause with the vertex cut • The SAT solver will derive a 1UIP conflict clause and backtrack accordingly

  25. 1-Net Example x 2 s: (0, 0) t: (3, 0) ¬(1,0)  ¬(2,0) ¬(1,0)  ¬(1,1) ¬(3,2)  ¬(3,1) x 1 (2,0) (3,1) (2,0)  ¬(3,2) x Routed  0 1 2 3 • The algorithm (implemented inside a SAT solver): • Connect s to t with the shortest path whenever possible • st path blocked  add a blocking clause with the vertex cut • The SAT solver will derive a 1UIP conflict clause and backtrack accordingly

  26. Outline

  27. Carried out separately • A separate mode is easy to implement, but: • Implies a substantial overhead • A placement might be unroutable • Especially so when design rules must be satisfied • A placement & routing loop is applied • We propose a solution for simultaneous place & route Placement Routing "PhysicalDesign" by Linear77 - Own work. Licensed under CC BY 3.0 via Wikimedia Commons - https://commons.wikimedia.org/wiki/File:PhysicalDesign.png#/media/File:PhysicalDesign.png

  28. PRUC: Placement Coming In RUC Input: grid & nets & F PRUC Input: grid & devices & F D0={(5,3),(0,0)} D1={(4,5),(0,0)}

  29. PRUC Output: Placement + Solution for the Induced RUC Problem PRUC Solution Examples: PRUC Input: grid & devices & F D0={(5,3),(0,0)} D0 @ (0,5) D1@ (5,0) D1={(4,5),(0,0)} D1@ (0,0) D0 @ (4,4)

  30. CBD-based PRUC Modeling: Variables & Constraints • Variables: • Edge & vertex activity; vertex nid • Inherited from RUC • Placement (bool): • Created for each device D and potential root (x,y) • Holds iff D is placed at (x,y) • Constraints: • Edge consistency: e  v  u; nid(v) = nid(u) • Placement consistency: a device is placed at exactly one location • Placement uniqueness: only one device can occupy a vertex

  31. CBD-based PRUC Modeling: Basic Decision Strategy

  32. Input PRUC Execution Example • The current order: • D0={(5,3),(0,0)} • D1={(4,5),(0,0)} Exponential blow-up D0={(5,3),(0,0)} C: Record clause P: Place D1 R: Route R: Route D1’s (9,5) P: Place D0 D1={(4,5),(0,0)} D0 @ (0,5) Algorithm P: Place next device D1@ (5,0) R: Route next terminal C: on conflict, record clause

  33. PRUC Decision Strategy: Reordering & Replacement Heuristics • Leaf reordering • Device replacement • Device reordering • All are regulated by user-given conflict thresholds

  34. Leaf Reordering: • Remove D’s routing (by backtracking) • D: the current device • Move the blocked leaf to the top of D’s leaf list. • Re-route D. • The current order: • D0={(5,3),(0,0)} • D1={(4,5),(0,0)} • The current order: • D0={(5,3),(0,0)} • D1={(0,0),(4,5)} D0={(5,3),(0,0)} D1={(4,5),(0,0)} Algorithm P: Place next device R: Route next terminal C: on conflict, record clause

  35. Device Replacement: • Remove D’s routing and placement • D: the current device • Place D differently • Re-route D. • The current order: • D0={(5,3),(0,0)} • D1={(4,5),(0,0)} D0={(5,3),(0,0)} D1={(4,5),(0,0)} Algorithm P: Place next device R: Route next terminal C: on conflict, record clause

  36. Device Reordering: • Backtrack to decision level 0 • Move D to the top of the device list. • D: the current device • Continue. • The current order: • D0={(5,3),(0,0)} • D1={(4,5),(0,0)} • The current order: • D1={(4,5),(0,0)} • D0={(5,3),(0,0)} D0={(5,3),(0,0)} D1={(4,5),(0,0)} D0 @ (0,5) Algorithm P: Place next device D1@ (5,0) R: Route next terminal C: on conflict, record clause 39

  37. Experimental Results • Instances: industrial and crafted • Configurations: • Time-out: 20 min.

  38. Experimental Results: Industrial • Data: 48 clips of Intel's designs. • Place & route for one clip on average, industrial flow: • Time: ~24 hours • Place & route iterations: 60-85 • The best config. solves 44 / 48 instances • 4 remaining instances are covered by other configurations • Best: combine frequent device replacement & device reordering • In addition: quality (routing length) is as good as that of the industrial flow

  39. Experimental Results: Crafted • Generation:

  40. Experimental Results: Crafted • All instances solved by one config. • Best: combine frequent device replacement & device reordering • Similar to the industrial results • The instances are publicly available

  41. Conclusion • Correct-by-Decision (CDB) paradigm for reducing a problem to constraint solving • Design your decision strategy wisely! • CBD Applications • SAT solving under assumptions • Clock routing • Routing under constraints • Simultaneous place & route under constraints

More Related