Lec 25: Parallel Processors. Announcements

Similar documents
Multicore and Parallel Processing

Advanced Instruction-Level Parallelism

Processor (IV) - advanced ILP. Hwansoo Han

The Processor: Instruction-Level Parallelism

Real Processors. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Advanced d Instruction Level Parallelism. Computer Systems Laboratory Sungkyunkwan University

Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University. P & H Chapter 4.10, 1.7, 1.8, 5.10, 6

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: C Multiple Issue Based on P&H

COMPUTER ORGANIZATION AND DESI

4. The Processor Computer Architecture COMP SCI 2GA3 / SFWR ENG 2GA3. Emil Sekerinski, McMaster University, Fall Term 2015/16

Chapter 4 The Processor (Part 4)

Parallelism, Multicore, and Synchronization

Homework 5. Start date: March 24 Due date: 11:59PM on April 10, Monday night. CSCI 402: Computer Architectures

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 32: Pipeline Parallelism 3

Chapter 4 The Processor 1. Chapter 4D. The Processor

EN164: Design of Computing Systems Topic 08: Parallel Processor Design (introduction)

Chapter 4. The Processor

Computer Architecture Computer Science & Engineering. Chapter 4. The Processor BK TP.HCM

Chapter 4. The Processor

Determined by ISA and compiler. We will examine two MIPS implementations. A simplified version A more realistic pipelined version

EIE/ENE 334 Microprocessors

Adapted from instructor s. Organization and Design, 4th Edition, Patterson & Hennessy, 2008, MK]

CS 61C: Great Ideas in Computer Architecture. Multiple Instruction Issue, Virtual Memory Introduction

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 4. The Processor

Department of Computer and IT Engineering University of Kurdistan. Computer Architecture Pipelining. By: Dr. Alireza Abdollahpouri

Chapter 4. The Processor

Thomas Polzer Institut für Technische Informatik

5 th Edition. The Processor We will examine two MIPS implementations A simplified version A more realistic pipelined version

Full Datapath. Chapter 4 The Processor 2

Multiple Instruction Issue. Superscalars

Computer Architecture Computer Science & Engineering. Chapter 4. The Processor BK TP.HCM

IF1/IF2. Dout2[31:0] Data Memory. Addr[31:0] Din[31:0] Zero. Res ALU << 2. CPU Registers. extension. sign. W_add[4:0] Din[31:0] Dout[31:0] PC+4

In-order vs. Out-of-order Execution. In-order vs. Out-of-order Execution

Computer and Information Sciences College / Computer Science Department Enhancing Performance with Pipelining

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Instruction Level Parallelism: Multiple Instruction Issue

Chapter 4. The Processor. Jiang Jiang

ENGN1640: Design of Computing Systems Topic 06: Advanced Processor Design

Multiple Issue ILP Processors. Summary of discussions

Anne Bracy CS 3410 Computer Science Cornell University

Lecture 2: Processor and Pipelining 1

Chapter 4. The Processor

CS 61C: Great Ideas in Computer Architecture Pipelining and Hazards

INSTRUCTION LEVEL PARALLELISM

Static, multiple-issue (superscaler) pipelines

EECC551 - Shaaban. 1 GHz? to???? GHz CPI > (?)

Hardware-based Speculation

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

CISC 662 Graduate Computer Architecture Lecture 13 - CPI < 1

LECTURE 10. Pipelining: Advanced ILP

CPI < 1? How? What if dynamic branch prediction is wrong? Multiple issue processors: Speculative Tomasulo Processor

CS425 Computer Systems Architecture

Orange Coast College. Business Division. Computer Science Department. CS 116- Computer Architecture. Pipelining

Control Hazards. Branch Prediction

LECTURE 3: THE PROCESSOR

CS311 Lecture: Pipelining and Superscalar Architectures

Control Hazards. Prediction

CS 61C: Great Ideas in Computer Architecture. Lecture 13: Pipelining. Krste Asanović & Randy Katz

Computer Organization and Components

CS 110 Computer Architecture. Pipelining. Guest Lecture: Shu Yin. School of Information Science and Technology SIST

Multi-cycle Instructions in the Pipeline (Floating Point)

Chapter 4. The Processor

CS 3410 Computer Science Cornell University. [K. Bala, A. Bracy, M. Martin, S. McKee, A. Roth E. Sirer, and H. Weatherspoon]

MIPS Pipelining. Computer Organization Architectures for Embedded Computing. Wednesday 8 October 14

CSE 820 Graduate Computer Architecture. week 6 Instruction Level Parallelism. Review from Last Time #1

CPI IPC. 1 - One At Best 1 - One At best. Multiple issue processors: VLIW (Very Long Instruction Word) Speculative Tomasulo Processor

NOW Handout Page 1. Review from Last Time #1. CSE 820 Graduate Computer Architecture. Lec 8 Instruction Level Parallelism. Outline

