Presentation is loading. Please wait.

Presentation is loading. Please wait.

A C OMPONENT - BASED D EFINITION OF S PATIAL L OCALITY Xiaoming GuChengliang Zhang Chen Ding University of RochesterMicrosoft Corporation.

Similar presentations


Presentation on theme: "A C OMPONENT - BASED D EFINITION OF S PATIAL L OCALITY Xiaoming GuChengliang Zhang Chen Ding University of RochesterMicrosoft Corporation."— Presentation transcript:

1 A C OMPONENT - BASED D EFINITION OF S PATIAL L OCALITY Xiaoming GuChengliang Zhang Chen Ding University of RochesterMicrosoft Corporation

2 T RADITIONAL D EFINITION OF S PATIAL LOCALITY When a data element is accessed, the nearby data elements will also be accessed Overall miss rate The fewer the misses, the better the layout

3 Q UESTIONS Can the overall spatial locality be decomposed into finer components? How much can the locality of a given data layout be improved? Can a data layout be improved if the miss rate cannot be lowered?

4 A C OMPONENT - BASED D EFINITION OF S PATIAL L OCALITY Based on the reuse distance Based on components

5 R EUSE D ISTANCE The reuse distance of a memory access is the number of distinct data elements accessed between this and the previous access to the same data. 20201 abcaabba

6 R EUSE S IGNATURE The distribution of all reuse distances In our experiment, we use log sized bins 012-3 2123

7 A C OMPONENT - BASED D EFINITION OF S PATIAL L OCALITY Spatial locality measures the change in reuse distance when the data block size changes from b1 to twice the size b2 = 2*b1. 20201 0 10000 abcaabba b1 b2

8 C ASES OF C HANGE xy Data layout x Trace........................................... Case 1:........................................... Case 2:........................................... cd x xx xxy b2 b1 xy s Data layout

9 C HANGES OF R EUSE S IGNATURE 2123 5102 0-01-12-3 b2 b1

10 D ATA L AYOUT Q UALITY Effective spatial reuse: the bin they are located has been moved to left by at least C bins, when the block size is doubled Ineffective spatial reuse: the other reuses In our experiment, we pick C to be 3 The data layout quality of a bin: 2 * effective spatial reuse / total spatial reuse

11 C OMPONENT Data reuses of nearby bins that have a similar portion of effective spatial reuse The spatial locality of a component is the weighted average of the spatial locality of each bin We manually examine the bins and groups them into components

12 E XPERIMENTAL S ETTING 7 SPEC2000 (equake, art, swim, gzip, mcf, crafty, twolf) and 1 SPEC2006 (milc) Data size varies from 1.2MB to 72MB Trace length varies from 7.7 billion to 400 billion Valgrind [NethercoteSeward07] to collect traces Augmented reuse distance analyzer [DingZhong03] Several hundred times slower

13 S WIM

14 W HY O PTIMIZED S WIM B ETTER L1 miss rateL2 miss rate Original version10.4%5.33% Optimized version9.7%5.33% L1 miss rate reduced by 6.7% Performance increased by 8.1% 4% reference: 0.16 -> 0.99

15 Good temporal locality Good spatial locality Poor Spatial locality

16

17 D IFFERENT I NPUTS Component Spatial locality Size (%) ref input swim-c1 0.255.1 swim-c2 15.2 train input swim-c1 0.255.1 swim-c2 0.985.2

18 P OSSIBLE U SES User tuning [Levinthal] Superpage management Data-based cache hints [ Fang05, BeylsDHollander05]

19 R ELATED W ORK Spatial locality [BuntMurphy84,Weinberg+05] Component-based analysis [DingZhong03,Shen+03] Spatial uses within a loop [WolfLam91,McKiney+96]

20 S UMMARY A quantitative model of spatial locality We have tested our new model on 8 SPEC benchmark programs Among 18 components, 2 have good temporal locality, 6 have good spatial locality, 4 have poor spatial locality/poor temporal locality/large Possible uses


Download ppt "A C OMPONENT - BASED D EFINITION OF S PATIAL L OCALITY Xiaoming GuChengliang Zhang Chen Ding University of RochesterMicrosoft Corporation."

Similar presentations


Ads by Google