180 likes | 272 Views
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
E N D
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 John Morris
Assignment 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 John Morris
Assignment 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 • L1 cache has x bytes and will affect my measurements in … • TLB has x and y characteristics and will … • … John Morris
Computer Architecture 363Experimental Design John Morris Computer Science/Electrical Engineering University of Auckland Email: jmor159@cs.auckland.ac.nz URL: http:/www.cs.auckland.ac.nz/~jmor159 Reference:Patterson & Hennessy, Chapter 2 John Morris
Experimental 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 John Morris
Theoretical Prediction • Example • Time is linear in size of problem Time (sec) Time Complexity O(n) Size of problem - n John Morris
Theoretical Prediction • but ... • Time will increase sharply when cache is full Time (sec) Running time jumps! Data fits in cache Cache overflows Size of problem - n John Morris
Refine the prediction! • Time will increase sharply when cache is full • How sharply? More likely! You can probably estimate the shape of this curve Time (sec) Data fits in cache Cache overflows Size of problem - n John Morris
Why not just do some measurements? • Experiments are always subject to errors Expectation Sharp jump here Time (sec) Experiment Measure up to here Data fits in cache Cache overflows Size of problem - n John Morris
Why not just do some measurements? • Experiments are always subject to errors Actual measurements No clear trend, so fit a straight line No sharp jump? \No cache! Time (sec) Data fits in cache Cache overflows Size of problem - n John Morris
Why not just do some measurements? • Make sure to carry the experiment far enough! but .. Measure as far as here and it’s clear! Time (sec) Measure up to here No sharp jump but sharp increase in slope as predicted! Data fits in cache Cache overflows Size of problem - n John Morris
Cache Problem Real Shape! From simple model L1 Cache Size John Morris
Errors • 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 John Morris
Errors • 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 John Morris
Generating conclusions • Estimate errors first • Add error bars before fitting curves • Same data - different errors Only a curve fits! A linear relation is possible! John Morris
Generating 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! John Morris
Transform 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! John Morris
Presenting 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! John Morris