



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




By: John Mellor-Crummey, David Whalley, Ken Kennedy
Presented By: Saeed Alaei
ย Memory hierarchies and performance. ย Data and computation reordering in general. ย Regular vs. Irregular applications. ย Space filling curves:
Hilbert curve
Morton curve ย Data and computation reordering approaches. ย Experimental results
ย Gap between CPU speed and memory speed has increased rapidly. ย Multi-level memory hierarchies are used to address this memory access bottleneck. ย Irregular applications underutilize the memory hierarchies.
ย Data and computation reordering can greatly help.
for(i=0;i<n;i++) for(j=0;j<n;j++) for(k=0;k<n;k++) C[i][j]+=A[i][k]*B[k][j];
for(i=0;i<n;i++) for(j=0;j<n;j++) for(k=0;k<n;k++) C[i][j]+=A[i][k]*BT[j][k];
for(i=0;i<n;i++) for(j=0;j<n;j++) for(k=0;k<n;k++) C[i][j]+=A[i][k]*B[k][j];
for(i=0;i<n;i++) for(k=0;k<n;k++) for(j=0;j<n;j++) C[i][j]+=A[i][k]*B[k][j];
ย Regular applications:
Static analysis and fixed access pattern.
Techniques: ย Loop blocking. ย Data prefetching.
Instances: ย Matrix multiplication/inversion. ย Irregular applications:
Dynamic analysis, access pattern unknown until runtime.
Proposed techniques: ย Dynamic data reordering before major computation phase. ย Computations reordering by blocking.
Cache miss.
TLB miss.
N-Body simulation.
ย A space-filling curve for some finite space of d dimensions ( d โฅ 2) is a continuous, non-smooth curve that passes arbitrarily close to every point. ย Each point in a d -dimensional space can be mapped to the nearest position along a 1- dimensional spacefilling curve by applying a sequence of bit-level logical operations to its d - dimensional coordinates
Space Filling Curve Computation Reordering
ย Changes the order of elements in the interaction list. ย The order of particle information remains unchanged. ย Improves temporal locality.
Computation Reordering by Blocking
Computation Reordering by Blocking (contโd)
0 1 2 3 4 5 P
PP PP P (^) P
Px P P
P
Pz
P
Py P
P P 0
1
2
3
ย Blocking can also be done base on different approaches (e.g. by taking the address).
Computation Reordering by Blocking (contโd)
ย Blocking can be extended to multiple levels. ย A blocking factor depends on architectural characteristics:
Size of cache lines or page size for TLB.
The number of sets in the cache.
Associativity.
Replacement policy.
โฆ
Computation Reordering by Blocking (contโd)
ย The recursive divide and conquer approach can be used to achieve a machine independent blocking.
Computation Reordering by Blocking (contโd)
Moldyn (a synthetic benchmark).
Magi
CHAD
ย A synthetic benchmark for molecular dynamics simulation. ย Closely resembles the N-Body example. ย The time consuming part is the computeForces function called on list of interactions. ย The experiment:
Performed SGI O2 based on R10000 MIPS.
256,000 particles, over 27 million interactions.
Block Number
Interaction Number
Block Number
Interaction Number
Block Number
Interaction Number
Block Number
Interaction Number