Download presentation

Presentation is loading. Please wait.

Published byGuy Curling Modified about 1 year ago

1
Accelerating External Search with Bitstate Hashing Stefan Edelkamp Shahid Jabbar Computer Science Department University of Dortmund, Dortmund, Germany

2
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 2 Model Checking Given A model of a system. A specification property Model Checking Problem: Does the system satisfy the property ? Method: An exhaustive exploration of the state space to search for a state that does not satisfy the property. Problem: How to cope with large state spaces that do not fit into the main memory?

3
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 3 Two Very Effective Methods 1. External Search: + Uses Harddisk to store the state space. + Implemented on top of SPIN model checker. + Promising: Largest exploration so far took ~20 GB – much larger than even the address limits of most computers. + Pause and Resume support – Can add more harddisks. - Slow duplicate detection phase 2. Bitstate Hashing (Partial Search): + Uses only a single bit per state for closed list => faster duplicates removal. + What if the size of the open list becomes greater than the internal memory ? - Solution reconstruction is not possible.

4
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 4 Best of the Both Worlds External Search combined with Bitstate Hashing + Faster duplicates removal. + Open and Closed lists can be saved on the harddisk. + (Partial) Solution reconstruction.

5
Outline 1. Directed Model Checking 2. External Search 3. Partial Search 4. External Partial Directed Search 5. Experimental Results 6. Conclusions

6
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 6 Directed Model Checking (Edelkamp, Leue, Lluch-Lafuente, 2004) A guided search in the state space. Usually by some heuristic estimate. Only promising states are explored. Under-certain conditions proved to be complete. Shorter error trails Better for human comprehension Problem: The inevitable demands of the model.. Space, space and space.

7
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 7 Possible Solution Use Virtual Memory. Assume a bigger address space divided into pages. Saved on the hard disk but are moved back to the main memory whenever they are “called” – Page Faults. Pages are mapped to physical locations within the main memory and the desired content is returned from the main memory location.

8
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 8 Problem with the Virtual Memory 0x000…000 0xFFF…FFF Virtual Address Space Memory Page

9
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 9 External Memory Model (Aggarwal and Vitter) Input of size N and N >> M M B Disk If the input size is very large, running time depends on the I/Os rather than on the number of instructions. Scan(N) = O(N / B) Sort(N) = O(N/B log M/B N/B)

10
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 10 External Memory Graph Algorithms External breadth first search [Munagala and Ranade, 2001]: Generated states flushed to the disk for every BFS level. No hash table. Duplicates are removed by sorting the nodes according to the indices and doing an scan and compaction phase. Before expanding a layer t, the nodes in the layer t-1 and t-2 are subtracted from t. O(|V| + sort(|V| + |E|)) I/Os. where sort(N) = O(N / B log M/B N / B) I/Os [Korf, 2003] presented the breadth first search version for implicit graphs.

11
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 11 External BFS A t t+1 t+2 BCDBCD XYZAXXYZAX XYZAXYZA XYZXYZ Duplicates’ Removal

12
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 12 A* Algorithm a.k.a Goal-directed Dijkstra A heuristic estimate is used to guide the search. E.g. Straight line distance from the current node to the goal in case of a graph with a geometric layout. Reweighing: w’(u,v) = w(u,v) – h(u) + h(v) Problems: A* needs to store all the states during exploration. A* generates large amount of duplicates that can be removed using an internal hash table – only if it can fit in the main memory. A* do not exhibit any locality of expansion. For large state spaces, standard virtual memory management can result in excessive page faults.

13
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 13 Take a closer look Implicit, unweighted, undirected graphs Consistent heuristic estimates. => ∆h ={-1,0,1} g 0 1 2 3 4 5 0123456 h It’s a Bucket !!

14
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 14 Bucket A Bucket is a set of states, residing on the disk, having the same (g, h) value, Where, g = number of transitions needed to transform the initial state to the states of the bucket, and h = Estimated distance of the bucket’s state to the goal No state is inserted again in a bucket that is expanded. If Active (being read or written), represented internally by a small buffer. File on disk Buffer in internal memory Insert stateFlush when full

