dynamic voltage and frequency scaling for energyfor … ·  · 2012-09-08dynamic voltage and...

48
Dynamic Voltage and Frequency Scaling Dynamic Voltage and Frequency Scaling for Energy for Energy Efficient System Design Efficient System Design for Energy for Energy-Efficient System Design Efficient System Design Kihwan Choi and Massoud Pedram University of Southern California Dept. of EE April 27 th , 2005 NCTU, Taiwan

Upload: hatuyen

Post on 11-May-2018

234 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Dynamic Voltage and Frequency Scaling Dynamic Voltage and Frequency Scaling for Energyfor Energy Efficient System DesignEfficient System Designfor Energyfor Energy--Efficient System DesignEfficient System Design

Kihwan Choi and Massoud Pedram

University of Southern CaliforniaDept. of EE

April 27th, 2005NCTU, Taiwan

Page 2: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

OutlineOutline

Introduction and review of basic conceptsDynamic voltage and frequency scalingWorkload decompositionDVFS targeting total system energy reductionConclusion and research directions

Page 3: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

RealitiesRealitiesMotivation

Power has emerged as the #1 limiter of design performance beyond the 65nm generation.Dynamic and static power dissipation limit achievable performance due to fixed caps on chip or systemperformance due to fixed caps on chip or system cooling capacity.Power related signal integrity issues (IR drop L di/dtPower related signal integrity issues (IR drop, L di/dt noise) have become major sources of design re-spins.

Transistors (and silicon) are freeTransistors (and silicon) are freeTransistors (and silicon) are free.Transistors (and silicon) are free.Power is the only real limiter.Power is the only real limiter.Optimizing for frequency and/or area may achieve neither.Optimizing for frequency and/or area may achieve neither.

Pat Gelsinger, Senior Vice President & CTO, Intel

Page 4: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Industry ViewIndustry ViewMotivation

Page 5: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

CMOS ScalingCMOS ScalingCMOS Scaling

Scaling improves:Transistor Density & Functionality on a chip.Speed and frequency of operation ⇒ Higher performance.

Scaling and power dissipationActive power ↑ - CVDD

2fScale VDDScale VDD

Scale Vth to recover speed ⇒Ileak↑

Standby (or leakage) power ↑Standby (or leakage) power ↑VDDIleak

Leakage power is catching up with the active power in UDSMwith the active power in UDSM CMOS circuits.

Page 6: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Capacitive Power DissipationCapacitive Power DissipationBackground

The capacitive component of power dissipation is a

Vdd

Vinof power dissipation is a function of:

FrequencyC iti l di

Vout

CLCapacitive loadingVoltage swingActivity factor. V

o

CLIload

afVCafE

VC ddL

=

⋅⋅

2

2

1=Power=P21=nsitionEnergy/tra=E

out

tafVCafE ddL ⋅⋅⋅⋅=⋅⋅

2 =Power = P Iload

tt

Page 7: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Short Circuit Power DissipationShort Circuit Power DissipationBackground

COU T vin vout Isc

Cdiff CLOAD

vin vout

Isc

30Esc x 10

-15

1 1 1 jiW τ∑∑∑20

25

30Size=60 Cout=10fFSize=60 Cout=15fFSize=39 Cout=20fF

( )0 0 0

, , insc in out ijk DDk

i j k out

WE W C m VC

ττ= = =

= ∑∑∑10

15

2 2.5 3 3.5 4 4.5 55

τin X10-10

Page 8: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Leakage Power DissipationLeakage Power DissipationBackground

FET 'ON'

Gnd GndVdd

FET 'OFF'

Gnd VddGnd

Subthreshold leakageDirect source-to-drain tunneling

e-

e-

Gate insulator tunneling

gDrain-to-body tunnelingSource

e-

DrainChannel

' '2 e 1 e 10

GS th DS DS GS th DS GS thT T T

V V V V V V V V Vnv v n SWI C

η ην

− + − − + −⎛ ⎞∝⎜ ⎟e 1 e 10T T T S

sub e T sthI v C eL

μ= − ∝ =⎜ ⎟⎜ ⎟⎝ ⎠

Page 9: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

OutlineOutline