EN164: Design of Computing Systems Topic 06.b: Superscalar Processor Design

Advanced Computer Architecture

3/12/2014. Single Cycle (Review) CSE 2021: Computer Organization. Single Cycle with Jump. Multi-Cycle Implementation. Why Multi-Cycle?

ELE 655 Microprocessor System Design

Advanced processor designs

Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 6. Parallel Processors from Client to Cloud

Serial. Parallel. CIT 668: System Architecture 2/14/2011. Topics. Serial and Parallel Computation. Parallel Computing

CS 590: High Performance Computing. Parallel Computer Architectures. Lab 1 Starts Today. Already posted on Canvas (under Assignment) Let s look at it

In embedded systems there is a trade off between performance and power consumption. Using ILP saves power and leads to DECREASING clock frequency.

Lecture 9: Multiple Issue (Superscalar and VLIW)

Keywords and Review Questions

DEE 1053 Computer Organization Lecture 6: Pipelining

Computer Architecture 计算机体系结构. Lecture 4. Instruction-Level Parallelism II 第四讲 指令级并行 II. Chao Li, PhD. 李超博士

CS3350B Computer Architecture Quiz 3 March 15, 2018

1 Hazards COMP2611 Fall 2015 Pipelined Processor

CENG 3531 Computer Architecture Spring a. T / F A processor can have different CPIs for different programs.

Issues in Parallel Processing. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

5008: Computer Architecture

CS252 Graduate Computer Architecture Midterm 1 Solutions

Four Steps of Speculative Tomasulo cycle 0

Complex Pipelines and Branch Prediction

Multicore Hardware and Parallelism

As the amount of ILP to exploit grows, control dependences rapidly become the limiting factor.

CS146 Computer Architecture. Fall Midterm Exam

CS311 Lecture: Pipelining, Superscalar, and VLIW Architectures revised 10/18/07

Pipelining. CSC Friday, November 6, 2015

Superscalar Processors

EEC 581 Computer Architecture. Instruction Level Parallelism (3.6 Hardware-based Speculation and 3.7 Static Scheduling/VLIW)

EEC 581 Computer Architecture. Lec 7 Instruction Level Parallelism (2.6 Hardware-based Speculation and 2.7 Static Scheduling/VLIW)

Review Tomasulo. Lecture 17: ILP and Dynamic Execution #2: Branch Prediction, Multiple Issue. Tomasulo Algorithm and Branch Prediction

CS6303 Computer Architecture Regulation 2013 BE-Computer Science and Engineering III semester 2 MARKS

45-year CPU Evolution: 1 Law -2 Equations

Pipelining to Superscalar

Transcription:

Lec 25: Parallel Processors Kavita Bala CS 340, Fall 2008 Computer Science Cornell University PA 3 out Hack n Seek Announcements The goal is to have fun with it Recitations today will talk about it Pizza party: Dec 2 Final project (distributed ray tracer) out last week Demos: Dec 6 and 7

Moore s Law Law about transistor count Parallel Processing Been around for long time in different forms Instruction Level Parallelism Data Parallelism Etc. 2

Instruction-Level Parallelism (ILP) Pipelining: executing multiple instructions in parallel To increase ILP Deeper pipeline Less work per stage shorter clock cycle Multiple issue Replicate pipeline stages multiple pipelines Start multiple instructions per clock cycle CPI <, so use Instructions Per Cycle (IPC) E.g., 4GHz 4-way multiple-issue 6 BIPS, peak CPI = 0.25, peak IPC = 4 But dependencies reduce this in practice Multiple Issue Static multiple issue Compiler groups instructions to be issued together Packages them into issue slots Specifies multiple concurrent operations Very Long Instruction Word (VLIW) Compiler detects and avoids hazards Dynamic multiple issue CPU examines instruction stream and chooses instructions to issue each cycle Compiler can help by reordering instructions CPU resolves hazards using advanced techniques at runtime 3

Speculation Guess what to do with an instruction Start operation as soon as possible Check whether guess was right If so, complete the operation If not, roll-back and do the right thing Common to static and dynamic multiple issue Examples Speculate on branch outcome Roll back if path taken is different Speculate on load Roll back if location is updated Compiler/Hardware Speculation Compiler can reorder instructions e.g., move load before branch Can include fix-up instructions to recover from incorrect guess Hardware can look ahead for instructions to execute Buffer results until it determines they are actually needed Flush buffers on incorrect speculation 4

Issues Hazards Exceptions MIPS with Static Dual Issue Two-issue packets One ALU/branch instruction One load/store instruction 64-bit aligned ALU/branch, then load/store Pad an unused instruction with nop Address Instruction type Pipeline Stages n ALU/branch IF ID EX MEM WB n + 4 Load/store IF ID EX MEM WB n + 8 ALU/branch IF ID EX MEM WB n + 2 Load/store IF ID EX MEM WB n + 6 ALU/branch IF ID EX MEM WB n + 20 Load/store IF ID EX MEM WB 5

