within Applica/ons Melanie Kambadur* + , Martha Kim* * - - PowerPoint PPT Presentation

within applica ons
SMART_READER_LITE
LIVE PREVIEW

within Applica/ons Melanie Kambadur* + , Martha Kim* * - - PowerPoint PPT Presentation

NRG-Loops: Adjus/ng Power from within Applica/ons Melanie Kambadur* + , Martha Kim* * Columbia University, New York, NY USA + Oscar Health Insurance, New York,


slide-1
SLIDE 1

NRG-­‑Loops: ¡Adjus/ng ¡Power ¡from ¡ within ¡Applica/ons ¡

Melanie ¡Kambadur*+, ¡Martha ¡Kim* ¡ *Columbia ¡University, ¡New ¡York, ¡NY ¡USA ¡

+Oscar ¡Health ¡Insurance, ¡New ¡York, ¡NY ¡USA ¡

¡

¡

slide-2
SLIDE 2

Once, ¡power/performance ¡tradeoffs ¡were ¡set ¡at ¡HW ¡ design ¡7me… ¡

¡

Power ¡efficiency ¡evolu/on ¡

2 ¡

  • ­‑ ¡Less ¡power ¡
  • ­‑ ¡Slower ¡runGme ¡

+ ¡More ¡power ¡ + ¡Faster ¡runGme ¡

Low ¡

  • Freq. ¡

High ¡

  • Freq. ¡
slide-3
SLIDE 3

Once, ¡power/performance ¡tradeoffs ¡were ¡set ¡at ¡HW ¡ design ¡7me… ¡

¡

Power ¡efficiency ¡evolu/on ¡

3 ¡

  • ­‑ ¡Less ¡power ¡
  • ­‑ ¡Slower ¡runGme ¡

+ ¡More ¡power ¡ + ¡Faster ¡runGme ¡

Low ¡

  • Freq. ¡

High ¡

  • Freq. ¡

+ ¡Med. ¡power ¡ + ¡Faster ¡runGme ¡

slide-4
SLIDE 4

Once, ¡power/performance ¡tradeoffs ¡were ¡set ¡at ¡HW ¡ design ¡7me… ¡

¡

Power ¡efficiency ¡evolu/on ¡

4 ¡

  • ­‑ ¡Less ¡power ¡
  • ­‑ ¡Slower ¡runGme ¡

+ ¡More ¡power ¡ + ¡Faster ¡runGme ¡

Low ¡

  • Freq. ¡

High ¡

  • Freq. ¡

+ ¡Med. ¡power ¡ + ¡Faster ¡runGme ¡

  • ­‑-­‑ ¡Power ¡

++ ¡RunGme ¡

Specialized ¡HW ¡

slide-5
SLIDE 5

The ¡next ¡big ¡thing ¡was ¡tunable ¡“knobs” ¡

¡

Power ¡efficiency ¡evolu/on ¡

5 ¡

Dynamic ¡ Frequency ¡ Tuning ¡(DFS/ DVFS) ¡

slide-6
SLIDE 6

The ¡next ¡big ¡thing ¡was ¡tunable ¡“knobs” ¡

¡

Power ¡efficiency ¡evolu/on ¡

6 ¡

Dynamic ¡ Frequency ¡ Tuning ¡(DFS/ DVFS) ¡ CPU ¡Idle ¡ Modes ¡

slide-7
SLIDE 7

The ¡next ¡big ¡thing ¡was ¡tunable ¡“knobs” ¡

¡

Power ¡efficiency ¡evolu/on ¡

7 ¡

Dynamic ¡ Frequency ¡ Tuning ¡(DFS/ DVFS) ¡ CPU ¡Idle ¡ Modes ¡ Asymmetric ¡ MulGcores ¡

slide-8
SLIDE 8

How ¡do ¡we ¡use ¡these ¡HW ¡knobs ¡for ¡SW ¡power ¡& ¡ energy ¡efficiency? ¡ ¡ ¡ ¡

Moving ¡power ¡efficiency ¡up ¡the ¡stack ¡

8 ¡

