Memory consistency models Presented by: Gabriel Tanase.

Slides:



Advertisements
Similar presentations
Chapter 5 Part I: Shared Memory Multiprocessors
Advertisements

Memory Consistency Models Sarita Adve Department of Computer Science University of Illinois at Urbana-Champaign Ack: Previous tutorials.
Synchronization. How to synchronize processes? – Need to protect access to shared data to avoid problems like race conditions – Typical example: Updating.
Memory Consistency Models Kevin Boos. Two Papers Shared Memory Consistency Models: A Tutorial – Sarita V. Adve & Kourosh Gharachorloo – September 1995.
Relaxed Consistency Models. Outline Lazy Release Consistency TreadMarks DSM system.
CS 162 Memory Consistency Models. Memory operations are reordered to improve performance Hardware (e.g., store buffer, reorder buffer) Compiler (e.g.,
Multiple-Writer Distributed Memory. The Sequential Consistency Memory Model P1P2 P3 switch randomly set after each memory op ensures some serial order.
Distributed Shared Memory
Consistency Models Based on Tanenbaum/van Steen’s “Distributed Systems”, Ch. 6, section 6.2.
1 Release Consistency Slides by Konstantin Shagin, 2002.
1 Munin, Clouds and Treadmarks Distributed Shared Memory course Taken from a presentation of: Maya Maimon (University of Haifa, Israel).
1 Lecture 12: Hardware/Software Trade-Offs Topics: COMA, Software Virtual Memory.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
(Software) Distributed Shared Memory (aka Shared Virtual Memory)
Lightweight Logging For Lazy Release Consistent DSM Costa, et. al. CS /01/01.
Lecture 13: Consistency Models
Computer Architecture II 1 Computer architecture II Lecture 9.
Memory Consistency Models
1 Lecture 12: Relaxed Consistency Models Topics: sequential consistency recap, relaxing various SC constraints, performance comparison.
Shared Memory Consistency Models: A Tutorial By Sarita V Adve and Kourosh Gharachorloo Presenter: Meenaktchi Venkatachalam.
Processor Consistency [Goodman 1989]* Processor Consistency is a memory model in which the result of any execution is the same as if the operations of.
Shared Memory Consistency Models: A Tutorial By Sarita V Adve and Kourosh Gharachorloo Presenter: Sunita Marathe.
Memory Consistency Models Some material borrowed from Sarita Adve’s (UIUC) tutorial on memory consistency models.
Distributed Shared Memory Systems and Programming
Shared Memory – Consistency of Shared Variables The ideal picture of shared memory: CPU0CPU1CPU2CPU3 Shared Memory Read/ Write The actual architecture.
TreadMarks Distributed Shared Memory on Standard Workstations and Operating Systems Pete Keleher, Alan Cox, Sandhya Dwarkadas, Willy Zwaenepoel.
©RG:E0243:L2- Parallel Architecture 1 E0-243: Computer Architecture L2 – Parallel Architecture.
Distributed Shared Memory: A Survey of Issues and Algorithms B,. Nitzberg and V. Lo University of Oregon.
Lazy Release Consistency for Software Distributed Shared Memory Pete Keleher Alan L. Cox Willy Z.
Shared Memory Consistency Models: A Tutorial Sarita V. Adve Kouroush Ghrachorloo Western Research Laboratory September 1995.
TECHNIQUES FOR REDUCING CONSISTENCY- RELATED COMMUNICATION IN DISTRIBUTED SHARED-MEMORY SYSTEMS J. B. Carter University of Utah J. K. Bennett and W. Zwaenepoel.
Performance of the Shasta distributed shared memory protocol Daniel J. Scales Kourosh Gharachorloo 創造情報学専攻 M グェン トアン ドゥク.
Consistency and Replication Chapter 6. Release Consistency (1) A valid event sequence for release consistency. Use acquire/release operations to denote.
Memory Consistency Models Alistair Rendell See “Shared Memory Consistency Models: A Tutorial”, S.V. Adve and K. Gharachorloo Chapter 8 pp of Wilkinson.
1 Lecture 12: Hardware/Software Trade-Offs Topics: COMA, Software Virtual Memory.
Ch 10 Shared memory via message passing Problems –Explicit user action needed –Address spaces are distinct –Small Granularity of Transfer Distributed Shared.
Cache Coherence Protocols 1 Cache Coherence Protocols in Shared Memory Multiprocessors Mehmet Şenvar.
Distributed Shared Memory Presentation by Deepthi Reddy.
Distributed Shared Memory (part 1). Distributed Shared Memory (DSM) mem0 proc0 mem1 proc1 mem2 proc2 memN procN network... shared memory.
Shared Memory Consistency Models. SMP systems support shared memory abstraction: all processors see the whole memory and can perform memory operations.
Memory Consistency Models. Outline Review of multi-threaded program execution on uniprocessor Need for memory consistency models Sequential consistency.
Treadmarks: Distributed Shared Memory on Standard Workstations and Operating Systems P. Keleher, A. Cox, S. Dwarkadas, and W. Zwaenepoel The Winter Usenix.
Memory Consistency Models 1. Uniform Consistency Models Only have read and write operations Sequential Consistency Pipelined-RAM Causal Consistency Coherence.
Release Consistency Yujia Jin 2/27/02. Motivations Place partial order on memory accesses for correct parallel program behavior Relax partial order for.
Implementation and Performance of Munin (Distributed Shared Memory System) Dongying Li Department of Electrical and Computer Engineering University of.
DISTRIBUTED COMPUTING
Page 1 Distributed Shared Memory Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Memory Consistency Zhonghai Lu Outline Introduction What is a memory consistency model? Who should care? Memory consistency models Strict.
Introduction to Software Distributed Shared Memory Systems Chang-Yi Lin 2004 / 02 / 26.
1 Chapter 9 Distributed Shared Memory. 2 Making the main memory of a cluster of computers look as though it is a single memory with a single address space.
Lazy Release Consistency for Software Distributed Shared Memory Pete Keleher Alan L. Cox Willy Z. By Nooruddin Shaik.
OpenMP for Networks of SMPs Y. Charlie Hu, Honghui Lu, Alan L. Cox, Willy Zwaenepoel ECE1747 – Parallel Programming Vicky Tsang.
Distributed shared memory u motivation and the main idea u consistency models F strict and sequential F causal F PRAM and processor F weak and release.
August 13, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 11: Multiprocessors: Uniform Memory Access * Jeremy R. Johnson Monday,
EE 382 Processor DesignWinter 98/99Michael Flynn 1 EE382 Processor Design Winter 1998 Chapter 8 Lectures Multiprocessors, Part I.
Implementation and Performance of Munin (Distributed Shared Memory System) Dongying Li Department of Electrical and Computer Engineering University of.
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Software Coherence Management on Non-Coherent-Cache Multicores
CS5102 High Performance Computer Systems Memory Consistency
Distributed Shared Memory
Memory Consistency Models
Memory Consistency Models
Relaxed Consistency models and software distributed memory
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Shared Memory Consistency Models: A Tutorial
Symmetric Multiprocessors: Synchronization and Sequential Consistency
Memory Consistency Models
Programming with Shared Memory Specifying parallelism
Lecture 11: Relaxed Consistency Models
Lecture 11: Consistency Models
Presentation transcript:

Memory consistency models Presented by: Gabriel Tanase

Summary Memory Consistency (definition) Sequential Consistency Processor Consistency Week Consistency Release Consistency Early Release Consistency Lazy Release Consistency Entry Consistency

Memory Consistency Def: A memory consistency model for a shared address space specifies constraints on the order in which memory operations must appear to be performed (i.e. to become visible to the processors) with respect to one another. P1P2(A, flag are zero initial) A=1while(flag == 0); flag=1print A; (Culler, Singh, Gupta)

Sequential Consistency Sequential Consistency(Lamport) “A multiprocessor is sequentially consistent if the result of any execution is the same as if the operations of all the processors were executed in some sequential order, and the operations of each individual processor occur in this sequence in the order specified by its program.”

Sequential Consistency 1. Every process issues memory operations in program order. 2. After a write operation is issued, the issuing process waits for the write to complete before issuing its next operation. 3. After a read operation is issued, the issuing process waits for the read to complete, and for the write whose value is being returned by the read to complete, before issuing its next operation. That is, if the write whose value is being returned has performed with respect to this processor (as it must have if its value is being returned) then the processor should wait until the write has performed with respect to all processors. (Culler, Singh, Gupta)

Processor Consistency 1. Before a read is allowed to perform with respect to any other processor, all previous read must be performed and 2. Before a write is allowed to performed with respect to any other processor all previous accesses(reads and writes) must be performed The above conditions relax sequential consistency by allowing reads following a a write to bypass the write; Writes from the same processor should be observed in program order; The order in which the writes from two processors occur (as observed by themselves or a third processor need NOT be identical (Gharachorloo & al.)

Example Case 1 (SC, PC) P1P2(A, flag are zero initial) A=1while(flag == 0); flag=1print A; Case 2 (SC but not PC) P1P2P3 (A, flag are zero initial) A=1while(A == 0);while(B == 0); B=1;print A;

Weak Consistency Ordinary shared accesses and synchronization accesses Conditions for weak consistency Before an ordinary read/write access is allowed to perform with respect to any other processor, all previous synchronization accesses must be performed and Before a synchronization access is allowed to performed with respect to any other processor, all previous ordinary read/write accesses must be performed and Synchronization accesses are sequentially consistent.

Release Consistency Categorization of shared memory accesses Shared access Competing non-competing Synchronization non-synchronization Acquire Release

RC: Properly-Labeled Programs shared special ordinary synch nsynch acq rel Two ways of labelling Parallelizing compilers Programming methodology

Conditions for Release Consistency Before an ordinary read or write access is allowed to perform with respect to any other processor, all previous acquire accesses must be performed and Before a release access is allowed to perform with respect to any other processor, all previous ordinary read and writes accesses must be performed, and Special accesses are sequential consistent with respect to one another

Comparison of the four models

Performance Potential

Lazy release consistency for Software DSM

Eager Release Consistency

Lazy Release Consistency

Lazy release consistency “happened-before-1” partial order Write notice propagation Multiple writer protocols Modify different parts of a page concurrently False sharing Reduces the amount of messages Invalidate vs. update(on the acquiring processor)

Lazy versus Eager

Entry Consistency Memory consistency requirements can be relaxed even more: Parallel programs define their own higher level consistency requirements Synchronization object (locks, barriers) Critical section Shared data accessed in critical section A processor’s view of the shared memory becomes consistent with the most recent updates only when it enters a critical section(Bershad & al)

Entry Consistency All synchronization objects should be explicitly declared as instances of one of the synchronization data types provided(by Midway(runtime)): locks, barriers All shared data must be explicitly labeled with the keyword shared which is understood by the compiler. All shared data must be explicitly associated with at least one synchronization object. This is made by calls to the runtime system, is dynamic and may change.

Entry Consistency performance Matrix Multiply #procsElapsedSpeedupData Transfered (MB) #Msgs Entry Cons Release Cons

Scope Consistency “A bridge between RC and EC” Scope Consistency offers most of the potential performance advantages of Entry Consistency. Doesn’t require explicit binding of data to synchronization variables “Consistency Scope” dynamic establish the binding of data to synchronization variables Most of the programs that follow LRC will be correct under scope consistency(ScC)

Consistency Scope “Consistency Scope” - modification to data within that scope are guaranteed to be visible within that scope: Ex All critical sections guarded by the same lock Session – the interval in which a consistency scope is open at a given processor. Any modification during a consistency scope session become visible to processes that enter sessions of that scope.

Scope Consistency Rules Before a new session of a consistency scope is allowed to open at processor P, any write previously performed with respect to that consistency scope must be performed with respect to P. A memory access issued by processor P is allowed to perform only after all consistency scope sessions previously opened by P have been successfully opened. (L.Iftode & al.)

Scope versus LRC

Conclusions The most important memory consistency models were presented. Every new model presented introduced a new relaxation. The more information a processor have the more optimizations can be performed. Some of them are suitable for hardware some for software distributed shared memory.

Bibliography 1.Memory consistency and event ordering in scalable shared- memory multiprocessors; Kourosh Gharacahorloo, Daniel Lenosky, James Laudon, Philip Gibbons, Anoop Gupta and John Hennessy. 2.Lazy release consistency for software distributed shared memory; Pete Keleher, Alan Cox, Willy Zwaenepoel 3.The Midway distributed shared memory; Brian Bershad & al. 4.Scope Consistency: A bridge between release consistency and entry consistency; L. Iftode, J.P. Singh, K. Li 5.Parallel computer architecture(chapter 5 and 9); David Culler, J.P. Singh, A. Gupta

Delayed Consistency

Delayed protocols

Update based cache protocols