1 / 40

Understanding Bloom Filter Intersection for Lazy Address-Set Disambiguation

Understanding Bloom Filter Intersection for Lazy Address-Set Disambiguation. Mark Jeffrey and J. Gregory Steffan ECE, University of Toronto June 6, 2011. Parallel Programming is Hard. Tools offload some burden of managing data accesses: Memory Race Replay Atomicity Violation Survival

arlene
Download Presentation

Understanding Bloom Filter Intersection for Lazy Address-Set Disambiguation

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. Understanding Bloom Filter Intersection for Lazy Address-Set Disambiguation Mark Jeffrey and J. Gregory Steffan ECE, University of Toronto June 6, 2011

  2. Parallel Programming is Hard Tools offload some burden of managing data accesses: • Memory Race Replay • Atomicity Violation Survival • Transactional Memory • Speculative Optimizations T1 T3 T2 Rd(a) Rd(a) Rd(x) Rd(b) Wr(c) Rd(a) Wr(a) Rd(a) Many tools are using Bloom filters Mark Jeffrey and Greg Steffan, U of Toronto

  3. Bloom Filter & • Bit-vector-based data structure [1970] • offers fast set operations • in exchange for some imprecision • Recently used to compare memory accesses • With unconventional practices: Intersection • We show new practices are inefficient! (in theory) Mark Jeffrey and Greg Steffan, U of Toronto

  4. Bloom Filters in Concurrency Tools We provide new theory to guide tool designers! Mark Jeffrey and Greg Steffan, U of Toronto

  5. Tracking Address-Set Conflicts Mark Jeffrey and Greg Steffan, U of Toronto

  6. Address-Sets Read Set: • memory locations read • RT1={ , } Write Set: • memory locations written • WT1={a} T1 T3 T2 a Rd(a) Rd(x) Rd(a) Rd(b) Wr(c) b Wr(a) Rd(a) Rd(a) Mark Jeffrey and Greg Steffan, U of Toronto

  7. Burden: Address-Set Conflicts Conflicts • address accesses are dependent • independence -> parallelism! • address conflicts -> no parallelism Conflict Detection requires • read and write set comparison • runtime address disambiguation T1 T3 T2 Rd(a) Rd(x) Rd(a) Rd(b) Wr(c) Wr(a) Rd(a) Rd(a) Mark Jeffrey and Greg Steffan, U of Toronto

  8. Conflict Detection – When? • Eager • Detect conflicts at the time of memory access • Lazy • Detect conflicts at the end of an arbitrary epoch Thread1 Thread2 -Rd(a) Wr(b)- Wr‘b’ OK? Thread1 Thread2 -Rd(a) Rd(a)- -Rd(b) Wr(b)- Rd(c)- {a,b,c} OK? Mark Jeffrey and Greg Steffan, U of Toronto

  9. Conflict Detection – When? • Eager = Set Membership • Query for that single address in the access sets • Lazy = Set Overlap • Compare access sets for non-empty intersections Thread1 Thread2 -Rd(a) Wr(b)- Thread1 Thread2 “When” determines the set operation -Rd(a) Rd(a)- -Rd(b) Wr(b)- Rd(c)- Mark Jeffrey and Greg Steffan, U of Toronto

  10. Bloom Filters (BF) Mark Jeffrey and Greg Steffan, U of Toronto

  11. Bloom Filter Background x = [x31, …,x3,x2,x1,x0] • Bloom filter is a compact set representation • Bit vector - much smaller than address space h() [x4,x3,x2,x1] Mark Jeffrey and Greg Steffan, U of Toronto

  12. Bloom Filter Background y Query for an address, y h() [y4,y3,y2,y1] {Yes, No} Mark Jeffrey and Greg Steffan, U of Toronto

  13. Bloom Filter False Positives (FPs) x • Encode a large address space into a bit-vector • Response to query is actually No or Maybe • False Positives – when “maybe” is wrong ? is y in y Mark Jeffrey and Greg Steffan, U of Toronto

  14. Partitioned Bloom Filter x h1() h2() … hk() … • Insert an address, x: • k hash functions encode k bit indices to set Mark Jeffrey and Greg Steffan, U of Toronto

  15. Partitioned Bloom Filter Query for an address, y: y h1() h2() … hk() … {Maybe, No} Probability of False Positives is well understood Mark Jeffrey and Greg Steffan, U of Toronto

  16. Unconventional Practices for Bloom Filters Mark Jeffrey and Greg Steffan, U of Toronto

  17. Bloom Filter for Set Overlaps Lazy systems perform set intersections Two common approaches: • build a Queue of Queries (QoQ) • batch queries into distinct Bloom filter • replace many queries with 1 intersection! a1 ? a5 a4 a3 a2 Mark Jeffrey and Greg Steffan, U of Toronto

  18. Partitioned BF Intersection Do two sets share any elements? & … … … {Disjoint, Maybe Not} Mark Jeffrey and Greg Steffan, U of Toronto

  19. Unpartitioned BF Intersection Any asserted bits indicate set overlap … … & … {Disjoint, Maybe Not} Mark Jeffrey and Greg Steffan, U of Toronto

  20. False Set Overlap with BF Intersection • Bloom filter was intended for fast Querying • Recent systems use filter for Intersection • Imprecision can produce False Set Overlaps (FSO) • Limited study of Bloom filter intersection • Our goal is to Demystify Bloom filter Intersection Mark Jeffrey and Greg Steffan, U of Toronto

  21. Important Questions When using BFs for address Set Overlaps: • how do BF Intersection and QoQ compare? • Empirical Study • what is the exact FSO probability? • Theoretical Study • what are the theoretical implications? Mark Jeffrey and Greg Steffan, U of Toronto

  22. Bloom Filters for Set Overlap How do BF Intersection and QoQ compare? Mark Jeffrey and Greg Steffan, U of Toronto

  23. Methodology For many trials: • Create sets A = {a1,a2,…,an} B = {b1,b2,…,bm}- A and B are disjoint // Measure Intersects with FSOs • count # trials with a FSO // Measure Queues of Queries with FSOs • For each bi in B: count # trials with at least one FP is biϵ A→ B→ ∩ Mark Jeffrey and Greg Steffan, U of Toronto

  24. Queue of Queries vs. Intersection For equivalent FSO rate, Intersection requires ≥ 4x more bits! 4x 4x 4x Better Mark Jeffrey and Greg Steffan, U of Toronto

  25. Queue of Queries vs. Intersection Doubling address set from 32 to 64 => Doubling size from 4x to 8x 8x 8x Better Mark Jeffrey and Greg Steffan, U of Toronto

  26. Empirical Study Summary • BF Intersection requires > bits for == FSO rate • Space overhead increases with set size • Partitioned intersect is better than Unpartitioned Mark Jeffrey and Greg Steffan, U of Toronto

  27. Bloom Filters for Set Overlap What is the exact probability of False Set Overlap (FSO)? Mark Jeffrey and Greg Steffan, U of Toronto

  28. Definitions Mark Jeffrey and Greg Steffan, U of Toronto

  29. Definitions h1() h2() … hk() … Mark Jeffrey and Greg Steffan, U of Toronto

  30. Probability of FSO • Unpartitioned BF Intersection • Partitioned BF Intersection • Queue of BF Queries b1 ϵ? b5 b4 b3 b2 h1 h2 … hk h1 h2 … hk Mark Jeffrey and Greg Steffan, U of Toronto

  31. Theorem: BF(A)∩BF(B) vs. BF(A∩B) Theorem [Guo et al. TKDE ‘10]: BF(A)∩BF(B) & A∩B BF(A) BF(B) h1 h2 … hk BF(A∩B) Mark Jeffrey and Greg Steffan, U of Toronto

  32. Bloom filters for Set Overlap What are the Theoretical Implications? Mark Jeffrey and Greg Steffan, U of Toronto

  33. False Conflicts: QoQ vs. Intersections For any length m, and k > 1 hash functions, Better • Queue of Queries gives fewer false conflicts • Partitioned intersection improves on Unpartitioned Mark Jeffrey and Greg Steffan, U of Toronto

  34. Space: QoQ vs. Intersection For equivalent Pr[FSO], when mPartitioned≥|A||B|, k > 1, Mark Jeffrey and Greg Steffan, U of Toronto

  35. Space: QoQ vs. Intersection For equivalent Pr[FSO], when mPartitioned≥|A||B|, k > 1, intersection requires at least square root factor more space. Mark Jeffrey and Greg Steffan, U of Toronto

  36. Single Hash: QoQ vs. Intersection For a single hash function, k = 1, Better exploit the speed of intersection instead of queries! Mark Jeffrey and Greg Steffan, U of Toronto

  37. Conclusion Mark Jeffrey and Greg Steffan, U of Toronto

  38. Summary Conflict detection often applies Bloom filters • for fast set operations: y ϵ S and S1∩S2 • Many new systems use BF intersect Our recommendations (in order of preference) • strongly consider querying before intersection • intersect partitioned Bloom filters • if single hash is required, exploit intersection! Mark Jeffrey and Greg Steffan, U of Toronto

  39. Current Work: Implementations • Analyze the effects of partitioning in RingSTM • Analyze the effects of QoQ in RingSTM • Develop a compromise in space and time • Reduce sqrt space overhead of BF Intersect • Reduce linear time complexity of Queue of Query Mark Jeffrey and Greg Steffan, U of Toronto

  40. Understanding Bloom Filter Intersection for Lazy Address-Set Disambiguation Thank you! markj@eecg.toronto.edu

More Related