Cache Access Latency

Download Report

Transcript Cache Access Latency

コンピュータ・アーキテクチャ特論
第3回 演習の内容
九州大学大学院システム情報科学研究院
村上和彰、井上弘士
講義用ホームページのお知らせ
講義スライド、実験演習で必要な情報、などを公開しています。
http://www.c.csce.kyushu-u.ac.jp/lecture2010/aca/index.html
実験環境
本日の演習
Application
Application
program
program
キャッシュメモリ特性の解析
(CACTI)
•キャッシュ容量 vs キャッシュヒット時間
•キャッシュ連想度 vs キャッシュヒット時間
アプリケーション特性の解析
(M5)
•並列性
•パーフェクトL1キャッシュを前提
•コア数 vs. 実行時間tion Time
•L1/L2キャッシュミス
•キャッシュサイズ vs ミス率
Application
Application •連想度 vs ミス率
program
program
マルチコア
アーキテク
チャの検討
性能評価
(M5)
CACTIとは?
• HP Lab.で開発
• キャッシュメモリのアクセス時間、サイクル時
間、面積、消費電力などの見積りツール
• Webベースで使用可能(C++のソースコードも
無料で入手可能)
– Web “http://quid.hpl.hp.com:9081/cacti/”
• 詳細は以下を参照
– “http://www.hpl.hp.com/research/cacti/”
実験環境
本日の演習
Application
Application
program
program
キャッシュメモリ特性の解析
(CACTI)
•キャッシュ容量 vs キャッシュヒット時間
•キャッシュ連想度 vs キャッシュヒット時間
アプリケーション特性の解析
(M5)
•並列性
•パーフェクトL1キャッシュを前提
•コア数 vs. 実行時間tion Time
•L1/L2キャッシュミス
•キャッシュサイズ vs ミス率
Application
Application •連想度 vs ミス率
program
program
マルチコア
アーキテク
チャの検討
性能評価
(M5)
“M5”とは?
Benchmark Program
(SPEC, NAS para)
Config. file
・・・
#of cores = 3
cache size = 32KB
cache latency = 3cc
Mem latency =
300cc ・・・
Results
・・・
IPC = 4.2
L1 miss rate = 3%
cycle count = 4M
・・・
Target OS
Simulator
(Target machine)
CPU
I/O
Cache
Bus
・・・
OS (Host)
Trace Data
Machine(Host)
プログラム実行時間の算出方法
Example of Multi-Core Configuration
CPU
core
CPU
core
2KB
L1
2KB
L1
Parameter
Value
#of Cores
2
L1 Data Cache
Shared 512 KB
L2 Cache
(16 BCEs)
L2 Shared
Cache
Main Memory
Size
2 KB
Associativity
1
Block Size
32 B (Fix)
Latency
?? (from CACTI)
Type
Shared
Size
512 KB
Associativity
4
Block Size
32 B (Fix)
Latency
?? (from CACTI)
Latency
300 Clock Cycles (Fix)
8
Step1 (Use CACTI)
Measure Cache Access Latency
L1
2048
32 (Fix)
1
1 (Fix)
65 (Fix)
Parameter
Value
#of Cores
2
L1 Data Cache
Cache Access
Latency
L2
524288
32 (Fix)
4
1 (Fix)
65 (Fix)
L2 Shared
Cache
Main Memory
Size
2 KB
Associativity
1
Block Size
32 B (Fix)
Latency
?? (from CACTI)
Type
Shared
Size
512 KB
Associativity
4
Block Size
32 B (Fix)
Latency
?? (from CACTI)
Latency
300 Clock Cycles (Fix)
9
Step2 (Use M5)
Measure #of Clock Cycles for Execution
• See “splash2の実行” in M5 install-man page
1. Download Splash-2 Benchmark
2. Download “run.py” (overwrite m5-stable/configs/splash2/run.py)
3. Execute a program and check sim-result (m5stats.txt)
Command-Line
Program Results
Config. File
#Cores
Bench.
Shared
>../build/ALPHA_SE/m5.fast -d output ../configs/splash2/run.py –n 2 -b Cholesky --l2shared
--l1size=2kB --l1assoc=1 --l1latency=1 --l2size=512kB --l2assoc=4 --l2latency=4 --memlatency=300
L1 Dcache
size
L1 Dcache
Associativity
L1 Dcache
Latency
L2 Shared
Cache Size
Fix
Other Parameters
L2 Shared
Cache
Associativity
Ceil (
L2 Shared
Cache
Latency
L2 Access Latency
L1 Access Latency
Main-Memory
Access Latency
)
See “run.py” file (parser.add_option)
10
Step3
Obtain Program Execution Time (ET)
• ET = #of clock cycles X clock-cycle Time
From M5
From CACTI
(L1 Cache Access Time)
m5stats.txt
sim_freq
sim_insts
sim_seconds
sim_ticks
1000000000000
1471881
0.001553
1552729000
CACTI
11
キャッシュ性能の解析
CACTI Web
本演習では「32」に固定
本演習では「1」に固定
本演習では「65」に固定
Cache Hit Time
Cache Access Time Analysis
• Use CACTI
• Measure cache access time of each organization
• Discuss the impact of cache size and assiciativity
Size
2 KB
4 KB
8 KB
Associativity
1
2
4
8
1
2
4
8
1
2
4
8
Access Time
??
??
??
??
??
??
??
??
??
??
??
??
Size
128 KB
256 KB
512 KB
Associativity
1
2
4
8
1
2
4
8
1
2
4
8
Access Time
??
??
??
??
??
??
??
??
??
??
??
??
14
Cache Hit Rate (or Miss Rate) Analysis
• Execute your target benchmark programs with
various L1/L2 cache sizes and associativities
– You can change each parameter in order to evaluate
cache hit rates
– *)L2 cache hit rates depend on L1 cache hit rates
Command-Line
Program Results
Config. File
#Cores
Bench.
Shared
>../build/ALPHA_SE/m5.fast -d output ../configs/splash2/run.py -n 8 -b Cholesky --l2shared
--l1size=2kB --l1assoc=1 --l1latency=1 --l2size=512kB --l2assoc=4 --l2latency=4 --memlatency=300
L1 Dcache
size
L1 Dcache
Associativity
L1 Dcache
Latency
L2 Shared
Cache Size
L2 Shared
Cache
Associativity
L2 Shared
Cache
Latency
Main-Memory
Access Latency
Parameters for L1 DCache
Parameters for L2 Unified Cache
15
M5によるプログラム実行
(講義ホームページを参照)