Dynamic ¡ Frequency ¡ Tuning ¡(DFS/ DVFS) ¡ CPU ¡Idle ¡ Modes ¡ Asymmetric ¡ MulGcores ¡

slide-9
SLIDE 9

Using ¡HW ¡knobs ¡for ¡SW ¡energy ¡efficiency ¡

9 ¡

Most ¡SW ¡energy ¡efficiency ¡soluGons ¡expose ¡“hints” ¡ to ¡OS, ¡which ¡then ¡tunes ¡HW ¡knobs. ¡ ¡

func ¡foo ¡_high_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡ ¡ func ¡bar ¡ ¡_low_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡ ¡ func ¡baz ¡_high_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡

High ¡

  • freq. ¡

Low ¡

  • freq. ¡

High

  • freq. ¡
slide-10
SLIDE 10

Using ¡HW ¡knobs ¡for ¡SW ¡energy ¡efficiency ¡

10 ¡

Most ¡SW ¡energy ¡efficiency ¡soluGons ¡expose ¡“hints” ¡ to ¡OS, ¡which ¡then ¡tunes ¡HW ¡knobs. ¡ ¡

class ¡Foo ¡_high_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡ ¡ class ¡Bar ¡ ¡_low_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡ ¡ class ¡Baz ¡_high_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡

High ¡

  • freq. ¡

Low ¡

  • freq. ¡

High

  • freq. ¡
slide-11
SLIDE 11

Using ¡HW ¡knobs ¡for ¡SW ¡energy ¡efficiency ¡

11 ¡

Most ¡SW ¡energy ¡efficiency ¡soluGons ¡expose ¡“hints” ¡ to ¡OS, ¡which ¡then ¡tunes ¡HW ¡knobs. ¡ ¡

class ¡Foo ¡_high_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡ ¡ class ¡Bar ¡ ¡_low_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡ ¡ class ¡Baz ¡_high_power_ ¡{ ¡ ¡// ¡some ¡code ¡ } ¡ ¡ ¡

Idle ¡some ¡ cores ¡

slide-12
SLIDE 12

STOP ¡using ¡HW ¡knobs ¡for ¡SW ¡energy ¡efficiency ¡

12 ¡

Most ¡SW ¡energy ¡efficiency ¡soluGons ¡expose ¡“hints” ¡ to ¡OS, ¡which ¡then ¡tunes ¡HW ¡knobs. ¡ ¡

  • Hard ¡to ¡manage ¡HW ¡power ¡when ¡mulGple ¡

programs ¡give ¡hints ¡simultaneously ¡

  • HW ¡can ¡predict ¡idle ¡periods ¡bederà ¡sub-­‑cycle ¡

DVFS ¡tuning? ¡ ¡

  • In ¡pracGce, ¡most ¡HW ¡tuning ¡increases ¡runGme ¡to ¡

save ¡power, ¡so ¡can’t ¡save ¡energy ¡during ¡SW ¡acGve ¡

  • periods. ¡ ¡
slide-13
SLIDE 13

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ Power ¡(% ¡Total) ¡ Time ¡(s) ¡

Mobile ¡app ¡example ¡ ¡

Segment ¡of ¡ mobile ¡game ¡ that ¡takes ¡10s. ¡

13 ¡

slide-14
SLIDE 14

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ Power ¡(% ¡Total) ¡ Time ¡(s) ¡

Too ¡much ¡power! ¡

Mobile ¡app ¡example ¡ ¡

Want ¡app ¡to ¡consume ¡<= ¡80% ¡power. ¡

14 ¡

slide-15
SLIDE 15

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ Power ¡(% ¡Total) ¡ Time ¡(s) ¡

25% ¡Increase ¡

Power ¡ok ¡now. ¡

Op/on ¡1: ¡Let ¡HW ¡handle ¡with ¡DVFS ¡ ¡

But ¡you ¡get ¡a ¡

  • slowdown. ¡

15 ¡

slide-16
SLIDE 16

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ Power ¡(% ¡Total) ¡ Time ¡(s) ¡

Op/on ¡2: ¡Compiler/Language ¡Smart ¡DVFS ¡ ¡ 10% ¡Increase ¡

Power ¡ok ¡now. ¡ S/ll ¡get ¡a ¡

