Docsity

Parallel Processing and Multiprocessors: A Deep Dive into Architectures and Applications, Study notes of Computer Science

Toggle sidebar
bg1
Page 1
1
Chapter 9: Multiprocessors
“…today’s machines…are nearing an impasse as technologies
approach the speed of light. Even if the components of a
sequential processor could be made to work this fast, the best
that could be expected is no more than a few million
instructions per second.”
-- Mitchell, The Transputer: The Time is Now.
2
Some Companies You’ve Never Heard Of?
• Thinking Macines (Danny Hillis, Guy Steele, Richard
Feynman, 64K procs. CM-1, CM-5)
• Tera Computing (MTA-1, now Cray Computer)
• Inmos Transputer (T800)
• Goodyear (yes, that Goodyear)
• Sperry Univac (Univac & Sperry merge, becomes
Burroughs, & then Unisys, known as “dinosaur mating”)
• Cyrdome, Multiflow (the original VLIWs, lead to IA-64)
• Convex
• Alliant Computers (founded to build baby Crays, SMPs)
• El’brus (Russian multiprocessor)
• Encore (Used Motorola 88K, now Sun owns part…)
• Kendall Square Research Corporation (Quickly died)
• Sequent (Intel engs, early SMPs, ccNUMA, IBM…)
• MasPar Computer Corporation
• Tandem (HP engs, bought by Compaq, bought by HP!)
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Parallel Processing and Multiprocessors: A Deep Dive into Architectures and Applications and more Study notes Computer Science in PDF only on Docsity!

1

Chapter 9: Multiprocessors

“…today’s machines…are nearing an impasse as technologies

approach the speed of light. Even if the components of a

sequential processor could be made to work this fast, the best

that could be expected is no more than a few million

instructions per second.”

-- Mitchell, The Transputer: The Time is Now.

2

Some Companies You’ve Never Heard Of?

• Thinking Macines (Danny Hillis, Guy Steele, Richard

Feynman, 64K procs. CM-1, CM-5)

• Tera Computing (MTA-1, now Cray Computer)

• Inmos Transputer (T800)

• Goodyear (yes, that Goodyear)

• Sperry Univac (Univac & Sperry merge, becomes

Burroughs, & then Unisys, known as “dinosaur mating”)

• Cyrdome, Multiflow (the original VLIWs, lead to IA-64)

• Convex

• Alliant Computers (founded to build baby Crays, SMPs)

• El’brus (Russian multiprocessor)

• Encore (Used Motorola 88K, now Sun owns part…)

• Kendall Square Research Corporation (Quickly died)

• Sequent (Intel engs, early SMPs, ccNUMA, IBM…)

• MasPar Computer Corporation

• Tandem (HP engs, bought by Compaq, bought by HP!)

3

Topics

• We’ll consider selected topics

– Parallel computing & general architectures

– Desktop parallelism (Sun UltraSPARC T1)

– Cache coherence for desktop

– Lock and synchronization mechanisms

(time permitting)

4

Parallel Machines

P P P P

Varies from small number of nodes to many hundreds and thousands

P P P P

Collection of multiple processors & memories Divide work among the processors Collaborate to accomplish task in parallel, rather than sequentially

7

Centralized Shared-Memory

Architectures

• Shared address space

  • A single address space seen by all processors
  • Load and store instructions
  • E.g., LD r5,[shared_address] reads same address on P1,P2…

• Uniform memory access (UMA) time

  • All memory accesses take same amount of time

• “Parallel computer” – one copy of OS

  • One operating system manages resources
  • OS scheduler selects which processor runs which task

8

Distributed Memory Architectures

P +

Cache

Mem I/O

Interconnect

P +

Cache

Mem I/O

P +

Cache

Mem I/O

P +

Cache

Mem I/O

P +

Cache

Mem I/O

P +

Cache

Mem I/O

Node

Individual interconnected PEs with memory at each node - network connected MPs

Typical for large N

9

Distributed Memory Architectures

• Shared memory systems don’t scale well (why?)

  • More processors, more bandwidth demands

• Distributed memory system

Typically high bandwidth interconnect Cost-effective scaling of memory bandwidth Assuming most accesses to local memory Limited node-to-node communication & synchronization Lower latency to local memory Don’t have to go “across bus” to shared memory Communication among nodes is more complex Communication has higher latency

10

Distributed Memory Architectures

• Distributed shared-memory (called “DSM”)

  • One logical memory distributed among physical memories
  • I.e., address space is shared (same shared address on two processors refers to the same location)
  • Implicit shared communication (via shared address space)
  • NUMA: Non-uniform memory access (why?)

• Multicomputers (e.g., Clusters)

  • Separate private address spaces for each PE
  • Same address on two processors: two different locations
  • Explicit communication with message passing
  • Libraries for standard communication primitives (e.g., MPI)

13

Sun UltraSPARC T

Throughput oriented workloads

  • Server applications (web, database, e-commerce, etc.)

Benchmark IPC Description SPECint 0.9 General purpose applications SPECweb 0.3 User web requests TPC-C 0.2 Database transactions

Low IPC Î Memory bound applications (will wait on memory) Server class machines Î Many requests to service NOT a good situation for typical general-purpose processor

Design for memory bound & high request rate

14

A Radical Departure

• Strongly favor thread level parallelism over

instruction level parallelism

  • Multiple “pipeline cores” (very simple pipelines, only 7 stages!)
  • Multiple threads per core (very fast thread switching)

• UltraSPARC T

  • Shared memory architecture
  • 8 cores per processor chip
  • 4 “hardware threads” per core
  • 32 hardware threads per processor chip

• Many other important design wins

  • Low complexity, low power, improved chip yield

opensparc.org

15

Core 1

Ready

Running

Waiting C^ D

A

B

4 cores, 15 threads

Core 2

Ready

Running

Waiting G

E

F

Core 3

Ready

Running

Waiting J^ K

H

I

Core 4

Ready

Running

Waiting N^ O

L

M

Thread is ready to run: A dependence from memory has been resolved

Thread is running: It is being actively fetched and dispatched into pipeline

Thread is running: It is being actively fetched and dispatched into pipeline

16

Traditional Execution

Time

Thread 1 (^) COMP MEM MEM MEM COMP MEM MEM

Thread 2

Thread 3

Thread 4

OS selects a new thread to run (among ready ones), say Thread 2

Pipeline stalls during the memory access – has to wait for data to satisfy dependence

19

Four Computation Bound Threads

Time

Thread 1

Thread 2

COMP IDLE IDLE IDLE

COMP

COMP

IDLE IDLE IDLE COMP IDLE

IDLE IDLE

COMP IDLE IDLE IDLE COMP

COMP IDLE IDLE IDLE

Thread 3

Thread 4

Round-robin scheduling – favor throughput Î Individual thread latency is harmed ICOUNT for response-time & throughput

20

Four Mixed Threads

Time

Thread 1

Thread 2

COMP

COMP IDLE IDLE

COMP

DIV

COMP MEM MEM MEM

COMP BR MEM

Thread 3

Thread 4

DIV DIV DIV DIV

COMP

COMP

COMP

IDLE

MEM MEM

IDLE

MEM

MEM

Typical: Mix of memory, branches, computation Long latency – just skip Schedule using round-robin

21

Multiple “Virtual Pipelines”

Time

Virtual Pipeline 32

Virtual Pipeline 31

Virtual Pipeline 30

Virtual Pipeline 29

Core 8

Core 1

Virtual Pipeline 1

Virtual Pipeline 2

Virtual Pipeline 3

Virtual Pipeline 4

22

Sun UltraSPARC T1 pipeline

In-order, single issue pipeline Cache hit 3 cycles (switch) No branch prediction (switch) Fetch 4 instrs/cycle from 2 threads Four contexts

25

Challenges

• Amdahl’s law:

• Parallel execution time = the sum of:

  • execution time for the parallel part / n
  • execution time for the non-parallel part

• Lesson: Even with parallelism, the speed up will

still be limited by the non-parallel part!

26

Challenges (Parallel Programs)

• Example:

for (i=0 ; i<100 ; i++) A(i+2) = A(i) + A(i+1);

for (i=0 ; i<100 ; i++) B(i) = A(i) + i;

• if each statement takes 1 unit time, then:

  • 200 units of time on one processor,
  • 100 + 100/n unit time on n processors.
  • S(100) = 1.98, S(20)=1.9 and S(2) = 1.33.