Cache-Oblivious Algorithms - PowerPoint PPT Presentation

cache oblivious algorithms n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Cache-Oblivious Algorithms PowerPoint Presentation
Download Presentation
Cache-Oblivious Algorithms

play fullscreen
1 / 449
Cache-Oblivious Algorithms
132 Views
Download Presentation
cadence-fidel
Download Presentation

Cache-Oblivious Algorithms

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Cache-Oblivious Algorithms By Ofer Freedman

  2. The Real World • In Theory • LCS problem • Analysis

  3. 1. The Real World

  4. חומרה

  5. Cache Miss

  6. Page Fault

  7. I/O Bound

  8. Latency

  9. 2. In Theory

  10. RAM model

  11. all memories are equal

  12. all memories are equal But some more than Others

  13. standard external-memory model AlokAggarwal and Jeff Vitter, 1988

  14. Storage > ∞ M – finite memory B – block size

  15. Analysis

  16. Time Complexity

  17. Space Complexity

  18. Cache Complexity

  19. We want to bound number of cache misses

  20. Some results: Scanning: Binary Search: Sort:

  21. In B-trees: B = B

  22. Many Problems

  23. 1. Requires tuning for every machine.

  24. 2. The OS might not tell us what we need to know.

  25. 3. How do we optimize for multi level cache?

  26. Cache-Oblivious Model Frigo, Leiserson, Prokop, and Ramachandran, 1999

  27. Storage > ∞ M – finite memory B – block size

  28. With the following additions

  29. Algorithm may not know about B and M.

  30. Algorithm have no control over blocks placing

  31. B and M apply only in analysis.

  32. Why is it Great?

  33. 1. Require no tuning.

  34. 2. RAM is cache-oblivious out of the box.

  35. 3. Optimal for multi-level cache hierarchy

  36. CPU RAM L2Cache L1Cache

  37. Memory Storage CPU RAM L2Cache L1Cache

  38. Memory Storage CPU RAM L2Cache L1Cache

  39. Memory Storage CPU RAM L2Cache L1Cache

  40. What about cache management policy?

  41. Good News

  42. (double) optimal policy (with M memory) FIFO and LRU (with 2M cache)

  43. 3. LCS

  44. Input: 2 strings X and Y,of length n and m.

  45. Output: Longest Common Subsequence of X and Y

  46. HUMAN CHIMPANZEE

  47. HUMAN CHIMPANZEE

  48. Naive Solution