Relaxed Consistency models and software distributed memory Computer Architecture Textbook pp. 79-83.

Slides:



Advertisements
Similar presentations
SPIN. Seach Optimization Exhaustive search requires so much time and memory to perform verification realistically, must perform some shortcuts –reduce.
Advertisements

SPSSによるHosmer-Lemeshow検定について
確率と統計 - 確率2回目 - 平成 18 年 11 月 1 日. 2 今日の内容 1. 確率の復習(再整理) 2. 加法の定理 3. 乗法の定理へのイントロ.
レポート書き方. おしいレポート よく調べてある それぞれの、1文の言っていることは正 しい しかし、全体として、何が言いた いのかわからない 内容の重要だが、全体の構成も重 要である.
東京工科大学 コンピュータサイエンス 亀田弘之
7.n次の行列式   一般的な(n次の)行列式の定義には、数学的な概念がいろいろ必要である。まずそれらを順に見ていく。
9.線形写像.
学生の携帯電話選択理由 岡田隆太.
3.多項式計算アルゴリズム べき乗の計算 多項式の計算.
時間的に変化する信号. 普通の正弦波 は豊富な情報を含んでいません これだけではラジオのような複雑な情報 を送れない 振幅 a あるいは角速度 ω を時間的に変化 させて情報を送る.
5.連立一次方程式.
相関.
音当て Game 時田 大樹 飛山 雄太郎. 作品の目的 入力として、スイッチを押すと音がスピー カーから流れ、スイッチを離すと、音が止 まる仕組みとなっている。
―本日の講義― ・平均と分散 -代表値 -ぱらつき(分散・標準偏差等) ・Excelによる演習
この資料は、情報工学レクチャーシリーズ オペレー ティングシステム 松尾啓志 著(森北出版株式会 社)を用いて授業を行うために、名古屋工業大学松 尾啓志、津邑公暁が作成しました。 パワーポイント2007で最終版として保存しているため、変更はできませ
広告付き価格サービ ス 小園一正. はじめに 世の中には様々な表現方法の広告があり ます。その中でも私たち学生にとって身 近にあるものを広告媒体として取り入れ られている。 価格サービス(無料配布のルーズリー フ)を体験したことにより興味を惹かれ るきっかけとなった。主な目的は、これ.
素数判定法 2011/6/20.
フーリエ係数の性質. どこまで足す? 理想的には無限大であるが、実際に はそれは出来ない これをフーリエ解析してみる.
公開鍵暗号系 2011/05/09.
1章 行列と行列式.
本宮市立白岩小学校. 1 はじめに 2 家庭学習プログラム開発の視点 ① 先行学習(予習)を生かした 確かな学力を形成する授業づく り ② 家庭との連携を図った家庭学習の習慣化.
フーリエ級数. 一般的な波はこのように表せる a,b をフーリエ級数とい う 比率:
3.エントロピーの性質と各種情報量.
Excelによる積分.
1 6.低次の行列式とその応用. 2 行列式とは 行列式とは、正方行列の特徴を表す一つのスカ ラーである。すなわち、行列式は正方行列からスカ ラーに写す写像の一種とみなすこともできる。 正方行列 スカラー(実数) の行列に対する行列式を、 次の行列式という。 行列 の行列式を とも表す。 行列式と行列の記号.
計算のスピードアップ コンピュータでも、sin、cosの計算は大変です 足し算、引き算、掛け算、割り算は早いです
線形符号(10章).
1 0章 数学基礎. 2 ( 定義)集合 集合については、 3セメスタ開講の「離散数学」で詳しく扱う。 集合 大学では、高校より厳密に議論を行う。そのために、議論の 対象を明確にする必要がある。 ある “ もの ” (基本的な対象、概念)の集まりを、 集合という。 集合に含まれる “ もの ” を、集合の要素または元という。
複素数.
4.プッシュダウンオートマトンと 文脈自由文法の等価性
1 0章 数学基礎. 2 ( 定義)集合 集合については、 3セメスタ開講の「離散数学」で詳しく扱う。 集合 大学では、高校より厳密に議論を行う。そのために、議論の 対象を明確にする必要がある。 ある “ もの ” (基本的な対象、概念)の集まりを、 集合という。 集合に含まれる “ もの ” を、集合の要素または元という。
信号測定. 正弦波 多くの場合正弦波は 0V の上下で振動する しかし、これでは AD 変換器に入れら れないので、オフ セットを調整して データを取った.
1 9.線形写像. 2 ここでは、行列の積によって、写像を 定義できることをみていく。 また、行列の積によって定義される写 像の性質を調べていく。
通信路(7章).
3.プッシュダウンオートマトンと 文脈自由文法
6.符号化法(6章).
ビット. 十進数と二進数 十進数  0から9までの数字を使って 0、1、2、3、4、5、6、7、8、9、 10、11、12 と数える 二進数  0と1を使って 0、1、10、11、100、101、11 0、111 と数える.
3.正方行列(単位行列、逆行列、対称行列、交代行列)
1 オペレーティングシステム #11 この資料は、情報工学レクチャーシリーズ オペ レーティングシステム 松尾啓志 著(森北出版 株式会社)を用いて授業を行うために、名古屋工 業大学松尾啓志、津邑公暁が作成しました。 パワーポイント 2007 で最終版として保存しているため、変更はで きませんが、授業でお使いなる場合は松尾.
論理回路 第1回. 今日の内容 論理回路とは? 本講義の位置づけ,達成目標 講義スケジュールと内容 受講時の注意事項 成績の評価方法.
Three-Year Course Orientation International Course.
JPN 311: Conversation and Composition 許可 (permission)
地図に親しむ 「しゅくしゃくのちがう 地図を 使ってきょりを調べよ う1」 小学4年 社会. 山口駅裁判所 県立 美術館 サビエル 記念聖堂 山口市役所 地図で探そう 市民会館 県立 図書館.
方程式を「算木」で 解いてみよう! 愛媛大学 教育学部 平田 浩一.
C言語応用 構造体.
3.多項式計算アルゴリズム べき乗の計算 多項式の計算.
Automatic Language Acquisition, an Interactive Approach † Robert J. Martin † 大西昇 ‡ 山村毅 † 名古屋大学 ‡ 愛知県立大学.
JPN 312 (Fall 2007): Conversation and Composition 文句 ( もんく ) を言う.
HKS Analysis Log Jul 2006 Part1 D.Kawama. 第壱部 HKS Sieve Slit Analysis.
1 プログラミング言語論 第13回 プログラムの意味論と検証 (2) 表示的意味論 担当:犬塚. 2 表示的意味論 denotational semantics  表示的意味論では、プログラムの要素とそれが 意味するものを対応付ける。 変数 式 文 A B … A+2 2B+C A:=A+2 if.
プログラミングⅠ( 2 組) 第 1 回 / pLB1.pptx.
「ネット社会の歩き方」レッスンキット プレゼンテーション資料集 15. チャットで個人情報は 言わない プレゼンテーション資料 著作権は独立行政法人情報処理推進機構( IPA )及び経済産業省に帰属します。
8.任意のデータ構造 (グラフの表現とアルゴリズム)
NODA Ken, KAJITA Satoshi and SASA Yoshinobu Truss Contest 2004 idea 男がこう言っ た。 「デザインにこだわろう。」 現場が一瞬凍りついた。 男はこう続けた。 「記録に残るだけではだめだ、記憶に残さなくて は。」 現場がひとつになった。
第14回 プログラムの意味論と検証(3) 不動点意味論 担当:犬塚
実験5 規則波 C0XXXX 石黒 ○○ C0XXXX 杉浦 ○○ C0XXXX 大杉 ○○ C0XXXX 高柳 ○○ C0XXXX 岡田 ○○ C0XXXX 藤江 ○○ C0XXXX 尾形 ○○ C0XXXX 足立 ○○
ネットワークの基礎技術と TCP/IP 曹 暁達 ( そう ぎょうたつ ) 国際産業情報学科 2 年 10 月 28 日.
ことばとコンピュータ 2007 年度 1 学期 第 1 回. 2 ことばとコンピュータ 授業科目名:言語情報処理論 授業題目名:ことばとコンピュータ 履修コード: 5067 教室: 323 一学期開講 授業の進め方 – 基本的に講義中心ですすめ,時々コンピュー タを使う.
携帯電話でのコミュニ ケーションについて 1班真田 出水 佐伯 堺. 仮説  女性のほうが携帯電話を使ったコミュニ ケーションを重要視する。
小島 肇  Windows ではアンチウイルスソフトウェアは 必須だが、「入れれば安心」というものでは ない  Mac, Linux における費用対効果はかなり低い  現時点ではマルウェアは流行っていないから  Windows を併用している場合は別.
音の変化を視覚化する サウンドプレイヤーの作成
HCC Hair Color Change. メンバー ソ 渋谷麻美 ソ 渋谷麻美 ソ 清野理衣子 ソ 清野理衣子 ソ 三上貴大 ソ 三上貴大.
1 オペレーティングシステム #7 計算機工学 III オペレーティングシステム #7 主記憶管理:主記憶管理基礎 2006/05/26 津邑 公暁.
本文. 考えながら読みましょ う 「いろいろなこと」( 3 行目)は何で すか 「①電話料金はコンビニで支払いをしていま す。いつでも払えますから、便利です。」 「②夕食はコンビニで買います。お弁当やお かずがいろいろありますから。」今、若者に 人気のあるコンビニは、いろいろなことをす るのに非常に便利な場所になった。
たくさんの人がいっしょに乗れる乗り物を 「公共交通」といいます バスや電車 と 自動車 の よいところ と よくない ところ よいところ と よくない ところ を考えてみよう!
Snoop cache AMANO, Hideharu, Keio University . ics . keio . ac . jp Textbook pp
英語勉強会 名手⇒詫間 2015/10/22. 原文 This study says acquiring motor skills support system. There is how to acquire moor skills that coach advises learner. Motor.
Relaxed Consistency models and software distributed memory
地球儀と様々な地図. 1 球体としての地球 こうした現象はあることをイ メージすると理解できる。
Ask Have ~ ? / How long ~ ? Answer these questions
Presentation transcript:

Relaxed Consistency models and software distributed memory Computer Architecture Textbook pp. 79-83

Memory Consistency maintenance on CC-NUMA A lot of messages are required when cache is miss-hit. When the cache data are updated, especially a lot of messages are required. Are acknowledge messages always required ? Relaxed Consistency Model

Cache coherent control ( Node 3 writes ) Node 1 Node 2 Node 3 Node 0 S S Write request Invalidation Ack D S Write D Ack → I→ I 11 0 Acknowledge messages are needed to keep the order of data update. However, synchronization is required for data interchange.

Sequential Consistency Both L1 and L2 are never established. Reads and writes are instantly reflected to the memory in order. P1:A=0; A=1; L1: if(B==0) … P2:B=0; B=1; L2: if(A==0) …

Sequential Consistency is not kept because of the delay. Thus, sequential consistency requires immediate update of shared memory or acknowledge messages. P1:A=0; A=1; L1: if(B==0) … P2:B=0; B=1; L2: if(A==0) …

Sequential Consistency Write(A) Read (B) SYNC Write(C) Read(D) SYNC Write(E) Write(F)

Total Store Ordering Read requests can be executed before pre- issued writes to other address in the write buffer. R→R R→W W→W W→R → shows the order which must be kept. Used in common processors. From the era of IBM370 Of course, the written data is not directly read out.

