Advertisement

Analytic Models and Empirical Search: A Hybrid Approach to Code Optimization

  • Arkady Epshteyn
  • María Jesús Garzaran
  • Gerald DeJong
  • David Padua
  • Gang Ren
  • Xiaoming Li
  • Kamen Yotov
  • Keshav Pingali
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4339)

Abstract

Compilers employ system models, sometimes implicitly, to make code optimization decisions. These models are analytic; they reflect their implementor’s understanding and beliefs of the system. While their decisions can be made almost instantaneously, unless the model is perfect their decisions may be flawed. To avoid exercising unique characteristics of a particular machine, such models are necessarily general and conservative. An alternative is to construct an empirical model. Building an empirical model involves extensive search of a parameter space to determine optimal settings. But this search is performed on the actual machine on which the compiler is to be deployed so that, once constructed, its decisions automatically reflect any eccentricities of the target system. Unfortunately, constructing accurate empirical models is expensive and, therefore, their applicability is limited to library generators such as ATLAS and FFTW. Here the high up-front installation cost can amortized over many future uses. In this paper we examine a hybrid approach. Active learning in an Explanation-Based paradigm allows the hybrid system to greatly increase the search range while drastically reducing the search time. Individual search points are analyzed for their information content using an known-imprecise qualitative analytic model. Next-search-points are chosen which have the highest expected information content with respect to refinement of the empirical model being constructed. To evaluate our approach we compare it with a leading analytic model and a leading empirical model. Our results show that the performance of the libraries generated using the hybrid approach is comparable to the performance of libraries generated via extensive search techniques and much better than that of the libraries generated by optimization based solely on an analytic model.

Keywords

Matrix Multiplication Regression Curve Tile Size Loop Unroll Instruction Level Parallelism 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
  2. 2.
    Allan, R., Kennedy, K.: Optimizing Compilers for Modern Architectures. Morgan Kaufmann Publishers, San Francisco (2002)Google Scholar
  3. 3.
    Bilmes, J., Asanović, K., Chin, C., Demmel, J.: OptimizingMatrixMultiply using PHiPAC: a Portable, High-Performance, ANSI C Coding Methodology. In: Proc. of Int. Conf. on Supercomputing, Vienna, Austria (July 1997)Google Scholar
  4. 4.
    Boulet, P., Darte, A., Risset, T., Robert, Y. (Pen)-ultimate Tiling? Integration, the VLSI Journal 17, 33–51 (1994)CrossRefGoogle Scholar
  5. 5.
    Callahan, D., Carr, S., Kennedy, K.: Improving Register Allocation for Subscripted Variables. In: Proc. of PLDI, pp. 53–65 (1990)Google Scholar
  6. 6.
    Carr, S., Ding, C., Sweany, P.: Improving software pipelining with unroll-and-jam. In: Proc. of 29th Hawaii International Conference on System Sciences (1996)Google Scholar
  7. 7.
    Coleman, S., McKinley, K.S.: Tile Size Selection Using Cache Organization and Data Layout. In: Proc. of PLDI. ACM Press, New York (1995)Google Scholar
  8. 8.
    Cooper, K., Waterman, T.: Investigating Adaptive Compilation Using the MIPSPro Compiler. In: Proc. of the LACSI Symposium, Los Alamos Computer Science Institute (October 2003)Google Scholar
  9. 9.
    Cooper, K.D., Subramanian, D., Torczon, L.: Adaptive optimizing compilers for the 21st century. The Journal of Supercomputing 23(1) (2002)Google Scholar
  10. 10.
    DeJong, G.: Explanation-based learning. In: Tucker, A. (ed.) Computer Science Handbook, 2nd edn., p. 68.1–68.18. Chapman & Hall/CRC and ACM (2004)Google Scholar
  11. 11.
    Diniz, P., Rinard, M.: Dynamic feedback: An effective technique for adaptive computing. In: Proc. of PLDI (1997)Google Scholar
  12. 12.
    Frigo, M., Johnson, S.G.: FFTW: An Adaptive Software Architecture for the FFT. In: Proc. IEE Intl. Conf. on Acoustics, Speech, and Signal Processing, vol. 3, pp. 1381–1384 (1998)Google Scholar
  13. 13.
    Li, X., Garzaran, M.J., Padua, D.A.: A dynamically tuned sorting library. In: CGO, pp. 111–124 (2004)Google Scholar
  14. 14.
    Robert, C.P.: The Bayesian Choice. Springer, Heidelberg (1994)zbMATHGoogle Scholar
  15. 15.
    Thomas, N., Tanase, G., Tkachyshyn, O., Perdue, J., Amato, N.M., Rauchwerger, L.: A framework for adaptive algorithm selection in stapl. In: Proc. ACM SIGPLAN Symp. Prin. Prac. Par. Prog, PPOPP (2005) (to appear)Google Scholar
  16. 16.
    Triantafyllis, S., Vachharajani, M., Vachharajani, N., August, D.: Compiler optimizationspace exploration. In: Int. Symp. on CGO (2003)Google Scholar
  17. 17.
    Whaley, R.C., Petitet, A., Dongarra, J.J.: Automated Empirical Optimization of Software and the ATLAS Project. Parallel Computing 27(1–2), 3–35 (2001)zbMATHCrossRefGoogle Scholar
  18. 18.
    Wolfe, M.: Iteration Space Tiling for Memory Hierarchies. In: Third SIAM Conf. on Parallel Processing for Scientific Computing (December 1987)Google Scholar
  19. 19.
    Xiong, J., Johnson, J., Johnson, R., Padua, D.: SPL: A Language and a Compiler for DSP Algorithms. In: Proc. of PLDI, pp. 298–308 (2001)Google Scholar
  20. 20.
    Yotov, K., Li, X., Ren, G., Cibulskis, M., DeJong, G., Garzaran, M., Padua, D., Pengali, K., Stodghill, P., Wu, P.: A Comparison of Empirical and Model-driven Optimization. In: Proc. of PLDI, pp. 63–76 (2003)Google Scholar
  21. 21.
    Yotov, K., Li, X., Ren, G., Garzarán, M.J., Padua, D., Pingali, K., Stodghill, P.: Is Search Really Necessary to Generate a High Performance Blas? Proc. of the IEEE, special issue on Program Generation, Optimization, and Platform Adaptation 23, 358–386 (2005)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Arkady Epshteyn
    • 1
  • María Jesús Garzaran
    • 1
  • Gerald DeJong
    • 1
  • David Padua
    • 1
  • Gang Ren
    • 1
  • Xiaoming Li
    • 1
  • Kamen Yotov
    • 2
  • Keshav Pingali
    • 2
  1. 1.University of Illinois at Urbana-ChampaignUrbanaUSA
  2. 2.Cornell UniversityIthacaUSA

Personalised recommendations