24
Prefetch and Cache in PLDI'02 Dynamic Hot Data Stream Prefetching... プロファイリングとHot Data Streamの解析に基づくダイ ナミックプリフェッチング手法の提案 Efficient Discovery of Regular Stride... Irregularなload命令のストライドパタンの発見 Static Load Classification for... load命令を20種に分類。Load-value predictionの利用 をコンパイル時に決定する

Pldir 0630

Embed Size (px)

Citation preview

Page 1: Pldir 0630

Prefetch and Cache in PLDI'02

● Dynamic Hot Data Stream Prefetching...● プロファイリングとHot Data Streamの解析に基づくダイ

ナミックプリフェッチング手法の提案

● Efficient Discovery of Regular Stride...● Irregularなload命令のストライドパタンの発見

● Static Load Classification for...● load命令を20種に分類。Load-value predictionの利用

をコンパイル時に決定する

Page 2: Pldir 0630

読んだ人 みよし たけふみ2010.06.30

CITED BY 40

Page 3: Pldir 0630

概要

● プリフェッチは限られた場所でしか有効ではない● ダイナミックプリフェッチングの提案

● Temporal data reference profile● Extract hot data stream● With the added prefetch inst(no profiler, analyzer)

● Improvement 5-19% speedup

Page 4: Pldir 0630

Overview

Page 5: Pldir 0630

Data Refs. Profiling and Analysis

● Bursty Tracing Framework for Low-over-head Temporal Profiling● Not only the freq., but also temporal relationships

eg. cdeabcdeabfgとabcdefabcdeg● Extensions for Online Optimization● Fast Hot Data Stream Detection

Page 6: Pldir 0630

Bursty Tracing Framework[15] forLow-overhead temporal profiling

2つのバージョンを用意 nCheckとnInstで実行コードを選択Vulcanでバイナリ変換してチェックコード等を挿入

Page 7: Pldir 0630

Extensions for Online Optilization

Page 8: Pldir 0630

Fast Hot Data Stream Detection(1)

= to compress the profile and infer its hierarchical structure. [23]

Page 9: Pldir 0630

Fast Hot Data Stream Detection(2)

v.heat = v.length*v.frequencyA.heat = wA.length*A.coldUses

Page 10: Pldir 0630

Overhead of profiling and analysis

Page 11: Pldir 0630

Dynamic Prefetching

● Generating Detection and Prefetching Code● Injecting Detection and Prefetching Code

Page 12: Pldir 0630

Generating Detection and Prefetching Code

Hot data stream v = v1v2...v{v.length} into a head v.head = v1v2...vheadLenand a tail v.tail = v{headLen+1}v{headLen+2}...v{v.length}.

Page 13: Pldir 0630
Page 14: Pldir 0630

Performance impact

Page 15: Pldir 0630
Page 16: Pldir 0630

読んだ人 みよし たけふみ2010.06.30

CITED BY 18

Page 17: Pldir 0630

概要

● Irregular data referencesのプリフェッチは難しい● 重要なIrregularなload命令はストライドアクセスパタン

をもっている(ようだ)

● ストライド付きload命令を発見するプロファイル手法● ストライド情報のプロファイルをedge frequencyなプロファイ

ラに組み込む● 17%の速度低下

● 181.mcf: 1.59x, 254.gap: 1.14x などなど

Page 18: Pldir 0630

読んだ人 みよし たけふみ2010.06.30

CITED BY 2

Page 19: Pldir 0630

概要

● Load-value prediction[20] : loadの結果を推測する● Load-value predictionの有効利用には、キャッシュミス

し正しく予測されるloadにSpeculationが限られる● 従来: Hardware-/Profile-based method

● コンパイル時にSpeculationの決定を行う● コンパイラによるloadの分類手法● CとJavaで効果を評価

[20] M. H. Lipasti, C. B. Wilkerson, and J. P. Shen. Value Locality and Load Value Prediction. In Proceedings ofthe second international conference on architectural support for programming languages and operatingsystems, pages 138–147, 1996.

Page 20: Pldir 0630

もう少し詳しい概要

● Load命令を静的に20種に分類● Region: Stack, Heap, Global space● Kind: object Field, Array element, Scalar variable● Type: Pointer, Non-pointer

● 16K, 64K, 256Kの2-way set-associative cache● 5 load-value predictors, 2048/infinite entries

(i) lv, which predicts the last value for every load(ii) l4v, which predicts one of the last four values for every load(iii) st2d, which uses strides to predict loads(iv) fcm, which uses a representation of the context of preceding loads to predict a load(v) dfcm, which enhances fcm with strides.

Page 21: Pldir 0630
Page 22: Pldir 0630

種類別キャッシュミス率

Page 23: Pldir 0630

Predictionの成功率

Page 24: Pldir 0630