Solving Huge Instances with IntelĀ® SAT Solver
Alexander Nadel, Intel and Technion, Israel
SAT 2023, Alghero, Italy
July 7, 2023
1
7/2/2023
PEG PDS DDI
The Paper in a Nutshell
Goal: enable solving huge instances with billions of clauses using a CDCL SAT solver
The SAT solver: āIntelĀ® SAT Solverā (IntelSAT); the 2023 release is called IS23
Main empirical result ā there are gigantic instances only IS23 can solve
Variable succession matters for efficient compression
2
7/2/2023
PEG PDS DDI
Literal Representation in SAT
Consider a variable vi
A literal lā{vi, ¬vi} is represented by its literal index li(l). In most solvers:
3
7/2/2023
PEG PDS DDI
Clause Management in SAT
Long (>2 literals) clauses are stored in the clause buffer
Layout of an initial clause:
Example: C1=(v1 ⨠v2 ⨠¬v3) ⧠C2=(¬v1 ⨠v2 ⨠v3)
Each clause C is uniquely identified by its clause index ci(C) ā index in the buffer
In our example: ci(C1) = 0; ci(C2) = 4
4
7/2/2023
Clause Size | li1 | li2 | ⦠| lin |
32 | 32 | 32 | 32 | 32 |
3 | 2 | 4 | 7 | 3 | 3 | 4 | 6 |
32 | 32 | 32 | 32 | 32 | 32 | 32 | 32 |
This row contains #bits
PEG PDS DDI
Limitation when Solving Huge Instances: Clause-Index Widthļæ½
Most solvers have a 32-bit clause-index
For huge instances, 32-bit indexing is not sufficient, since 232 space is exhausted
The following solvers support 64-bit clause-index
64-bit support lifts the indexing limitation, but inflates the memory usage
5
7/2/2023
PEG PDS DDI
Clause Compression: Core Idea
Literal-width lw(clause C) is the minimal #bits, required to store Cās literals
Compression: store every clause C using lw(C) bits per literal
Example: C1=(v1 ⨠v2 ⨠¬v3) ⧠C2=(¬v1 ⨠v2 ⨠v3)
Standard:
Compressed (lw(C1) = lw(C2)= 3):
6
7/2/2023
3 | 2 | 4 | 7 | 3 | 3 | 4 | 6 |
32 | 32 | 32 | 32 | 32 | 32 | 32 | 32 |
2 | 4 | 7 | 3 | 4 | 6 |
3 | 3 | 3 | 3 | 3 | 3 |
6Ć3=18 bits overall < one 32-bit word
8Ć32=256 bits overall
PEG PDS DDI
Clause Compression in IS23
Clauses are stored in multiple bit-arrays (clause buffers)
Given a clause C, its bit-array is uniquely determined by Cās 11-bit hash value hash(C):
hash(C) is calculated at creation time
Bit-arrays are stored in a hash table
7
7/2/2023
PEG PDS DDI
Compressed Clause-Index
Cās compressed clause-index (64 bits overall) stores hash(C) and the actual index:
Clause-index contains all the necessary information to access and parse C
8
7/2/2023
Literal-width | Clause-size-width | Learnt-status | Bit where C starts in its bit-array |
5 bits | 5 bits | 1 bits | 53 bits |
PEG PDS DDI
IS23ās (the 2023 Release of IntelSAT) API
Templated C++ API (parameter values are chosen by the user at compile-time):
IS23<clause-index-width=32, literal-index-width=32, is-compressed=0>
Instantiations, studied in this paper:
9
7/2/2023
PEG PDS DDI
Experimental Set-up: S(n) -- Trivially SAT Instances
U(n): trivially unsatisfiable family with n varās & 2n clauses in every instance
S(n): trivially satisfiable family with n+1 varās & 2n clauses in every instance
What is the largest n for which S(n) is solvable?
Machines: 790Mb of memory, no timeout, no memory limit
10
7/2/2023
PEG PDS DDI
Experimental Results over S(n) instances
Only the compressed IntelSAT IS23-64C can solve S(33)
IS23-64C consumes ~half the memory of IS23-64 / CaDiCaL
11
7/2/2023
64-bit CryptoMiniSat
32-bit IntelSAT
64-bit IntelSAT
64-bit IntelSAT with compression
233 = 8,589,934,592 clauses and 233 Ć(33+1) = 292,057,776,128 literals overall
PEG PDS DDI
Experimental Set-up: Finding One Placement
Application: cell placement ā a critical stage in chip design
Our SAT-based anytime placement optimization flow is productized @ Intel
The empirical challenge which triggered this work:
Generated publicly available P(R) family
Timeout: 48 hours
Memory limit: 512Gb
12
7/2/2023
PEG PDS DDI
Experimental Results: Finding One Placement
Only IS23-64 solved P(5000) with almost 1B variables and 4.3B clauses
CaDiCaL solved only P(3000) being 4.8X slower and using 2.5X more memory
IS23-64C vs. IS23-64
13
7/2/2023
Finding one placement. The first three columns provide the number of rectangles (in hundreds), variables in CNF (in millions) and clauses in CNF (in millions). Each subsequent pair or triplet of columns corresponds to one solver. Each shows, for the corresponding solver, either: (1) the run-time (in hours), the memory usage (in GB) and, optionally, the number of conflicts (in thousands), or (2) the reason for a failure.
PEG PDS DDI
Experimental Set-up: Finding Many Placements
A flavor of the placement problem: find many (1,000,000) placements
Implemented the basic blocking AllSAT algorithm (in IntelSAT and CaDiCaL and used an existing CryptoMiniSat implementation)
Two IS23-64C versions for testing variable succession:
Compared with the 3 state-of-the-art AllSAT Toda tools -- {bc,nbc,bdd}_minisat_all
Timeout & memory limit: 10 hours & 32Gb
14
7/2/2023
PEG PDS DDI
Experimental Results: Finding 1,000,000 Placements
Only IS23-64CL was able to find all the solutions for P(900) and P(1000)
This time, IS23-64CL used significantly less memory than IS23-64
IS23-64CL solved 2 more instances than IS23-64CH: variable succession matters!
External solvers, including the AllSAT Toda tools, werenāt competitive
15
7/2/2023
Finding 106 placements. The first column in both the sub-tables shows the number of rectangles (in hundreds); the upper table also contains two columns with the number of variables and clauses in CNF (in millions). Each subsequent triplet of columns shows, for one solver: the number of solutions (in thousands), the run-time (in hours) and the memory usage (in GB); in case of a failure, the last two columns per solver show its reason instead.
PEG PDS DDI
Conclusion & Future Work
Solved giganitic instances with billions of clauses using IS23 -- the 2023 version of IntelSAT:
Core idea: store clauses compressedly using fewer than 32 bits per literal
Dedicated variable succession scheme enabled solving larger AllSAT placement instances
Future work:
16
7/2/2023
PEG PDS DDI
Backup
17
7/2/2023
PEG PDS DDI
IS23ās (the 2023 Release of IntelSAT) API
Templated C++ API (parameters are chosen by the user at compile-time):
IS23<clause-index-width=32, literal-index-width=32, is-compressed=0>
Instantiations, studied in this paper:
Literal-index-width can be customized too (itās 32 bits for every modern solver)
18
7/2/2023
PEG PDS DDI
Clause Compression Discussion
Compressionās impact on performance
How to design the compressed buffer?
Storing a fixed amount of additional bits per clause would be wasteful in terms of both
19
7/2/2023
PEG PDS DDI
Compressed Clause-Index
Cās compressed clause-index (64 bits overall) stores hash(C) and the actual index:
Clause-index contains all the necessary information to access and parse C
To save bits, we store the compressed size |C|* instead of the actual size |C| in the clause
20
7/2/2023
Literal-width | Clause-size-width | Learnt-status | Bit where C starts in its bit-array |
5 bits | 5 bits | 1 bits | 53 bits |
PEG PDS DDI
Clause-Size-Width and Compressed Size |C|* per |C|
21
7/2/2023
|C| | Clause-Size-Width | |C|* Value in the Clause | Comments |
3 | 0 | None | Dedicated bit-arrays for 3-clauses (a single bit-array for 3-clauses per given literal-width & learnt-status) |
4 | 1 | 1 | Dedicated bit-arrays for 4-clauses. Value |C|*=0 is reserved for clause deletion machinery. |
5 | 2 | 1 | 22-1=3 sizes (5,6,7) with clause-size-width 2 |
6 | 2 | 2 | |
7 | 2 | 3 | |
8 | 3 | 1 | 23-1=7 sizes [8,ā¦,14] with clause-size-width 3 |
9 | 3 | 2 | |
⦠| | | |
14 | 3 | 7 | |
15 | 4 | 1 | 24-1=15 sizes [15,ā¦,29] with clause-size-width 4 |
⦠| | | 2k-1 sizes with clause-size-width k |
PEG PDS DDI
Compressed Clause-Index
Cās compressed clause-index (64 bits overall) stores hash(C) and the actual index:
Clause-index contains all the necessary information to access and parse C
Clause-size-width sw(C) and the clause-size value in C are optimized for space
22
7/2/2023
Literal-width | Clause-size-width | Learnt-status | Bit where C starts in its bit-array |
5 bits | 5 bits | 1 bits | 53 bits |
PEG PDS DDI
Clause Compression: Example
23
7/2/2023
PEG PDS DDI
Variable Succession
Variable succession: the order in which the user creates variables
Variable succession has a vital impact on literal-width, and thus on the quality of memory compression
Example: swapping v3 and v6 (G 𔪠Gā) saves 6 bits overall
24
7/2/2023
PEG PDS DDI
Variable Succession is Expected to Matter in Practice: Examples
We propose that the user determines variable succession upfront. Automation would not be trivial.
25
7/2/2023
PEG PDS DDI
Agenda
Clause Buffer Data Structure and its Limitations for Huge Instances
The API of IS23 -- the 2023 Version of IntelSAT
Clause Compression
Variable Succession
Experimental Results
Conclusion & Future Work
26
7/2/2023
PEG PDS DDI
Variable Succession
Variable succession: the order in which the user creates variables
Variable succession has an immediate impact on
Speculative example:
Example empirically verified in the paper: important variables in blocking AllSAT
27
7/2/2023
PEG PDS DDI
Intel SATĀ® Solver (IntelSAT) Review
Alexander Nadel, āIntroducing IntelĀ® SAT Solverā.Ā SATā22 [long presentationĀ (presented atĀ MIAO SeminarĀ on Feb. 28, 2023),Ā MIAO Seminar video]
Full-fledged CDCL solver
Tuned for solving rapid, incremental, mostly satisfiable queries
Used 32-bit clause-index
28
7/2/2023
I
PEG PDS DDI
Literal Representation in SAT
Consider a literal l=vi or l=¬vi
l is represented by its literal index li(l). In most solvers:
Examples:
29
7/2/2023
PEG PDS DDI
Application: cell placement ā a critical stage in chip designļæ½
30
7/2/2023
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | |
| | | |
| | | |
| | | |
| |
| |
|
|
|
|
|
0
8
8
The grid where to place the cells
The cells to be placed
c1
c2
c3
c4
c5
| |
| |
| |
| |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
0
8
8
| | | |
|
|
|
|
|
| |
| |
| | | |
| | | |
| | | |
| |
| |
| |
| |
Cell Placement w/o Optimization: Output
Basic input:
PEG PDS DDI