html5-img
1 / 449

Cache-Oblivious Algorithms

Cache-Oblivious Algorithms. By Ofer Freedman. The Real World In Theory LCS problem Analysis. 1. The Real World. חומרה. Cache Miss. Page Fault. I/O Bound. Latency. 2. In Theory. RAM model. all memories are equal. all memories are equal But some more than Others.

Download Presentation

Cache-Oblivious Algorithms

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. 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

More Related