Introduction and review of basic concepts

OutlineOutline

Dynamic voltage and frequency scalingWorkload decompositionDVFS targeting total system energy reductionConclusion and research directions

Page 10: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Dynamic Voltage & Frequency ScalingDynamic Voltage & Frequency Scalingy g q y gy g q y g

DVFS is a method to provide variable amount of energy f t k b li th ti lt /ffor a task by scaling the operating voltage/frequency.

Power consumption of a CMOS-based circuit isPower consumption of a CMOS based circuit isα : switching factorCeff : effective capacitanceV : operating voltage

α ⋅ ⋅ ⋅2effP = C V f

Energy required to run a task during T is

V : operating voltagef : operating frequency

Energy required to run a task during T is(assuming V∝ f, T ∝ f –1)⋅ ∝ 2E = P T V

By lowering CPU frequency, CPU energy can be saved.

Page 11: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Energy saving with DVFSEnergy saving with DVFSgy ggy g

Example : a task with workload W should be l t d b d dli Dcompleted by a deadline, D

Voltage Voltage∝ 2E f ∝ = ∝

22 1 1

2 2f EE f4 4

WW

V1

V2

g

75% energy saving

∝1 1E f 2 2 4 4( ), ,⎛ ⎞= ⎜ ⎟

⎝ ⎠1 1

2 2V fV f2 2

WTime Time

DT1 D

DVFS is an effective way of reducing the CPU energy consumption by providing “just-enough” computation power.

Page 12: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Choosing a frequency in DVFSChoosing a frequency in DVFSg q yg q y

Workload of a task, Wtask, is defined as the total b f CPU l k l i d t fi i h thnumber of CPU clock cycles required to finish the

task N : total number of instructions in a taskCPI : clock cycles per instruction≡ ∑

N

task ii 1

W CPI

Task execution time, Ttask, is a function of the CPU frequency, f cpu

y pi=1

t kWq y,

Given a deadline of D, ftarget denotes the CPU

= tasktask cpu

WTf

, targetfrequency that results in Ttask closest to D

= ⇒ =taskt t t k

Wf T D ⇒target taskf T DD

Page 13: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

OutlineOutlineOutlineOutline

Introduction and review of basic conceptsDynamic voltage and frequency scalingWorkload decompositionDVFS targeting total system energy reductionConclusion and research directions

Page 14: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Motivation for workload decompositionMotivation for workload decomposition

CPU-bound vs. memory-bound applicationsThe figure shows execution time variation according to the CPU frequency ranging from 733 MHz to 333 MHz.

100

120

[%]

fgrepqsortgzip

“crc”PFloss

t d*

PFloss @ 333MHz

120 %≡cpu maxtask,ftask,f

l

T -TPF

60

80

man

ce L

oss djpeg

crc

“qsort”

expected*“crc”

“qsort”

120 %110 %

10 %

max

losstask,f

PFT

20

40

Perf

orm

*assume

qsort 10 %

= tasktask cpu

WTf0

733 666 600 533 466 400 333

Frequency [MHz]

task cpuf

Page 15: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Workload decompositionWorkload decompositionpp

A program execution sequence consists of on-chip and ff hi koff-chip work

On-chip work : performed inside the CPU (e.g. cache hit)Off-chip work : performed outside the CPU (e g cache miss)Off chip work : performed outside the CPU (e.g. cache miss).

An external memory access is asynchronous to the CPU

Execution time variation as a function of the CPU frequency depends on the workload composition of the task.

∂= + ⇒ = −

on off ontask

task 2cpu ext cpu cpu

TW W WTf f f f

Fixed (100MHz for SDRAM access)

Varied(333MHz to 733MHz)

Page 16: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Energy saving via workload decompositionEnergy saving via workload decompositiongy g pgy g p

For memory-bound application programs, CPU energy b d ith th l f ltcan be saved with a rather low performance penalty.

f cpu = fmax / 2f cpu = fmaxD 18

8 2 16 2a.

Ta=10 T’a=18 (80% PFloss)a’.

CPU-boundD=18

5 5 10 5b.Tb=10 T’b=15 (50%)

b’.

2 8T 4 8 T

