EECC551 - Shaaban #1 lec # 6 Fall 2002 10-3-2002 Evolution of Processor Performance Source: John P. Chen, Intel Labs CPI > 10 1.1-10 0.5 - 1.1.35 -.5 (?)

Slides:



Advertisements
Similar presentations
Hardware-Based Speculation. Exploiting More ILP Branch prediction reduces stalls but may not be sufficient to generate the desired amount of ILP One way.
Advertisements

Lecture 8 Dynamic Branch Prediction, Superscalar and VLIW Advanced Computer Architecture COE 501.
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed, Oct 19, 2005 Topic: Instruction-Level Parallelism (Multiple-Issue, Speculation)
A scheme to overcome data hazards
ENGS 116 Lecture 101 ILP: Software Approaches Vincent H. Berk October 12 th Reading for today: , 4.1 Reading for Friday: 4.2 – 4.6 Homework #2:
CPE 631: ILP, Static Exploitation Electrical and Computer Engineering University of Alabama in Huntsville Aleksandar Milenkovic,
CPE 731 Advanced Computer Architecture ILP: Part V – Multiple Issue Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University of.
COMP4611 Tutorial 6 Instruction Level Parallelism
POLITECNICO DI MILANO Parallelism in wonderland: are you ready to see how deep the rabbit hole goes? ILP: VLIW Architectures Marco D. Santambrogio:
EECC551 - Shaaban #1 Fall 2003 lec# Pipelining and Exploiting Instruction-Level Parallelism (ILP) Pipelining increases performance by overlapping.
Dynamic Branch PredictionCS510 Computer ArchitecturesLecture Lecture 10 Dynamic Branch Prediction, Superscalar, VLIW, and Software Pipelining.
CS152 Lec15.1 Advanced Topics in Pipelining Loop Unrolling Super scalar and VLIW Dynamic scheduling.
Pipelining 5. Two Approaches for Multiple Issue Superscalar –Issue a variable number of instructions per clock –Instructions are scheduled either statically.
Computer Architecture Lec 8 – Instruction Level Parallelism.
CS136, Advanced Architecture Speculation. CS136 2 Outline Speculation Speculative Tomasulo Example Memory Aliases Exceptions VLIW Increasing instruction.
Lecture 8: More ILP stuff Professor Alvin R. Lebeck Computer Science 220 Fall 2001.
CPE 731 Advanced Computer Architecture ILP: Part IV – Speculative Execution Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University.
DAP Spr.‘98 ©UCB 1 Lecture 6: ILP Techniques Contd. Laxmi N. Bhuyan CS 162 Spring 2003.
EECC551 - Shaaban #1 lec # 6 Fall Multiple Instruction Issue: CPI < 1 To improve a pipeline’s CPI to be better [less] than one, and to.
1 EE524 / CptS561 Computer Architecture Speculation: allow an instruction to issue that is dependent on branch predicted to be taken without any consequences.
3.13. Fallacies and Pitfalls Fallacy: Processors with lower CPIs will always be faster Fallacy: Processors with faster clock rates will always be faster.
1 COMP 740: Computer Architecture and Implementation Montek Singh Tue, Mar 17, 2009 Topic: Instruction-Level Parallelism (Multiple-Issue, Speculation)
What if dynamic branch prediction is wrong?
EECC551 - Shaaban #1 lec # 6 Fall Evolution of Microprocessor Performance Source: John P. Chen, Intel Labs CPI >
EECC551 - Shaaban #1 lec # 6 Winter Multiple Instruction Issue: CPI < 1 To improve a pipeline’s CPI to be better [less] than one, and to.
EECC551 - Shaaban #1 Winter 2002 lec# Pipelining and Exploiting Instruction-Level Parallelism (ILP) Pipelining increases performance by overlapping.
EECC551 - Shaaban #1 lec # 6 Fall Evolution of Processor Performance Source: John P. Chen, Intel Labs CPI > (?)
EECC551 - Shaaban #1 lec # 6 Winter Evolution of Microprocessor Performance Source: John P. Chen, Intel Labs CPI >
EECC551 - Shaaban #1 Spring 2006 lec# Pipelining and Instruction-Level Parallelism. Definition of basic instruction block Increasing Instruction-Level.
EECC551 - Shaaban #1 Fall 2005 lec# Pipelining and Instruction-Level Parallelism. Definition of basic instruction block Increasing Instruction-Level.
COMP381 by M. Hamdi 1 Superscalar Processors. COMP381 by M. Hamdi 2 Recall from Pipelining Pipeline CPI = Ideal pipeline CPI + Structural Stalls + Data.
1 Lecture 5: Pipeline Wrap-up, Static ILP Basics Topics: loop unrolling, VLIW (Sections 2.1 – 2.2) Assignment 1 due at the start of class on Thursday.
EECC551 - Shaaban #1 lec # 6 Winter Evolution of Processor Performance Source: John P. Chen, Intel Labs CPI >
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Oct. 9, 2002 Topic: Instruction-Level Parallelism (Multiple-Issue, Speculation)
Review of CS 203A Laxmi Narayan Bhuyan Lecture2.
EECC551 - Shaaban #1 lec # 8 Winter Multiple Instruction Issue: CPI < 1 To improve a pipeline’s CPI to be better [less] than one, and to.
CIS 629 Fall 2002 Multiple Issue/Speculation Multiple Instruction Issue: CPI < 1 To improve a pipeline’s CPI to be better [less] than one, and to utilize.
EECC551 - Shaaban #1 lec # 6 Fall Evolution of Processor Performance Source: John P. Chen, Intel Labs CPI > (?)
EECC551 - Shaaban #1 Spring 2004 lec# Definition of basic instruction blocks Increasing Instruction-Level Parallelism & Size of Basic Blocks.
EECC551 - Shaaban #1 lec # 6 Spring Evolution of Microprocessor Performance Source: John P. Chen, Intel Labs CPI >
ENGS 116 Lecture 91 Dynamic Branch Prediction and Speculation Vincent H. Berk October 10, 2005 Reading for today: Chapter 3.2 – 3.6 Reading for Wednesday:
EECC551 - Shaaban #1 lec # 6 Spring CPI < 1? How?  Multiple issue processors: VLIW (Very Long Instruction Word) Superscalar processors.
1 Overcoming Control Hazards with Dynamic Scheduling & Speculation.
1 Chapter 2: ILP and Its Exploitation Review simple static pipeline ILP Overview Dynamic branch prediction Dynamic scheduling, out-of-order execution Hardware-based.
CIS 662 – Computer Architecture – Fall Class 16 – 11/09/04 1 Compiler Techniques for ILP  So far we have explored dynamic hardware techniques for.
CSCE 614 Fall Hardware-Based Speculation As more instruction-level parallelism is exploited, maintaining control dependences becomes an increasing.
Embedded Computer Architectures Hennessy & Patterson Chapter 4 Exploiting ILP with Software Approaches Gerard Smit (Zilverling 4102),
1 Lecture 7: Speculative Execution and Recovery Branch prediction and speculative execution, precise interrupt, reorder buffer.
CS 5513 Computer Architecture Lecture 6 – Instruction Level Parallelism continued.
CS203 – Advanced Computer Architecture ILP and Speculation.
Ch2. Instruction-Level Parallelism & Its Exploitation 2. Dynamic Scheduling ECE562/468 Advanced Computer Architecture Prof. Honggang Wang ECE Department.
CS 352H: Computer Systems Architecture
What if dynamic branch prediction is wrong?
/ Computer Architecture and Design
CPE 731 Advanced Computer Architecture ILP: Part V – Multiple Issue
COMP 740: Computer Architecture and Implementation
CS203 – Advanced Computer Architecture
CPSC 614 Computer Architecture Lec 5 – Instruction Level Parallelism
Lecture 8: ILP and Speculation Contd. Chapter 2, Sections 2. 6, 2
Adapted from the slides of Prof
Lecture 7: Dynamic Scheduling with Tomasulo Algorithm (Section 2.4)
Larry Wittie Computer Science, StonyBrook University and ~lw
CC423: Advanced Computer Architecture ILP: Part V – Multiple Issue
CPSC 614 Computer Architecture Lec 5 – Instruction Level Parallelism
What if dynamic branch prediction is wrong?
Adapted from the slides of Prof
Chapter 3: ILP and Its Exploitation
Overcoming Control Hazards with Dynamic Scheduling & Speculation
Lecture 5: Pipeline Wrap-up, Static ILP
Presentation transcript:

