Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Understanding Energy Behaviors of Thread Management Constructs

Gustavo Pinto
January 14, 2018
62

Understanding Energy Behaviors of Thread Management Constructs

Gustavo Pinto

January 14, 2018
Tweet

Transcript

  1. Understanding Energy Behaviors
    of Thread Management Constructs
    Gustavo Pinto1 Fernando Castor1 David Liu2
    {ghlp, castor}@cin.ufpe.br1
    [email protected]

    View full-size slide

  2. 2
    • First, the proliferation of multicore CPUs
    • Second, the prevalence of multi-threaded programs
    Motivation

    View full-size slide

  3. 3
    • First, more cores more power consumed
    • Second, little is known about energy behaviors of
    multi-threaded program on the application and
    programming language level
    The Problem

    View full-size slide

  4. 4
    1. programming abstractions of thread management
    on energy efficiency
    2. programmer choices of thread management on
    energy efficiency
    This Talk
    for Java multi-threaded programs

    View full-size slide

  5. 5
    • Explicit threading (the Thread-style): Using the
    java.lang.Thread class
    • Thread pooling (the Executor-style): Using the
    java.util.concurrent.Executor framework
    • Working Stealing (the ForkJoin-style): Using the
    java.util.concurrent.ForkJoin framework
    Thread management
    constructs

    View full-size slide

  6. 6
    • Embarrassingly parallel: spectralnorm, sunflow,
    n-queens
    • Leaning parallel: xalan, knucleotide, tomcat
    • Leaning serial: mandelbrot, largestImage
    • Embarrassingly serial: h2
    Benchmarks

    View full-size slide

  7. 7
    • Embarrassingly parallel: spectralnorm, sunflow,
    n-queens
    • Leaning parallel: xalan, knucleotide, tomcat
    • Leaning serial: mandelbrot, largestImage
    • Embarrassingly serial: h2
    Benchmarks
    Micro-benchmarks
    DaCapo benchmarks

    View full-size slide

  8. 8
    Experimental Environment
    A 2×16-core AMD CPUs, running Debian
    Linux, 64GB of memory, JDK version 1.7.0
    11, build 21, “ondemand” governor

    View full-size slide

  9. 9
    Experimental Environment
    A 2×16-core AMD CPUs, running Debian
    Linux, 64GB of memory, JDK version 1.7.0
    11, build 21, “ondemand” governor

    View full-size slide

  10. 10
    Experimental Environment
    A 2×16-core AMD CPUs, running Debian
    Linux, 64GB of memory, JDK version 1.7.0
    11, build 21.

    View full-size slide

  11. 11
    Experimental Environment
    A 2×16-core AMD CPUs, running Debian
    Linux, 64GB of DDR3 1600 memory, and
    JDK version 1.7.0 11, build 21.

    View full-size slide

  12. Energy Consumption When Varying the
    Number of Threads
    12

    View full-size slide

  13. 13
    The Λ Curve

    View full-size slide

  14. 14
    The Λ Curve

    View full-size slide

  15. 15
    The Λ Curve

    View full-size slide

  16. 16
    More cores idle
    CPU frequency
    at a lower level
    The Λ Curve

    View full-size slide

  17. 17
    More cores idle
    CPU frequency
    at a lower level
    More threads used,
    program completes sooner
    The greater the ratio
    between speedup and
    power, the steeper the \
    The Λ Curve

    View full-size slide

  18. Which programming style should I use?
    18
    ?
    ?

    View full-size slide

  19. Overpopulating Cores with Threads
    19

    View full-size slide

  20. Overpopulating Cores with Threads
    20

    View full-size slide

  21. Faster ≠ Greener
    21

    View full-size slide

  22. Copying vs Sharing
    22

    View full-size slide

  23. Copying vs Sharing
    23
    Copying

    View full-size slide

  24. Copying vs Sharing
    24
    Copying
    Sharing

    View full-size slide

  25. Copying vs Sharing
    25
    Copying
    Sharing
    ±15% of energy savings!

    View full-size slide

  26. 27
    After
    Before
    Copy-Fork

    View full-size slide

  27. 28
    After
    Before
    Copy-Fork
    Copy/Fork/Copy/Fork/…

    View full-size slide

  28. 29
    After
    Before
    Copy-Fork
    Copy/Fork/Copy/Fork/…

    View full-size slide

  29. 30
    After
    Before
    Copy-Fork
    Copy/Fork/Copy/Fork/…
    Copy/../Copy/Fork/…/Fork

    View full-size slide

  30. 31
    After
    Before
    Copy-Fork
    ±10% of energy
    savings!
    Copy/Fork/Copy/Fork/…
    Copy/../Copy/Fork/…/Fork

    View full-size slide

  31. Data Size
    33
    For most of the cases, energy
    consumption is linear to data
    size!

    View full-size slide

  32. Understanding Energy Behaviors
    of Thread Management Constructs
    Gustavo Pinto1 Fernando Castor1 David Liu2
    {ghlp, castor}@cin.ufpe.br1
    [email protected]

    View full-size slide