Total Store Ordering CPU Cache Read Write Buffer Read from difference address should be done earlier than the previous write → For avoiding interlock by the data dependency Coherence defines the behavior of reads and writes to the same memory location, while Consistency defines the behavior of reads and writes with respect to accesses to other memory location. Today, the consistency is treated.

Total Store Ordering Write(A) Read (B) SYNC Read(C) Write(D) SYNC Write(E) Write(F) Order which must be kept

Partial Store Ordering The order of multiple writes are not kept. R→R R→W W→W W→R Synchronization is required to guarantee the finish of writes Used in SPARC Sometimes, it is called ‘Processor Ordering’.

Partial Store Ordering Write(A) Read (B) SYNC Read(C) Write(D) SYNC Write(E) Write(F)

Partial Store Ordering CPU Cache Read Write Buffer CPU Cache Read Write Buffer Network Partial Store Ordering is a natural model for distributed memory systems

Wake up exercise Which order should be kept in the following access sequence when TSO and PSO are applied respectively. Write A Read B Write C Write D Read E Write F

Weak Ordering All orders of memory accesses are not guaranteed. R→R R→W W→W W→R All memory accesses are finished before synchronization. The next accesses are not started before the end of synchronization. Used in PowerPC

Weak Ordering Write(A) Read (B) SYNC Read(C) Write(D) SYNC Write(E) Write(F)