EECC551 - Shaaban #1 lec # 6 Fall Evolution of Processor Performance Source: John P. Chen, Intel Labs CPI > (?) Pipelined (single issue) Multi-cycle Multiple Issue (CPI <1) Superscalar/VLIW

EECC551 - Shaaban #2 lec # 6 Fall Multiple Instruction Issue: CPI < 1 To improve a pipeline’s CPI to be better [less] than one, and to utilize ILP better, a number of independent instructions have to be issued in the same pipeline cycle. Multiple instruction issue processors are of two types: –Superscalar: A number of instructions (2-8) is issued in the same cycle, scheduled statically by the compiler or dynamically (Tomasulo). PowerPC, Sun UltraSparc, Alpha, HP –VLIW (Very Long Instruction Word): A fixed number of instructions (3-6) are formatted as one long instruction word or packet (statically scheduled by the compiler). –Joint HP/Intel agreement (Itanium, Q4 2000). –Intel Architecture-64 (IA-64) 64-bit address: Explicitly Parallel Instruction Computer (EPIC): Itanium. Limitations of the approaches: –Available ILP in the program (both). –Specific hardware implementation difficulties (superscalar). –VLIW optimal compiler design issues.

EECC551 - Shaaban #3 lec # 6 Fall Multiple Instruction Issue: Superscalar Vs. VLIW Multiple Instruction Issue: Superscalar Vs. VLIW Smaller code size. Binary compatibility across generations of hardware. Simplified Hardware for decoding, issuing instructions. No Interlock Hardware (compiler checks?) More registers, but simplified hardware for register ports.

