Multi-Strided Access Patterns to Boost Hardware Prefetching

Open Access
Authors
Publication date 2025
Book title ICPE '25
Book subtitle Proceedings of the 16th ACM/SPEC International Conference on Performance Engineering : May 5-9, 2025, Toronto, Canada
ISBN (electronic)
  • 9798400710735
Event 16th ACM/SPEC International Conference on Performance, ICPE 2025
Pages (from-to) 204-215
Number of pages 12
Publisher New York, NY: Association for Computing Machinery
Organisations
  • Faculty of Science (FNWI) - Informatics Institute (IVI)
Abstract

Important memory-bound kernels, such as linear algebra, convolutions, and stencils, rely on SIMD instructions as well as optimizations targeting improved vectorized data traversal and data re-use to attain satisfactory performance. On contemporary CPU architectures, the hardware prefetcher is of key importance for efficient utilization of the memory hierarchy. In this paper, we demonstrate that transforming a memory access pattern consisting of a single stride to one that concurrently accesses multiple strides, can boost the utilization of the hardware prefetcher, and in turn improves the performance of memory-bound kernels significantly. Using a set of micro-benchmarks, we establish that accessing memory in a multi-strided manner enables more cache lines to be concurrently brought into the cache, resulting in improved cache hit ratios and higher effective memory bandwidth without the introduction of costly software prefetch instructions. Subsequently, we show that multi-strided variants of a collection of six memory-bound dense compute kernels outperform state-of-the-art counterparts on three different micro-architectures. More specifically, for kernels among which Matrix Vector Multiplication, Convolution Stencil and kernels from PolyBench, we achieve significant speedups of up to 12.55x over Polly, 2.99x over MKL, 1.98x over OpenBLAS, 1.08x over Halide and 1.87x over OpenCV. The code transformation to take advantage of multi-strided memory access is a natural extension of the loop unroll and loop interchange techniques, allowing this method to be incorporated into compiler pipelines in the future.

Document type Conference contribution
Language English
Published at https://doi.org/10.1145/3676151.3719375
Other links https://www.scopus.com/pages/publications/105007294807
Downloads
3676151.3719375 (Final published version)
Permalink to this page
Back