{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

NOT_USEFUL-lecture-03

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

Info icon This 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
Image of page 1

Info icon This 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
Image of page 2
Matrix-matrix multiply Key kernel in linear algebra How much data? How much computation? Significant 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
Image of page 3

Info icon This 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
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
Image of page 5

Info icon This 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 fits 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!
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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern