$30 off During Our Annual Pro Sale. View Details »

Understanding Energy Behaviors of Thread Management Constructs

Gustavo Pinto
January 14, 2018
60

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 Slide

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

    View 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 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 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 Slide

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

    View 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 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 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 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 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 Slide

  12. Energy Consumption When Varying the
    Number of Threads
    12

    View Slide

  13. 13
    The Λ Curve

    View Slide

  14. 14
    The Λ Curve

    View Slide

  15. 15
    The Λ Curve

    View Slide

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

    View 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 Slide

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

    View Slide

  19. Overpopulating Cores with Threads
    19

    View Slide

  20. Overpopulating Cores with Threads
    20

    View Slide

  21. Faster ≠ Greener
    21

    View Slide

  22. Copying vs Sharing
    22

    View Slide

  23. Copying vs Sharing
    23
    Copying

    View Slide

  24. Copying vs Sharing
    24
    Copying
    Sharing

    View Slide

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

    View Slide

  26. 26
    Copy-Fork

    View Slide

  27. 27
    After
    Before
    Copy-Fork

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  32. Data Size
    32

    View Slide

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

    View Slide

  34. 34

    View Slide

  35. 35

    View Slide

  36. 36

    View Slide

  37. 37

    View Slide

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

    View Slide