c.Tc=10 T’c=12 (20%)

c’.

memory-boundOn-chip workOff-chip work

memory boundLower f cpu can be set for “b” & “c”,

resulting in higher energy saving

Page 17: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

DVFS with workload decompositionDVFS with workload decompositionDVFS with workload decompositionDVFS with workload decomposition

With workload decomposition, the target frequency, f i l l t d

=onWf + +

on offon off W WT T T

ftarget, is calculated as

=−target offf

D T= + = +on off

task cpu extT T Tf f

Note thaton WW target frequency without

workload decomposition≤

−task

off

WWD T D

Workload decomposition–based DVFS results in lower CPU energy consumption due to more aggressiveCPU energy consumption due to more aggressive voltage scaling.

Page 18: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Decomposing the workload at runtimep g

Utilize the embedded hardware in modern i i th f it i itmicroprocessors, i.e., the performance monitoring unit

(PMU).PMU can report 15 ~ 20 different dynamic events duringPMU can report 15 ~ 20 different dynamic events during execution of a program

Cache hit/miss counts TLB hit/miss countsNo. of stall cyclesT t l f i t ti b i t dTotal no. of instructions being executed Branch misprediction counts.

Based on events from the PMU workload mayBased on events from the PMU, workload may accurately be decomposed at runtime.

Page 19: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

OutlineOutline

Introduction and review of basic conceptsDynamic voltage and frequency scalingWorkload decompositionDVFS targeting total system energy reductionConclusion and research directions

Page 20: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Overview of prior DVFS worksOverview of prior DVFS workspp

Most DVFS methods are concerned about CPU energy reduction onlyreduction only

More precisely, dynamic portion of the CPU energyLower CPU frequency always causes less CPU energy.

Most computing systems, however, comprise of many subsystems such as memory subsystems and peripheral devicesperipheral devices.

Battery lifetime also depends on power consumption in subsystems, which is not affected by CPU frequency changeschanges.Lowering CPU frequency can cause shorter battery lifetime due to an increase in the standing and idle portions of the system energy consumptionsystem energy consumption.

Page 21: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

System energy with DVFSSystem energy with DVFSSystem energy with DVFSSystem energy with DVFS

A computing system with a CPU and n memory and I/O b tI/O subsystems

CPUsub2

sub1Vsys

Gndbattery

Consider a CPU bound application as an example

subn

Consider a CPU-bound application as an examplePower = =

1, 1max maxcpu cpu

n

f P = =

=∑

0.5, 0.125

1

cpu cpu

n

f P

P=

=

=

∑1

1

2

isubi

maxsys

P

E

=

=

=

∑1

1

2.125

isubi

sys

P

EcpuP

∑ i

n

subi

P1

6.25% higher energy consumption0 1 2 Time0 1 2

=i 1

Page 22: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

DVFS for the minimal system energyDVFS for the minimal system energyy gyy gy

Timing constraintDifferent applications exhibit different execution time variation as a function of the CPU frequency.Need an accurate task execution time model as a function of the CPU frequency.

Minimal system energyEach component’s power consumption must be known a priori.Information about the power state of each component (i.e., p p ( ,active or idle state info) is also required.

These two requirements can be satisfied by using the kl d d iti hworkload decomposition approach.

Page 23: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Timing constraintTiming constraintTiming constraintTiming constraint

Program execution time, T

= + = +on off

on offcpu ext

W WT T Tf f

Given a task with workload, Won and Woff, and latency constraint, D

=⎛ ⎞

−⎜ ⎟⎝ ⎠

on

target off

ext

WfWDf

Freq. Freq.D D

W(Won, Woff)

fmax

W(Won, Woff)ftarget

Time Time

Page 24: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

System power breakdownSystem power breakdownSystem power breakdownSystem power breakdown

Power consumption profile severely fluctuates due to lt t ti f Won d Woffalternate execution of Won and Woff.

Won (Woff) results in CPU (subsystem) power consumption.System power consumption may thus be divided into

fixed variable when components

System power consumption may thus be divided into the following components:

fixed variable

idleremains unchanged

are not used

DC-DC converter, PLL,

CPU idle, memory is not accessedidle

activestandingidle + fixed

when each component is used for some task

leakage

CPU active, memory is

Obtained by simple measurements or using values in the spec.

, yaccessed

Page 25: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

System energy modelSystem energy modelSystem energy modelSystem energy model

Using workload decomposition, the t i d l d

fixed variable

system energy is modeled as:idle

activestanding= = ⋅ + ⋅ + ⋅∑∫3

1

Nt std act on act offsys sys sys cpu sub it

E P t P T P T P T,( )

without decomposition with decomposition

=1t i 1

powersysP t( ) power

sysP t( )

T =∑N

actsub i

iP ,

1

onT offT

actcpuP

active power

standing power

stdsysP

timet1 t3 timet1 t3t2

onT offT

Page 26: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

The BitsyX Platform The BitsyX Platform e tsy at oe tsy at o

The ADS’s BitsyX board has a PXA255 microprocessor hi h i 32 bit RISC ith 32KBwhich is a 32-bit RISC processor core, with a 32KB

instruction cache and a 32KB write-back data cache, a 2KB mini-cache, a write buffer, and a memory management unit y g(MMU) combined in a single chip.

PXA255 processor

Page 27: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Clock frequencies in BitsyXClock frequencies in BitsyXClock frequencies in BitsyXClock frequencies in BitsyX

PXA255 can operate from 100MHz to 400MHz, with a fcore supply voltage of 0.85V to 1.3V f cpu

.

Internal bus (PXbus) connects the core and other functional blocks inside the CPU f intfunctional blocks inside the CPU f int

.

External bus is connected to SDRAM (64MB) f ext

Wh f cpu i h d f int d f ext l h dWhen f cpu is changed, f int and f ext are also changed.

Page 28: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Frequency settings in BitsyXFrequency settings in BitsyX

Nine frequency combinations, Fn(f cpu, f int, f ext)

Freq. Set

f cpu

[MHz] V cpu [V] f int [MHz] f ext [MHz]

F1 100 0.85 50 100F2 133 0.85 66 133F 200 1 0 50 100F3 200 1.0 50 100F4 200 1.0 100 100F5 265 1.0 133 133F6 300 1.1 50 100F7 300 1.1 100 100F 400 1 3 100 100F8 400 1.3 100 100F9 400 1.3 200 100

Page 29: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Performance monitoring unit (PMU)

PMU on the PXA255 processor can report up to 15 diff t d i t t tidifferent dynamic events at run time.

Cache hit/miss counts, TLB hit/miss counts, No. of stall cycles, Total no. of instructions being executed, Branch y , g ,misprediction counts.

For DVFS, we use the PMU to generate statistics forTotal no. of instructions being executed (INSTR)No. of stall cycles due to on/off-chip data dependencies (STALL)( )No. of Data Cache misses (DMISS)

We also record the no. of clock cycles from the beginning of the program execution (CCNT).

Page 30: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Algorithm flow of the SE-DVFS for BitsyX

System power valuesDecompose workload

E ti ti d l

Pcpu, Pstd, Psub … Wtask Won and Woff

Execution time model Ttask (Fn) = Ton + Toff

System energy model, Esys(Fn)

DVFS policyAn optimal Fopt is adopted such thatTtask(Fopt) ≤ D with minimal Esys(Fopt)

Page 31: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Execution time and frequency settingsExecution time and frequency settingsExecution time variation for different frequency combinations – “math”, “crc”, “djpeg”, “qsort”, “gzip”

“math” is CPU-bound ( strongly dependent on f cpu ) “gzip” is memory-bound (f int & f ext dependent )

Freq. Set

f cpu

(MHz)f int

(MHz)f ext

(MHz)F1 100 50 1004

5

norm

.) math crc djpeg qsort gzipmathgzip

F2 133 66 133F3 200 50 100F4 200 100 1002

3

on ti

me