15
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 15 External A* [Edelkamp, Jabbar, and Schroedl, 2004] Buckets represent temporal locality – cache efficient order of expansion. If we store the states in the same bucket together we can exploit the spatial locality. Munagala and Ranade’s BFS and Korf’s delayed duplicate detection for implicit graphs. External A*

16
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 16 Complexity Analysis Internal A* => Each edge is looked at most once. Duplicates Removal: Sorting the green bucket having one state for every edge from the 3 black buckets. Scanning and compaction. O(sort(|E|)) Subtraction: Removing states of orange buckets (duplicates free) from the green one. O(scan(|V|) + scan(|E|))

17
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 17 I/O Performance of External A* Theorem: The complexity of External A* in an implicit unweighted and undirected graph with a consistent estimate is bounded by O(sort(|E|) + scan(|V|)) I/Os.

18
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 18 Bitstate Hashing Single bit per state to represent Closed list. Guarantees duplicates removal. But: can remove non-duplicates too – false- positive. Average probability of a false-positive error during the search: Since the ith element collides with one of the i-1 already inserted elements with a probability of at most (i-1) / m n: size of the state space; m: size of the hash table

19
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 19 External Partial Directed Search Procedure External A* Bucket(0, h(I)) {I} f min h(I) while (f min ≠ ∞) g min{i | Bucket(i, f min − i) ≠ } while (g ≤ f min ) h f min − g forall v є succ(Bucket(g, h)) if (not H[v]) H[v] true A(f min ),A(f min + 1),A(f min + 2) v Bucket(g + 1, h + 1) A(f min + 2) U Bucket(g + 1, h+1) Bucket(g + 1, h) A(f min + 1) U Bucket(g + 1, h) Bucket(g + 1, h − 1) A(f min ) U Bucket(g + 1, h − 1) g g + 1 f min min{i + j > f min | Bucket(i, j) ≠ } U {∞} H[0 … m – 1]: Bitstate Hashtable for i = 0 to m – 1 H[i] false

20
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 20 Experimental Results -1 Deadlock Detection in Optical Telegraph # Sta- tions Sol. Depth #stored sates #stored states with bitstate Time (mm:ss) Time with bitstate 745333,877243,31800:14.4700:07.39 850420,531332,96300:22.2500:11.20 9579,186,6116,350,08717:26.8804:10.33

21
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 21 Experimental Results -2 CORBA GIOP – 1 Server, N Clients # Clients Sol. Depth #stored sates #stored states with bitstate Time (mm:ss) Time with bitstate 25852,41048,00000:11.3600:03.49 370893,392809,09803:03.7900:43.26 4757,929,7106,998,69322:49.2308:43.01

22
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 22 Experimental Results -3 CORBA GIOP – 2 Servers, N Clients # Clients Sol. Depth #stored sates#stored states with bitstate Time (mm:ss) Time with bitstate 3763,431,6193,127,71805:43.1602:42.5 48130,504,63027,133,946293:00.0033:06.28 20 GB space requirement

23
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 23 Experimental Results – 4 Negative case Deadlock Detection in Dining Philosophers # Philoso- phers Solution Depth #stored sates #stored states with bitstate Time (mm:ss) Time with bitstate 100402 999,810975,45901:0501:39 150603 3,330,4563,319,31205:4406:18 Time to compute the hash value is dominant than external sorting!

24
Shahid Jabbar (Dortmund)Accelerating External Search with Bitstate Hashing 24 Summary State space explosion problem can be circumvented by Directed External Model Checking or Bitstate Hashing. Both approaches have some flaws. A fusion of both approaches cover individual flaws. Implemented on top of IO-HSF-SPIN – SPIN model checker with external heuristic search. Gain in speed up till 9 times. -- THE END --

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google