skip to main content
research-article
Public Access

Space-efficient multi-versioning for input-adaptive feedback-driven program optimizations

Published:15 October 2014Publication History
Skip Abstract Section

Abstract

Function versioning is an approach to addressing input-sensitivity of program optimizations. A major side effect of it is notable code size increase, which has been hindering its broad applications to large code bases and space-stringent environments. In this paper, we initiate a systematic exploration into the problem, providing answers to some fundamental questions: Given a space constraint, to which function we should apply versioning? How many versions of a function should we include in the final executable? Is the optimal selection feasible to do in polynomial time? This study proves selecting the best set of versions under a space constraint is NP-complete and proposes a heuristic algorithm named CHoGS which yields near optimal results in quadratic time. We implement the algorithm and conduct experiments through the IBM XL compilers. We observe significant performance enhancement with only slight code size increase; the results from CHoGS show factors of higher space efficiency than those from traditional hotness-based methods.

References

  1. P. Berube and J. N. Amaral. Benchmark design for robust profile-directed optimization. In Standard Performance Evaluation Corporation (SPEC) Workshop, 2007.Google ScholarGoogle Scholar
  2. P. Berube and J. N. Amaral. Benchmark design for robust prole-directed optimization. In Standard Performance Evaluation Corporation (SPEC) Workshop, 2007.Google ScholarGoogle Scholar
  3. J. Bilmes, K. Asanovic, C.-W. Chin, and J. Demmel. Optimizing matrix multiply using PHiPAC: A portable, highperformance, ANSI C coding methodology. In Proceedings of the ACM International Conference on Supercomputing, pages 340--347, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Chen, N. Vachharajani, R. Hundt, S. wei Liao, V. Ramasamy, P. Yuan, W. Chen, and W. Zheng. Taming hardware event samples for fdo compilation. In International Symposium on Code Generation and Optimization (CGO), Toronto, Ontario, Canada, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. B. Childers, J. W. Davidson, and M. L. Soffa. Continuous compilation: A new approach to aggressive and adaptive code transformation. In International Parallel and Distributed Processing Symposium(IPDPS), Nice, France, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. P. fei Chuang, H. Chen, G. F. Hoflehner, D. M. Lavery, and W. chung Hsu. Dynamic prole driven code version selection. In the 11th Annual Workshop on the Interaction between Compilers and Computer Architecture, 2007.Google ScholarGoogle Scholar
  7. M. Frigo and S. G. Johnson. The design and implementation of FFTW3. Proceedings of the IEEE, 93(2):216--231, 2005.Google ScholarGoogle ScholarCross RefCross Ref
  8. S. L. Graham, P. B. Kessler, and M. K. Mckusick. Gprof: A call graph execution profiler. In SIGPLAN symposium on Compiler construction, pages 120--126, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. E.-J. Im, K. Yelick, and R. Vuduc. Sparsity: Optimization framework for sparse matrix kernels. Int. J. High Perform. Comput. Appl., 18(1):135--158, 2004. ISSN 1094-3420. . Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Y. Jiang, E. Zhang, K. Tian, F. Mao, M. Gethers, and X. Shen. Exploiting statistical correlations for proactive prediction of program behaviors. In International Symposium on Code Generation and Optimization (CGO), Toronto, Ontario, Canada, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Jung, S. Rus, B. P. Railing, N. Clark, and S. Pande. Brainy: effective selection of data structures. In Proceedings of the 32nd ACM SIGPLAN conference on Programming language design and implementation, PLDI '11, pages 86--97, New York, NY, USA, 2011. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Lau, M. Arnold, M. Hind, and B. Calder. Online performance auditing: Using hot optimizations without getting burned. In ACM SIGPLAN conference on Programming language design and implementation (PLDI), Ottawa, Canada, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. X. Li, M. J. Garzarn, and D. Padua. A dynamically tuned sorting library. In International Symposium on Code Generation and Optimization (CGO), Palo Alto, California, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Y. Liu, E. Z. Zhang, and X. Shen. A cross-input adaptive framework for gpu programs optimization. In Proceedings of International Parallel and Distribute Processing Symposium (IPDPS), pages 1--10, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Puschel, J. Moura, J. Johnson, D. Padua, M. Veloso, B. Singer, J. Xiong, F. Franchetti, A. Gacic, Y. Voronenko, K. Chen, R. Johnson, and N. Rizzolo. SPIRAL: code generation for DSP transforms. Proceedings of the IEEE, 93(2): 232--275, 2005.Google ScholarGoogle ScholarCross RefCross Ref
  16. M. Samadi, A. Hormati, M. Mehrara, J. Lee, and S. Mahlke. Adaptive input-aware compilation for graphics engines. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '12, pages 13--22, New York, NY, USA, 2012. ACM. ISBN 978-1-4503-1205-9. URL http://doi.acm.org/10.1145/2254064.2254067. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. X. Shen and F. Mao. Modeling relations between inputs and dynamic behavior for general programs. In Proceedings of the Workshop on Languages and Compilers for Parallel Computing, 2007.Google ScholarGoogle Scholar
  18. M. Sipser. Introduction to the Theory of Computation 2nd edition. Cengage Learning, Boston, Massachusetts, 1997.Google ScholarGoogle Scholar
  19. M. D. Smith. Overcoming the challenges to feedback-directed optimization. In the ACM SIGPLAN Workshop on Dynamic and Adaptive Compilation and Optimization( Dynamo), Boston, USA, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. N. Thomas, G. Tanase, O. Tkachyshyn, J. Perdue, N. M. Amato, and L. Rauchwerger. A framework for adaptive algorithm selection in stapl. In ACM SIGPLAN symposium on Principles and practice of parallel programming (PPoPP), Chicago, Illinois, USA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. K. Tian, Y. Jiang, E. Zhang, and X. Shen. An input-centric paradigm for program dynamic optimizations. In ACM International Conference on Systems, Programming, Languages and Applications (OOPSLA), Reno/Tahoe, Nevada, USA, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. K. Tian, Y. Jiang, E. Zhang, and X. Shen. An input-centric paradigm for program dynamic optimizations. In ACM International Conference on Systems, Programming, Languages and Applications (OOPSLA), Reno/Tahoe, Nevada, USA, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. K. Tian, E. Zhang, and X. Shen. A step towards transparent integration of input-consciousness into dynamic program optimizations. In ACM International Conference on Systems, Programming, Languages and Applications (OOPSLA), Portland, Oregon, USA, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. K. Tian, E. Zhang, and X. Shen. A step towards transparent integration of input-consciousness into dynamic program optimizations. In ACM International Conference on Systems, Programming, Languages and Applications (OOPSLA), Portland, Oregon, USA, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. M. J. Voss and R. Eigenmann. High-level adaptive program optimization with adapt. In ACM SIGPLAN symposium on Principles and practice of parallel programming (PPoPP), Snowbird, Utah, USA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. C. Wang and Z. Li. Parametric analysis for adaptive computation ofoading. In ACM SIGPLAN conference on Programming language design and implementation (PLDI), Washington, DC, USA, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. R. C. Whaley, A. Petitet, and J. Dongarra. Automated empirical optimizations of software and the ATLAS project. Parallel Computing, 27(1-2):3--35, 2001.Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. B.Wu, Z. Zhao, X. Shen, Y. Jiang, Y. Gao, and R. Silvera. Exploiting inter-sequence correlations for program behavior prediction. In ACM International Conference on Systems, Programming, Languages and Applications (OOPSLA), Tucson, Arizona, USA, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Z. Zhao, B. Wu, and X. Shen. Challenging the "embarrassingly sequential": Parallelizing finite state machine-based computations through principled speculation. In Proceedings of the 19th International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS '14, pages 543--558, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2305-5. URL http://doi.acm.org/10.1145/2541940.2541989. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Space-efficient multi-versioning for input-adaptive feedback-driven program optimizations

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 49, Issue 10
      OOPSLA '14
      October 2014
      907 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2714064
      • Editor:
      • Andy Gill
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '14: Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications
        October 2014
        946 pages
        ISBN:9781450325851
        DOI:10.1145/2660193

      Copyright © 2014 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 15 October 2014

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!