(n gzip

F5 265 133 133F6 300 50 100F7 300 100 100

1

Exec

utio

F8 400 100 100F9 400 200 100

01 2 3 4 5 6 7 8 9

Frequency combination

Page 32: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

OnOn--chip workload, chip workload, WWononp ,p ,

Total workload, Wtask, is modeled as:

= = ⋅∑N

i avgtaskW CPI N CPI

number of instructionsCPU clocks per instruction

( )=

= ⋅ + + +

∑taski

avg avg avg0 branch miss stall on stall offN CPI CPI CPI CPI

1

_ _ _

ideal CPI which is 1 for a single-issue processor

CPU clocks due to branch misprediction overhead

CPU clocks due to on-chip (off-chip) stalls

On-chip workload, Won, is given as:

( )

ideal CPI which is 1 for a single issue processor

( )= ⋅ = ⋅ + +on avg avg avgon branch miss stall onW N CPI N CPI CPI CPI0 _ _

Page 33: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

OnOn--chip CPI calculationchip CPI calculationOO c p C ca cu at oc p C ca cu at o

In our previous work on XScale80200-based system (DATE’04) b i d f h l f CPI(DATE’04), was obtained from the plot of CPIavg

vs. MPIavg.

avgonCPI

CCNT MEM= =avg avgCCNT MEMCPI MPI

INSTR INSTR,

XScale-80200 processor

CPIavg

CCNT

events description

number of executed instructionsnumber of clock counts

INSTRMPIavg

avgonCPI

CPIavg = b•MPIavg + c

MEM is not provided by the PMU of PXA255 processor

MEM number of off-chip accessesMPIavg

MEM is not provided by the PMU of PXA255 processorInstead, we used STALL and DMISS events.

Page 34: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Plot of CPIPlot of CPIavgavg vs. SPIvs. SPIavgavgPlot of CPIPlot of CPI vs. SPIvs. SPI

We define SPI as ratio of the number of stall cycles to the total instruction count

≡ = +avg avg avgon off

STALLSPI SPI SPIINSTR

the total instruction count

10

12gzip

10

12gzip= + +avg avg avg

on branch miss stall onCPI CPI CPI CPI0 _ _

minonCPI

4

6

8

CPI

avg

4

6

8

CPI

avg

CPI value without any stall cycles

Then, Won is rewritten as:0

2

4

0 2 4 6 8 100

2

4

0 2 4 6 8 10=on avgW N CPI 0 2 4 6 8 10

SPI avg

0 2 4 6 8 10

SPI avg

( )= ⋅

= ⋅ +

gon

min avgon on

W N CPI

N CPI SPI

Page 35: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Calculating SPICalculating SPIonon using Dusing D--cache misscache missgg onon gg

The more D-cache miss events, the higher the probability of off-chip accesses most stalls are off-chip stallschip accesses most stalls are off chip stalls.We define DPI as ratio of the number of D-cache miss events to the total instruction count.

≡avg DMISSDPIINSTRINSTR

= + = +avg min avg minon on on onCPI CPI SPI CPI dpi spi DPI2 ( )CPIavg

DPI dpi2spi(DPI)

DPI≤ k1 CPIonmax - CPIon

min

avgonCPI

maxonCPI CPU-bound

avgonCPI

CPIonmax

CPIonmin

k1<DPI≤ k2 DF•(n-1)

… … …

kn-2<DPI≤ kn-1 DF•2

k DPI k DF 1 i

+ ⋅minonCPI 2 DF

+ ⋅minonCPI (n -1) DF

SPIavg

(CPIonmax – CPIon

min)

kn is constant: k1 < k2 < … < kn

kn-1<DPI≤ kn DF•1

DPI > kn 0 minonCPI

+ ⋅minonCPI 1 DF

mem-bound

(CPIon CPIon )DF =

n

Page 36: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Calculating Calculating WWoffoff from from TToffoffgg

Woff is calculated from Toff which is given as

= − = −n n

n n

onoff on

F task n F cpu cpuF F

CCNT WT T F Tf f

( )

Toff is dependent on the f ext as well as f int.Example: when a D-cache miss occurs, two operations are performed:are performed:

Data fetch from the external memory (f ext)Data transfer to the CPU core where the cache-line andData transfer to the CPU core where the cache line and destination register are updated (f int)

Due to lack of exact timing information, we have opted to d l T ff ( ) offffmodel Toff as: ( )αα − ⋅⋅

= + = +n n n

n n

offoffoff off off

F int,F ext,F int extF F

1 WWT T Tf f

Page 37: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Execution time model summaryExecution time model summaryyy

Execution time, Ttask(Fn), in BitsyX system

( )αα − ⋅⋅= + + = + +

n n n

n n n

offon offon off off

task n F int,F ext,F cpu int extF F F

1 WW WT F T T Tf f f

( )

An α value of ~0.35 was obtained for tested applications

n n n

The average error in predicting the execution time was less than 2% for all nine frequency settings.

Page 38: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

System energy model for BitsyXSystem energy model for BitsyXy gy yy gy y

Using workload decomposition

Powernsys,FP t( )

= + +n n n n

on off offF F int,F ext,FT T T T

, n

offext FP

n

onFP

n

offint,FP

active power

stdP

t tt t

standing powern

offext,FT

n

offint,FT

n

onFT

nsys,FP

std on on off off off offE P T P T P T P T

Timet1 t4t2 t3

= ⋅ + ⋅ + ⋅ + ⋅n n n n n n n n

std on on off off off offsys F sys F F F int F int,F ext F ext,FE P T P T P T P T, , , ,

Page 39: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Accuracy of the system energy modelAccuracy of the system energy modelThe estimated energy consumption for “djpeg”

The average error rate is less than 4%.g

Freq. set

measured parameters [ mW ]

40

J]