For further performance improvement Synchronization operation is divided into Acquire and Release. The restriction is further relaxed by division of synchronization operation. Release Consistency

・ Synchronization operation is divided into acquire(read) and release(write) ・ All memory accesses following acquire ( SA) are not executed until SA is finished. ・ All memory accesses must be executed before release ( SR) is finished. ・ Synchronization operations must satisfy sequential consistency (RCsc) ・ Used in a lot of CC-NUMA machines ( DASH,ORIGIN )

Release Consistency SA→W SA→R W→SA R→SA SR→W SR→R W→SR R→SR The order of SA and SR must be kept.

Release Consistency Write(A) Read (B) SYNC A Write(C) Read(D) SYNC R Write(E) Write(F)

Overlap of critical section with Release Consistency acquire release Load/Store acquire release Load/Store acquire release Load/Store acquire release Load/Store (RCpc) ・ The overlapped execution of critical sections is allowed.

Implementation of Weak Consistency Write requests are not needed to wait for acknowledge packets. Reads can override packets in Write buffer. The order of Writes are not needed to be kept. The order of Reads are not needed to be kept. Before synchronization, Memory fence operation is issued, and waits for finish of all accesses.

Weak/Release consistency model vs. PSO/TSO + extension of speculative execution Speculative execution  The execution is cancelled when branch mis- prediction occurs or exceptions are requested.  Most of recent high-end processor with dynamic scheduling provides the mechanism. If there are unsynchronized accesses that actually cause a race, it is triggered. The performance of PSO/TSO with speculative execution is comparable to that with weak/release consistency model.

Glossary 1 Consistency Model: Consistency は一貫性のことで、 Snoop Cache の所で出てきたが、異なったアドレスに対して考える場合 に使う言葉。一方、 Coherence は同じアドレスに対して考える場 合に用いる。 Sequential Consistency model: 最も厳しいモデル、全アクセス の順序が保証される Relaxed Consistency model:Sequential Consistecy model が厳し いすぎるので、これを緩めたモデル TSO(Total Store Ordering): 書き込みの全順序を保証するモデル PSO(Partial Store Ordering): 書き込みの順序を同期、読み出しが 出てくる場合のみ保証するモデル Weak Consistency 弱い一貫性、同期のときのみ一貫性が保証 される Release Consistency 同期のリリース時にのみ一般性が保証さ れる。 Acquire (獲得)がロック、 Release (解放)がアンロッ ク Synchronization, Critical Section :同期、際どい領域

Software distributed shared memory (Virtual shared memory) The virtual memory management mechanism is used for shared memory management  IVY (U.of Irvine), TreadMark(Wisconsin U.) The unit of management is a page (i.e. 4KB for example) Single Writer Protocol vs. Multiple-Writer Protocol Widely used in Simple NUMAs, NORAs or PC-clusters without hardware shared memory