EECC551 - Shaaban #4 lec # 6 Fall Two instructions can be issued per cycle (two-issue superscalar). One of the instructions is integer (including load/store, branch). The other instruction is a floating-point operation. –This restriction reduces the complexity of hazard checking. Hardware must fetch and decode two instructions per cycle. Then it determines whether zero (a stall), one or two instructions can be issued per cycle. Simple Statically Scheduled Superscalar Pipeline MEM EX ID IF EX ID IF WB EX MEM EX WB EX MEM EX WB EX ID IF WB EX MEM EX ID IF Integer Instruction FP Instruction Instruction Type Two-issue statically scheduled pipeline in operation FP instructions assumed to be adds

EECC551 - Shaaban #5 lec # 6 Fall Intel/HP VLIW “Explicitly Parallel Instruction Computing (EPIC)” Three instructions in 128 bit “Groups”; instruction template fields determines if instructions are dependent or independent –Smaller code size than old VLIW, larger than x86/RISC –Groups can be linked to show dependencies of more than three instructions. 128 integer registers floating point registers –No separate register files per functional unit as in old VLIW. Hardware checks dependencies (interlocks  binary compatibility over time) Predicated execution: An implementation of conditional instructions used to reduce the number of conditional branches used in the generated code  larger basic block size IA-64 : Name given to instruction set architecture (ISA). Itanium : Name of the first implementation (2001).

EECC551 - Shaaban #6 lec # 6 Fall Intel/HP EPIC VLIW Approach original source code ExposeInstructionParallelism Optimize ExploitParallelism:GenerateVLIWs compiler Instruction Dependency Analysis Instruction 2 Instruction 1 Instruction 0 Template 128-bit bundle bits 5 bits41 bits

EECC551 - Shaaban #7 lec # 6 Fall IA-64 Instruction Types I-unit/B-unitExtendedL+X B-unitBranchB F-unitFloating PointF M-unitMemoryM I-unitNon-integer ALUI I-unit or M-unitInteger ALUA Execution Unit TypeDescriptionInstruction Type

EECC551 - Shaaban #8 lec # 6 Fall IA-64 Template Use The template specifies the functional units for the three operations in the instruction. Possible instruction combinations: –M-unit, I-unit, I-unit –M-unit, L-unit, X-unit –M-unit, M-unit, I-unit –M-unit, F-unit, I-unit –M-unit, M-unit, F-unit –M-unit, I-unit, B-unit –M-unit, B-unit, B-unit –B-unit, B-unit, B-unit –M-unit, M-unit, B-unit –M-unit, F-unit, B-unit