measuredn

offext,FP

n

offint,FP

n

onFP

n

stdsys FP ,set

F1 1665 89 363 785F2 1757 148 479 785*1.33F3 1699 218 456 785

30

umpt

ion

[J measuredestimated

F3 1699 218 456 785F4 1728 217 766 785F5 1836 336 1018 785*1.33F 1732 344 575 785

10

20

nerg

y co

ns

F6 1732 344 575 785F7 1778 378 885 785F8 1869 673 1113 785F 1963 675 1733 785

01 2 3 4 5 6 7 8 9

Frequency combination

En

F9 1963 675 1733 785

k1 = 0.73 [nF], k2 = 6.2 [V2nF]

⋅ ⋅ + ⋅n n n n

off cpu intint,F F F FP k V f k f2

1 2∼

Page 40: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Scaling granularityScaling granularityg g yg g y

Fine-grained SE-DVFS may be applied to non real-ti li titime applications.Considering the scaling overhead, frequent voltage scaling may outweigh any advantage from DVFSscaling may outweigh any advantage from DVFS.OS quantum unit (~60 msec in Linux) is suitable as a scale unit, which is three orders of magnitude larger , g gthan the voltage scaling overhead (~500 μsec).Using the OS quantum, our DVFS can be applied to each process when it is scheduled.

Page 41: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Determining the optimal frequency settingDetermining the optimal frequency settingDetermining the optimal frequency settingDetermining the optimal frequency setting

First satisfy the timing constraint; Next find a setting th t i i i th t t l t (SE DVFS)that minimizes the total system energy (SE-DVFS).Pseudo code for optimal frequency selection:

1. Ψ = { Fmin , …, Fmax }, Γ = {φ }, and Emin = ∞2. for every frequency setting Fn in Ψ

Timing3. if ( )4. Γ = Γ ∪ Fn ;5 for every frequency setting F in Γ

Timing constraint ( )+ ≤ + ⋅

n max

i 1 iF loss FT 1 PF T CE-DVFS

5. for every frequency setting Fn in Γ6. calculate system energy using proposed model7. if ( ≤ Emin )

System energy minimization nsys FE ,

8. Emin = Esys,Fn; Fopt

i+1 = Fn ;minimization

Page 42: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

The software architectureThe software architectureThe software architecture comprises of a proc interface module and a policy setting module tightly linked with th Li h d l th PMU d th f dthe Linux scheduler, the PMU, and the freq. and voltage control circuitry on the BitsyX board.

“proc” Interface ModuleKernel Space

External PFloss input parameter

proc Interface Module

Linux Policy Setting ModuleLinux Scheduler

y g

PMU Access Module

DVFSModuleDVFS

PXA255 Processor

Page 43: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Power measurementPower measurementPower measurementPower measurement

Data acquisition system operates up to 100 kHz.

Power supplyR

Power supply(12V)

BitsyX

Data Acquisition

S

V+V-

System

Page 44: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Experimental results (I)Experimental results (I)p ( )p ( )

Comparing two DVFS techniques:SE-DVFS vs. CE-DVFS

Resulting performance lossSE DVFS

60

70

80

e [%

]

10% 20% 30% 40% 50%

Target PFloss

60

70

80

e [%

]

10% 20% 30% 40% 50%

Target PFloss

60

70

80

e [%

]

10% 20% 30% 40% 50%

Target PFloss

60

70

80

e [%

]

10% 20% 30% 40% 50%

Target PFloss

SE-DVFSCE-DVFS

30

40

50

60

erfo

rman

ce

30

40

50

60

erfo

rman

ce

30

40

50

60

erfo

rman

ce30

40

50

60

erfo

rman

ce

0

10

20

30

Act

ual p

e

0

10

20

30

Act

ual p

e

0

10

20

30A

ctua

l pe

0

10

20

30A

ctua

l pe

0math crc djpeg qsort gzip

0math crc djpeg qsort gzip

0math crc djpeg qsort gzip

0math crc djpeg qsort gzip

Page 45: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Experimental results (II)Experimental results (II)Experimental results (II)Experimental results (II)

Actual power consumption of two DVFS methodsFor “gzip” with 30% target PFloss, SE-DVFS results in 11.4% lower total system energy than CE-DVFS

5000

[mW

]

gzip, with 30% Target PFloss

5000

[mW

]

gzip, with 30% Target PFloss

5000

mW

]

