Docsity

Performance Evaluation: Understanding Computer Organization and Assembly Language, Study notes of Computer Science

Toggle sidebar
bg1
CS/COE0447: Computer Organization
and Assembly Language
and Assembly Language
Chapter 4
Chapter 4
Sangyeun Cho
Sangyeun Cho
Dept. of Computer Science
University of Pittsburgh
Performance evaluation
Performance evaluation
It’s an everyday process…
When you buy food
•Same
q
uantit
y,
then
y
ou look at cost
qy,y
•Same cost, then you look at quantity
•(Assuming same quality!)
When
y
ou bu
y
a noteboo
k
yy
•You give weights to different features
LCD size?
CPU speed?
a
n
memory
s
ze
Battery life?
•How do you quantify these and come up with a single score that will
g
uide
y
our decision?
CS/CoE0447: Computer Organization and Assembly Language University of Pittsburgh
2
gy
Performance evaluation
Performance evaluation
Often we face an o
p
timization
p
roblem…
pp
When cost is fixed
Mii f (d ft )!
•
M
ax
i
m
i
ze
per
f
ormance
(
an
d f
ea
t
ures
)!
When performance target is achieved
•Minimize cost!
Give me the highest
performance computer! Don
’
t care
Give me the highest
-
performance computer! Don t care
about cost…
•Supercomputers are of this class
CS/CoE0447: Computer Organization and Assembly Language University of Pittsburgh
3
Computer performance
Computer performance
Have you cared about performance seriously when buying a
computer?
•What were the most important factors when you bought a new PC?
Defining computer performance may not be that simple…
•What do you mean when you say a computer has better performance
than another?
We need a common metric
•Remember, however, than a single metric will not say everything
about a computer
•
We may need multiple metrics!
•
We may need multiple metrics!
Response time vs. throughput
CS/CoE0447: Computer Organization and Assembly Language University of Pittsburgh
4
pf3
pf4
pf5
pf8

Partial preview of the text

Download Performance Evaluation: Understanding Computer Organization and Assembly Language and more Study notes Computer Science in PDF only on Docsity!

CS/COE0447: Computer Organization

and Assembly Languageand Assembly Language

Chapter 4Chapter 4

Sangyeun ChoSangyeun Cho

Dept. of Computer Science University of Pittsburgh

Performance evaluationPerformance evaluation

ƒ It’s an everyday process…

ƒ When you buy food

  • Same quantity, then you look at costq y, y
  • Same cost, then you look at quantity
  • (Assuming same quality!)

ƒ When you buy a notebooky y

  • You give weights to different features LCD size? CPU speed? M iMain memory size? i? Battery life?
  • How do you quantify these and come up with a single score that will guide your decision?

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 2

g y

Performance evaluationPerformance evaluation

ƒ Often we face an optimization problem…p p

ƒ When cost is fixed

  • MMaximize performance (and features)! i i f ( d f t )!

ƒ When performance target is achieved

  • Minimize cost!

ƒƒ Give me the highest performance computer! Don’t careGive me the highest-performance computer! Don t care

about cost…

  • Supercomputers are of this class

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

Computer performanceComputer performance

ƒ Have you cared about performance seriously when buying a

computer?

  • What were the most important factors when you bought a new PC?

ƒ Defining computer performance may not be that simple…

  • What do you mean when you say a computer has better performance than another?

ƒ We need a common metric

  • Remember, however, than a single metric will not say everything about a computer
  • • We may need multiple metrics!We may need multiple metrics!

ƒ Response time vs. throughput

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

Response time vs. throughputResponse time vs. throughput

Plane DC to Paris Top Speed Passengers Throughput(pmph) Boeing 747 6.5 hours 610 mph 470 286, BAD/Sud Concorde 3 hours^ 1350 mph^132 178,

ƒ Which has higher performance?

  • Time to deliver 1 passenger
  • • Time to deliver 400 passengersTime to deliver 400 passengers

ƒ Time for 1 job called

  • This is called “response time” or “execution time” or “latency”
  • • Time/jobTime/job

ƒ Jobs per day called

  • This is called “throughput” or “bandwidth”
  • Jobs/time

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 5

  • Jobs/time

ConventionsConventions

ƒ Throughputg p

  • E.g., # of transactions processed per second
  • Larger is better

ƒ If we are primarily concerned with response time,

performance can be defined as 1/T where T is the response

timetime

  • Smaller T is better
  • That is, larger (1/T) is better

ƒ Machine A isMachine A is NN times faster than Btimes faster than B

  • N = performance(A) / performance(B) = time(B) / time(A)
  • When we present this statement, we want to have N >1 to eliminate confusion

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 6

confusion

Response time vs. throughputResponse time vs. throughput

ƒ Time of Concorde vs. Boeing 747

  • Concord is faster
  • (6.5 hours / 3 hours) or 2.2 times faster

ƒ Throughput of Being 747 vs. Concorde

  • 286,700 p·mph / 176,200 p·mph
  • 1.6 times higher (faster)

ƒ “Boeing 747 is 1.6 times (or 60%) faster than Concorde in

terms of throughput”

ƒ “Concorde is 2.2 times (or 120%) faster than Boeing 747 in

terms of flying time (response time)”

ƒ We will focus primarily on execution time of a single job for

the remaining discussions

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

g

Time in a computerTime in a computer

ƒ When you time a program, what do you measure?y p g y

  • Total time to complete a task
  • CPU time
  • Overheads include disk accesses, memory accesses, I/O activities, OS, y , , overheads, overheads from other programs, …
  • “Real time,” “response time,” “elapsed time,” …

