assignment 3

18
August 9, 2022 John Morris 1 Assignment 3 Assignment 3 Form a group of 2 Find processors with two different architectures Intel Alpha (cs26) SPARC PowerPC (Mac) Write a program to measure the characteristics of the TLB in the two processors Size Others (refer to cache lectures) Write a report Your results How you measured them

Upload: hayley-mercado

Post on 31-Dec-2015

19 views

Category:

Documents


2 download

DESCRIPTION

Assignment 3. Form a group of 2 Find processors with two different architectures Intel Alpha (cs26) SPARC PowerPC (Mac) … Write a program to measure the characteristics of the TLB in the two processors Size Others (refer to cache lectures) Write a report Your results - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Assignment 3

April 19, 2023 John Morris 1

Assignment 3Assignment 3

► Form a group of 2► Find processors with two different architectures

Intel Alpha (cs26) SPARC PowerPC (Mac) …

► Write a program to measure the characteristics of the TLB in the two processors Size Others (refer to cache lectures)

► Write a report Your results How you measured them

Page 2: Assignment 3

April 19, 2023 John Morris 2

Assignment 3Assignment 3

► Warnings Cache and TLB measurement programs are available on the Internet Use of somebody else’s program is forbidden

►Breaking this rule is plagiarism!►Penalty can be more than loss of marks for this assignment►Don’t risk it!

You must be able to tell us HOW your program works!►You may be required to give an oral explanation

This is a scientific experiment Good scientific experiments have some basic characteristics

►Next set of slides give some of these Failing to follow good experimental practice loses marks

►Key check points? Hypothesis

? Reasonable error estimates

Page 3: Assignment 3

April 19, 2023 John Morris 3

Assignment 3Assignment 3

► Warnings Don’t forget that your processor has a cache too!

► Your experimental design should allow for it also!► As with the TLB, some research to form an initial

hypothesis will save time and improve your final result You may like to break your hypothesis down in several

hypotheses

a) L1 cache has x bytes and will affect my measurements in …

b) TLB has x and y characteristics and will …

c) …

Page 4: Assignment 3

April 19, 2023 John Morris 4

Computer Architecture 363Computer Architecture 363Experimental DesignExperimental Design

John Morris

Computer Science/Electrical EngineeringUniversity of Auckland

Email: [email protected]: http:/www.cs.auckland.ac.nz/~jmor159

Reference: Patterson & Hennessy, Chapter 2

Page 5: Assignment 3

April 19, 2023 John Morris 5

Experimental DesignExperimental Design

► Good design Saves Time Gets better results!

► Hypothesis - essential starting point Form one before doing the experiment Use theory to predict results

►Examples Time for this program will be proportional to the size of the

problem► O (n) running time

Page 6: Assignment 3

April 19, 2023 John Morris 6

Theoretical PredictionTheoretical Prediction

► Example Time is linear in size of problem

Time(sec)

Size of problem - n

Time Complexity

O(n)

Page 7: Assignment 3

April 19, 2023 John Morris 7

Theoretical PredictionTheoretical Prediction

► but ... Time will increase sharply when cache is full

Time(sec)

Size of problem - n

Cacheoverflows

Data fitsin cache

Running time jumps!

Page 8: Assignment 3

April 19, 2023 John Morris 8

More likely!

You can probablyestimate the shape of

this curve

Refine the prediction!Refine the prediction!

► Time will increase sharply when cache is full► How sharply?

Time(sec)

Size of problem - n

Cacheoverflows

Data fitsin cache

Page 9: Assignment 3

April 19, 2023 John Morris 9

Why not just do some measurements?Why not just do some measurements?

► Experiments are always subject to errors

Time(sec)

Size of problem - n

Cacheoverflows

Data fitsin cache

ExpectationSharp jump here

ExperimentMeasure up to here

Page 10: Assignment 3

April 19, 2023 John Morris 10

Cacheoverflows

Data fitsin cache

Why not just do some measurements?Why not just do some measurements?

► Experiments are always subject to errors

Time(sec)

Size of problem - n

No clear trend,so fit a straight line

Actual measurements

No sharpjump?

No cache!

Page 11: Assignment 3

April 19, 2023 John Morris 11

Measure up to here

Why not just do some measurements?Why not just do some measurements?

► Make sure to carry the experiment far enough!

Time(sec)

Size of problem - n

Cacheoverflows

Data fitsin cache

No sharp jump but sharp increase

in slopeas predicted!

but ..Measure as far as here

and it’s clear!

Page 12: Assignment 3

April 19, 2023 John Morris 12

Hit Rate and Access Time vs Problem Size

0

0.2

0.4

0.6

0.8

1

1.2

3000

0

6000

0

9000

0

1200

00

1500

00

1800

00

2100

00

2400

00

2700

00

3000

00

3300

00

3600

00

3900

00

4200

00

4500

00

4800

00

5100

00

Problem Size

Hit

Ra

te

0

0.5

1

1.5

2

2.5

3

3.5

4

4.5

5

Tim

e (

cycl

es)

Hit rate

Teff

Cache ProblemCache Problem

L1 Cache Size

Real Shape!From simple model

Page 13: Assignment 3

April 19, 2023 John Morris 13

ErrorsErrors

• Random errors• Repeat a measurement

• Deviations from mean are random errors• Limited clock resolution can produce these

dt = 0.8*(timer resolution) randomly reported as 0 or 1

Page 14: Assignment 3

April 19, 2023 John Morris 14

ErrorsErrors

► Systematic errors Results are perturbed in one direction

►OS will interrupt►All times are lengthened

► Error Reduction Reduce quantisation effects

►Ensure dt >> timer resolution Make several measurements

►Use minimum? Still likely to have OS contribution!

►Use mean? Includes average amount of OS overhead

Page 15: Assignment 3

April 19, 2023 John Morris 15

Generating conclusionsGenerating conclusions

► Estimate errors first Add error bars before fitting curves Same data - different errors

Only a curve fits! A linear relation is possible!

Page 16: Assignment 3

April 19, 2023 John Morris 16

Generating conclusionsGenerating conclusions

► If your original hypothesis suggested a linear relation, failure to adequately allow for error would have sent you off on a fruitless search for a new hypothesis!

Only a curve fits! A linear relation is possible!

Page 17: Assignment 3

April 19, 2023 John Morris 17

Transform DataTransform Data

► Use your hypothesis Usually transform data to linear form

O(n2) algorithm Running time for problem size n,

t(n) = c n2

Divide experimental times, t(n) by n2

constant, c• Use the computer to generate a table of normalised data

• It’s very good at these simple, boring tasks!• It’ll also print out a neat table for your report!

Page 18: Assignment 3

April 19, 2023 John Morris 18

Presenting dataPresenting data

► Trap - Computer calculates result to 6 significant figures Put these numbers directly in your report

►Average time = 4.53456 s

implies 4.53456 +/- 0.000005 s

Obviously ridiculous!• Accuracy of 1% would be excellent here

• Average time = 4.5 s

implies 4.5 +/- 0.05 s Present a realistic number of significant figures in your report!

Too many significant figures will lose marks!