Escolar Documentos
Profissional Documentos
Cultura Documentos
CS 700
Design of Experiments
Goals Terminology
Full factorial designs m-factor ANOVA Fractional factorial designs Multi-factorial designs
1.
2.
ANOVA Summary
Alternatives SSA k !1
Error SSE k (n ! 1)
Total SST kn ! 1
Terminology
Response variable Measured output value
E.g. total execution time
Terminology
Replication Completely re-run experiment with same input levels Used to determine impact of measurement error Interaction Effect of one input factor depends on level of another input factor
Two-factor Experiments
Two factors (inputs) A, B Separate total variation in output values
into:
Effect due to A Effect due to B Effect due to interaction of A and B (AB) Experimental error
B (Mbytes) A 1 2 3 4 32 0.25 0.52 0.81 1.50 64 0.21 0.45 0.66 1.45 128 0.15 0.36 0.50 0.70
9
Two-factor ANOVA
Factor A a input levels Factor B b input levels n measurements for each input combination abn total measurements
10
Factor A 1 1 2 Factor B 2
yijk
n replications
11
measurement is composition of
12
Two-factor ANOVA
Each individual
measurement is composition of
13
Sum-of-Squares
As before, use sum-of-squares identity
Two-Factor ANOVA
A B AB Error Sum of squares SSA SSB SSAB SSE Deg freedom a !1 b !1 (a ! 1)(b ! 1) ab(n ! 1) 2 2 2 Mean square sa = SSA (a ! 1) sb = SSB (b ! 1) sab = SSAB [(a ! 1)(b ! 1)] se2 = SSE [ab(n ! 1)] 2 2 2 2 2 Computed F Fa = sa se Fb = sb se Fab = sab se2 Tabulated F F[1!" ;( a !1),ab ( n !1)] F[1!" ;(b !1),ab ( n !1)] F[1!" ;( a !1)(b !1),ab ( n !1)]
15
16
17
Example
Output = user
B (Mbytes) A 1 2 3 4 32 0.25 0.52 0.81 1.50 64 0.21 0.45 0.66 1.45 128 0.15 0.36 0.50 0.70
18
Need replications to
separate error
Example
B (Mbytes) A 1 2 3 4 32 0.25 0.28 0.52 0.48 0.81 0.76 1.50 1.61 64 0.21 0.19 0.45 0.49 0.66 0.59 1.45 1.32 128 0.15 0.11 0.36 0.30 0.50 0.61 0.70 0.68
19
Example
A B AB Error Sum of squares 3.3714 0.5152 0.4317 0.0293 Deg freedom 3 2 6 12 Mean square 1.1238 0.2576 0.0720 0.0024 Computed F 460.2 105.5 29.5 Tabulated F F[ 0.95;3,12] = 3.49 F[ 0.95; 2,12] = 3.89 F[ 0.95;6,12] = 3.00
20
10
response time due to degree of multiprogramming 11.8% (SSB/SST) due to memory size 9.9% (SSAB/SST) due to interaction 0.7% due to measurement error 95% confident that all effects and interactions are statistically significant
21
22
11
df(SSAB) = abcn-1
23
Calculate (2m-1) sum of squares terms (SSx) and SSE Determine degrees of freedom for each SSx Calculate mean squares (variances) Calculate F statistics Find critical F values from table If F(computed) > F(table), (1-) confidence that effect is statistically significant
24
12
A Problem
Full factorial design with replication Measure system response with all possible input combinations Replicate each measurement n times to determine effect of measurement error m factors, v levels, n replications n vm experiments m = 5 input factors, v = 4 levels, n = 3 3(45) = 3,072 experiments!
25
Find factors that have largest impact Full factorial design with only those
factors
26
13
n2m Experiments
A SSA 1 2 sa = SSA 1
2 Fa = sa se2 F[1!" ;1, 2m ( n !1)]
B SSB 1 2 sb = SSB 1
2 Fb = sb se2 F[1!" ;1, 2m ( n !1)]
27
28
14
n2m Contrasts
15
A SSA 1 2 sa = SSA 1
2 Fa = sa se2 F[1!" ;1, 2m ( n !1)]
B SSB 1 2 sb = SSB 1
2 Fb = sb se2 F[1!" ;1, 2m ( n !1)]
31
16
df(each effect) = 1, since only two levels measured SST = SSA + SSB + SSC + SSAB + SSAC + SSBC +
SSABC df(SSE) = (n-1)23 Then perform ANOVA as before Easily generalizes to m > 3 factors
34
17
Important Points
Experimental design is used to Isolate the effects of each input variable. Determine the effects of interactions. Determine the magnitude of the error Obtain maximum information for given effort Expand 1-factor ANOVA to m factors Use n2m design to reduce the number of
experiments needed
35
36
18
X = next multiple of 4 m
PB design matrix Rows = configurations Columns = parameters values in each config High/low = +1/ -1 First row = from P&B paper Subsequent rows = circular right shift of preceding row Last row = all (-1)
37
PB Design Matrix
Config A 1 2 3 4 5 6 7 8 Effect
38
Response
+1 -1 -1 +1 -1 +1 +1 -1
19
PB Design Matrix
Config A 1 2 3 4 5 6 7 8 Effect
39
Response
+1 -1 -1 +1 -1 +1 +1 -1
9 11
PB Design Matrix
Config A 1 2 3 4 5 6 7 8 Effect
40
Response
+1 -1 -1 +1 -1 +1 +1 -1
9 11 2 1 9 74 7 4
20
PB Design Matrix
Config A 1 2 3 4 5 6 7 8 Effect +1 -1 -1 +1 -1 +1 +1 -1 65
41
Response
9 11 2 1 9 74 7 4
PB Design Matrix
Config A 1 2 3 4 5 6 7 8 Effect +1 -1 -1 +1 -1 +1 +1 -1 65 B +1 +1 -1 -1 +1 -1 +1 -1 -45
42
Response
9 11 2 1 9 74 7 4
21
PB Design Matrix
Config A 1 2 3 4 5 6 7 8 Effect +1 -1 -1 +1 -1 +1 +1 -1 65 B +1 +1 -1 -1 +1 -1 +1 -1 -45 Input Parameters (factors) C +1 +1 +1 -1 -1 +1 -1 -1 75 D -1 +1 +1 +1 -1 -1 +1 -1 -75 E +1 -1 +1 +1 +1 -1 -1 -1 -75 F -1 +1 -1 +1 +1 +1 -1 -1 73 G -1 -1 +1 -1 +1 +1 +1 -1 67
43
Response
9 11 2 1 9 74 7 4
PB Design
Only magnitude of effect is important Sign is meaningless In example, most least important
effects:
[C, D, E] F G A B
44
22
selected interactions
45
46
23
Case Study #1
Determine the most significant parameters in a
processor simulator.
47
24
Simulation Environment
SimpleScalar simulator
sim-outorder 3.0
gzip, vpr, gcc, mesa, art, mcf, equake, parser, vortex, bzip2, twolf
49
50
25
Low Value
Least Recently Used
High Value 5 Cycles 50 Cycles 32 Bytes 256 Entries 4096 KB Fully Assoc 30 Cycles 256 Entries Fully-Assoc
L2 Cache Latency Mem Latency, First Mem Latency, Next Mem Bandwidth I-TLB Size I-TLB Page Size I-TLB Assoc I-TLB Latency D-TLB Size D-TLB Page Size D-TLB Assoc D-TLB Latency
26
Low Value
4 2-Level 10 Cycles 4 16 2-Way In Commit 4-Way
High Value
32 Perfect 2 Cycles 64 512 Fully-Assoc In Decode 64 1.0 * ROB 4
53
Config
1 2 3 Effect
+1 -1 -1
54
27
Across configurations
Input Parameters (factors) A B +1 +1 -1 C +1 +1 +1 D -1 +1 +1 E +1 -1 +1 F -1 +1 -1 G -1 -1 +1 9 Response
Config
1 2 3 Effect
+1 -1 -1 65
55
Parameter A B C
Benchmark 1 3 29 2
Benchmark 2 12 4 6
Benchmark 3 8 22 7
56
28
57
Parameter
ROB Entries L2 Cache Latency Branch Predictor Accuracy Number of Integer ALUs L1 D-Cache Latency L1 I-Cache Size L2 Cache Size L1 I-Cache Block Size Memory Latency, First LSQ Entries Speculative Branch Update
gcc
4 2 5 8 7 1 6 3 9 10 28
gzip
1 4 2 3 7 6 9 16 36 12 8
ar t
2 4 27 29 8 12 1 10 3 39 16
Average
2.77 4.00 7.69 9.08 10.00 10.23 10.62 11.77 12.31 12.62 18.23
58
29
General Procedure
Determine upper/lower bounds for
parameters Simulate configurations to find response Compute effects of each parameter for each configuration Rank the parameters for each benchmark based on effects Average the ranks across benchmarks Focus on top-ranked parameters for subsequent analysis
59
Case Study #2
Determine the big picture impact of a system
enhancement.
60
30
Simple analysis
Discards a lot of good information
61
enhancement
enhancement
62
31
a table when the program is loaded into memory Query the table when an instruction is issued Dont execute the instruction if it is already in the table Reduces contention for function units
63
After
Difference
32
Difference
33
Case Study #3
Benchmark program classification.
67
Benchmark Classification
By application type Scientific and engineering applications Transaction processing applications Multimedia applications By use of processor function units Floating-point code Integer code Memory intensive code Etc., etc.
68
34
Another Point-of-View
Classify by overall impact on processor Define: Two benchmark programs are similar if
They stress the same components of a system to similar degrees
How to measure this similarity? Use Plackett and Burman design to find ranks Then compare ranks
69
Similarity metric
Use rank of each parameter as elements of
70
35
Similarity Metric
Euclidean Distance Between Points
D = [( x1 ! y1 ) 2 + ( x2 ! y2 ) 2 + K + ( xn !1 ! yn !1 ) 2 + ( xn ! yn ) 2 ]1/ 2
72
36
Parameter
ROB Entries L2 Cache Latency Branch Predictor Accuracy Number of Integer ALUs L1 D-Cache Latency L1 I-Cache Size L2 Cache Size L1 I-Cache Block Size Memory Latency, First LSQ Entries Speculative Branch Update
gcc
4 2 5 8 7 1 6 3 9 10 28
gzip
1 4 2 3 7 6 9 16 36 12 8
art
2 4 27 29 8 12 1 10 3 39 16
73
Distance Computation
Rank vectors Gcc = (4, 2, 5, 8, ) Gzip = (1, 4, 2, 3, ) Art = (2, 4, 27, 29, ) Euclidean distances D(gcc - gzip) = [(4-1)2 + (2-4)2 + (5-2)2 + ]1/2 D(gcc - art) = [(4-2)2 + (2-4)2 + (5-27)2 + ]1/2 D(gzip - art) = [(1-2)2 + (4-4)2 + (2-27)2 + ]1/2
74
37
75
76
38
Important Points
Multifactorial (Plackett and Burman) design Requires only O(m ) experiments Determines effects of main factors only Ignores interactions Logically minimal number of experiments to
estimate effects of m input parameters Powerful technique for obtaining a bigpicture view of a lot of data
78
39
Summary
Design of experiments
Isolate effects of each input variable. Determine effects of interactions. Determine magnitude of experimental error m-factor ANOVA (full factorial design) All effects, interactions, and errors
79
Summary
n2m designs Fractional factorial design All effects, interactions, and errors But for only 2 input values high/low on/off
80
40
Summary
Plackett and Burman (multi-factorial
No interactions
For only 2 input values (high/low, on/off) Examples rank parameters, group
81
41