ƒ We are interested in time spent by CPU on your program

only – there are multiple programs running at the same time

  • • “CPU execution time” or “CPU time”CPU execution time or CPU time
  • Often divided into system CPU time (in OS) and user CPU time (in user program)

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

What impacts time?What impacts time?

ƒ Time = IC×CPI×CCT

ƒ IC – # of instructions

  • Instruction set architecture (ISA)( )
  • Compiler used

ƒ CPI (average clock per instruction)

  • Microarchitecture (e.g., pipelining, cache size, …)( g , p p g, , )
  • (Compiler)
  • (ISA)

ƒ CCT (equivalently clock rate)( q y )

  • Technology & circuit optimization
  • Microarchitecture, esp. pipelining
  • (ISA)

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 13

WorkloadWorkload

ƒ A set of programs run on a computer would form ap g p

workload

  • Actual collection of applications
  • Synthetic programsy p g
  • Kernel loops
  • …

ƒ To compare two computer systems, a user would typically

compare the execution time of the workload on the two

machineshi

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 14

Benchmark suitesBenchmark suites

ƒ A benchmark suite is a set of applications relevant for performance

evaluationevaluation

ƒ SPEC (standard performance evaluation corporation)

  • www.spec.orgwww.spec.org
  • CPU benchmarks
  • Server benchmarks
  • Graphics benchmarks
  • • …

ƒ EEMBC (embedded microprocessor benchmark consortium)

  • Automotive
  • Consumer
  • Network
  • Telecom
  • Office
  • …

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

Synthetic benchmarksSynthetic benchmarks

ƒ A synthesized program intended to mimic real programsy p g p g

• A = B×C+D/E+F;

ƒƒ One may write a synthetic benchmark to exercise a specificOne may write a synthetic benchmark to exercise a specific

sequence of actions

  • A program that maximally exercises the multiplication unit in CPU

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

Kernel programs (or loops)Kernel programs (or loops)

ƒ An important portion of a real programp p p g

  • Quicksort
  • Matrix multiplication

ƒ Real programs usually consist of many loops and functions

and it may be quite difficult to understand and interpret any

performance evaluation results if we are only given summaryperformance evaluation results if we are only given summary

information

ƒ In the case kernel programs, we immediately understand

what’s going on in the programs

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 17

Summarizing performanceSummarizing performance

Computer A Computer B Program 1 (sec) 1 10 Program 2 (sec) 1000 100

ƒ Computer A is 10 times faster than B for program 1

Total time (sec) 1001 110

p p g

ƒ Computer B is 10 times faster than A for program 2

ƒ Although the above statements are correct individually, theyl h h h b i di id ll h

present a confusing picture…

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 18

Arithmetic meanArithmetic mean

ƒ Assume that we have N programsp g

ƒ Arithmetic mean (AM) = (∑ Time i)/N

ƒ Weighted arithmetic mean = ∑ Time i×Wi, ∑ Wi = 1

ƒ AM is a special case of weighted AM where W i = 1/N

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

Normalized timeNormalized time

Computer A Computer B Ratio Program 1 1 (0.1) 10 (1) 0. Program 2 1 (10) 0.1 (1) 10

ƒ Normalized time maintains the ratio of the original times

Sum 2 (10.1) 10.1 (2)

ƒ However, depending on the reference, the result can be

different!

ƒ Summing (e.g., arithmetic mean) the normalized times maySumming (e.g., arithmetic mean) the normalized times may

not produce the same comparison result

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

AmdahlAmdahl s law’s law

Time (^) before Time (^) unaffected Time (^) affected

Time (^) after Time (^) unaffected improvement factor

ƒ If we extend this basic form, we have

  • Timeafter=T 1 /N 1 +T 2 /N 2 +…+TM/N (^) M where Ti is a portion of Time (^) before and Nd N i (^) i is the improvement ratio (or speedup) applied to the program h i i ( d ) li d h execution portion

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 25

Fallacies and pitfallsFallacies and pitfalls

ƒ Pitfall 1: Expecting the improvement of one aspect of ap g p p

computer to increase performance by an amount

proportional to the size of the improvement

ƒ Pitfall 2: Using a subset of the performance equation as a

performance metric

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh 26

SummarySummary

ƒ Performance evaluation is an important stage of any designp g y g

and engineering process

ƒ We are interested in measuring computer performance

where the goal iswhere the goal is

  • Software improvement
  • Hardware improvement
  • • Or bothOr both

ƒ We need relevant metrics and a method to summarize

measurements

ƒ Latency vs. throughput

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

SummarySummary

ƒ Response time (latency) = time to finish a given jobp y g j

ƒ Throughput = # of jobs done in a second

ƒ TiTi me = # of clock cycles# f l k l × clock cycle timel k l i

ƒ # of clock cycles = # of instructions × CPI

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh

SummarySummary

ƒ Workloads used in performance evaluation are typically

drawn from real applications

ƒ Synthetic or kernel benchmarks are often useful

ƒ A benchmark suite is a set of applications designed to aidpp g

performance evaluation tasks

  • Easier experiments, fair comparison, consistent reporting, …

ƒ Summarizing results

  • Use arithmetic mean (AM) for measured times
  • Use geometric mean (GM) for ratiosg ( )

ƒ Amdahl’s law

  • Dictates the actual performance improvement due to a speedup factor applied to a limited portion of a program

CS/CoE0447: Computer Organization and Assembly Language (^) University of Pittsburgh