Scheduling Example Schedule this for dual-issue MIPS Loop: lw $t0, 0($s) # $t0=array element addu $t0, $t0, $s2 # add scalar in $s2 sw $t0, 0($s) # store result addi $s, $s, 4 # decrement pointer bne $s, $zero, Loop # branch $s!=0 Loop: ALU/branch nop Load/store lw $t0, 0($s) cycle addi $s, $s, 4 addu $t0, $t0, $s2 nop nop 2 3 bne $s, $zero, Loop sw $t0, 4($s) 4 IPC = 5/4 =.25 (c.f. peak IPC = 2) Dynamic Multiple Issue Superscalar processors CPU decides whether to issue 0,, 2, each cycle Avoiding structural and data hazards Avoids the need for compiler scheduling Though it may still help Code semantics ensured by the CPU 6

Dynamic Multiple Issue Dynamic Pipeline Scheduling Allow the CPU to execute instructions out of order to avoid stalls But commit result to registers in order Example lw $t0, 20($s2) addu $t, $t0, $t2 sub $s4, $s4, $t3 slti $t5, $s4, 20 Can start sub while addu is waiting for lw 7

Why Do Dynamic Scheduling? Why not just let the compiler schedule code? Not all stalls are predicable e.g., cache misses Can t always schedule around branches Branch outcome is dynamically determined Different implementations of an ISA have different latencies and hazards Does Multiple Issue Work? Yes, kind of But not as much as we d like Programs have real dependencies that limit ILP Some dependencies are hard to eliminate e.g., pointer aliasing Some parallelism is hard to expose Limited window size during instruction issue Memory delays and limited bandwidth Hard to keep pipelines full Speculation can help if done well 8

Power Efficiency Complexity of dynamic scheduling and speculations requires power Multiple simpler cores may be better Microprocessor Year Clock Rate Pipeline Stages Issue width Out-of-order/ Speculation Cores Power i486 989 25MHz 5 No 5W Pentium 993 66MHz 5 2 No 0W Pentium Pro 997 200MHz 0 3 Yes 29W P4 Willamette 200 2000MHz 22 3 Yes 75W P4 Prescott 2004 3600MHz 3 3 Yes 03W Core 2006 2930MHz 4 4 Yes 2 75W UltraSparc III 2003 950MHz 4 4 No 90W UltraSparc T 2005 200MHz 6 No 8 70W Moore s law Why Multicore? A law about transistors Smaller means faster transistors Power consumption growing with transistors The power wall We can t reduce voltage further We can t remove more heat How else can we improve performance? 9

Inside the Processor AMD Barcelona: 4 processor cores 0

Uniprocessor Performance Constrained by power, instruction-level parallelism, memory latency Inside the Processor AMD Barcelona: 4 processor cores

Intel s argument.2x.6x 2

Parallel Programming Parallel software is the problem Need to get significant performance improvement Otherwise, just use a faster uniprocessor, since it s easier! Difficulties Partitioning Coordination Communications overhead Balance load Load Balancing Need to manage work so all units are actually operating 3

Amdahl s Law Task: serial part, parallel part As number of processors increases, time to execute parallel part goes to zero time to execute serial part remains the same Serial part eventually dominates Must parallelize ALL parts of task Amdahl s Law Consider an improvement E F of the execution time is affected S is the speedup 4

Amdahl s Law Pitfall: Amdahl s Law Improving an aspect of a computer and expecting a proportional improvement in overall performance T improvement factor affected T improved = + unaffected Example: multiply accounts for 80s/00s How much improvement in multiply performance to get 5 overall? 80 20 = + 20 Can t be done! n T 5

Amdahl s Law Sequential part can limit speedup Example: 00 processors, 90 speedup? T new = T parallelizable /00 + T sequential Speedup = ( Fparallelizable ) + F Solving: F parallelizable = 0.999 parallelizable = 90 /00 Need sequential part to be 0.% of original time Scaling Example Workload: sum of 0 scalars, and 0 0 matrix sum Speed up from 0 to 00 processors Single processor: Time = (0 + 00) t add 0 processors Time = 0 t add + 00/0 t add = 20 t add Speedup = 0/20 = 5.5 (55% of potential) 00 processors Time = 0 t add + 00/00 t add = t add Speedup = 0/ = 0 (0% of potential) Assumes load can be balanced across processors 6

Scaling Example (cont) What if matrix size is 00 00? Single processor: Time = (0 + 0000) t add 0 processors Time = 0 t add + 0000/0 t add = 00 t add Speedup = 000/00 = 9.9 (99% of potential) 00 processors Time = 0 t add + 0000/00 t add = 0 t add Speedup = 000/0 = 9 (9% of potential) Assuming load balanced 7