gzip, with 30% Target PFloss

5000

mW

]

gzip, with 30% Target PFloss

SE-DVFSCE-DVFS

3000

4000

nsum

ptio

n [

avg. power : 2619mW, 6.531sec

3000

4000

nsum

ptio

n [

avg. power : 2619mW, 6.531sec

3000

4000

nsum

ptio

n [

avg. power : 2720.3mW, 5.568sec

3000

4000

nsum

ptio

n [

avg. power : 2720.3mW, 5.568sec

1000

2000

0 1 2 3 4 5 6 7 8

Pow

er c

o

Energy : 17.105J1000

2000

0 1 2 3 4 5 6 7 8

Pow

er c

o

Energy : 17.105J1000

2000

0 1 2 3 4 5 6 7 8

Pow

er c

o

Energy : 15.147J1000

2000

0 1 2 3 4 5 6 7 8

Pow

er c

o

Energy : 15.147J

0 1 2 3 4 5 6 7 8Time [sec]

0 1 2 3 4 5 6 7 8Time [sec]

0 1 2 3 4 5 6 7 8Time [sec]

0 1 2 3 4 5 6 7 8Time [sec]

Page 46: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

Experimental results (III)Experimental results (III)p ( )p ( )

CE-DVFS vs. SE-DVFSSE-DVFS results in 2% ~ 18% higher system energy savings compared to CE-DVFS

303030

renc

e [%

]

10% 20% 30% 40% 50%Target PFloss

30

renc

e [%

]

10% 20% 30% 40% 50%Target PFloss

20

ergy

diff

er 20

ergy

diff

er

10

yste

m e

ne 10

yste

m e

ne

0math crc djpeg qsort gzip

Sy 0math crc djpeg qsort gzip

Sy

Page 47: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

OutlineOutline

Introduction and review of basic conceptsDynamic voltage and frequency scalingWorkload decompositionDVFS targeting total system energy reductionConclusion and research directions

Page 48: Dynamic Voltage and Frequency Scaling for Energyfor … ·  · 2012-09-08Dynamic Voltage and Frequency Scaling for Energyfor Energy-Efficient System DesignEfficient System Design

ConclusionConclusion

A DVFS policy for the actual system energy reduction d d i l t d hi h liwas proposed and implemented, which uses online

decomposition of the application workload into on-chip and off-chip componentsand off chip components

Based on actual current measurements in the BitsyX platform up to 18% more system energy saving wasplatform, up to 18% more system energy saving was achieved with the proposed DVFS compared with the results in the previous DVFS techniques

For both CPU and memory-bound programs, the specified timing constraints were satisfied