Adaptive Fork-Heuristics for Software Thread-Level Speculation

  • Zhen Cao
  • Clark Verbrugge
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8384)


Fork-heuristics play a key role in software Thread-Level Speculation (TLS). Current fork-heuristics either lack real parallel execution environment information to accurately evaluate fork points and/or focus on hardware-TLS implementation which cannot be directly applied to software TLS. This paper proposes adaptive fork-heuristics as well as a feedback-based selection technique to overcome the problems. Adaptive fork-heuristics insert and speculate on all potential fork/join points and purely rely on the runtime system to disable inappropriate ones. Feedback-based selection produces parallelized programs with ideal speedups using log files generated by adaptive heuristics. Experiments of three scientific computing benchmarks on a 64-core machine show that feedback-based selection and adaptive heuristics achieve more than 88 % and 50 % speedups of the manual-parallel version, respectively. For the Barnes-Hut benchmark, feedback-based selection is 49 % faster than the manual-parallel version.


Software thread-level speculation Fork heuristics Automatic parallelization Performance tuning 


  1. 1.
    LLVM (low-level vitrual machine).
  2. 2.
    Cao, Z., Verbrugge, C.: Language and architecture independent software thread-level speculation. In: Kasahara, H., Kimura, K. (eds.) LCPC 2012. LNCS, vol. 7760, pp. 270–272. Springer, Heidelberg (2013) Google Scholar
  3. 3.
    Cao, Z., Verbrugge, C.: Mixed model universal software thread-level speculation. In: ICPP’13: Proceedings of the 42nd International Conference on Parallel Processing, pp. 651–660 (2013)Google Scholar
  4. 4.
    Chen, M.K., Olukotun, K.: The Jrpm system for dynamically parallelizing Java programs. In: ISCA’03: Proceedings of the 30th Annual International Symposium on Computer Architecture, pp. 434–446, June 2003Google Scholar
  5. 5.
    Dou, J., Cintra, M.: A compiler cost model for speculative parallelization. ACM Trans. Architect. Code Optim. 4(2), 12 (2007)CrossRefGoogle Scholar
  6. 6.
    Du, Z.H., Lim, C.C., Li, X.F., Yang, C., Zhao, Q., Ngai, T.F.: A cost-driven compilation framework for speculative parallelization of sequential programs. In: PLDI’04: Proceedings of the ACM SIGPLAN 2004 Conference on Programming Language Design and Implementation, pp. 71–81, June 2004Google Scholar
  7. 7.
    Liu, W., Tuck, J., Ceze, L., Ahn, W., Strauss, K., Renau, J., Torrellas, J.: POSH: a TLS compiler that exploits program structure. In: PPoPP’06: Proceedings of the 11th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, pp. 158–167, Mar 2006Google Scholar
  8. 8.
    Liu, Y., An, H., Liang, B., Wang, L.: An online profile guided optimization approach for speculative parallel threading. In: Choi, L., Paek, Y., Cho, S. (eds.) ACSAC 2007. LNCS, vol. 4697, pp. 28–39. Springer, Heidelberg (2007) Google Scholar
  9. 9.
    Luo, Y., Packirisamy, V., Hsu, W.C., Zhai, A., Mungre, N., Tarkas, A.: Dynamic performance tuning for speculative threads. In: Proceedings of the 36th Annual International Symposium on Computer Architecture (ISCA ’09), pp. 462–473 (2009)Google Scholar
  10. 10.
    Quiñones, C.G., Madriles, C., Sánchez, J., Marcuello, P., González, A., Tullsen, D.M.: Mitosis compiler: an infrastructure for speculative threading based on pre-computation slices. In: PLDI’05: Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 269–279, June 2005Google Scholar
  11. 11.
    Steffan, J.G., Colohan, C., Zhai, A., Mowry, T.C.: The stampede approach to thread-level speculation. ACM Trans. Comput. Syst. (TOCS) 23(3), 253–300 (2005)CrossRefGoogle Scholar
  12. 12.
    Wang, S., Dai, X., Yellajyosula, K.S., Zhai, A., Yew, P.-C.: Loop selection for thread-level speculation. In: Ayguadé, E., Baumgartner, G., Ramanujam, J., Sadayappan, P. (eds.) LCPC 2005. LNCS, vol. 4339, pp. 289–303. Springer, Heidelberg (2006) Google Scholar
  13. 13.
    Whaley, J., Kozyrakis, C.: Heuristics for profile-driven method-level speculative parallelization. In: ICPP’05: Proceedings of the 2005 International Conference on Parallel Processing, pp. 147–156, June 2005Google Scholar
  14. 14.
    Xu, F., Shen, L., Wang, Z., Guo, H., Su, B., Chen, W.: Heuspec: A software speculation parallel model. In: ICPP’13: Proceedings of the 42nd International Conference on Parallel Processing, pp. 621–630 (2013)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  1. 1.School of Computer ScienceMcGill UniversityMontréalCanada

Personalised recommendations