EECC551 - Shaaban #9 lec # 6 Fall qpR1R1 R2R2 R3R3 X 2b X4X4 VeVe X 2a  8 is the major opcode for this instruction type.  X2a, X2b, Ve, and X4 are opcode extensions.  qp is the predicate register assigned to this operation. Register-register format: IA-64 Instruction Format Example: IA-64 Instruction Format Example: A-Unit Instruction Format

EECC551 - Shaaban #10 lec # 6 Fall qpR1R1 imm 7b R3R3 imm 6d VeVe X 2a s  X2a and Ve are opcode extensions.  qp is the predicate register assigned to this operation.  The immediate value is made up of s, imm6d, and imm7b.  Other formats available for 8-bit and 22-bit immediates. 14-bit Immediate format: IA-64 Instruction Format Example: IA-64 Instruction Format Example: A-Unit Instruction Format

EECC551 - Shaaban #11 lec # 6 Fall x qpR1R1 R3R3 hintX6X6 m  m and x determine the subset of load/store operations.  Bits 35:32 give special directives for LAT, cache, etc.  Bits 31:30 tell the size of the load (1, 2, 4, or 8 bytes).  Hint allows for system pre-fetching of data by specifying if temporal locality exists for this data. Integer Load/Store operations: IA-64 Instruction Format Example: IA-64 Instruction Format Example: M-Unit Instruction Format

EECC551 - Shaaban #12 lec # 6 Fall p 12 1 s qpbtypeimm 20b whdopcode  Opcode 0- indirect branch, 1- indirect call, 4- IP-relative branch, 5- IP-relative call  btype sub-category of branch type, qp- branch condition  d- cache de-allocation, wh- branch hint, s & imm 20b give offset  p pre-fetch 0-few, or 1-many inst. following the target IP-relative branch: IA-64 Instruction Format Example: IA-64 Instruction Format Example: B-Unit Instruction Format

EECC551 - Shaaban #13 lec # 6 Fall Unrolled Loop Example for Scalar Pipeline 1 Loop:L.DF0,0(R1) 2 L.DF6,-8(R1) 3 L.DF10,-16(R1) 4 L.DF14,-24(R1) 5 ADD.DF4,F0,F2 6 ADD.DF8,F6,F2 7 ADD.DF12,F10,F2 8 ADD.DF16,F14,F2 9 S.DF4,0(R1) 10 S.DF8,-8(R1) 11 DADDUIR1,R1,# S.DF12,-16(R1) 13 BNER1,R2,LOOP 14 S.DF16,8(R1); 8-32 = clock cycles, or 3.5 per iteration L.D to ADD.D: 1 Cycle ADD.D to S.D: 2 Cycles

EECC551 - Shaaban #14 lec # 6 Fall Loop Unrolling in Superscalar Pipeline: (1 Integer, 1 FP/Cycle) Integer instructionFP instructionClock cycle Loop:L.D F0,0(R1)1 L.D F6,-8(R1)2 L.D F10,-16(R1)ADD.D F4,F0,F23 L.D F14,-24(R1)ADD.D F8,F6,F24 L.D F18,-32(R1)ADD.D F12,F10,F25 S.D F4,0(R1)ADD.D F16,F14,F26 S.D F8,-8(R1)ADD.D F20,F18,F27 S.D F12,-16(R1)8 DADDUI R1,R1,#-409 S.D F16,-24(R1)10 BNE R1,R2,LOOP11 SD -32(R1),F2012 Unrolled 5 times to avoid delays (+1 due to SS) 12 clocks, or 2.4 clocks per iteration (1.5X) 7 issue slots wasted

