PARALLEL RECURSIVE STATE COMPRESSION FOR FREE
ALFONS LAARMAN
JOINT WORK WITH:
MICHAEL WEBER
JACO VAN DE POL
12/7/2011
SPIN 2011
• Motivation
• Previous work
• Problem Description
• Background
• Tree Compression
• Contribution
• Concurrent Tree Compression
• An Incremental Algorithm
• Analysis of Compression Ratios
• Experiments
• Conclusion / Future Work
12/7/2011Parallel Recursive State Compression for Free 2
OVERVIEW
(Enumerative) reachability as a basis for many verification problems
S: open set (stack or queue)
DB: closed set
12/7/2011Parallel Recursive State Compression for Free 3
MOTIVATIONPREVIOUS WORK
S4:
12/7/2011 4
PREVIOUS WORKMOTIVATION
Parallel Recursive State Compression for Free
DB
Worker 1 Worker 2
Worker 3Worker 4re
ques
t
Lock
less h
ash
table
Synchronous Random Polling
post()
S1:
S3:
S2:
[FMCAD 2010]
12/7/2011 5
PROPERTIES OF THE LOCKLESS HASH TABLEMOTIVATION
Parallel Recursive State Compression for Free
• Monotonically growing (no remove() operation)
• find_or_put(vector) : boolean
• Without resizing
• Avoid scalability problem
• Stable indices: find_or_put(vector) : (index, boolean)
• Fixed-sized integer vectors (limitation of LTSmin)
12/7/2011 6
MEMORY BECOMES THE PROBLEM (AGAIN)MOTIVATION
Parallel Recursive State Compression for Free
• The hash set has to store up to 10^9 state vectors of length up to 1 kbyte
• With 16 cores: 1GB/sec of new state vectors
• In asynchronous systems, transitions are typically local:
• States are very similar
Solution:
• Compress the DB
Cf. COLLAPSE in SPIN
• Exploit locality with incremental algorithms
++++++------+---------++-------+------------------+-+----++++++------+---------------------++--+++------------++-----------------++--------+--------++-----------+-----++--------------+--++-----------------+-+-------+--------+-++---------+-----+-++------------+--+-++---+-----------+-+-
• Motivation
• Previous work
• Problem Description
• Background
• Tree Compression
• Contribution
• Concurrent Tree Compression
• An Incremental Algorithm
• Analysis of Compression Ratios
• Experiments
• Conclusion / Future Work
12/7/2011Parallel Recursive State Compression for Free 7
OVERVIEW
12/7/2011 8
MEMORY-EFFICIENT STORAGEBACKGROUND
Parallel Recursive State Compression for Free
12/7/2011 9
TREE COMPRESSIONBACKGROUND
Parallel Recursive State Compression for Free
Store a table of vectors as a fixed-shaped tree of tables with tuples
12/7/2011 10
TREE COMPRESSIONBACKGROUND
Parallel Recursive State Compression for Free
12/7/2011 11
TREE COMPRESSION ALGORITHMBACKGROUND
Parallel Recursive State Compression for Free
returns (index, bool)
Used before in distributed model checking – Blom et al.
12/7/2011Parallel Recursive State Compression for Free 12
CONFLICTING REQUIREMENTSPROBLEM DESCRIPTION
Goal: scalable concurrent tree database
Unknown table sizes requires resizing breaks stable indices
• Motivation
• Previous work
• Problem Description
• Background
• Tree Compression
• Contribution
• Concurrent Tree Compression
• An Incremental Algorithm
• Analysis of Compression Ratios
• Experiments
• Conclusion / Future Work
12/7/2011Parallel Recursive State Compression for Free 13
OVERVIEW
12/7/2011Parallel Recursive State Compression for Free 14
INTRODUCE MAXIMAL SHARINGCONCURRENT TREE COMPRESSION
Idea: Merge all hash tables into a single non-resizing hash table.
This maintains an injection Tk : Natk Nat
T2(4,1) = 1
T6(3,5,5,4,1,3) = 7
T3(4,1,3) = 4
12/7/2011Parallel Recursive State Compression for Free 15
INTRODUCE MAXIMAL SHARINGCONCURRENT TREE COMPRESSION
Idea: Merge all hash tables into a single non-resizing hash table.
Problem: T6 (….) = T2 (3,5)
12/7/2011Parallel Recursive State Compression for Free 16
INTRODUCE MAXIMAL SHARINGCONCURRENT TREE COMPRESSION
Solution: add an isRoot tag to nodes
For correct boolean result
12/7/2011 17
THE ALGORITHMCONCURRENT TREE COMPRESSION
Parallel Recursive State Compression for Free
12/7/2011Parallel Recursive State Compression for Free 18
INCREMENTAL TREE INSERTIONCONCURRENT TREE COMPRESSION
Hash table
vs
Tree
1 (random) memory access of k integers (k-1) (random)
accesses of two integers
Next problem:
12/7/2011 19
INCREMENTAL TREE INSERTIONCONCURRENT TREE COMPRESSION
Parallel Recursive State Compression for Free
Exploits locality (log2(k) accesses in many cases)
post( ) =
• Motivation
• Previous work
• Problem Description
• Background
• Tree Compression
• Contribution
• Concurrent Tree Compression
• An Incremental Algorithm
• Analysis of Compression Ratios
• Experiments
• Conclusion / Future Work
12/7/2011Parallel Recursive State Compression for Free 20
OVERVIEW
21
WORST AND BEST CASE INPUTSANALYSIS OF COMPRESSION RATIOS
Parallel Recursive State Compression for Free
Inputs Tuples in tree nodes Ratio
Worst case:
Best case:
k
n
12/7/2011 22
MEMORY USAGEEXPERIMENTS
Parallel Recursive State Compression for Free
[BEEM database]
12/7/2011 23
MEMORY USAGEEXPERIMENTS
Parallel Recursive State Compression for Free
• Always compression with tree
• In most cases, compression is
close to optimal (see median)
• Always higher ratios than
COLLAPSE
10 100 10000.01
0.10
1.00
10.00
SPIN COL-LAPSETree com-pressionoptimal 8/kmedian 9.6/k
state length (byte)
co
mp
res
se
d r
ati
o (
by
te)
12/7/2011 24
RUNTIMES COMPARED TO HASH TABLEEXPERIMENTS
Parallel Recursive State Compression for Free
0.05 0.50 5.00 50.00 500.000.05
0.50
5.00
50.00
500.00Sequential runtime (sec)16 core runtime (sec)x = y
Hash table (sec)
Tre
e (
se
c)
• Performance close to HT
• Due to incremental algorithm
12/7/2011 25
SCALABILITY EXPERIMENTS (AGGREGATE SPEEDUPS)EXPERIMENTS
Parallel Recursive State Compression for Free
With paying careful attention to data layout, we designed a parallel on-
the-fly compression method, that features:
• Impressive compression ratios
• Good performance/scalability
• For the full BEEM benchmark database
12/7/2011Parallel Recursive State Compression for Free 26
CONCLUSION
12/7/2011Parallel Recursive State Compression for Free 27
FUTURE WORK
Support dynamic-sized vectors
Overcome hardware limitations (2 billion vectors due to CAS)
use compact hash table (Cleary)
Static reordering of vector slots to improve compression ratios
Also Multi-Core LTL Model Checking (ATVA 2011 / PDMC 14:00)
Implemented in LTSmin (open source): http://fmt.cs.utwente.nl/tools/ltsmin/
12/7/2011Parallel Recursive State Compression for Free 28
AN INTUITIONANALYSIS OF COMPRESSION RATIOS