  • slowdown. ¡

16 ¡

slide-17
SLIDE 17

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ Power ¡(% ¡Total) ¡ Time ¡(s) ¡

Op/on ¡2: ¡Compiler/Language ¡Smart ¡DVFS ¡ ¡ 10% ¡Increase ¡

Power ¡ok ¡now. ¡ S/ll ¡get ¡a ¡

  • slowdown. ¡

17 ¡

Moreover, ¡must ¡slow ¡ALL ¡apps ¡on ¡the ¡same ¡core. ¡

slide-18
SLIDE 18

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ Power ¡(% ¡Total) ¡ Time ¡(s) ¡ Total ¡ ¡ AdverGsement ¡

Op/on ¡3: ¡Trade ¡func/onality ¡for ¡power ¡

18 ¡

Banner ¡ad: ¡

slide-19
SLIDE 19

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ Power ¡(% ¡Total) ¡ Time ¡(s) ¡ Total ¡ ¡ AdverGsement ¡

Op/on ¡3: ¡Trade ¡func/onality ¡for ¡power ¡

19 ¡

Banner ¡ad: ¡ Ad ¡is ¡responsible ¡ for ¡power ¡spike ¡

slide-20
SLIDE 20

0 ¡ 20 ¡ 40 ¡ 60 ¡ 80 ¡ 100 ¡ 0 ¡ 2 ¡ 4 ¡ 6 ¡ 8 ¡ 10 ¡ 12 ¡ 14 ¡ Power ¡(% ¡Total) ¡ Time ¡(s) ¡ Total ¡ ¡ AdverGsement ¡

Op/on ¡3: ¡Trade ¡func/onality ¡for ¡power ¡

20 ¡

Banner ¡ad: ¡ Pause ¡the ¡ad, ¡ maintain ¡ power ¡budget ¡ with ¡no ¡/me ¡ delay ¡

slide-21
SLIDE 21

NRG-­‑Loops: ¡SW-­‑Only ¡Power ¡Management ¡

21 ¡

  • Instead ¡of ¡having ¡sohware ¡manage ¡power ¡via ¡

hardware ¡knobs, ¡have ¡sohware ¡manage ¡ power ¡via ¡sohware ¡knobs. ¡

slide-22
SLIDE 22

NRG-­‑Loops: ¡SW-­‑Only ¡Power ¡Management ¡

22 ¡

  • Instead ¡of ¡having ¡sohware ¡manage ¡power ¡via ¡

hardware ¡knobs, ¡have ¡sohware ¡manage ¡ power ¡via ¡sohware ¡knobs. ¡ HW ¡Knobs ¡ SW ¡Knobs ¡

  • DVFS ¡
  • Idle ¡cores ¡
  • Asymmetric ¡

mulGcore ¡

  • Adjust ¡caching ¡strategy ¡
  • Reduce ¡thread ¡count ¡
  • EsGmate ¡mathemaGcal ¡

funcGon ¡

  • Stop ¡computaGon ¡early ¡

and ¡dump ¡memory ¡

slide-23
SLIDE 23

NRG-­‑Loops: ¡SW-­‑Only ¡Power ¡Management ¡

23 ¡

  • C++ ¡Language ¡Extension ¡to ¡tune ¡SW ¡power ¡

through ¡SW ¡knobs. ¡ ¡

  • Measures ¡hardware ¡power ¡+ ¡energy ¡and ¡

enables ¡programs ¡to ¡trade ¡funcGonality ¡or ¡ accuracy ¡ONLY ¡when ¡runGme ¡power ¡or ¡energy ¡ budgets ¡are ¡exceeded. ¡ ¡

