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

Loading in 2 Seconds...

play fullscreen
1 / 449

Cache-Oblivious Algorithms - PowerPoint PPT Presentation


  • 109 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Cache-Oblivious Algorithms' - cadence-fidel


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide2
The Real World
  • In Theory
  • LCS problem
  • Analysis
slide13

all memories are equal

But some more than

Others

slide14

standard external-memory model

AlokAggarwal and Jeff Vitter, 1988

slide15

Storage > ∞

M – finite memory

B – block size

slide21

Some results:

Scanning:

Binary Search:

Sort:

slide27

Cache-Oblivious Model

Frigo, Leiserson, Prokop, and Ramachandran, 1999

slide28

Storage > ∞

M – finite memory

B – block size

slide37

CPU

RAM

L2Cache

L1Cache

slide38

Memory

Storage

CPU

RAM

L2Cache

L1Cache

slide39

Memory

Storage

CPU

RAM

L2Cache

L1Cache

slide40

Memory

Storage

CPU

RAM

L2Cache

L1Cache

slide43

(double) optimal policy

(with M memory)

FIFO and LRU (with 2M cache)

slide45

Input:

2 strings X and Y,of length n and m.

slide46

Output:

Longest Common Subsequence

of X and Y

slide47

HUMAN

CHIMPANZEE

slide48

HUMAN

CHIMPANZEE

slide145

it means the number of cache misses is asymptotically equal to the number of blocks in the DP table.

slide146

asymptotically

