inferring energy bounds via static program analysis and
play

Inferring Energy Bounds via Static Program Analysis and - PowerPoint PPT Presentation

Inferring Energy Bounds via Static Program Analysis and Evolutionary Modeling of Basic Blocks Umer Liqat 1,3 c 1 Zorana Bankovi a 1,2 Manuel Hermenegildo 1,3 Pedro L opez-Garc 1 IMDEA Software Institute 2 Spanish Research Council (CSIC)


  1. Inferring Energy Bounds via Static Program Analysis and Evolutionary Modeling of Basic Blocks Umer Liqat 1,3 c 1 Zorana Bankovi´ ıa 1,2 Manuel Hermenegildo 1,3 Pedro L´ opez-Garc´ 1 IMDEA Software Institute 2 Spanish Research Council (CSIC) 3 Technical University of Madrid (UPM) LOPSTR, Namur, Belgium, Oct 11, 2017 U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  2. Motivation Energy consumption is a significant issue in systems ranging from: small Internet of Things (IoT) devices, sensors, smart watches, smart phones and portable/implantable medical devices, to large data centers and high-performance computing systems. A need for estimating the energy consumed by program executions . Often dependent on run-time data sizes (string length, signal samples, recursions, etc.). Different types of energy estimations can be performed, depending on the application: probabilistic, average, safe bounds, ... For verification → safe upper and lower bounds are required. Given an energy budget E b and safe upper- and lower-bound estimations, E u and E l respectively: E u ≤ E b = ⇒ the given program can be safely executed within the 1 existing energy budget. E l ≤ E b ≤ E u = ⇒ it might be possible to execute the program, but 2 we cannot claim it for certain. E b < E l = ⇒ it is not possible to execute the program (the system 3 will run out of batteries before program execution is completed). U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  3. Motivation Energy consumption is a significant issue in systems ranging from: small Internet of Things (IoT) devices, sensors, smart watches, smart phones and portable/implantable medical devices, to large data centers and high-performance computing systems. A need for estimating the energy consumed by program executions . Often dependent on run-time data sizes (string length, signal samples, recursions, etc.). Different types of energy estimations can be performed, depending on the application: probabilistic, average, safe bounds, ... For verification → safe upper and lower bounds are required. Given an energy budget E b and safe upper- and lower-bound estimations, E u and E l respectively: E u ≤ E b = ⇒ the given program can be safely executed within the 1 existing energy budget. E l ≤ E b ≤ E u = ⇒ it might be possible to execute the program, but 2 we cannot claim it for certain. E b < E l = ⇒ it is not possible to execute the program (the system 3 will run out of batteries before program execution is completed). U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  4. Motivation Energy consumption is a significant issue in systems ranging from: small Internet of Things (IoT) devices, sensors, smart watches, smart phones and portable/implantable medical devices, to large data centers and high-performance computing systems. A need for estimating the energy consumed by program executions . Often dependent on run-time data sizes (string length, signal samples, recursions, etc.). Different types of energy estimations can be performed, depending on the application: probabilistic, average, safe bounds, ... For verification → safe upper and lower bounds are required. Given an energy budget E b and safe upper- and lower-bound estimations, E u and E l respectively: E u ≤ E b = ⇒ the given program can be safely executed within the 1 existing energy budget. E l ≤ E b ≤ E u = ⇒ it might be possible to execute the program, but 2 we cannot claim it for certain. E b < E l = ⇒ it is not possible to execute the program (the system 3 will run out of batteries before program execution is completed). U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  5. Using Upper and Lower Bounds for Energy Verification We face an interesting safety/accuracy trade-off. Challenge: finding a practical compromise. Goal Estimate tight upper and lower bounds on the energy consumption of a program as functions on its input data sizes → that are practical for energy verification (and optimization). Approach A novel combination of static and dynamic (modeling) techniques. U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  6. Using Upper and Lower Bounds for Energy Verification We face an interesting safety/accuracy trade-off. Challenge: finding a practical compromise. Goal Estimate tight upper and lower bounds on the energy consumption of a program as functions on its input data sizes → that are practical for energy verification (and optimization). Approach A novel combination of static and dynamic (modeling) techniques. U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  7. Modeling at the Instruction Level (Choice 1) [LOPSTR13] B1 Energy ¡bound ¡ Each instruction is profiled (using, e.g., an ------ es-ma-on ¡ ------ Evolutionary Algorithm – EA) to derive upper- and lower-bound energy estimates. B2 These are combined using static analysis. ------ ------ B3 B4 + Very compositional. ------ ------ ------ ------ + Can infer functions of input data sizes. B6 B7 B5 − Bounds obtained are very conservative . ------ ------ ------ ------ ------ ------ − Dependence among instructions is not modeled (or very complex). U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  8. Modeling the Whole Program (Choice 2) The whole program is profiled using the B1 ------ EA to estimate upper/lower bounds ------ (no static analysis performed). B2 + Instruction dependence is captured. ------ ------ Energy ¡bounds ¡ ¡ ¡ ¡ + Bounds can be very precise (if no es-ma-on ¡ data-dependent branching). B3 B4 ------ ------ ------ ------ − The EA infers just one fixed cost for a given fixed input. B6 B7 B5 ------ ------ ------ − The EA becomes imprecise and ------ ------ ------ impractical due to data-dependent branching. U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  9. Our Proposal: Modeling at Basic Block Level Each basic block is profiled using the EA and upper/lower bounds estimated for B1 Basic-­‑block ¡bounds ¡ ¡ ¡ ¡ ------ each block. es0ma0on ¡ ------ Bounds over basic blocks are composed (by static analysis) to infer the bounds B2 ------ over the whole program. ------ + Inter-instruction dependence is captured B3 B4 within the blocks: more precise bounds. ------ ------ ------ ------ + The EA is precise and practical since no data-dependent branching within a block. B6 B7 B5 ------ ------ ------ + Infers functions of input data sizes. ------ ------ ------ − Inter-block dependence may be over- or under-estimated. U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  10. Overview of our Approach B1 B1 ------ UB ------ LB B2 B2 ------ UB SRA ¡es&ma&on ¡of ¡the ¡ ------ LB whole ¡program ¡ 3 ¡ ¡ B3 B4 B3 B4 Upper-­‑ ¡and ¡lower-­‑ ------ ------ UB UB ------ ------ bound ¡cost ¡func4ons ¡on ¡ LB LB input ¡data ¡sizes ¡of ¡the ¡ program. ¡ B6 B7 B6 B7 B5 B5 ------ ------ UB UB ------ UB ------ ------ LB LB ------ LB 1 ¡ 2 ¡ EA ¡es&ma&on ¡of ¡UB/LB ¡of ¡basic ¡blocks ¡ B1 B2 B3 B4 B5 B6 B7 UB UB UB UB UB UB UB LB LB LB LB LB LB LB U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  11. EA to Estimate Energy Consumption of Basic Blocks A custom EA is used to estimate the maximum/minimum energy consumption of each basic block. An individual is constructed from a set of input arguments to a basic block. The initial population includes randomly created individuals plus any known corner cases that may maximize/minimize the energy of basic blocks. Example: mutation operation U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  12. Dividing the Program into Basic Blocks U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

  13. Dividing the Program into Basic Blocks (Contd.) A basic block with k function call instructions is divided into k + 1 basic blocks without the function call instructions. A set of special instructions (e.g., entsp, retsp, bl, etc.) are measured separately. The memory accesses in each block are transformed into accesses to a fixed address in the local memory of the harness function. U. Liqat, Z. Bankovi´ c, P. L´ opez-Garc´ ıa, M. Hermenegildo Energy Bounds using Static Analysis and Evolutionary Algorithms

Recommend


More recommend