EECC551 - Shaaban #15 lec # 6 Fall Loop Unrolling in VLIW Pipeline (2 Memory, 2 FP, 1 Integer / Cycle) Memory MemoryFPFPInt. op/Clock reference 1reference 2operation 1 op. 2 branch L.D F0,0(R1)L.D F6,-8(R1) 1 L.D F10,-16(R1)L.D F14,-24(R1) 2 L.D F18,-32(R1)L.D F22,-40(R1)ADD.D F4,F0,F2ADD.D F8,F6,F2 3 L.D F26,-48(R1)ADD.D F12,F10,F2ADD.D F16,F14,F2 4 ADD.D F20,F18,F2ADD.D F24,F22,F2 5 S.D F4,0(R1)S.D F8, -8(R1)ADD.D F28,F26,F2 6 S.D F12, -16(R1)S.D F16,-24(R1) DADDUI R1,R1,#-56 7 S.D F20, 24(R1)S.D F24,16(R1) 8 S.D F28, 8(R1)BNE R1,R2,LOOP 9 Unrolled 7 times to avoid delays 7 results in 9 clocks, or 1.3 clocks per iteration (1.8X) Average: 2.5 ops per clock, 50% efficiency Note: Needs more registers in VLIW (15 vs. 6 in Superscalar)

EECC551 - Shaaban #16 lec # 6 Fall Superscalar Dynamic Scheduling How to issue two instructions and keep in-order instruction issue for Tomasulo? –Assume: 1 integer + 1 floating-point operations. –1 Tomasulo control for integer, 1 for floating point. Issue at 2X Clock Rate, so that issue remains in order. Only FP loads might cause a dependency between integer and FP issue: –Replace load reservation station with a load queue; operands must be read in the order they are fetched. –Load checks addresses in Store Queue to avoid RAW violation –Store checks addresses in Load Queue to avoid WAR, WAW. Called “Decoupled Architecture”

EECC551 - Shaaban #17 lec # 6 Fall Multiple Instruction Issue Challenges While a two-issue single Integer/FP split is simple in hardware, we get a CPI of 0.5 only for programs with: –Exactly 50% FP operations –No hazards of any type. If more instructions issue at the same time, greater difficulty of decode and issue operations arise: –Even for a 2-issue superscalar machine, we have to examine 2 opcodes, 6 register specifiers, and decide if 1 or 2 instructions can issue. VLIW: tradeoff instruction space for simple decoding –The long instruction word has room for many operations. –By definition, all the operations the compiler puts in the long instruction word are independent => execute in parallel –E.g. 2 integer operations, 2 FP ops, 2 Memory refs, 1 branch 16 to 24 bits per field => 7*16 or 112 bits to 7*24 or 168 bits wide –Need compiling technique that schedules across several branches.

EECC551 - Shaaban #18 lec # 6 Fall Limits to Multiple Instruction Issue Machines Inherent limitations of ILP: –If 1 branch exist for every 5 instruction : How to keep a 5-way VLIW busy? –Latencies of unit adds complexity to the many operations that must be scheduled every cycle. –For maximum performance multiple instruction issue requires about: Pipeline Depth x No. Functional Units independent instructions per cycle. Hardware implementation complexities: –Duplicate FUs for parallel execution are needed. –More instruction bandwidth is essential. –Increased number of ports to Register File (datapath bandwidth): VLIW example needs 7 read and 3 write for Int. Reg. & 5 read and 3 write for FP reg –Increased ports to memory (to improve memory bandwidth). –Superscalar decoding complexity may impact pipeline clock rate.

EECC551 - Shaaban #19 lec # 6 Fall Empty or wasted issue slots can be defined as either vertical waste or horizontal waste: –Vertical waste is introduced when the processor issues no instructions in a cycle. –Horizontal waste occurs when not all issue slots can be filled in a cycle. Superscalar Architectures: Issue Slot Waste Classification

EECC551 - Shaaban #20 lec # 6 Fall Sources of Unused Issue Cycles in an 8-issue Superscalar Processor. Processor busy represents the utilized issue slots; all others represent wasted issue slots. 61% of the wasted cycles are vertical waste, the remainder are horizontal waste. Workload: SPEC92 benchmark suite. Source: Simultaneous Multithreading: Maximizing On-Chip Parallelism Dean Tullsen et al., Proceedings of the 22rd Annual International Symposium on Computer Architecture, June 1995, pages

