Skip to content

Profiling energy consumption of Haskell programs

luisgabriel edited this page Dec 4, 2014 · 8 revisions

Idea

Collect fine-grained information about the energy consumption of Haskell programs. This can be done by extending the GHC profiler to analyse the power and energy of each cost centre of a Haskell program using the infomation provided by Intel RAPL.

How?

In order to validate the idea, the first prototype can extend the time profiler reusing its infra-structure. Internally the time profiler has a function handleProfTick() called every 1-20ms that we can use to sample the energy consumption. The gathered information can be stored in the CostCentre and CostCentreStack structs, which is also used by the time and heap profilers to store its information.

Tasks

  • Test and play with rapl-read
  • Setup the environment and build GHC
  • Adapt rapl-read to export useful functions
  • Compile rapl-read inside GHC and call it from RTS
  • Add the necessary fields to the cost centre structs
  • Sample the energy consumption inside the time profiler
  • Aggregate the energy costs
  • Change the report to include the energy information
Clone this wiki locally