/ Computer Architecture and Design

Slides:



Advertisements
Similar presentations
CS136, Advanced Architecture Limits to ILP Simultaneous Multithreading.
Advertisements

Computer Structure 2014 – Out-Of-Order Execution 1 Computer Structure Out-Of-Order Execution Lihu Rappoport and Adi Yoaz.
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 731 Advanced Computer Architecture ILP: Part V – Multiple Issue Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University of.
1 Copyright © 2012, Elsevier Inc. All rights reserved. Chapter 3 Instruction-Level Parallelism and Its Exploitation Computer Architecture A Quantitative.
POLITECNICO DI MILANO Parallelism in wonderland: are you ready to see how deep the rabbit hole goes? ILP: VLIW Architectures Marco D. Santambrogio:
Pipelining 5. Two Approaches for Multiple Issue Superscalar –Issue a variable number of instructions per clock –Instructions are scheduled either statically.
/ Computer Architecture and Design Instructor: Dr. Michael Geiger Summer 2014 Lecture 6: Speculation.
Chapter 8. Pipelining. Instruction Hazards Overview Whenever the stream of instructions supplied by the instruction fetch unit is interrupted, the pipeline.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon, Dec 5, 2005 Topic: Intro to Multiprocessors and Thread-Level Parallelism.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 19 - Pipelined.
Instruction Level Parallelism (ILP) Colin Stevens.
Multithreading and Dataflow Architectures CPSC 321 Andreas Klappenecker.
Review of CS 203A Laxmi Narayan Bhuyan Lecture2.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania Computer Organization Pipelined Processor Design 3.
CPE 731 Advanced Computer Architecture Thread Level Parallelism Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University of California,
1 Multi-core processors 12/1/09. 2 Multiprocessors inside a single chip It is now possible to implement multiple processors (cores) inside a single chip.
POLITECNICO DI MILANO Parallelism in wonderland: are you ready to see how deep the rabbit hole goes? Multithreaded and multicore processors Marco D. Santambrogio:
Hardware Multithreading. Increasing CPU Performance By increasing clock frequency By increasing Instructions per Clock Minimizing memory access impact.
1 Advanced Computer Architecture Dynamic Instruction Level Parallelism Lecture 2.
CSCE 614 Fall Hardware-Based Speculation As more instruction-level parallelism is exploited, maintaining control dependences becomes an increasing.
Thread Level Parallelism Since ILP has inherent limitations, can we exploit multithreading? –a thread is defined as a separate process with its own instructions.
Chapter 3.4: Loop-Level Parallelism and Thread-Level Parallelism
Advanced Computer Architecture pg 1 Embedded Computer Architecture 5SAI0 Chip Multi-Processors (ch 8) Henk Corporaal
Advanced Computer Architecture 5MD00 / 5Z033 SMT Simultaneously Multi-Threading Henk Corporaal TUEindhoven.
Ch3. Limits on Instruction-Level Parallelism 1. ILP Limits 2. SMT (Simultaneous Multithreading) ECE562/468 Advanced Computer Architecture Prof. Honggang.
Advanced Pipelining 7.1 – 7.5. Peer Instruction Lecture Materials for Computer Architecture by Dr. Leo Porter is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
PipeliningPipelining Computer Architecture (Fall 2006)
Use of Pipelining to Achieve CPI < 1
CS 352H: Computer Systems Architecture
COMP 740: Computer Architecture and Implementation
Computer Architecture Principles Dr. Mike Frank
/ Computer Architecture and Design
/ Computer Architecture and Design
CPE 731 Advanced Computer Architecture Thread Level Parallelism
CPE 731 Advanced Computer Architecture ILP: Part V – Multiple Issue
Simultaneous Multithreading
Multi-core processors
Computer Structure Multi-Threading
Limits on ILP and Multithreading
5.2 Eleven Advanced Optimizations of Cache Performance
Chapter 14 Instruction Level Parallelism and Superscalar Processors
Embedded Computer Architecture 5SAI0 Chip Multi-Processors (ch 8)
Advanced Computer Architecture 5MD00 / 5Z033 SMT Simultaneously Multi-Threading Henk Corporaal TUEindhoven.
CSCE 430/830 Computer Architecture Advanced HW Approaches: Speculation
Department of Electrical and Computer Engineering
Electrical and Computer Engineering
Advanced Computer Architecture 5MD00 / 5Z033 SMT Simultaneously Multi-Threading Henk Corporaal TUEindhoven.
Pipelining: Advanced ILP
Morgan Kaufmann Publishers The Processor
Superscalar Processors & VLIW Processors
Levels of Parallelism within a Single Processor
Computer Architecture Lecture 4 17th May, 2006
Lecture 8: ILP and Speculation Contd. Chapter 2, Sections 2. 6, 2
Limits to ILP Conflicting studies of amount
Hardware Multithreading
CPE 631: Multithreading: Thread-Level Parallelism Within a Processor
How to improve (decrease) CPI
CC423: Advanced Computer Architecture ILP: Part V – Multiple Issue
/ Computer Architecture and Design
* From AMD 1996 Publication #18522 Revision E
/ Computer Architecture and Design
Embedded Computer Architecture 5SAI0 Chip Multi-Processors (ch 8)
Levels of Parallelism within a Single Processor
Hardware Multithreading
CSC3050 – Computer Architecture
Lecture 22: Multithreading
The University of Adelaide, School of Computer Science
Advanced Computer Architecture 5MD00 / 5Z032 SMT Simultaneously Multi-Threading Henk Corporaal TUEindhoven.
Presentation transcript:

16.482 / 16.561 Computer Architecture and Design Instructor: Dr. Michael Geiger Summer 2015 Lecture 7: Multithreading

Computer Architecture Lecture 7 Lecture outline Announcements/reminders HW 5 due tomorrow (6/12) HW 6 to be posted; due 6/16 Today’s lecture Review: speculation Multiple issue and multithreading Return midterm exams 9/14/2018 Computer Architecture Lecture 7

Computer Architecture Lecture 10 Review: Speculation Hardware speculation, a technique with significant performance advantages, builds on dynamic scheduling Assume branch predictions are correct Speculate past control dependences Allow instructions to execute and complete out-of-order, but must commit in order Extra stage: when instructions commit, they update the register file or memory In-order commit also allows precise exceptions Reorder buffer maintains program order Also effectively replaces register file for in-flight instructions—instructions first check reorder buffer for operand values 9/14/2018 Computer Architecture Lecture 10

Computer Architecture Lecture 7 Getting CPI below 1 CPI ≥ 1 if issue only 1 instruction every clock cycle Multiple-issue processors come in 3 flavors: statically-scheduled superscalar processors, dynamically-scheduled superscalar processors, and VLIW (very long instruction word) processors 2 types of superscalar processors issue varying numbers of instructions per clock use in-order execution if they are statically scheduled, or out-of-order execution if they are dynamically scheduled 9/14/2018 Computer Architecture Lecture 7

Performance beyond single thread ILP There can be much higher natural parallelism in some applications (e.g., Database or Scientific codes) Explicit Thread Level Parallelism or Data Level Parallelism Thread: process with own instructions and data thread may be a process part of a parallel program of multiple processes, or it may be an independent program Each thread has all the state (instructions, data, PC, register state, and so on) necessary to allow it to execute Data Level Parallelism: Perform identical operations on data, and lots of data 9/14/2018 Computer Architecture Lecture 7

Thread Level Parallelism (TLP) ILP exploits implicit parallel operations within a loop or straight-line code segment TLP explicitly represented by the use of multiple threads of execution that are inherently parallel Goal: Use multiple instruction streams to improve Throughput of computers that run many programs Execution time of multi-threaded programs TLP could be more cost-effective to exploit than ILP 9/14/2018 Computer Architecture Lecture 7

New Approach: Mulithreaded Execution Multithreading: multiple threads to share the functional units of 1 processor via overlapping processor must duplicate independent state of each thread e.g., a separate copy of register file, a separate PC, and for running independent programs, a separate page table memory shared through the virtual memory mechanisms, which already support multiple processes HW for fast thread switch; much faster than full process switch  100s to 1000s of clocks When switch? Alternate instruction per thread (fine grain) When a thread is stalled, perhaps for a cache miss, another thread can be executed (coarse grain) 9/14/2018 Computer Architecture Lecture 7