(#block in the table) = (#cache misses)

slide148

M

X

slide149

M

X

slide150

M

X

slide151

M

X

slide152

M

X

slide153

M

For every block we bring a block.

X

slide158

LCS-Output-Boundary

Input:

Output:

slide165

When the given matrix is of size 1 recursion breaks

We use dynamic method recursion to compute it’s value

slide199

4

4

3

3

2

1

2

1

slide200

4

4

3

3

2

1

2

1

slide201

4

4

3

3

2

1

2

1

slide202

4

4

3

3

2

1

2

1

slide203

4

4

3

3

2

1

2

2

1

slide204

4

4

3

3

2

1

2

1

2

slide205

4

4

3

3

2

1

2

2

1

slide206

4

4

3

3

2

1

2

2

1

slide207

4

4

3

3

2

1

2

2

1

slide208

4

4

3

3

2

1

2

2

1

slide209

4

4

3

3

2

1

2

2

1

slide210

4

4

3

3

2

1

2

2

1

slide211

4

4

3

3

2

1

2

2

1

slide212

4

4

3

3

2

1

2

2

1

slide213

4

4

3

3

2

1

2

2

1

slide214

4

4

3

3

2

1

2

2

1

slide215

4

4

3

3

2

1

2

2

1

slide216

4

4

3

3

2

1

2

2

1

slide217

4

4

3

3

2

1

2

2

1

slide218

4

4

3

3

2

1

2

2

1

slide219

4

4

3

3

2

1

2

2

1

slide220

4

4

3

3

2

1

2

2

1

slide221

4

4

3

3

2

1

2

2

1

slide222

4

4

3

3

2

1

2

2

1

slide223

4

4

3

2

1

2

2

3

1

slide224

4

4

3

3

2

1

2

2

1

slide225

4

4

3

3

2

1

2

2

1

slide226

4

4

3

3

2

1

2

2

1

slide227

4

4

3

3

2

1

2

2

1

slide228

4

4

3

3

2

1

2

2

1

slide229

4

4

3

3

2

1

2

2

1

slide230

4

4

3

3

2

1

2

2

1

slide231

4

4

3

3

2

1

2

2

1

slide232

4

3

3

2

1

2

2

4

1

slide233

4

4

3

3

2

1

2

2

1

slide234

4

4

3

3

2

1

2

2

1

slide235

4

4

3

3

2

1

2

2

1

slide236

4

4

3

3

2

1

2

2

1

slide237

4

4

3

3

2

1

2

2

1

slide238

4

4

3

3

2

1

2

2

1

slide239

4

4

3

3

2

1

2

2

3

1

slide240

4

4

3

3

2

1

2

2

1

3

slide241

4

4

3

3

2

1

2

2

3

1

slide242

4

4

3

3

2

1

2

2

3

1

slide243

4

4

3

3

2

1

2

2

3

1

slide244

4

4

3

3

2

1

2

2

3

1

slide245

4

4

3

3

2

1

2

2

3

1

slide246

4

4

3

3

2

1

2

2

3

1

slide247

4

4

3

3

2

1

2

2

3

1

slide248

4

4

3

3

2

1

2

2

3

1

slide249

4

4

3

3

2

1

2

2

3

1

slide250

4

4

3

3

2

1

2

2

3

1

slide251

4

4

3

3

2

1

2

2

3

1

slide252

4

4

3

3

2

1

2

2

3

1

slide253

4

4

3

3

2

1

2

2

3

1

slide254

4

4

3

3

2

1

2

2

3

1

slide255

4

4

3

3

2

1

2

2

3

1

slide256

4

4

3

3

2

1

2

2

3

1

slide257

4

4

3

2

1

2

2

3

3

1

slide258

4

4

3

2

1

2

2

3

1

3

slide259

4

4

3

2

1

2

2

3

1

3

slide260

4

4

3

2

1

2

2

3

1

3

slide261

4

4

3

2

1

2

2

3

1

3

slide262

4

4

3

2

1

2

2

3

1

3

slide263

4

4

3

2

1

2

2

3

1

3

slide264

4

4

3

2

1

2

2

3

1

3

slide265

4

4

3

2

1

2

2

3

1

3

slide266

4

3

2

1

2

2

3

4

1

3

slide267

4

3

2

1

2

2

3

1

3

slide268

4

3

2

1

2

2

3

1

3

slide269

4

3

2

1

2

2

3

1

3

slide270

4

3

2

1

2

2

3

1

3

slide271

4

3

2

1

2

2

3

1

3

slide272

4

3

2

1

2

2

3

1

3

slide273

4

3

2

1

2

2

3

1

3

slide274

4

3

2

1

2

2

3

1

3

slide275

4

3

2

1

2

2

4

3

1

3

slide276

4

3

2

1

2

2

1

3

3

4

slide277

4

3

2

1

2

2

3

3

4

1

slide278

4

3

2

1

2

2

3

3

4

1

slide279

4

3

2

1

2

2

3

3

4

1

slide280

4

3

2

1

2

2

3

3

4

1

slide281

4

3

2

1

2

2

3

3

4

1

slide282

4

3

2

1

2

2

3

3

4

1

slide283

4

3

2

1

2

2

3

3

4

1

slide284

4

3

2

1

2

2

3

3

4

1

slide285

4

3

2

1

2

2

3

3

4

1

slide286

4

3

2

1

2

2

3

3

4

1

slide287

4

3

2

1

2

2

3

3

4

1

slide288

4

3

2

1

2

2

3

3

4

1

slide289

4

3

2

1

2

2

3

3

4

1

slide290

4

3

2

1

2

2

3

3

4

1

slide291

4

3

2

1

2

2

3

3

4

1

slide292

4

3

2

1

2

2

3

3

4

1

slide293

4

3

2

1

2

2

3

3

4

1

slide294

4

3

2

1

2

3

2

3

4

1

slide295

4

3

2

1

2

2

3

3

4

1

slide296

4

3

2

1

2

2

3

3

4

1

slide297

4

3

2

1

2

2

3

3

4

1

slide298

4

3

2

1

2

2

3

3

4

1

slide299

4

3

2

1

2

2

3

3

4

1

slide300

4

3

2

1

2

2

3

3

4

1

slide301

4

3

2

1

2

2

3

3

4

1

slide302

4

3

2

1

2

2

3

3

4

1

slide303

4

3

2

1

2

2

3

4

3

1

4

slide304

2

2

3

3

4

1

slide305

2

2

3

3

4

1

slide306

2

2

3

3

4

1

slide307

2

2

3

3

4

1

slide308

2

2

3

3

4

1

slide309

2

2

3

3

4

1

slide310

2

2

3

3

4

1

slide311

2

2

3

3

4

1

slide312

2

2

3

3

4

1

slide313

2

2

3

3

4

1

slide318

2

2

3

3

4

1

slide322

Recursive-LCS

Input:

Output:

slide331

When the given matrix is of size 1 recursion breaks

We use dynamic method recursion to update path

slide435

M2

M2

slide436

M2

M2

M2

slide437

M2

M2

M2

M2

slide440

n2 = Table Size

k = (#blocks in cache)

M = k•B

slide449

Reference:

  • models, cache-oblivious B-trees, Erik Demain (Video Lecture)
  • Cache-Oblivious Algorithms and Data Structures (PDF)
  • Cache-Oblivious Dynamic Programming, RezaulAlamChowdhuryVijayaRamachandran (SODA 2006)
  • Hirschberg’s LCS (Code Sample and explanation)