  • Can ¡work ¡concurrently ¡with ¡HW ¡power ¡
  • soluGons. ¡
slide-24
SLIDE 24

NRG-­‑Loops ¡ADAPT ¡

24 ¡

Concise ¡syntax ¡adds ¡only ¡a ¡few ¡lines ¡of ¡code ¡to ¡exis7ng ¡ programs ¡

¡ NRG_ADAPT_for ¡( ¡int ¡i=0; ¡i<MAX_ADS ¡; ¡++i ¡&& ¡ ¡ ¡ ¡ ¡ ¡ ¡NRG_AVG_P<=POWER_LIMIT ¡) ¡{ ¡ ¡ ¡// ¡run ¡ad ¡normally ¡ } ¡NRG_ALTERNATE ¡{ ¡ ¡ ¡usleep ¡( ¡PAUSE_TIME ¡); ¡ } ¡ ¡ ¡ ¡ ¡

slide-25
SLIDE 25

NRG-­‑Loops ¡ADAPT ¡

25 ¡

Concise ¡syntax ¡adds ¡only ¡a ¡few ¡lines ¡of ¡code ¡to ¡exis7ng ¡ programs ¡

¡ NRG_ADAPT_FOR ¡( ¡int ¡i=0; ¡i<MAX_ADS ¡; ¡++i ¡&& ¡ ¡ ¡ ¡ ¡ ¡ ¡NRG_AVG_P<=POWER_LIMIT ¡) ¡{ ¡ ¡ ¡// ¡run ¡ad ¡normally ¡ } ¡NRG_ALTERNATE ¡{ ¡ ¡ ¡usleep ¡( ¡PAUSE_TIME ¡); ¡ } ¡ ¡ ¡ ¡ ¡ Loop ¡pragma ¡

slide-26
SLIDE 26

NRG-­‑Loops ¡ADAPT ¡

26 ¡

Concise ¡syntax ¡adds ¡only ¡a ¡few ¡lines ¡of ¡code ¡to ¡exis7ng ¡ programs ¡

¡ NRG_ADAPT_FOR ¡( ¡int ¡i=0; ¡i<MAX_ADS ¡; ¡++i ¡&& ¡ ¡ ¡ ¡ ¡ ¡ ¡NRG_AVG_P<=POWER_LIMIT ¡) ¡{ ¡ ¡ ¡// ¡run ¡ad ¡normally ¡ } ¡NRG_ALTERNATE ¡{ ¡ ¡ ¡usleep ¡( ¡PAUSE_TIME ¡); ¡ } ¡ ¡ ¡ ¡ ¡ Original ¡loop ¡bounds ¡

slide-27
SLIDE 27

NRG-­‑Loops ¡ADAPT ¡

27 ¡

Concise ¡syntax ¡adds ¡only ¡a ¡few ¡lines ¡of ¡code ¡to ¡exis7ng ¡ programs ¡

¡ NRG_ADAPT_FOR ¡( ¡int ¡i=0; ¡i<MAX_ADS ¡; ¡++i ¡&& ¡ ¡ ¡ ¡ ¡ ¡ ¡NRG_AVG_P<=POWER_LIMIT ¡) ¡{ ¡ ¡ ¡// ¡run ¡ad ¡normally ¡ } ¡NRG_ALTERNATE ¡{ ¡ ¡ ¡usleep ¡( ¡PAUSE_TIME ¡); ¡ } ¡ ¡ ¡ ¡ ¡ Concatenate ¡power/ energy ¡goals ¡

slide-28
SLIDE 28

NRG-­‑Loops ¡ADAPT ¡

28 ¡

Concise ¡syntax ¡adds ¡only ¡a ¡few ¡lines ¡of ¡code ¡to ¡exis7ng ¡ programs ¡

¡ NRG_ADAPT_FOR ¡( ¡int ¡i=0; ¡i<MAX_ADS ¡; ¡++i ¡&& ¡ ¡ ¡ ¡ ¡ ¡ ¡NRG_AVG_P<=POWER_LIMIT ¡) ¡{ ¡ ¡ ¡// ¡run ¡ad ¡normally ¡ } ¡NRG_ALTERNATE ¡{ ¡ ¡ ¡usleep ¡( ¡PAUSE_TIME ¡); ¡ } ¡ ¡ ¡ ¡ ¡ Original ¡loop ¡body ¡

slide-29
SLIDE 29

NRG-­‑Loops ¡ADAPT ¡

29 ¡

Concise ¡syntax ¡adds ¡only ¡a ¡few ¡lines ¡of ¡code ¡to ¡exis7ng ¡ programs ¡

¡ NRG_ADAPT_FOR ¡( ¡int ¡i=0; ¡i<MAX_ADS ¡; ¡++i ¡&& ¡ ¡ ¡ ¡ ¡ ¡ ¡NRG_AVG_P<=POWER_LIMIT ¡) ¡{ ¡ ¡ ¡// ¡run ¡ad ¡normally ¡ } ¡NRG_ALTERNATE ¡{ ¡ ¡ ¡usleep ¡( ¡PAUSE_TIME ¡); ¡ } ¡ ¡ ¡ ¡ ¡ Enter ¡if ¡power ¡budget ¡ exceeded ¡

slide-30
SLIDE 30

NRG-­‑Loops ¡ADAPT ¡

30 ¡

Concise ¡syntax ¡adds ¡only ¡a ¡few ¡lines ¡of ¡code ¡to ¡exis7ng ¡ programs ¡

¡ NRG_ADAPT_FOR ¡( ¡int ¡i=0; ¡i<MAX_ADS ¡; ¡++i ¡&& ¡ ¡ ¡ ¡ ¡ ¡ ¡NRG_AVG_P<=POWER_LIMIT ¡) ¡{ ¡ ¡ ¡// ¡run ¡ad ¡normally ¡ } ¡NRG_ALTERNATE ¡{ ¡ ¡ ¡usleep ¡( ¡PAUSE_TIME ¡); ¡ } ¡ ¡ ¡ ¡ ¡ Alternate, ¡low-­‑power ¡ loop ¡body ¡

slide-31
SLIDE 31

Other ¡types ¡of ¡NRG-­‑Loops ¡

31 ¡

¡ NRG_TRUN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_INFO* ¡foo_usage); ¡ ¡ ¡ float ¡foo_energy ¡= ¡foo_usage-­‑>energy; ¡ float ¡foo_average_power ¡= ¡foo_usage-­‑>average_power; ¡ float ¡foo_wall_time ¡= ¡foo_usage-­‑>wall_time; ¡ ¡ NRG_AVG_P ¡<= ¡50.0 ¡ NRG_TOT_E ¡<= ¡foo_energy ¡ NRG_AVG_P ¡<= ¡0.5*SYS_MAX_POWER ¡

¡ ¡

Capture ¡the ¡energy, ¡ power, ¡and ¡runGme ¡ use ¡of ¡any ¡code. ¡ ¡

slide-35
SLIDE 35

NRG-­‑Loop ¡Helpers ¡

35 ¡

NRG_AUDIT ¡{ ¡ ¡ ¡foo() ¡ ¡// ¡any ¡code ¡here ¡ } ¡NRG_USAGE ¡(NRG_USAGE_INFO* ¡foo_usage); ¡ ¡ ¡ float ¡foo_energy ¡= ¡foo_usage-­‑>energy; ¡ float ¡foo_average_power ¡= ¡foo_usage-­‑>average_power; ¡ float ¡foo_wall_time ¡= ¡foo_usage-­‑>wall_time; ¡ ¡ NRG_AVG_P ¡<= ¡50.0 ¡ ¡// ¡Watts ¡ NRG_TOT_E ¡<= ¡foo_energy ¡// ¡Relative ¡to ¡foo() ¡ NRG_AVG_P ¡<= ¡0.5*SYS_MAX_POWER ¡// ¡Relative ¡to ¡TDP ¡

¡ ¡

Different ¡opGons ¡to ¡set ¡ energy/power ¡budgets. ¡

slide-36
SLIDE 36

NRG-­‑Loops ¡Implementa/on ¡

36 ¡

  • No ¡adjustments ¡to ¡the ¡O/S, ¡used ¡commodity ¡HW ¡

with ¡built ¡in ¡power ¡meters ¡(Intel ¡RAPL) ¡

– Measure ¡CPU ¡+ ¡cache ¡power ¡+ ¡esGmate ¡DRAM ¡power ¡

  • ImplementaGon ¡*should ¡have* ¡been ¡trivial, ¡but ¡

unfortunately ¡wasn’t ¡

– Socket ¡level ¡power ¡meters ¡make ¡adribuGng ¡power ¡to ¡ processes ¡tricky ¡ – Small, ¡overflowing ¡counters ¡ – To ¡minimize ¡monitoring ¡overhead ¡we ¡have ¡one ¡monitoring ¡ thread ¡even ¡for ¡mulGthreaded ¡programs ¡

slide-37
SLIDE 37

NRG-­‑Loops ¡Implementa/on ¡

37 ¡

  • No ¡adjustments ¡to ¡the ¡O/S, ¡used ¡commodity ¡HW ¡

with ¡built ¡in ¡power ¡meters ¡(Intel ¡RAPL) ¡

– Measure ¡CPU ¡+ ¡cache ¡power ¡+ ¡esGmate ¡DRAM ¡power ¡

  • ImplementaGon ¡*should ¡have* ¡been ¡trivial, ¡but ¡

unfortunately ¡wasn’t ¡

– Socket ¡level ¡power ¡meters ¡make ¡adribuGng ¡power ¡to ¡ processes ¡tricky ¡ – Small, ¡overflowing ¡counters ¡ – To ¡minimize ¡monitoring ¡overhead ¡we ¡have ¡one ¡monitoring ¡ thread ¡even ¡for ¡mulGthreaded ¡programs ¡

  • Profiling ¡power ¡& ¡energy ¡goals ¡adds ¡<1% ¡overhead. ¡ ¡
slide-38
SLIDE 38

NRG-­‑Loops ¡Implementa/on ¡

38 ¡

  • No ¡adjustments ¡to ¡the ¡O/S, ¡used ¡commodity ¡HW ¡

with ¡built ¡in ¡power ¡meters ¡(Intel ¡RAPL) ¡

– Measure ¡CPU ¡+ ¡cache ¡power ¡+ ¡esGmate ¡DRAM ¡power ¡

  • ImplementaGon ¡*should ¡have* ¡been ¡trivial, ¡but ¡

unfortunately ¡wasn’t ¡

– Socket ¡level ¡power ¡meters ¡make ¡adribuGng ¡power ¡to ¡ processes ¡tricky ¡ – Small, ¡overflowing ¡counters ¡ – To ¡minimize ¡monitoring ¡overhead ¡we ¡have ¡one ¡monitoring ¡ thread ¡even ¡for ¡mulGthreaded ¡programs ¡

  • Profiling ¡power ¡& ¡energy ¡goals ¡adds ¡<1% ¡overhead. ¡ ¡
slide-39
SLIDE 39

Results: ¡NRG_ADAPT ¡Minesweeper ¡

39 ¡

When ¡adver7sements ¡are ¡consuming ¡too ¡much ¡ energy, ¡force ¡them ¡to ¡occasionally ¡pause, ¡ decreasing ¡net ¡game ¡plus ¡ad ¡energy. ¡

slide-40
SLIDE 40

Results: ¡NRG_ADAPT ¡Parallel ¡Programs ¡

40 ¡

Reduce ¡soYware ¡thread ¡count ¡to ¡keep ¡ within ¡a ¡power ¡budget. ¡

Energy ¡RelaGve ¡ ¡ to ¡Uncapped ¡

slide-41
SLIDE 41

Ques/ons? ¡

41 ¡

¡ ¡• Melanie ¡Kambadur ¡

(melaniekambadur@gmail.com) ¡

  • Martha ¡Kim ¡(martha@cs.columbia.edu) ¡

¡

NRG-­‑Loops: ¡Adjus7ng ¡Power ¡from ¡within ¡ Applica7ons ¡

slide-42
SLIDE 42
slide-43
SLIDE 43

Results: ¡NRG_PERFORATE ¡

43 ¡

Set ¡a ¡target ¡energy ¡budget ¡and ¡drop ¡ frames ¡to ¡meet ¡it. ¡ ¡