高级计算机体系结构设计及其在数据中心和云计算的应用Lecture 4Memory Data Prefetching
高级计算机体系结构设计及其在数据中心和云计算的应 用 Lecture 4 Memory Data Prefetching
高级计算机体系结构设计及其在数据中心和云计算的应用Prefetching (1/3)Fetch block ahead of demandTarget compulsory, capacity, (& coherence) misses- Why not conflict?· Big challenges:- Knowing"what"to fetch·Fetchinguselessblockswastesresources-Knowing"when"to fetch. Too early → clutters storage (or gets thrown out before use).Fetching too late →>defeats purpose of"pre"-fetching
高级计算机体系结构设计及其在数据中心和云计算的应 用 Prefetching (1/3) • Fetch block ahead of demand • Target compulsory, capacity, (& coherence) misses – Why not conflict? • Big challenges: – Knowing “what” to fetch • Fetching useless blocks wastes resources – Knowing “when” to fetch • Too early clutters storage (or gets thrown out before use) • Fetching too late defeats purpose of “pre”-fetching
高级计算机体系结构设计及其在数据中心和云计算的应用Prefetching (2/3)Withoutprefetching:LL2DRAMLoadDataTotal Load-to-Use LatencytimeWith prefetching:PrefetchDataLoadMuchimprovedLoad-to-UseLatencyOr:DataPrefetchLoadSomewhat improved LatencyPrefetchingmust be accurate and timely
高级计算机体系结构设计及其在数据中心和云计算的应 用 • Without prefetching: • With prefetching: • Or: Prefetch Prefetch Prefetching (2/3) Load L1 L2 Data DRAM Total Load-to-Use Latency Load Data Much improved Load-to-Use Latency Somewhat improved Latency Load Data Prefetching must be accurate and timely time
高级计算机体系结构设计及其在数据中心和云计算的应用Prefetching (3/3)Without prefetchingAARunWithprefetching:LoadtimePrefetchingremovesloadsfromcritical path
高级计算机体系结构设计及其在数据中心和云计算的应 用 Prefetching (3/3) • Without prefetching: • With prefetching: Run Load time Prefetching removes loads from critical path
高级计算机体系结构设计及其在数据中心和云计算的应用Common"Types" of PrefetchingSoftwareNext-Line, Adjacent-LineNext-N-LineStreamBuffers Stride"Localized" (e.g., PC-based)Pointer Correlation
高级计算机体系结构设计及其在数据中心和云计算的应 用 Common “Types” of Prefetching • Software • Next-Line, Adjacent-Line • Next-N-Line • Stream Buffers • Stride • “Localized” (e.g., PC-based) • Pointer • Correlation