Understanding Computer Performance Metrics: Latency, Throughput, and Efficiency, Lecture notes of Computer Science

An overview of important performance metrics in computer systems, focusing on end-to-end latency, response time, throughput, energy consumption, cost of operation, and quality of results. It discusses the significance of tflops and inferences per second (ips) as evaluation metrics, highlighting their limitations and the factors that can influence them. The document also touches on the importance of considering co2e emissions and energy efficiency in modern computer evaluations, emphasizing the need for a holistic approach to performance assessment. It is useful for understanding the complexities of evaluating computer performance in various contexts, including machine learning and general computing tasks. The document also includes a link to a youtube channel for lecture recordings and mentions programming assignments, suggesting it is part of a course.

Typology: Lecture notes

2023/2024

Uploaded on 05/23/2025

fancycode
fancycode 🇺🇸

7 documents

1 / 59

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Performance (1):
What does “perfect” mean?
Hung-Wei Tseng
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b

Partial preview of the text

Download Understanding Computer Performance Metrics: Latency, Throughput, and Efficiency and more Lecture notes Computer Science in PDF only on Docsity!

Performance (1):

What does “perfect” mean?

Hung-Wei Tseng

Recap: Processors and memory modules are everywhere!

Processors Memory

Recap: Demo

if(option)
std::sort(data, data + arraySize);
for (unsigned c = 0 ; c < arraySize*1000; ++c) {
int t = std::rand();
(data[c%arraySize] >= t)
sum ++;

O ( nlog 2 n ) O ( n )

if option is set to 1: — but faster!!!

otherwise, O(n):

O ( nlog 2 n ) O ( n )

Recap: Demo (2) for(i = 0 ; i < ARRAY_SIZE; i++) { for(j = 0 ; j < ARRAY_SIZE; j++) { c[i][j] = a[i][j]+b[i][j]; } } for(j = 0 ; j < ARRAY_SIZE; j++) { for(i = 0 ; i < ARRAY_SIZE; i++) { c[i][j] = a[i][j]+b[i][j]; } } O ( n 2 ) O ( n 2 Complexity )

A^ B

A Lot Better! Performance? Worse
  • (^) Definition of “Performance”
  • (^) The classical CPU performance equation
  • (^) Other important metrics Outline

What does it really mean by

performance?

https://www.pollev.com/hungweitseng close in
  • (^) Comparing the experiments we have done with Gemini and ChatGPT, how many of the following metrics does Gemini outperforms ChatGPT? က Response time က Throughput က End-to-end latency (i.e., total execution time) က Quality of results A. 0 B. 1 C. 2 D. 3 E. 4 Gemini v.s. ChatGPT
  • (^) Comparing the experiments we have done with Gemini and ChatGPT, how many of the following metrics does Gemini outperforms ChatGPT? က Response time က Throughput က End-to-end latency (i.e., total execution time) က Quality of results A. 0 B. 1 C. 2 D. 3 E. 4 Gemini v.s. ChatGPT
  • (^) Comparing the experiments we have done with Gemini and ChatGPT, how many of the following metrics does Gemini outperforms ChatGPT? က Response time က Throughput က End-to-end latency (i.e., total execution time) က Quality of results A. 0 B. 1 C. 2 D. 3 E. 4 Gemini v.s. ChatGPT ?
  • (^) End-to-end latency — how much time the program/operation takes from the beginning to the end
  • (^) Response time — how much time the user starts to feel the program is running/finishing
  • (^) Throughput/bandwidth — the average amount of work/data can the program/system deliver within the execution time
  • (^) Energy consumption — the aggregated power during the execution time
  • (^) Cost of operation — the amount of money necessary for finishing an operation
  • (^) Quality of results — the human perception of the execution result
  • (^) Power consumption — the heat generation produced by the circuit Important performance metrics
  • (^) Latency is the most fundamental performance metric Takeaways: What does “perfect” mean?

Let’s start with “end-to-end latency” as the default metric — how long it takes to execute a program?

  • (^) Consider the following c code snippet and x86 instructions implement the code snippet If (1) count is set to 1,000,000,000, (2) a memory instruction takes 5 cycles, (3) a branch/ jump instruction takes 2 cycles, (4) other instructions takes 1 cycle on average, and (5) the processor runs at 4 GHz, how much time is it take to finish executing the code snippet? A. 0.5 sec B. 1 sec C. 2.5 sec D. 3.75 sec E. 4 sec Performance equation C x for(i = 0 ; i < count; i++) { s += a[i]; } .L3: movslq (%rdi), %rdx addq $4, %rdi addq %rdx, %rax cmpq %rcx, %rdi jne .L

Execution time of a program in the von Neumann model

Processor

Memory

Storage

f30f1efa 4883ec 488d3d 0f0000e dcffffff 31c c408c30f

Instructions 1f

08400000 00000100 02004865 6c6c6f2c 20776f 6c 00000000 00000000

Data

int main(){ printf(“Hello, world!\n”); } f30f1efa 4883ec 488d3d 0f0000e dcffffff 31c c408c30f

Instructions 1f

08400000 00000100 02004865 6c6c6f2c 20776f 6c 00000000 00000000

Data

Instruction Fetch Arithmetic Logical Units (ALU) Complex Arithmetic Operations (Mul/div) Branch/ Jump Memory Operations Instruction Decode Program Counter Registers 4883ec sub $0x8,%rsp 0x8 0x 0x 0x How long do we need for each instruction on average? How many instruction “instances” for the program?