NOT_USEFUL-lecture-03

NOT_USEFUL-lecture-03 - Modeling loop performance Tuesday...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Modeling loop performance Tuesday, February 2, 2010
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Loop transformations Many kinds of loop transformations Loop permutation/interchange Loop blocking/tiling Loop reversal Loop fusion Want to understand the effects of these transformations How does a transformation impact performance? Can we predict this impact? Focus on a case study: matrix-matrix multiply and loop interchange Tuesday, February 2, 2010
Background image of page 2
Matrix-matrix multiply Key kernel in linear algebra How much data? How much computation? Signifcant data reuse Important Factor in perFormance: miss ratio Does miss ratio depend on problem size? Interesting Fact: can execute loops in any order Does miss ratio depend on loop order? Can we predict miss ratio? for i [0 : 1 : N - 1] for j [0 : 1 : M - 1] for k [0 : 1 : K - 1] C ij = C ij + A ik * B kj A C B j j k k i i Tuesday, February 2, 2010
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Miss ratios 0 1000 2000 3000 4000 N (elements) 0 10 20 30 40 50 60 L2 Miss Rate k inner i inner j inner Tuesday, February 2, 2010
Background image of page 4
Miss ratios 0 50 100 150 200 250 300 350 N (elements) 0 2 4 6 8 L2 Miss Rate (%) k inner i inner j inner Tuesday, February 2, 2010
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Explaining miss ratios When matrices are small, everything fts in cache Only get cold misses, no capacity misses Misses: 3N 2 /b, accesses: 4N 3 (why?) Miss rate: 3/(4bN) Miss rate goes down as problem size goes up!
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 20

NOT_USEFUL-lecture-03 - Modeling loop performance Tuesday...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online