A simple example of software shared memory Data Read PC A PC B Shared Page Page Fault! Home PC Interrupt !

Representative Software DSMs NameUniversitySW/MWConsistency model IVYUniv.IrvineSWSequential CVSUniv. of MarylandSWLazy release TreadMarksWashington Univ.MWLazy release MuninRice Univ.MWEager release MidwayCMUMWEntry JIAJIAChinese Academy of Science MWScope Whether the copies are allowed for multiple writers The timing to send the messages

Extended relaxed consistency model In CC-NUMA machines, further performance improvement is difficult by extended relaxed model. Extended models are required for Software distributed model used in PC clusters.  Eager Release Consistency  Lazy Release Consistency  Entry Release Consistency

Eager Release Consistency (1) p1 p2 w(x)w(y)w(z)rel ・ In release consistency, write messages are sent immediately. xy z

p1 p2 w(x)w(y)w(z)rel x,y,z ・ In eager release consistency, a merged message is sent when the lock is released. Eager Release Consistency (1)

Single Writer Protocol Data Write PC APC B Shared Page Data Read Request Write back request Write back Host PC Only one writer is allowed W PC A W PC A,B

Eager Release Consistency (2) ・ In Multiple-Writer Protocol, only difference is sent when released. p1 p2 w(x) w(y) acq rel Page updated y updated x diff

Multiple Writers protocol Write data PC A PC B Twin Shared Page Twin memory is allocated when target page is fetched. Host PC

Multiple Writers protocol PC A PC B Twin Shared Page Host PC

Multiple writers protocol PC APC B Twin Shared page Only difference with twin is written back → Eager Release Consistency Sync. Write back request HOST PC

p1 p2 p3 p4 acq r(x) w(x) rel acq w(x) rel ・ eager release consistency updates all caches Lazy Release Consistency

p1 p2 p3 p4 w(x) rel r(x) ・ eager release consistency updates all caches ・ lazy release consistency only updates cache which executes acquire Lazy Release Consistency acq

Entry Release Consistency (1) ・ shared data and synchronization objects are associated ・ executes acquire or release on a synchronization object →Only guarantees consistency of the target shared data ・ by caching synchronization object, the speed of entering a critical section is enhanced (Only for the same processor) ・ cache miss will be reduced by associating synchronization object and corresponding shared data.

Entry Release Consistency (2) p1 p2 w(x)acq Srel S ・ synchronization object S ⇔ shared data x,y acq Sw(x)r(y)rel S S, x,y p3 ・ synchronization object R ⇔ shared data z w(z)acq Rrel Rw(z)acq Rrel R

Summary ・ Researches on relaxed consistency models are almost closing: Further relax is difficult. The impact on the performance becomes small. Speculative execution with PSO/TSO might be a better solution. Software DSM approach is practical.

Glossary 2 Virtual Shared Memory: 仮想共有メモリ、仮想記憶機構を利用 してページ単位でソフトウェアを用いて共有メモリを実現する 方法。 Single Writer Protocol は、従来のメモリの一貫性を取る方 法と同じものを用いるが、 Multiple Writers Protocol は Twin( 双 子のコピー)を用いて Difference( 差分)のみを送ることで効率化 を図る。 IVY,TreadMark,JiaJia などはこの分散共有メモリのシス テム名である。 Eager Release consistency: Eager は熱心な、積極的なという意 味で、更新を一度に行うことから(だと思う) Lazy Release consistency: Lazy はだらけた、という意味で、 必要なところだけ更新を行うことから出ているが、 Eager に合わ せたネーミングだと思う。 Entry Release consistency: Entry 単位で consistency を維持するこ とから出たネーミングだと思う。

Exercise Which order should be kept in the following access sequence when TSO,PSO and WO are applied respectively. SYNC Write Read SYNC Read Write SYNC