Fine-Grained Multithreading Switch on each instruction Usually done in a round-robin fashion, skipping any stalled threads CPU must be able to switch threads every clock Advantage: Hide both short/long stalls Disadvantage: slows individual threads 9/14/2018 Computer Architecture Lecture 7

Coarse-Grained Multithreading Switches only on costly stalls, such as L2 cache misses Advantages Relieves need to have very fast thread-switching Doesn’t slow down individual thread Disadvantage: hard to overcome throughput losses on shorter stalls, due to pipeline start-up costs Since CPU issues instructions from 1 thread, when a stall occurs, the pipeline must be emptied or frozen New thread must fill pipeline before instructions can complete Because of this start-up overhead, coarse-grained multithreading is better for reducing penalty of high cost stalls, where pipeline refill << stall time 9/14/2018 Computer Architecture Lecture 7

Computer Architecture Lecture 7 Do both ILP and TLP? TLP and ILP exploit two different kinds of parallel structure in a program Could a processor oriented at ILP exploit TLP? Functional units are often idle in data path designed for ILP because of either stalls or dependences in the code Could the TLP be used as a source of independent instructions that might keep the processor busy during stalls? Could TLP be used to employ the functional units that would otherwise lie idle when insufficient ILP exists? 9/14/2018 Computer Architecture Lecture 7

Simultaneous Multi-threading ... One thread, 8 units Two threads, 8 units Cycle M M FX FX FP FP BR CC Cycle M M FX FX FP FP BR CC 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 9/14/2018 M = Load/Store, FX = Fixed Point, FP = Floating Point, BR = Branch, CC = Condition Codes Computer Architecture Lecture 7

Simultaneous Multithreading (SMT) Simultaneous multithreading (SMT): insight that dynamically scheduled processor already has many HW mechanisms to support multithreading Large set of virtual registers that can be used to hold the register sets of independent threads Register renaming provides unique register identifiers, so instructions from multiple threads can be mixed in datapath without confusing sources and destinations across threads Out-of-order completion allows the threads to execute out of order, and get better utilization of the HW Just adding a per thread renaming table and keeping separate PCs Independent commitment can be supported by logically keeping a separate reorder buffer for each thread Source: Microprocessor Report, December 6, 1999 “Compaq Chooses SMT for Alpha” 9/14/2018 Computer Architecture Lecture 7

Multithreaded Categories Simultaneous Multithreading Superscalar Fine-Grained Coarse-Grained Multiprocessing Time (processor cycle) Thread 1 Thread 3 Thread 5 Thread 2 Thread 4 Idle slot 9/14/2018 Computer Architecture Lecture 7

Multithreading examples Assume processor with following characteristics 4 functional units 2 ALU 1 memory port (either load or store) 1 branch In-order scheduling Given 3 threads, show execution using Fine-grained multithreading Coarse-grained multithreading Assume any stall longer than 2 cycles causes switch Simultaneous multithreading Thread 1 is preferred, followed by Thread 2 & Thread 3 Assume any two instructions without stalls between them are independent 9/14/2018 Computer Architecture Lecture 7

ECE Application Programming: Lecture 14 Exam stats Average: 80.8 16.482: 80.6 16.561: 81 Median: 89 Std. deviation: 19.8 Max: 96 (x2) Question-by-question averages: Q1: 8.3 / 10 (83%) Q2: 10.6 / 14 (76%) Q3: 16.7 / 20 (84%) Q4: 13.7 / 16 (86%) Q5: 19.4 / 23 (84%) Q6: 12.1 / 17 (71%) 9/14/2018 ECE Application Programming: Lecture 14

Computer Architecture Lecture 7 Final notes Next time Memory hierarchies Reminders HW 5 due tomorrow (6/12) HW 6 to be posted; due 6/16 9/14/2018 Computer Architecture Lecture 7