EECC551 - Shaaban #21 lec # 6 Fall Superscalar Architectures: All possible causes of wasted issue slots, and latency-hiding or latency reducing techniques that can reduce the number of cycles wasted by each cause. Source: Simultaneous Multithreading: Maximizing On-Chip Parallelism Dean Tullsen et al., Proceedings of the 22rd Annual International Symposium on Computer Architecture, June 1995, pages

EECC551 - Shaaban #22 lec # 6 Fall Hardware Support for Extracting More Parallelism Compiler ILP techniques (loop-unrolling, software Pipelining etc.) are not effective to uncover maximum ILP when branch behavior is not well known at compile time. Hardware ILP techniques: –Conditional or Predicted Instructions: An extension to the instruction set with instructions that turn into no-ops if a condition is not valid at run time. –Speculation: An instruction is executed before the processor knows that the instruction should execute to avoid control dependence stalls: Static Speculation by the compiler with hardware support: –The compiler labels an instruction as speculative and the hardware helps by ignoring the outcome of incorrectly speculated instructions. –Conditional instructions provide limited speculation. Dynamic Hardware-based Speculation: –Uses dynamic branch-prediction to guide the speculation process. –Dynamic scheduling and execution continued passed a conditional branch in the predicted branch direction.

EECC551 - Shaaban #23 lec # 6 Fall Conditional or Predicted Instructions Avoid branch prediction by turning branches into conditionally-executed instructions: if (x) then (A = B op C) else NOP –If false, then neither store result nor cause exception: instruction is annulled (turned into NOP). –Expanded ISA of Alpha, MIPS, PowerPC, SPARC have conditional move. –HP PA-RISC can annul any following instruction. –IA-64: 64 1-bit condition fields selected so conditional execution of any instruction (Predication). Drawbacks of conditional instructions –Still takes a clock cycle even if “annulled”. –Must stall if condition is evaluated late. –Complex conditions reduce effectiveness; condition becomes known late in pipeline. x A = B op C

EECC551 - Shaaban #24 lec # 6 Fall IA-64 Predication Example

EECC551 - Shaaban #25 lec # 6 Fall Dynamic Hardware-Based Speculation Combines:Combines: –Dynamic hardware-based branch prediction –Dynamic Scheduling: of multiple instructions to issue and execute out of order. Continue to dynamically issue, and execute instructions passed a conditional branch in the dynamically predicted branch direction, before control dependencies are resolved. –This overcomes the ILP limitations of the basic block size. –Creates dynamically speculated instructions at run-time with no compiler support at all. –If a branch turns out as mispredicted all such dynamically speculated instructions must be prevented from changing the state of the machine (registers, memory). Addition of commit (retire or re-ordering) stage and forcing instructions to commit in their order in the code (i.e to write results to registers or memory). Precise exceptions are possible since instructions must commit in order.

EECC551 - Shaaban #26 lec # 6 Fall Hardware-Based Speculation Speculative Execution + Tomasulo’s Algorithm Tomasulo’s Algorithm

EECC551 - Shaaban #27 lec # 6 Fall Four Steps of Speculative Tomasulo Algorithm 1. Issue — Get an instruction from FP Op Queue If a reservation station and a reorder buffer slot are free, issue instruction & send operands & reorder buffer number for destination (this stage is sometimes called “dispatch”) 2.Execution — Operate on operands (EX) When both operands are ready then execute; if not ready, watch CDB for result; when both operands are in reservation station, execute; checks RAW (sometimes called “issue”) 3.Write result — Finish execution (WB) Write on Common Data Bus to all awaiting FUs & reorder buffer; mark reservation station available. 4.Commit — Update registers, memory with reorder buffer result –When an instruction is at head of reorder buffer & the result is present, update register with result (or store to memory) and remove instruction from reorder buffer. –A mispredicted branch at the head of the reorder buffer flushes the reorder buffer (sometimes called “graduation”)  Instructions issue in order, execute (EX), write result (WB) out of order, but must commit in order.

EECC551 - Shaaban #28 lec # 6 Fall Advantages of HW (Tomasulo) vs. SW (VLIW) Speculation HW determines address conflicts. HW provides better branch prediction. HW maintains precise exception model. HW does not execute bookkeeping instructions. Works across multiple implementations SW speculation is much easier for HW design.