290 likes | 386 Views
Chapter 1. Computer Abstractions and Technology Part II. CPU Clock and Instructions. Multiplication and division takes more time than addition and subtraction Floating point operations take longer than integer operations Accessing memory takes more time than accessing registers
E N D
Chapter 1 Computer Abstractions and Technology Part II
CPU Clock and Instructions • Multiplication and division takes more time than addition and subtraction • Floating point operations take longer than integer operations • Accessing memory takes more time than accessing registers Important : changing the cycle time often changes the number of cycles required for various instructions Florida A & M University - Department of Computer and Information Sciences
1st instruction 2nd instruction 3rd instruction ... 4th 5th 6th CPU Clock and Instructions • One could assume that number of clock cycles equals number of instructions, i.e., one clock cycle per instruction: • BUT .. different instructions take different number of cycles. Florida A & M University - Department of Computer and Information Sciences
Cycles Per Instruction (CPI) • Execution time depends on the total number of executed instructions in a program • CPI is the average number of clock cycles each instruction takes to execute • Useful way to compare two different implementations of the same ISA Florida A & M University - Department of Computer and Information Sciences
Instruction Count and CPI • Instruction Count for a program • Determined by program, ISA and compiler • Average clock cycles per instruction • Determined by CPU hardware • Determined by instructions mix Florida A & M University - Department of Computer and Information Sciences
CPI Example 1 • Suppose we have two implementations of the same instruction set architecture (ISA), and some program. • Computer A: clock cycle time = 250ps, CPI = 2.0 Computer B: clock cycle time = 500ps, CPI = 1.2 Which machine is faster for this program? By how much? • Question: If two machines have the same ISA, which quantities (e.g., clock rate, CPI, execution time, #instructions) will always be identical? Florida A & M University - Department of Computer and Information Sciences
CPI Example 1 A is faster… …by this much Florida A & M University - Department of Computer and Information Sciences
same ISA => same #instructions Florida A & M University - Department of Computer and Information Sciences
CPI in More Detail • If different instructions take different numbers of cycles • Counti : number of instructions in class i CPIi : number of cycles per class-i instruction n : number of instruction classes Florida A & M University - Department of Computer and Information Sciences
CPI in More Detail • Weighted average CPI (instruction mix) • Example: • 20% 3 cycle; 50% 4 cycles; 30% 6 cycles • CPI = 3 x 0.20 + 4 x 0.50 + 6 x 0.30 • = 0.6 + 2.0 + 1.8 = 4.4 Relative frequency Florida A & M University - Department of Computer and Information Sciences
CPI Example 2 • A compiler designer is trying to decide between two code sequences for a machine that has three different classes of instructions based on number of clock cycles required to execute. • Analyze: • Which sequence requires more instructions? • Which sequence will be faster? By how much? • What is average CPI for each sequence. Florida A & M University - Department of Computer and Information Sciences
CPI Example 2 • Sequence 1: • IC = 5 • Clock Cycles= 2×1 + 1×2 + 2×3= 10 • Avg. CPI = 10/5 = 2.0 • Sequence 2: • IC = 6 • Clock Cycles= 4×1 + 1×2 + 1×3= 9 • Avg. CPI = 9/6 = 1.5 Florida A & M University - Department of Computer and Information Sciences
Performance Summary • Performance is determined by execution time • Do any of the other variables equal performance? • # of cycles to execute program? • # of instructions in program? • # of cycles per second? • average # of cycles per instruction? • average # of instructions per second? • Common pitfall: thinking one of the variables is indicative of performance when it really isn’t. Florida A & M University - Department of Computer and Information Sciences
Performance Summary • Time is the only complete and reliable measurement • Changing instruction set to lower instruction count may lead to an computer with a slower clock cycle time • Code that executes fewer instructions may not be faster because CPI depends on the type of instructions executed The BIG Picture Florida A & M University - Department of Computer and Information Sciences
Performance Summary • Performance depends on • Algorithm: affects IC, possibly CPI • Programming language: affects IC, CPI • Compiler: affects IC, CPI • Instruction set architecture: affects IC, CPI, Tc The BIG Picture Florida A & M University - Department of Computer and Information Sciences
Power Trends • Rapid slowing due to practical power limit for cooling microprocessors Florida A & M University - Department of Computer and Information Sciences
Power Trends • In CMOS IC technology • Dynamic power • Primary source of power dissipation • Power consumed during switching • Depends on • capacitive loading of each transistor • voltage applied • frequency of transistor switching ×30 ×1000 5V → 1V Florida A & M University - Department of Computer and Information Sciences
Reducing Power • Suppose a new CPU has • 85% of capacitive load of old CPU • 15% voltage and 15% frequency reduction • The power wall • We can’t reduce voltage further • We can’t remove more heat • How else can we improve performance? Florida A & M University - Department of Computer and Information Sciences
Uniprocessor Performance §1.6 The Sea Change: The Switch to Multiprocessors Constrained by power, instruction-level parallelism, memory latency Florida A & M University - Department of Computer and Information Sciences
Multiprocessors • Multicore microprocessors • More than one processor per chip • Requires explicit parallel programming • Compare with instruction level parallelism • Hardware executes multiple instructions at once • Hidden from the programmer • Hard to do • Programming for performance • Load balancing • Optimizing communication and synchronization Florida A & M University - Department of Computer and Information Sciences
SPEC Benchmarks • Programs used to measure performance • Ideally reflects a typical actual workload or expected class of applications (e.g. compiler, graphics) • Standard Performance Evaluation Coop (SPEC) • Mission: Establish, maintain, and endorse a standardized set of relevant benchmarks and metrics for performance evaluation of modern computer systems • Develops benchmarks for CPU, I/O, Web, … Florida A & M University - Department of Computer and Information Sciences
SPEC • SPEC is an umbrella non-profit organization that covers three groups, each with their own benchmarks: • Open Systems Group(OSG) -Component-and system-level benchmarks in an UNIX / NT / VMS environment. • High Performance Group(HPG) -Benchmarking in a numeric computing environment, with emphasis on high-performance numeric computing. • Graphics Performance Characterization Group(GPCG) -Benchmarks for graphical subsystems and OpenGL and Xwindows. Florida A & M University - Department of Computer and Information Sciences
SPEC • SPEC 1989, 1992, 1995 • SPEC CPU2000 – retired February 2007 • SPEC CPU 2006 version 1.0 released August 2006 • SPEC provides benchmark sets for: • graphics • high performance scientific computing - HPC2002, OMP2001, MPI2006 • file systems SPEC - sfs2008 • Web servers and clients - WEB2005 • JAVA client server - jAppServer2004 • Engineering CAD applications Florida A & M University - Department of Computer and Information Sciences
SPEC CPU2006 v1.0 • next-generation, industry-standardized, CPU-intensive benchmark suite • emphasizes performance of the processor (CPU), memory, and compiler • comparative measure of compute-intensive performance across the widest practical range of hardware • source code from real user applications. Florida A & M University - Department of Computer and Information Sciences
SPEC CPU2006 • Two benchmark suites: CINT2006 for measuring compute-intensive integer performance, and CFP2006 for compute-intensive floating point performance • CINT2006 suite includes 12 application-based benchmarks written in C and C++ • CFP2006 includes 17 CPU-intensive benchmarks written in C, C++, Fortran, and a mixture of C and Fortran Florida A & M University - Department of Computer and Information Sciences
SPEC CPU Benchmark • SPEC CPU2006 • Elapsed time to execute a collection/mix of programs • Negligible I/O, so focuses on CPU performance • Normalize relative to reference machine • Summarize as geometric mean of performance ratios Florida A & M University - Department of Computer and Information Sciences
CINT2006 for Opteron X4 2356 SPECratio is inversely proportional to execution time Florida A & M University - Department of Computer and Information Sciences
SPEC Power Benchmark • Power consumption of server at different workload levels • Performance: ssj_ops/sec • Power: Watts (Joules/sec) Florida A & M University - Department of Computer and Information Sciences
Concluding Remarks • Cost/performance is improving • Due to underlying technology development • Hierarchical layers of abstraction • In both hardware and software • Instruction set architecture • The hardware/software interface • Execution time: the best performance measure • Power is a limiting factor • Use parallelism to improve performance Florida A & M University - Department of Computer and Information Sciences