Professional Documents
Culture Documents
Computer Architecture
Performance Measurement
Edgar Gabriel
Fall 2008
Edgar Gabriel
1
Measuring performance (II)
Timing how long an application takes
Wall clock time/elapsed time: time to complete a task
as seen by the user. Might include operating system
overhead or potentially interfering other applications.
CPU time: does not include time slices introduced by
external sources (e.g. running other applications). CPU
time can be further
User CPU time: CPU time spent in the program
System CPU time: CPU time spent in the OS
performing tasks requested by the program.
Measuring performance
E.g. using the UNIX time command
Elapsed time
2
Amdahls Law
Describes the performance gains by enhancing one part of the
overall system (code, computer)
Timeorg 1
Speedupoverall = = (5)
Timeenh Fractionenh
(1 Fractionenh ) +
Speedupenh
COSC 6385 Computer Architecture
Edgar Gabriel
5
Fraction enhanced:
4 20%
Fraction enhanced:
Speedup overall
40%
3 Fraction enhanced:
60%
Fraction enhanced:
2 80%
0
0 20 40 60 80 100
Speedup enhanced
3
Amdahls Law (IV)
Speedup according to Amdahl's Law
12
10
8
Speedup overall
Speedup enhanced: 2
6 Speedup enhanced: 4
Speedup enhanced: 10
4
0
0 0.2 0.4 0.6 0.8 1
Fraction enhanced
4
Amdahls Law example (II)
Example: Consider a graphics card
50% of its total execution time is spent in floating point
operations
20% of its total execution time is spent in floating point square
root operations (FPSQR).
Option 1: improve the FPSQR operation by a factor of 10.
Option 2: improve all floating point operations by a factor of 1.6
1 1
SpeedupFPSQR = = = 1.22
0 .2
(1 0.2) + ( ) 0.82
10
1 1
SpeedupFP = = = 1.23 Option 2 slightly faster
0 .5 0 . 8125
(1 0.5) + ( )
1 .6
COSC 6385 Computer Architecture
Edgar Gabriel
5
CPU Performance equation (II)
CPI: Average number of clock cycles per instruction
IR: number of instructions
nocycles (8)
CPI =
IR
n
CPU time = ICi CPI i CCtime (12)
i =1
COSC 6385 Computer Architecture
Edgar Gabriel
6
CPU performance equation (IV)
The average CPI for an application can then be
calculated as n
IC CPI
i i n
ICi
CPI = i =1
= CPI i (13)
ICtotal i =1 ICtotal
Example (I)
(Page 43 in the 4th Edition)
Consider a graphics card, with
FP operations (including FPSQR): frequency 25%, average CPI 4.0
FPSQR operations only: frequency 2%, average CPI 20
all other instructions: average CPI 1.3333333
Design option 1: decrease CPI of FPSQR to 2
Design option 2: decrease CPI of all FP operations to 2.5
Using formula (13):
n
ICi
CPI org = CPI i = (4 * 0.25) + (1.333333 * 0.75) = 2.0
i =1 ICtotal
7
Example (II)
Slightly modified compared to the previous section:
consider a graphics card, with
FP operations (excluding FPSQR): frequency 25%, average CPI 4.0
FPSQR operations: frequency 2%, average CPI 20
all other instructions: average CPI 1.33
Design option 1: decrease CPI of FPSQR to 2
Design option 2: decrease CPI of all FP operations to 2.5
Using formula (13):
n
ICi
CPI org = CPI i = ( 4 * 0.25) + (20 * 0.02) + (1.33 * 0.73) = 2.3709
i =1 ICtotal
n
ICi
CPI1 = CPI i = ( 4 * 0.25) + ( 2 * 0.02) + (1.33 * 0.73) = 2.0109
i =1 IC total
n
ICi
CPI 2 = CPI i = ( 2.5 * 0.25) + ( 20 * 0.02) + (1.33 * 0.73) = 1.9959
i =1 ICtotal
Dependability
Module reliability measures
MTTF: mean time to failure
FIT: failures in time
1
FIT = (14)
MTTF
Often expressed as failures in 1,000,000,000 hours
MTTR: mean time to repair
MTBF: mean time between failures
Module availability:
MTTF
MA = (16)
MTTF + MTTR
COSC 6385 Computer Architecture
Edgar Gabriel
8
Dependability - example
Assume a disk subsystem with the following
components and MTTFs:
10 disks, MTTF=1,000,000h
1 SCSI controller, MTTF=500,000h
1 power supply, MTTF=200,000h
1 fan, MTTF= 200,000h
1 SCSI cable, MTTF=1,000,000h
What is the MTTF of the entire system?
What is the probability, that the system fails within a 1
week period?
24 * 7
1week
Psystem = 0,00386 = 0,386%
43,500
COSC 6385 Computer Architecture
Edgar Gabriel
9
Dependability example (III)
What happens if we add a second power supply and we
assume, that the MTTR of a power supply is 24 hours?
Assumption: failures are not correlated
MTTF of the pair of power supplies is the mean time to
failure of the overall system divided by the probability,
that the redundant unit fails before the primary unit has
been replaced
MTTF of the overall system is MTTFpower / 2
Probability, that 1 unit fails within MTTR: MTTR/ MTTFpower
MTTFpower / 2 MTTF 2 200,000 2
MTTFpair = = = 830,000,000
MTTR 2 MTTR 2 24
MTTFpower
COSC 6385 Computer Architecture
Edgar Gabriel
Solution will be posted on the web, but try first on your own!
10
Choosing the right programs to test a
system
Most systems host a wide variety of different applications
Profiles of certain systems given by their purpose/function
Web server:
high I/O requirements
hardly any floating point operations
A system used for weather forecasting simulations
Very high floating point performance required
Lots of main memory
Number of processors have to match the problem size
calculated in order to deliver at least real-time results
11
Choosing the right programs to test a
system (III)
Toy benchmarks: very small code segments which
produce a predictable result
E.g. sieve of Eratosthenes, quicksort
Synthetic benchmarks: try to match the average
frequency of operations and operands for a certain
program
Code does not do any useful work
SPEC Benchmarks
Edgar Gabriel
12
What is SPEC?
SPEC Members
SPEC Members: 3DLabs * Acer Inc. * Advanced Micro Devices * Apple Computer, Inc. *
ATI Research * Azul Systems, Inc. * BEA Systems * Borland * Bull S.A. * CommuniGate
Systems * Dell * EMC * Exanet * Fabric7 Systems, Inc. * Freescale Semiconductor, Inc. *
Fujitsu Limited * Fujitsu Siemens * Hewlett-Packard * Hitachi Data Systems * Hitachi
Ltd. * IBM * Intel * ION Computer Systems * JBoss * Microsoft * Mirapoint * NEC - Japan *
Network Appliance * Novell * NVIDIA * Openwave Systems * Oracle * P.A. Semi * Panasas
* PathScale * The Portland Group * S3 Graphics Co., Ltd. * SAP AG * SGI * Sun
Microsystems * Super Micro Computer, Inc. * Sybase * Symantec Corporation * Unisys *
Verisign * Zeus Technology *
13
SPEC groups
Open Systems Group (desktop systems, high-end workstations and servers)
CPU (CPU benchmarks)
JAVA (java client and server side benchmarks)
MAIL (mail server benchmarks)
SFS (file server benchmarks)
WEB (web server benchmarks)
High Performance Group (HPC systems)
OMP (OpenMP benchmark)
HPC (HPC application benchmark)
MPI (MPI application benchmark)
Graphics Performance Groups (Graphics)
Apc (Graphics application benchmarks)
Opc (OpenGL performance benchmarks)
14
SPEC-Benchmarks (CPU)
1989: first version SPEC89 with SPECint89 and SPECfp89
contained 10 programs with a total of 150.000 lines of C- and Fortran
code
1992: second version SPEC92, containing 11 additional programs. One of
them was withdrawn later on because it became deprecate by compiler
optimizations
normalized results obtained by calculating the geometric average of
all SPEC-ratios. This leads to the SPECmark
Results are split since SPEC92 generally into SPECint92 and SPECfp92
Reference architectures :
SPEC89 und SPEC92: VAX 11/780
SPEC 2000: SUN Microsystems Ultra 5/10 Workstation (300 MHz
UltraSPARC IIi processor, L1-Cache 16KB + 16KB on chip, L2-Cache 2MB
off chip, 256 MB main memory)
SPEC-Benchmarks
All SPEC benchmarks are publicly available and well
known/understood
Compiler can introduce special optimizations for these
benchmarks, which might be irrelevant for other, real-world
applications.
user has to provide the precise list of compile-flags
user has to provide performance of base (non-optimized) run
Compiler can use statistical informations collected during the
first execution in order to optimize further runs (Cache hit
rates, usage of registers)
Benchmarks designed such that external influences are kept
at a minumum (e.g. input/output)
Slides based on a talk and courtesy of
Matthias Mueller,
Center for Information Services and High
Performance Computing
COSC 6385 Computer Architecture
Edgar Gabriel
Technical University Dresden
15
SPEC CPU2000
26 independent programs:
CINT2000 - integer benchmark: 12 applications (11 in C and 1 in
C++)
CFP2000 - floating-point benchmark: 14 applications (6 in
Fortran-77, 4 in Fortran-90 and 4 in C)
Additional information is available for each benchmark:
Author of the benchmark
Detailled description
Dokumentation regarding Input and Output
Potential problems and references.
CINT2000
16
CFP2000
17
Slides based on a talk and courtesy of
Matthias Mueller,
Center for Information Services and High
Performance Computing
COSC 6385 Computer Architecture
Edgar Gabriel
Technical University Dresden
Performance metrics
Two fundamentally different metrics:
speed
rate (throughput)
For each metric results for two different optimization level
have to be provided
moderate optimization
aggressive optimization
4 results for CINT2000 + 4 results for CFP2000 = 8 metrics
If taking the measurements of each application individually
into account:
2*2*(14+12)=104 metrics
18
Performance metrics (II)
All results are relative to a reference system
The final results is computed by using the geometric mean values
n
t i ref
Speed: SPECint/ fp = n (
i =1 t i run
*100)
n
t i ref
Rate: SPECint/ fp = n (t
i =1
i
run
*1.16 * % )
with:
n: number of benchmarks in a suite
t i ref / t i run : execution time for benchmark i on the reference/test
system
N: Number of simultaneous tasks
Slides based on a talk and courtesy of
Matthias Mueller,
Center for Information Services and High
Performance Computing
COSC 6385 Computer Architecture
Edgar Gabriel
Technical University Dresden
2500
Benchmark Results
2000
SPECint_2000 (1 PE)
1500
SPECint_base2000 (1 PE)
SPECfp_2000 (1 PE)
1000
SPECfp_base2000 (1 PE)
500
0
z
n
H
44
4
iso
14
14
14
24
84
G
2
ad
4
on
on
on
on
on
on
2,
2,
er
er
er
er
er
er
P
um
D
pt
pt
pt
pt
pt
pt
O
O
N
ni
O
D
ta
XE
XE
AM
AM
AM
AM
AM
AM
lI
te
2
In
A3
A3
lI
lI
te
te
In
In
Prozessoren
19
Reporting results
SPEC produces a minimal set of representative numbers:
+ Reducies complexity to understand correlations
+ Easies comparison of different systems
- Loss of information
Results have to be compliant to the SPEC benchmakring rules in order to
be approved as an official SPEC report
All components have to available at least 3 month after the
publication (including a runtime environment for C/C++/Fortran
applications)
Usage of SPEC tools for compiling and reporting
Each individual benchmark has to be executed at least three times
Verification of the benchmark output
A maximum of four optimization flags are allowed for the base run
(including preprocessor and link directives)
Disclosure report containing all relevant data has to be available
Slides based on a talk and courtesy of
Matthias Mueller,
Center for Information Services and High
Performance Computing
COSC 6385 Computer Architecture
Edgar Gabriel
Technical University Dresden
20