Relaxed Memory-Consistency Models
Total Page:16
File Type:pdf, Size:1020Kb
Load more
Recommended publications
-
Memory Consistency
Lecture 9: Memory Consistency Parallel Computing Stanford CS149, Winter 2019 Midterm ▪ Feb 12 ▪ Open notes ▪ Practice midterm Stanford CS149, Winter 2019 Shared Memory Behavior ▪ Intuition says loads should return latest value written - What is latest? - Coherence: only one memory location - Consistency: apparent ordering for all locations - Order in which memory operations performed by one thread become visible to other threads ▪ Affects - Programmability: how programmers reason about program behavior - Allowed behavior of multithreaded programs executing with shared memory - Performance: limits HW/SW optimizations that can be used - Reordering memory operations to hide latency Stanford CS149, Winter 2019 Today: what you should know ▪ Understand the motivation for relaxed consistency models ▪ Understand the implications of relaxing W→R ordering Stanford CS149, Winter 2019 Today: who should care ▪ Anyone who: - Wants to implement a synchronization library - Will ever work a job in kernel (or driver) development - Seeks to implement lock-free data structures * - Does any of the above on ARM processors ** * Topic of a later lecture ** For reasons to be described later Stanford CS149, Winter 2019 Memory coherence vs. memory consistency ▪ Memory coherence defines requirements for the observed Observed chronology of operations on address X behavior of reads and writes to the same memory location - All processors must agree on the order of reads/writes to X P0 write: 5 - In other words: it is possible to put all operations involving X on a timeline such P1 read (5) that the observations of all processors are consistent with that timeline P2 write: 10 ▪ Memory consistency defines the behavior of reads and writes to different locations (as observed by other processors) P2 write: 11 - Coherence only guarantees that writes to address X will eventually propagate to other processors P1 read (11) - Consistency deals with when writes to X propagate to other processors, relative to reads and writes to other addresses Stanford CS149, Winter 2019 Coherence vs. -
Memory Consistency: in a Distributed Outline for Lecture 20 Memory System, References to Memory in Remote Processors Do Not Take Place I
Memory consistency: In a distributed Outline for Lecture 20 memory system, references to memory in remote processors do not take place I. Memory consistency immediately. II. Consistency models not requiring synch. This raises a potential problem. Suppose operations that— Strict consistency Sequential consistency • The value of a particular memory PRAM & processor consist. word in processor 2’s local memory III. Consistency models is 0. not requiring synch. operations. • Then processor 1 writes the value 1 to that word of memory. Note that Weak consistency this is a remote write. Release consistency • Processor 2 then reads the word. But, being local, the read occurs quickly, and the value 0 is returned. What’s wrong with this? This situation can be diagrammed like this (the horizontal axis represents time): P1: W (x )1 P2: R (x )0 Depending upon how the program is written, it may or may not be able to tolerate a situation like this. But, in any case, the programmer must understand what can happen when memory is accessed in a DSM system. Consistency models: A consistency model is essentially a contract between the software and the memory. It says that iff they software agrees to obey certain rules, the memory promises to store and retrieve the expected values. © 1997 Edward F. Gehringer CSC/ECE 501 Lecture Notes Page 220 Strict consistency: The most obvious consistency model is strict consistency. Strict consistency: Any read to a memory location x returns the value stored by the most recent write operation to x. This definition implicitly assumes the existence of a global clock, so that the determination of “most recent” is unambiguous. -
Towards Shared Memory Consistency Models for Gpus
TOWARDS SHARED MEMORY CONSISTENCY MODELS FOR GPUS by Tyler Sorensen A thesis submitted to the faculty of The University of Utah in partial fulfillment of the requirements for the degree of Bachelor of Science School of Computing The University of Utah March 2013 FINAL READING APPROVAL I have read the thesis of Tyler Sorensen in its final form and have found that (1) its format, citations, and bibliographic style are consistent and acceptable; (2) its illustrative materials including figures, tables, and charts are in place. Date Ganesh Gopalakrishnan ABSTRACT With the widespread use of GPUs, it is important to ensure that programmers have a clear understanding of their shared memory consistency model i.e. what values can be read when issued concurrently with writes. While memory consistency has been studied for CPUs, GPUs present very different memory and concurrency systems and have not been well studied. We propose a collection of litmus tests that shed light on interesting visibility and ordering properties. These include classical shared memory consistency model properties, such as coherence and write atomicity, as well as GPU specific properties e.g. memory visibility differences between intra and inter block threads. The results of the litmus tests are determined by feedback from industry experts, the limited documentation available and properties common to all modern multi-core systems. Some of the behaviors remain unresolved. Using the results of the litmus tests, we establish a formal state transition model using intuitive data structures and operations. We implement our model in the Murphi modeling language and verify the initial litmus tests. -
Trivial Meet and Join Within the Lattice of Monotone Triangles John Engbers Marquette University, [email protected]
Marquette University e-Publications@Marquette Mathematics, Statistics and Computer Science Mathematics, Statistics and Computer Science, Faculty Research and Publications Department of 1-1-2014 Trivial Meet and Join within the Lattice of Monotone Triangles John Engbers Marquette University, [email protected] Adam Hammett Bethel College - Mishawaka Published version. Electronic Journal of Combinatorics, Vol. 21, No. 3 (2014). Permalink. © 2014 The Authors. Used with permission. Trivial Meet and Join within the Lattice of Monotone Triangles John Engbers Department of Mathematics, Statistics and Computer Science Marquette University Milwaukee, WI, U.S.A. [email protected] Adam Hammett Department of Mathematical Sciences Bethel College Mishawaka, IN, U.S.A. [email protected] Submitted: Jan 22, 2014; Accepted: Jul 10, 2014; Published: Jul 21, 2014 Mathematics Subject Classifications: 05A05, 05A16, 06A20 Abstract The lattice of monotone triangles (Mn; 6) ordered by entry-wise comparisons is studied. Let τmin denote the unique minimal element in this lattice, and τmax the unique maximum. The number of r-tuples of monotone triangles (τ1; : : : ; τr) with minimal infimum τmin (maximal supremum τmax, resp.) is shown to asymptotically r−1 approach rjMnj as n ! 1. Thus, with high probability this event implies that one of the τi is τmin (τmax, resp.). Higher-order error terms are also discussed. Keywords: monotone triangles; permutations; square ice; alternating sign matri- ces; meet; join 1 Introduction and statement -
On the Coexistence of Shared-Memory and Message-Passing in The
On the Co existence of SharedMemory and MessagePassing in the Programming of Parallel Applications 1 2 J Cordsen and W SchroderPreikschat GMD FIRST Rudower Chaussee D Berlin Germany University of Potsdam Am Neuen Palais D Potsdam Germany Abstract Interop erability in nonsequential applications requires com munication to exchange information using either the sharedmemory or messagepassing paradigm In the past the communication paradigm in use was determined through the architecture of the underlying comput ing platform Sharedmemory computing systems were programmed to use sharedmemory communication whereas distributedmemory archi tectures were running applications communicating via messagepassing Current trends in the architecture of parallel machines are based on sharedmemory and distributedmemory For scalable parallel applica tions in order to maintain transparency and eciency b oth communi cation paradigms have to co exist Users should not b e obliged to know when to use which of the two paradigms On the other hand the user should b e able to exploit either of the paradigms directly in order to achieve the b est p ossible solution The pap er presents the VOTE communication supp ort system VOTE provides co existent implementations of sharedmemory and message passing communication Applications can change the communication paradigm dynamically at runtime thus are able to employ the under lying computing system in the most convenient and applicationoriented way The presented case study and detailed p erformance analysis un derpins the -
Consistency Models • Data-Centric Consistency Models • Client-Centric Consistency Models
Consistency and Replication • Today: – Consistency models • Data-centric consistency models • Client-centric consistency models Computer Science CS677: Distributed OS Lecture 15, page 1 Why replicate? • Data replication: common technique in distributed systems • Reliability – If one replica is unavailable or crashes, use another – Protect against corrupted data • Performance – Scale with size of the distributed system (replicated web servers) – Scale in geographically distributed systems (web proxies) • Key issue: need to maintain consistency of replicated data – If one copy is modified, others become inconsistent Computer Science CS677: Distributed OS Lecture 15, page 2 Object Replication •Approach 1: application is responsible for replication – Application needs to handle consistency issues •Approach 2: system (middleware) handles replication – Consistency issues are handled by the middleware – Simplifies application development but makes object-specific solutions harder Computer Science CS677: Distributed OS Lecture 15, page 3 Replication and Scaling • Replication and caching used for system scalability • Multiple copies: – Improves performance by reducing access latency – But higher network overheads of maintaining consistency – Example: object is replicated N times • Read frequency R, write frequency W • If R<<W, high consistency overhead and wasted messages • Consistency maintenance is itself an issue – What semantics to provide? – Tight consistency requires globally synchronized clocks! • Solution: loosen consistency requirements -
Challenges for the Message Passing Interface in the Petaflops Era
Challenges for the Message Passing Interface in the Petaflops Era William D. Gropp Mathematics and Computer Science www.mcs.anl.gov/~gropp What this Talk is About The title talks about MPI – Because MPI is the dominant parallel programming model in computational science But the issue is really – What are the needs of the parallel software ecosystem? – How does MPI fit into that ecosystem? – What are the missing parts (not just from MPI)? – How can MPI adapt or be replaced in the parallel software ecosystem? – Short version of this talk: • The problem with MPI is not with what it has but with what it is missing Lets start with some history … Argonne National Laboratory 2 Quotes from “System Software and Tools for High Performance Computing Environments” (1993) “The strongest desire expressed by these users was simply to satisfy the urgent need to get applications codes running on parallel machines as quickly as possible” In a list of enabling technologies for mathematical software, “Parallel prefix for arbitrary user-defined associative operations should be supported. Conflicts between system and library (e.g., in message types) should be automatically avoided.” – Note that MPI-1 provided both Immediate Goals for Computing Environments: – Parallel computer support environment – Standards for same – Standard for parallel I/O – Standard for message passing on distributed memory machines “The single greatest hindrance to significant penetration of MPP technology in scientific computing is the absence of common programming interfaces across various parallel computing systems” Argonne National Laboratory 3 Quotes from “Enabling Technologies for Petaflops Computing” (1995): “The software for the current generation of 100 GF machines is not adequate to be scaled to a TF…” “The Petaflops computer is achievable at reasonable cost with technology available in about 20 years [2014].” – (estimated clock speed in 2004 — 700MHz)* “Software technology for MPP’s must evolve new ways to design software that is portable across a wide variety of computer architectures. -
On Comparability of Random Permutations
ON COMPARABILITY OF RANDOM PERMUTATIONS DISSERTATION Presented in Partial Fulfillment of the Requirements for the Degree Doctor of Philosophy in the Graduate School of the Ohio State University By Adam Hammett, B.S. ***** The Ohio State University 2007 Dissertation Committee: Approved by Dr. Boris Pittel, Advisor Dr. Gerald Edgar Advisor Dr. Akos Seress Graduate Program in Mathematics ABSTRACT Two permutations of [n] := {1, 2, . , n} are comparable in the Bruhat order if one can be obtained from the other by a sequence of transpositions decreasing the number of inversions. We show that the total number of pairs of permutations (π, σ) with π ≤ σ is of order (n!)2/n2 at most. Equivalently, if π, σ are chosen uniformly at random and independently of each other, then P (π ≤ σ) is of order n−2 at most. By a direct probabilistic argument we prove P (π ≤ σ) is of order (0.708)n at least, so that there is currently a wide qualitative gap between the upper and lower bounds. Next, emboldened by a connection with Ferrers diagrams and plane partitions implicit in Bressoud’s book [13], we return to the Bruhat order upper bound and show that for n-permutations π1, . , πr selected independently and uniformly at random, −r(r−1) P (π1 ≤ · · · ≤ πr) = O n , thus providing an extension of our result for pairs of permutations to chains of length r > 2. Turning to the related weak order “” – when only adjacent transpositions are ∗ admissible – we use a non-inversion set criterion to prove that Pn := P (π σ) is pn ∗ submultiplicative, thus showing existence of ρ = lim Pn . -
An Overview on Cyclops-64 Architecture - a Status Report on the Programming Model and Software Infrastructure
An Overview on Cyclops-64 Architecture - A Status Report on the Programming Model and Software Infrastructure Guang R. Gao Endowed Distinguished Professor Electrical & Computer Engineering University of Delaware [email protected] 2007/6/14 SOS11-06-2007.ppt 1 Outline • Introduction • Multi-Core Chip Technology • IBM Cyclops-64 Architecture/Software • Cyclops-64 Programming Model and System Software • Future Directions • Summary 2007/6/14 SOS11-06-2007.ppt 2 TIPs of compute power operating on Tera-bytes of data Transistor Growth in the near future Source: Keynote talk in CGO & PPoPP 03/14/07 by Jesse Fang from Intel 2007/6/14 SOS11-06-2007.ppt 3 Outline • Introduction • Multi-Core Chip Technology • IBM Cyclops-64 Architecture/Software • Programming/Compiling for Cyclops-64 • Looking Beyond Cyclops-64 • Summary 2007/6/14 SOS11-06-2007.ppt 4 Two Types of Multi-Core Architecture Trends • Type I: Glue “heavy cores” together with minor changes • Type II: Explore the parallel architecture design space and searching for most suitable chip architecture models. 2007/6/14 SOS11-06-2007.ppt 5 Multi-Core Type II • New factors to be considered –Flops are cheap! –Memory per core is small –Cache-coherence is expensive! –On-chip bandwidth can be enormous! –Examples: Cyclops-64, and others 2007/6/14 SOS11-06-2007.ppt 6 Flops are Cheap! An example to illustrate design tradeoffs: • If fed from small, local register files: 64-bit FP – 3200 GB/s, 10 pJ/op unit – < $1/Gflop (60 mW/Gflop) (drawn to a 64-bit FPU is < 1mm^2 scale) and ~= 50pJ • If fed from global on-chip memory: Can fit over 200 on a chip. -
Constraint Graph Analysis of Multithreaded Programs
Journal of Instruction-Level Parallelism 6 (2004) 1-23 Submitted 10/03; published 4/04 Constraint Graph Analysis of Multithreaded Programs Harold W. Cain [email protected] Computer Sciences Dept., University of Wisconsin 1210 W. Dayton St., Madison, WI 53706 Mikko H. Lipasti [email protected] Dept. of Electrical and Computer Engineering, University of Wisconsin 1415 Engineering Dr., Madison, WI 53706 Ravi Nair [email protected] IBM T.J. Watson Research Laboratory P.O. Box 218, Yorktown Heights, NY 10598 Abstract This paper presents a framework for analyzing the performance of multithreaded programs using a model called a constraint graph. We review previous constraint graph definitions for sequentially consistent systems, and extend these definitions for use in analyzing other memory consistency models. Using this framework, we present two constraint graph analysis case studies using several commercial and scientific workloads running on a full system simulator. The first case study illus- trates how a constraint graph can be used to determine the necessary conditions for implementing a memory consistency model, rather than conservative sufficient conditions. Using this method, we classify coherence misses as either required or unnecessary. We determine that on average over 30% of all load instructions that suffer cache misses due to coherence activity are unnecessarily stalled because the original copy of the cache line could have been used without violating the mem- ory consistency model. Based on this observation, we present a novel delayed consistency imple- mentation that uses stale cache lines when possible. The second case study demonstrates the effects of memory consistency constraints on the fundamental limits of instruction level parallelism, com- pared to previous estimates that did not include multiprocessor constraints. -
A Selection of Maximal Elements Under Non-Transitive Indifferences
Munich Personal RePEc Archive A selection of maximal elements under non-transitive indifferences Alcantud, José Carlos R. and Bosi, Gianni and Zuanon, Magalì Universidad de Salamanca, University of Trieste, University of Brescia 4 August 2009 Online at https://mpra.ub.uni-muenchen.de/16601/ MPRA Paper No. 16601, posted 10 Aug 2009 08:03 UTC A selection of maximal elements under non-transitive indifferences Jos´eCarlos R. Alcantud ∗,1 Facultad de Econom´ıay Empresa, Universidad de Salamanca, E 37008 Salamanca, Spain Gianni Bosi Facolt`adi Economia, Universit`adegli Studi di Trieste, Piazzale Europa 1, 34127 Trieste, Italy Magal`ıZuanon Facolt`adi Economia, Universit`adegli Studi di Brescia, Contrada Santa Chiara 50, 25122 Brescia, Italy Abstract In this work we are concerned with maximality issues under intransitivity of the indifference. Our approach relies on the analysis of “undominated maximals” (cf., Peris and Subiza [7]). Provided that an agent’s binary relation is acyclic, this is a selection of its maximal elements that can always be done when the set of alterna- tives is finite. In the case of semiorders, proceeding in this way is the same as using Luce’s selected maximals. We put forward a sufficient condition for the existence of undominated maximals for interval orders without any cardinality restriction. Its application to certain type of continuous semiorders is very intuitive and accommodates the well-known “sugar example” by Luce. Key words: Maximal element, Selection of maximals, Acyclicity, Interval order, Semiorder JEL Classification: D11. Preprint submitted to Elsevier August 4, 2009 1 Introduction Even though there are arguments to ensure the existence of maximal elements for binary relations in very general settings, this concept does not always explain choice under non-transitive indifference well. -
Generalized Quotients in Coxeter Groups
TRANSACTIONS OF THE AMERICAN MATHEMATICAL SOCIETY Volume 308, Number 1, July 1988 GENERALIZED QUOTIENTS IN COXETER GROUPS ANDERS BJORNER AND MICHELLE L. WACHS ABSTRACT. For (W, S) a Coxeter group, we study sets of the form W/V = {w e W | l{wv) = l(w) + l(v) for all v e V}, where V C W. Such sets W/V, here called generalized quotients, are shown to have much of the rich combinatorial structure under Bruhat order that has previously been known only for the case when VCS (i.e., for minimal coset representatives modulo a parabolic subgroup). We show that Bruhat intervals in W/V, for general V C W, are lexicographically shellable. The Mobius function on W/V under Bruhat order takes values in { —1,0, +1}. For finite groups W, generalized quotients are the same thing as lower intervals in the weak order. This is, however, in general not true. Connections with the weak order are explored and it is shown that W/V is always a complete meet-semilattice and a convex order ideal as a subset of W under weak order. Descent classes Dj = {w e W \ l{ws) < l(w) o s 6 I, for all s G S}, I C S, are also analyzed using generalized quotients. It is shown that each descent class, as a poset under Bruhat order or weak order, is isomorphic to a generalized quotient under the corresponding ordering. The latter half of the paper is devoted to the symmetric group and to the study of some specific examples of generalized quotients which arise in combinatorics.