Exact analysis of the cache behavior of nested loops
The DOI matches its Crossref record; 41 of the 41 references it cites were found in a registry or an index.
Abstract
We develop from first principles an exact model of the behavior of loop nests executing in a memory hicrarchy, by using a nontraditional classification of misses that has the key property of composability. We use Presburger formulas to express various kinds of misses as well as the state of the cache at the end of the loop nest. We use existing tools to simplify these formulas and to count cache misses. The model is powerful enough to handle imperfect loop nests and various flavors of non-linear array layouts based on bit interleaving of array indices. We also indicate how to handle modest levels of associativity, and how to perform limited symbolic analysis of cache behavior. The complexity of the formulas relates to the static structure of the loop nest rather than to its dynamic trip count, allowing our model to gain efficiency in counting cache misses by exploiting repetitive patterns of cache behavior. Validation against cache simulation confirms the exactness of our formulation. Our method can serve as the basis for a static performance predictor to guide program and data transformations to improve performance.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Lecture Notes in Computer Science 1205
(1999) · Industrial Robot: An International Journal · doi:10.1108/ir.1999.04926fae.001 · Cited by 38,662
Introduction to automata theory, languages and computation
(1981) · Mathematics and Computers in Simulation · doi:10.1016/0378-4754(81)90068-9 · Cited by 10,699
Introduction to automata theory, languages, and computation
(1980) · Computer Languages · doi:10.1016/0096-0551(80)90011-9 · Cited by 6,824 · cited 1×
“Presburger arithmetic [31] is the subset of first order logic corresponding to the theory of integers with addition.”
BackgroundA data locality optimizing algorithm
Wolf, M. E., & Lam, M. S. (1991) · Proceedings of the ACM SIGPLAN 1991 conference on Programming language design and implementation - PLDI '91 · doi:10.1145/113445.113449 · Cited by 1,331 · cited 1×
“However, models of the expected performance gains of performing a given loop transformation are less well-developed [19, 38, 45, 48, 50, 51, 61].”
BackgroundATOM: a system for building customized program analysis tools
Srivastava, A., & Eustace, A. (1994) · ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI) · doi:10.1145/178243.178260 · Cited by 981
The cache performance and optimizations of blocked algorithms
Lam, M. D., Rothberg, E. E., & Wolf, M. E. (1991) · Proceedings of the fourth international conference on Architectural support for programming languages and operating systems - ASPLOS-IV · doi:10.1145/106972.106981 · Cited by 921 · cited 4×
“For example, tiling requires the choice of tile sizes, and the performance of a loop nest is typically a non-smooth function of the extents of the loop bounds, the tile sizes, and the cache parameters [13, 29, 7].”
BackgroundInfluentialEvaluating associativity in CPU caches
Hill, M. D., & Smith, A. J. (1989) · IEEE Transactions on Computers · doi:10.1109/12.40842 · Cited by 606 · cited 3×
“The structure of a single level of a memory hierarchy—a cache— is generally characterized by three parameters [30]: Associativity, Block size, and Capacity.”
BackgroundInfluentialDataflow analysis of array and scalar references
Feautrier, P. (1991) · International Journal of Parallel Programming · doi:10.1007/bf01407931 · Cited by 567
Wolfe, M. (1989) · Proceedings of the 1989 ACM/IEEE conference on Supercomputing - Supercomputing '89 · doi:10.1145/76263.76337 · Cited by 429 · cited 1×
“Loop transformations such as iteration space tiling [62] are a major source of performance benefits.”
BackgroundTile size selection using cache organization and data layout
Coleman, S., & McKinley, K. S. (1995) · Proceedings of the ACM SIGPLAN 1995 conference on Programming language design and implementation · doi:10.1145/207110.207162 · Cited by 402 · cited 2×
“For example, tiling requires the choice of tile sizes, and the performance of a loop nest is typically a non-smooth function of the extents of the loop bounds, the tile sizes, and the cache parameters [13, 29, 7].”
BackgroundAgarwal, A., Hennessy, J., & Horowitz, M. (1989) · ACM Transactions on Computer Systems · doi:10.1145/63404.63407 · Cited by 304 · cited 1×
“Trace-centric. Prior research [ 1 , 44] has investigated various analytic cache models by extracting parameters from the reference trace.”
BackgroundCompiler optimizations for improving data locality
Carr, S., McKinley, K. S., & Tseng, C.-W. (1994) · Proceedings of the sixth international conference on Architectural support for programming languages and operating systems · doi:10.1145/195473.195557 · Cited by 291 · cited 1×
“For example, tiling requires the choice of tile sizes, and the performance of a loop nest is typically a non-smooth function of the extents of the loop bounds, the tile sizes, and the cache parameters [13, 29, 7].”
BackgroundPage placement algorithms for large real-indexed caches
Kessler, R. E., & Hill, M. D. (1992) · ACM Transactions on Computer Systems · doi:10.1145/138873.138876 · Cited by 285 · cited 1×
“Fortunately, most operating systems employ page coloring techniques that minimize this effect [37] by creating virtual to physical page mappings such that the virtual and physical cache index are identical.”
BackgroundCache miss equations: a compiler framework for analyzing and tuning memory behavior
Ghosh, S., Martonosi, M., & Malik, S. (1999) · ACM Transactions on Programming Languages and Systems · doi:10.1145/325478.325479 · Cited by 269 · cited 1×
“[26].”
Unifying data and control transformations for distributed shared-memory machines
Cierniak, M., & Li, W. (1995) · Proceedings of the ACM SIGPLAN 1995 conference on Programming language design and implementation · doi:10.1145/207110.207145 · Cited by 238 · cited 1×
“We will subsequently refer to row- and column-major layouts as canonical layouts [17].”
MethodData transformations for eliminating conflict misses
Rivera, G., & Tseng, C.-W. (1998) · Proceedings of the ACM SIGPLAN 1998 conference on Programming language design and implementation · doi:10.1145/277650.277661 · Cited by 232 · cited 3×
“Such data layout transformations can vary in complexity; examples include transposition and stride reordering [26], array merging [30], intra- and interarray padding [40, 41], data copying [29], and non-linear array layouts [8].”
BackgroundCache profiling and the SPEC benchmarks: a case study
Lebeck, A. R., & Wood, D. A. (1994) · Computer · doi:10.1109/2.318580 · Cited by 216 · cited 2×
“Such data layout transformations can vary in complexity; examples include transposition and stride reordering [32], array merging [39], intra- and inter-array padding [50, 51], data copying [38], and non-linear array layouts [14].”
BackgroundSelf-citationCache miss equations: an analytical representation of cache misses
Ghosh, S., Martonosi, M., & Malik, S. (1997) · Proceedings of the 11th international conference on Supercomputing - ICS '97 · doi:10.1145/263580.263657 · Cited by 201 · cited 1×
“[23, 24, 25, 26] is most closely related to our framework for analytical cache modeling.”
BackgroundMaximizing parallelism and minimizing synchronization with affine transforms
Lim, A. W., & Lam, M. S. (1997) · Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL '97 · doi:10.1145/263699.263719 · Cited by 179 · cited 1×
“Kelly and Pugh [35, 36] and Lim and Lam [41] have presented other algorithms that embed imperfect loop nests into perfect loop nests, with similar end results.”
BackgroundCache behavior prediction by abstract interpretation
Alt, M., Ferdinand, C., Martin, F., & Wilhelm, R. (1996) · Lecture Notes in Computer Science · doi:10.1007/3-540-61739-6_33 · Cited by 174
A 222pn upper bound on the complexity of Presburger Arithmetic
Oppen, D. C. (1978) · Journal of Computer and System Sciences · doi:10.1016/0022-0000(78)90021-1 · Cited by 167 · cited 1×
“To be precise, the truth of a sentence of length n can be determined within 2(2) 2 pn time, for some constant p > 1 [36].”
BackgroundNonlinear array layouts for hierarchical memory systems
Chatterjee, S., Jain, V. V., Lebeck, A. R., Mundhra, S., & Thottethodi, M. (1999) · Proceedings of the 13th international conference on Supercomputing · doi:10.1145/305138.305231 · Cited by 163 · cited 4×
“Prior empirical evidence [14, 15, 21] suggests that alternative array layout functions provide better cache behavior than canonical layout functions for many dense linear algebra codes.”
BackgroundInfluentialSelf-citationClauss, P. (2014) · International Conference on Supercomputing · doi:10.1145/2591635.2667172 · Cited by 128 · cited 2×
“We first convert the union into a disjoint union of polytopes, and then use Ehrhart polynomials to count the number of integer points [12] in each polytope.”
BackgroundMethodRecursive array layouts and fast parallel matrix multiplication
Chatterjee, S., Lebeck, A. R., Patnala, P. K., & Thottethodi, M. S. (1999) · ACM Symposium on Parallelism in Algorithms and Architectures (SPAA) · doi:10.1145/305619.305645 · Cited by 127 · cited 4×
“Prior empirical evidence [15, 8, 9] suggests that alternative array layout functions provide better cache behavior than canonical layout functions for many dense linear algebra codes.”
BackgroundMethodInfluentialSelf-citationPrecise miss analysis for program transformations with caches of arbitrary associativity
Ghosh, S., Martonosi, M., & Malik, S. (1998) · International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) · doi:10.1145/291069.291051 · Cited by 112 · cited 1×
“[25] can handle set-associative caches, their solution method is equivalent to simulation in the worst case.”
MethodAuto-blocking matrix-multiplication or tracking BLAS3 performance from source code
Frens, J. D., & Wise, D. S. (1997) · ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming · doi:10.1145/263764.263789 · Cited by 112 · cited 2×
“Prior empirical evidence [14, 15, 21] suggests that alternative array layout functions provide better cache behavior than canonical layout functions for many dense linear algebra codes.”
BackgroundClauss, P. (1996) · International Conference on Supercomputing · doi:10.1145/237578.237617 · Cited by 95
Quantifying the Multi-Level Nature of Tiling Interactions
Mitchell, N., Högstedt, K., Carter, L., & Jeanne Ferrante, Y. (1998) · International Journal of Parallel Programming · doi:10.1023/a:1018782528453 · Cited by 75
Cache-efficient matrix transposition
Chatterjee, S., & Sen, S. (2002) · IEEE International Symposium on High-Performance Computer Architecture (HPCA) · doi:10.1109/hpca.2000.824350 · Cited by 70 · cited 1×
“However, there is empirical evidence that almost every choice of pad can be catastrophically bad for a program as simple as matrix transposition [16].”
BackgroundSelf-citationAnalytical modeling of set-associative cache behavior
Harper, J. S., Kerbyson, D. J., & Nudd, G. R. (1999) · IEEE Transactions on Computers · doi:10.1109/12.805152 · Cited by 62 · cited 1×
“[28] present an analytical model that focuses on set-associative caches.”
BackgroundTiling Imperfectly-nested Loop Nests
Ahmed, N., Mateev, N., & Pingali, K. K. (2000) · doi:10.5555/370049.370401 · Cited by 61
Quantifying loop nest locality using SPEC'95 and the perfect benchmarks
McKinley, K. S., & Temam, O. (1999) · ACM Transactions on Computer Systems · doi:10.1145/329466.329484 · Cited by 61 · cited 1×
“McKinley and Temam [44] examine locality characteristics in the SPEC’95 and Perfect Benchmarks.”
BackgroundA linear algebra framework for automatic determination of optimal data layouts
Kandemir, M., Choudhary, A., Shenoy, N., Banerjee, P., & Ramenujarn, J. (1999) · IEEE Transactions on Parallel and Distributed Systems · doi:10.1109/71.752779 · Cited by 58 · cited 1×
“Such data layout transformations can vary in complexity; examples include transposition and stride reordering [32], array merging [39], intra- and inter-array padding [50, 51], data copying [38], and non-linear array layouts [14].”
BackgroundEliminating conflict misses for high performance architectures
Rivera, G., & Tseng, C. (1998) · International Conference on Supercomputing · doi:10.1145/277830.277917 · Cited by 52 · cited 3×
“Such data layout transformations can vary in complexity; examples include transposition and stride reordering [26], array merging [30], intra- and interarray padding [40, 41], data copying [29], and non-linear array layouts [8].”
BackgroundWisconsin Architectural Research Tool Set
Hill, M. D., Larus, J. R., Lebeck, A. R., Talluri, M., & Wood, D. A. (1993) · ACM SIGARCH Computer Architecture News · doi:10.1145/165496.165500 · Cited by 52 · cited 1×
“This is precisely what cache simulators [29, 40, 54, 56] do.”
BackgroundSelf-citationComplexity and uniformity of elimination in Presburger arithmetic
Weispfenning, V. (1997) · International Symposium on Symbolic and Algebraic Computation · doi:10.1145/258726.258746 · Cited by 41 · cited 3×
“The bound is tight [60].”
BackgroundInfluentialFinding legal reordering transformations using mappings
Kelly, W., & Pugh, W. (1995) · Lecture notes in computer science · doi:10.1007/bfb0025874 · Cited by 32 · cited 1×
“Kelly and Pugh [35, 36] and Lim and Lam [41] have presented other algorithms that embed imperfect loop nests into perfect loop nests, with similar end results.”
BackgroundQuantifying the multi-level nature of tiling interactions
Mitchell, N., Carter, L., Jeanne Ferrante, Y., & Högstedt, K. (1998) · Lecture notes in computer science · doi:10.1007/bfb0032680 · Cited by 29
Complexity of Presburger Arithmetic with Fixed Quantifier Dimension
Schöning, U. (1997) · Theory of Computing Systems · doi:10.1007/bf02679468 · Cited by 28
Active memory: a new abstraction for memory system simulation
Lebeck, A. R., & Wood, D. A. (1997) · ACM Transactions on Modeling and Computer Simulation · doi:10.1145/244804.244806 · Cited by 26
Self-citationThe Combinatorics of Cache Misses during Matrix Multiplication
Hanlon, P. J., Chung, D., Chatterjee, S., Genius, D., Lebeck, A. R., & Parker, E. (2001) · Journal of Computer and System Sciences · doi:10.1006/jcss.2001.1756 · Cited by 8 · cited 1×
“Previous work [27] has taken a combinatorial approach to modeling cache misses in the presence of such non-linear data layouts.”
BackgroundSelf-citation
Cited by
Self-Adapting Linear Algebra Algorithms and Software
Demmel, J., Dongarra, J., Eijkhout, V., Fuentes, E., Petitet, A., Vuduc, R., Whaley, R. C., & Yelick, K. (2005) · Proceedings of the IEEE · doi:10.1109/jproc.2004.840848 · Cited by 204
“For example, CSR storage prevents automatically tiling accesses to x for either registers or caches, as might be done in the dense case [40], [41], [42], [43].”
BackgroundProgram locality analysis using reuse distance
Zhong, Y., Shen, X., & Ding, C. (2009) · ACM Transactions on Programming Languages and Systems · doi:10.1145/1552309.1552310 · Cited by 166
“There are a number of compiler techniques that estimate the miss rate of a program [Porter.eld 1989; Ferrante et al. 1991; Ghosh et al. 1999; Chatterjee et al. 2001; Xue and Vera 2004].”
BackgroundA comparison of empirical and model-driven optimization
Yotov, K., Li, X., Ren, G., Cibulskis, M., DeJong, G., Garzaran, M., Padua, D., Pingali, K., Stodghill, P., & Wu, P. (2003) · ACM SIGPLAN Notices · doi:10.1145/780822.781140 · Cited by 165
Estimating cache misses and locality using stack distances
CaΒcaval, C., & Padua, D. A. (2003) · Proceedings of the 17th annual international conference on Supercomputing · doi:10.1145/782814.782836 · Cited by 163
“[6] use Presburger formulas to express various kinds of misses as well as the state of the cache at the beginning and at the end of a loop.”
Method(2002) · doi:10.5555/762761.762822 · Cited by 115
Metadata
- Authors
- Chatterjee, S., Parker, E., Hanlon, P. J., & Lebeck, A. R.
- Venue
- Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation
- Publisher
- ACM
- Published
- 2001-05
- Pages
- 286-297
- ISSN
- 1531-7102 (ISSN-L)
- OpenAlex
- W2065705265
- Cited by
- 163
- References
- 41
- FWCI
- 11.28
- Type
- conference paper
- Language
- en
- Open access
- closed
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.