Samira Khan University of Virginia Mar 3, 2016 COMPUTER ARCHITECTURE CS 6354 Main Memory The content and concept of this course are adapted from CMU ECE.

Slides:



Advertisements
Similar presentations
Outline Memory characteristics SRAM Content-addressable memory details DRAM © Derek Chiou & Mattan Erez 1.
Advertisements

Practical Caches COMP25212 cache 3. Learning Objectives To understand: –Additional Control Bits in Cache Lines –Cache Line Size Tradeoffs –Separate I&D.
CMPE 421 Parallel Computer Architecture MEMORY SYSTEM.
Main Mem.. CSE 471 Autumn 011 Main Memory The last level in the cache – main memory hierarchy is the main memory made of DRAM chips DRAM parameters (memory.
Lecture 12: DRAM Basics Today: DRAM terminology and basics, energy innovations.
1 Lecture 14: Cache Innovations and DRAM Today: cache access basics and innovations, DRAM (Sections )
1 Lecture 15: DRAM Design Today: DRAM basics, DRAM innovations (Section 5.3)
1  1998 Morgan Kaufmann Publishers Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
1 Chapter Seven Large and Fast: Exploiting Memory Hierarchy.
Computer ArchitectureFall 2007 © November 7th, 2007 Majd F. Sakr CS-447– Computer Architecture.
1  2004 Morgan Kaufmann Publishers Chapter Seven.
1 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: –value is stored as a charge.
1 CSE SUNY New Paltz Chapter Seven Exploiting Memory Hierarchy.
1 Lecture 1: Introduction and Memory Systems CS 7810 Course organization:  5 lectures on memory systems  5 lectures on cache coherence and consistency.
Computing Systems Memory Hierarchy.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
ECE 526 – Network Processing Systems Design Network Processor Architecture and Scalability Chapter 13,14: D. E. Comer.
CPE432 Chapter 5A.1Dr. W. Abu-Sufah, UJ Chapter 5A: Exploiting the Memory Hierarchy, Part 1 Adapted from Slides by Prof. Mary Jane Irwin, Penn State University.
1 Computer Architecture Research Overview Rajeev Balasubramonian School of Computing, University of Utah
Lecture 19 Today’s topics Types of memory Memory hierarchy.
Main Memory CS448.
How to Build a CPU Cache COMP25212 – Lecture 2. Learning Objectives To understand: –how cache is logically structured –how cache operates CPU reads CPU.
Computer Architecture And Organization UNIT-II Structured Organization.
A Row Buffer Locality-Aware Caching Policy for Hybrid Memories HanBin Yoon Justin Meza Rachata Ausavarungnirun Rachael Harding Onur Mutlu.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 10 Memory Hierarchy.
+ CS 325: CS Hardware and Software Organization and Architecture Memory Organization.
1 Lecture 14: DRAM Main Memory Systems Today: cache/TLB wrap-up, DRAM basics (Section 2.3)
Computer Memory Storage Decoding Addressing 1. Memories We've Seen SIMM = Single Inline Memory Module DIMM = Dual IMM SODIMM = Small Outline DIMM RAM.
Computer Architecture Lecture 24 Fasih ur Rehman.
CSE378 Intro to caches1 Memory Hierarchy Memory: hierarchy of components of various speeds and capacities Hierarchy driven by cost and performance In early.
COMP SYSTEM ARCHITECTURE HOW TO BUILD A CACHE Antoniu Pop COMP25212 – Lecture 2Jan/Feb 2015.
1 Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4.
1  1998 Morgan Kaufmann Publishers Chapter Seven.
Advanced Topics: Prefetching ECE 454 Computer Systems Programming Topics: UG Machine Architecture Memory Hierarchy of Multi-Core Architecture Software.
07/11/2005 Register File Design and Memory Design Presentation E CSE : Introduction to Computer Architecture Slides by Gojko Babić.
COMP SYSTEM ARCHITECTURE PRACTICAL CACHES Sergio Davies Feb/Mar 2014COMP25212 – Lecture 3.
1 Chapter Seven. 2 SRAM: –value is stored on a pair of inverting gates –very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: –value.
COMPUTER SYSTEMS ARCHITECTURE A NETWORKING APPROACH CHAPTER 12 INTRODUCTION THE MEMORY HIERARCHY CS 147 Nathaniel Gilbert 1.
1 Lecture: DRAM Main Memory Topics: DRAM intro and basics (Section 2.3)
CS203 – Advanced Computer Architecture Main Memory Slides adapted from Onur Mutlu (CMU)
Fall 2010 Computer Architecture Lecture 6: Caching Basics Prof. Onur Mutlu Carnegie Mellon University.
15-740/ Computer Architecture Lecture 25: Main Memory
Chapter 5 Memory Hierarchy Design. 2 Many Levels in Memory Hierarchy Pipeline registers Register file 1st-level cache (on-chip) 2nd-level cache (on same.
Memory Hierarchy and Cache. A Mystery… Memory Main memory = RAM : Random Access Memory – Read/write – Multiple flavors – DDR SDRAM most common 64 bit.
1 Lecture 16: Main Memory Innovations Today: DRAM basics, innovations, trends HW5 due on Thursday; simulations can take a few hours Midterm: 32 scores.
Fall 2012 Parallel Computer Architecture Lecture 4: Multi-Core Processors Prof. Onur Mutlu Carnegie Mellon University 9/14/2012.
1 Lecture: Memory Basics and Innovations Topics: memory organization basics, schedulers, refresh,
CS161 – Design and Architecture of Computer Main Memory Slides adapted from Onur Mutlu (CMU)
CS 704 Advanced Computer Architecture
Memories.
Caches Samira Khan March 23, 2017.
Computer Architecture Lecture 19: Memory Hierarchy and Caches
Samira Khan University of Virginia Sep 17, 2017
5.2 Eleven Advanced Optimizations of Cache Performance
Architecture Background
Cache Memory Presentation I
Samira Khan University of Virginia Oct 9, 2017
Lecture 15: DRAM Main Memory Systems
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Lecture: DRAM Main Memory
Computer Architecture
Lecture: DRAM Main Memory
Lecture: DRAM Main Memory
Memory Hierarchy Memory: hierarchy of components of various speeds and capacities Hierarchy driven by cost and performance In early days Primary memory.
Samira Khan University of Virginia Nov 5, 2018
15-740/ Computer Architecture Lecture 19: Main Memory
15-740/ Computer Architecture Lecture 18: Caching Basics
Cache Memory and Performance
Memory Principles.
Presentation transcript:

Samira Khan University of Virginia Mar 3, 2016 COMPUTER ARCHITECTURE CS 6354 Main Memory The content and concept of this course are adapted from CMU ECE 740

AGENDA Logistics Review from last lecture Main Memory 2

ANONYMOUS FEEDBACK Course Pace Okay (11) Fast (1) Material Right level (4) Hard (6) Too Easy (1) 3

ANONYMOUS FEEDBACK Workload Okay (8) Heavy (3) Comments Examples Pictures Text book/Reading material Basics Exam vs. Project 4

MATERIAL Undergraduate Computer Architecture Course – Includes more than what we are covering in this course Watch the lecture videos st=PL5PHm2jkkXmidJOd59REog9jDnPDTG6IJ st=PL5PHm2jkkXmidJOd59REog9jDnPDTG6IJ st=PL5PHm2jkkXmi5CxxI7b3JCL1TWybTDtKq st=PL5PHm2jkkXmi5CxxI7b3JCL1TWybTDtKq Readings readings readings 5

TEXTBOOK Textbooks do not provide the high-level intuition behind the ideas Many of the ideas are not yet in the text book – Want to learn state of the art, and their tradeoffs Want to answer the question – Why? – What was done before? – Why this is better? – What are the downsides? …. But do consult the textbook if you need …. 6

EXAM VS. PROJECT VS. GRADE Focus on project Exams are just to make sure you understood the material You want to learn the topics Grades do not get you a job, acquired skill does Your project shows – You know the recent topics – You know the tools – You can implement and evaluate ideas 7

REVIEW: USE OF ASYMMETRY FOR ENERGY EFFICIENCY Kumar et al., “Single-ISA Heterogeneous Multi-Core Architectures: The Potential for Processor Power Reduction,” MICRO Idea: – Implement multiple types of cores on chip – Monitor characteristics of the running thread (e.g., sample energy/perf on each core periodically) – Dynamically pick the core that provides the best energy/performance tradeoff for a given phase “Best core”  Depends on optimization metric 8

Advantages + More flexibility in energy-performance tradeoff + Can execute computation to the core that is best suited for it (in terms of energy) Disadvantages/issues - Incorrect predictions/sampling  wrong core  reduced performance or increased energy - Overhead of core switching - Disadvantages of asymmetric CMP (e.g., design multiple cores) - Need phase monitoring and matching algorithms - What characteristics should be monitored? - Once characteristics known, how do you pick the core? REVIEW: USE OF ASYMMETRY FOR ENERGY EFFICIENCY 9

REVIEW: SLIPSTREAM PROCESSORS Goal: use multiple hardware contexts to speed up single thread execution (implicitly parallelize the program) Idea: Divide program execution into two threads: – Advanced thread executes a reduced instruction stream, speculatively – Redundant thread uses results, prefetches, predictions generated by advanced thread and ensures correctness Benefit: Execution time of the overall program reduces Core idea is similar to many thread-level speculation approaches, except with a reduced instruction stream Sundaramoorthy et al., “Slipstream Processors: Improving both Performance and Fault Tolerance,” ASPLOS

REVIEW: DUAL CORE EXECUTION Idea: One thread context speculatively runs ahead on load misses and prefetches data for another thread context Zhou, “Dual-Core Execution: Building a Highly Scalable Single- Thread Instruction Window,” PACT

DUAL CORE EXECUTION VS. SLIPSTREAM Dual-core execution does not – remove dead instructions – reuse instruction register results – uses the “leading” hardware context solely for prefetching and branch prediction + Easier to implement, smaller hardware cost and complexity - “Leading thread” cannot run ahead as much as in slipstream when there are no cache misses - Not reusing results in the “trailing thread” can reduce overall performance benefit 12

HETEROGENEITY (ASYMMETRY)  SPECIALIZATION Heterogeneity and asymmetry have the same meaning – Contrast with homogeneity and symmetry Heterogeneity is a very general system design concept (and life concept, as well) Idea: Instead of having multiple instances of the same “resource” to be the same (i.e., homogeneous or symmetric), design some instances to be different (i.e., heterogeneous or asymmetric) Different instances can be optimized to be more efficient in executing different types of workloads or satisfying different requirements/goals – Heterogeneity enables specialization/customization 13

WHY ASYMMETRY IN DESIGN? (I) Different workloads executing in a system can have different behavior – Different applications can have different behavior – Different execution phases of an application can have different behavior – The same application executing at different times can have different behavior (due to input set changes and dynamic events) – E.g., locality, predictability of branches, instruction-level parallelism, data dependencies, serial fraction, bottlenecks in parallel portion, interference characteristics, … Systems are designed to satisfy different metrics at the same time – There is almost never a single goal in design, depending on design point – E.g., Performance, energy efficiency, fairness, predictability, reliability, availability, cost, memory capacity, latency, bandwidth, … 14

WHY ASYMMETRY IN DESIGN? (II) Problem: Symmetric design is one-size-fits-all It tries to fit a single-size design to all workloads and metrics It is very difficult to come up with a single design – that satisfies all workloads even for a single metric – that satisfies all design metrics at the same time This holds true for different system components, or resources – Cores, caches, memory, controllers, interconnect, disks, servers, … – Algorithms, policies, … 15

FUTURE SPECIALIZED CORES HYBRID, MEMORY WITH LOGIC MANAGE DATA FLOW APPLICATION, PROCESSOR, MEMORY 16

MAIN MEMORY BASICS

THE MAIN MEMORY SYSTEM Main memory is a critical component of all computing systems: server, mobile, embedded, desktop, sensor Main memory system must scale (in size, technology, efficiency, cost, and management algorithms) to maintain performance growth and technology scaling benefits Processor and caches Main Memory Storage (SSD/HDD) 18

MEMORY SYSTEM: A SHARED RESOURCE VIEW Storage 19

STATE OF THE MAIN MEMORY SYSTEM Recent technology, architecture, and application trends – lead to new requirements – exacerbate old requirements DRAM and memory controllers, as we know them today, are (will be) unlikely to satisfy all requirements Some emerging non-volatile memory technologies (e.g., PCM) enable new opportunities: memory+storage merging We need to rethink the main memory system – to fix DRAM issues and enable emerging technologies – to satisfy all requirements 20

MAJOR TRENDS AFFECTING MAIN MEMORY (I) Need for main memory capacity, bandwidth, QoS increasing Main memory energy/power is a key system design concern DRAM technology scaling is ending 21

Need for main memory capacity, bandwidth, QoS increasing – Multi-core: increasing number of cores – Data-intensive applications: increasing demand/hunger for data – Consolidation: cloud computing, GPUs, mobile Main memory energy/power is a key system design concern DRAM technology scaling is ending MAJOR TRENDS AFFECTING MAIN MEMORY (II) 22

EXAMPLE TREND: MANY CORES ON CHIP Simpler and lower power than a single large core Large scale parallelism on chip IBM Cell BE 8+1 cores Intel Core i7 8 cores Tilera TILE Gx 100 cores, networked IBM POWER7 8 cores Intel SCC 48 cores, networked Nvidia Fermi 448 “cores” AMD Barcelona 4 cores Sun Niagara II 8 cores 23

CONSEQUENCE: THE MEMORY CAPACITY GAP Memory capacity per core expected to drop by 30% every two years Trends worse for memory bandwidth per core! Core count doubling ~ every 2 years DRAM DIMM capacity doubling ~ every 3 years 24

Need for main memory capacity, bandwidth, QoS increasing Main memory energy/power is a key system design concern – ~40-50% energy spent in off-chip memory hierarchy [Lefurgy, IEEE Computer 2003] – DRAM consumes power even when not used (periodic refresh) DRAM technology scaling is ending MAJOR TRENDS AFFECTING MAIN MEMORY (III) 25

Need for main memory capacity, bandwidth, QoS increasing Main memory energy/power is a key system design concern DRAM technology scaling is ending – ITRS projects DRAM will not scale easily below X nm – Scaling has provided many benefits: higher capacity (density), lower cost, lower energy MAJOR TRENDS AFFECTING MAIN MEMORY (IV) 26

THE DRAM SCALING PROBLEM DRAM stores charge in a capacitor (charge-based memory) – Capacitor must be large enough for reliable sensing – Access transistor should be large enough for low leakage and high retention time – Scaling beyond 40-35nm (2013) is challenging [ITRS, 2009] DRAM capacity, cost, and energy/power hard to scale 27

SOLUTIONS TO THE DRAM SCALING PROBLEM Two potential solutions – Tolerate DRAM (by taking a fresh look at it) – Enable emerging memory technologies to eliminate/minimize DRAM Do both – Hybrid memory systems 28

SOLUTION 1: TOLERATE DRAM Overcome DRAM shortcomings with – System-DRAM co-design – Novel DRAM architectures, interface, functions – Better waste management (efficient utilization) Key issues to tackle – Reduce refresh energy – Improve bandwidth and latency – Reduce waste – Enable reliability at low cost 29

SOLUTION 2: EMERGING MEMORY TECHNOLOGIES Some emerging resistive memory technologies seem more scalable than DRAM (and they are non- volatile) Example: Phase Change Memory – Expected to scale to 9nm (2022 [ITRS]) – Expected to be denser than DRAM: can store multiple bits/cell But, emerging technologies have shortcomings as well – Can they be enabled to replace/augment/surpass DRAM? 30

HYBRID MEMORY SYSTEMS CPU DRA MCtrl Fast, durable Small, leaky, volatile, high-cost Fast, durable Small, leaky, volatile, high-cost Large, non-volatile, low-cost Slow, wears out, high active energy Large, non-volatile, low-cost Slow, wears out, high active energy PCM Ctrl DRAM Phase Change Memory (or Tech. X) Hardware/software manage data allocation and movement to achieve the best of multiple technologies 31

MAIN MEMORY IN THE SYSTEM CORE 1 L2 CACHE 0 SHARED L3 CACHE DRAM INTERFACE CORE 0 CORE 2 CORE 3 L2 CACHE 1 L2 CACHE 2L2 CACHE 3 DRAM BANKS DRAM MEMORY CONTROLLER 32

IDEAL MEMORY Zero access time (latency) Infinite capacity Zero cost Infinite bandwidth (to support multiple accesses in parallel) 33

THE PROBLEM Ideal memory’s requirements oppose each other Bigger is slower – Bigger  Takes longer to determine the location Faster is more expensive – Memory technology: SRAM vs. DRAM Higher bandwidth is more expensive – Need more banks, more ports, higher frequency, or faster technology 34

MEMORY TECHNOLOGY: DRAM Dynamic random access memory Capacitor charge state indicates stored value – Whether the capacitor is charged or discharged indicates storage of 1 or 0 – 1 capacitor – 1 access transistor Capacitor leaks through the RC path – DRAM cell loses charge over time – DRAM cell needs to be refreshed row enable _bitline 35

Static random access memory Two cross coupled inverters store a single bit – Feedback path enables the stored value to persist in the “cell” – 4 transistors for storage – 2 transistors for access MEMORY TECHNOLOGY: SRAM row select bitline _bitline 36

AN ASIDE: PHASE CHANGE MEMORY Phase change material (chalcogenide glass) exists in two states: – Amorphous: Low optical reflexivity and high electrical resistivity – Crystalline: High optical reflexivity and low electrical resistivity PCM is resistive memory: High resistance (0), Low resistance (1) Lee, Ipek, Mutlu, Burger, “Architecting Phase Change Memory as a Scalable DRAM Alternative,” ISCA

MEMORY BANK: A FUNDAMENTAL CONCEPT Interleaving (banking) – Problem: a single monolithic memory array takes long to access and does not enable multiple accesses in parallel – Goal: Reduce the latency of memory array access and enable multiple accesses in parallel – Idea: Divide the array into multiple banks that can be accessed independently (in the same cycle or in consecutive cycles) Each bank is smaller than the entire memory storage Accesses to different banks can be overlapped – An issue: How do you map data to different banks? (i.e., how do you interleave data across banks?) 38

MEMORY BANK ORGANIZATION AND OPERATION Read access sequence: 1. Decode row address & drive word-lines 2. Selected bits drive bit- lines Entire row read 3. Amplify row data 4. Decode column address & select subset of row Send to output 5. Precharge bit-lines For next access 39

WHY MEMORY HIERARCHY? We want both fast and large But we cannot achieve both with a single level of memory Idea: Have multiple levels of storage (progressively bigger and slower as the levels are farther from the processor) and ensure most of the data the processor needs is kept in the fast(er) level(s) 40

MEMORY HIERARCHY Fundamental tradeoff – Fast memory: small – Large memory: slow Idea: Memory hierarchy Latency, cost, size, bandwidth CPU Main Memory (DRAM) RF Cache Hard Disk 41

CACHING BASICS: EXPLOIT TEMPORAL LOCALITY Idea: Store recently accessed data in automatically managed fast memory (called cache) Anticipation: the data will be accessed again soon Temporal locality principle – Recently accessed data will be again accessed in the near future – This is what Maurice Wilkes had in mind: Wilkes, “Slave Memories and Dynamic Storage Allocation,” IEEE Trans. On Electronic Computers, “The use is discussed of a fast core memory of, say words as a slave to a slower core memory of, say, one million words in such a way that in practical cases the effective access time is nearer that of the fast memory than that of the slow memory.” 42

CACHING BASICS: EXPLOIT SPATIAL LOCALITY Idea: Store addresses adjacent to the recently accessed one in automatically managed fast memory – Logically divide memory into equal size blocks – Fetch to cache the accessed block in its entirety Anticipation: nearby data will be accessed soon Spatial locality principle – Nearby data in memory will be accessed in the near future E.g., sequential instruction access, array traversal – This is what IBM 360/85 implemented 16 Kbyte cache with 64 byte blocks Liptay, “Structural aspects of the System/360 Model 85 II: the cache,” IBM Systems Journal,

A NOTE ON MANUAL VS. AUTOMATIC MANAGEMENT Manual: Programmer manages data movement across levels -- too painful for programmers on substantial programs – “core” vs “drum” memory in the 50’s – still done in some embedded processors (on-chip scratch pad SRAM in lieu of a cache) Automatic: Hardware manages data movement across levels, transparently to the programmer ++ programmer’s life is easier – simple heuristic: keep most recently used items in cache – the average programmer doesn’t need to know about it You don’t need to know how big the cache is and how it works to write a “correct” program! (What if you want a “fast” program?) 44

AUTOMATIC MANAGEMENT IN MEMORY HIERARCHY Wilkes, “Slave Memories and Dynamic Storage Allocation,” IEEE Trans. On Electronic Computers, “By a slave memory I mean one which automatically accumulates to itself words that come from a slower main memory, and keeps them available for subsequent use without it being necessary for the penalty of main memory access to be incurred again.” 45

A MODERN MEMORY HIERARCHY Register File 32 words, sub-nsec L1 cache ~32 KB, ~nsec L2 cache 512 KB ~ 1MB, many nsec L3 cache,..... Main memory (DRAM), GB, ~100 nsec Swap Disk 100 GB, ~10 msec manual/compiler register spilling automatic demand paging Automatic HW cache management Memory Abstraction 46

THE DRAM SUBSYSTEM

DRAM SUBSYSTEM ORGANIZATION Channel DIMM Rank Chip Bank Row/Column 48

PAGE MODE DRAM A DRAM bank is a 2D array of cells: rows x columns A “DRAM row” is also called a “DRAM page” “Sense amplifiers” also called “row buffer” Each address is a pair Access to a “closed row” – Activate command opens row (placed into row buffer) – Read/write command reads/writes column in the row buffer – Precharge command closes the row and prepares the bank for next access Access to an “open row” – No need for activate command 49

DRAM BANK OPERATION Row Buffer (Row 0, Column 0) Row decoder Column mux Row address 0 Column address 0 Data Row 0Empty (Row 0, Column 1) Column address 1 (Row 0, Column 85) Column address 85 (Row 1, Column 0) HIT Row address 1 Row 1 Column address 0 CONFLICT ! Columns Rows Access Address: 50

THE DRAM CHIP Consists of multiple banks (2-16 in Synchronous DRAM) Banks share command/address/data buses The chip itself has a narrow interface (4-16 bits per read) 51

128M X 8-BIT DRAM CHIP 52

Samira Khan University of Virginia Mar 3, 2016 COMPUTER ARCHITECTURE CS 6354 Main Memory The content and concept of this course are adapted from CMU ECE 740