Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MAGEEC

 MAGEEC

At the GNU Tools Cauldron in California, Jeremy Bennett and I introduced the MAGEEC project to the GCC community and began discussions on how we aim to reduce software energy usage.

Simon Cook

July 11, 2013
Tweet

More Decks by Simon Cook

Other Decks in Technology

Transcript

  1. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license What is MAGEEC? Today we optimize for speed or space
  2. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license What is MAGEEC? Today we optimize for speed or space What if we could optimize for energy usage?
  3. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license How We Got Here Research into modeling energy usage
  4. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license How We Got Here Research into modeling energy usage Energy measurement
  5. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license How We Got Here Research into modeling energy usage Research into feedback directed optimization Energy measurement
  6. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license How We Got Here Research into modeling energy usage Research into feedback directed optimization Energy measurement
  7. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license How We Got Here Research into modeling energy usage Research into feedback directed optimization Energy measurement
  8. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license How We Got Here Research into modeling energy usage Research into feedback directed optimization Energy measurement
  9. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Literature Review • Energy measuring and modeling – The software drained my battery. Kerstin Eder & Jeremy Bennett, NMI Yearbook 2012, www.embecosm.com/resources/articles/#EAR12. • MILEPOST GCC - Feedback directed optimization – ctuning.org/milepost-gcc • Measurement of compiler energy usage – Identifying Compiler Options to Minimize Energy Consumption for Embedded Platforms. James Pallister, Simon Hollis, Jeremy Bennett arxiv.org/abs/1303.6485 • MAGEEC – mageec.org
  10. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license What's New? Objective is energy optimization
  11. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license What's New? Objective is energy optimization Energy measured not modeled
  12. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Energy Measurement • Based on ST Discovery board – ARM Cortex A8 with ADC daughter board • Burst sample rate 6Msample/s – 192kB on-board RAM buffer – Short code samples e.g. superoptimizer • Sustained sample rate 2Msample/s – Pre-processed and Streamed off-board – Used for MAGEEC • The board in action: – mageec.org/wiki/Power_Sensing_Board
  13. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license What's New? Objective is energy optimization Generic framework: GCC and LLVM initially Energy measured not modeled
  14. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license What's New? Objective is energy optimization Generic framework: GCC and LLVM initially Energy measured not modeled Working system, not research prototype
  15. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Our Plan • Implement MILEPOST concepts in a generic way. • Train and evaluate based on real hardware energy measurements and existing passes. • Write and evaluate optimization passes specifcally for energy efficiency (Jörn Rennecke).
  16. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner Plugin I/F ML I/F MAGEEC MAGEEC
  17. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner * may be gen_features()
  18. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() * may be gen_features() init
  19. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() * may be gen_features() version / target init
  20. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() * may be gen_features() version / target version / target init
  21. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() * may be gen_features() version / target version / target init
  22. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() decision() * may be gen_features() version / target version / target program features init running loop
  23. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() decision() run_pass() * may be gen_features() version / target version / target program features pass list init running loop
  24. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() decision() run_pass() stats_gen()* * may be gen_features() version / target version / target program features pass list init running loop
  25. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() decision() run_pass() stats_gen()* next_pass() mod_stats()* * may be gen_features() version / target version / target program features pass list init running loop
  26. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() decision() run_pass() stats_gen()* next_pass() mod_stats()* decision() * may be gen_features() version / target version / target program features new features pass list init running loop
  27. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() decision() run_pass() stats_gen()* next_pass() mod_stats()* decision() end() * may be gen_features() version / target version / target program features new features pass list init running loop finish
  28. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() decision() run_pass() stats_gen()* next_pass() mod_stats()* decision() end() end() * may be gen_features() version / target version / target program features new features pass list init running loop finish
  29. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Overall Design Compiler Coordinator Machine Learner plugin_init() init() init() gen_features() decision() run_pass() stats_gen()* next_pass() mod_stats()* decision() end() end() end() * may be gen_features() version / target version / target program features new features pass list init running loop finish
  30. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Pass Constraints • The challenge for an arbitary order pass manager: only using valid combinations. • The machine learner can additionally learn about what options to avoid when selecting passes.
  31. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Flags • Today's optimisaction passes optimize for speed... again, why not have passes dedicated to energy? gcc -fenergy (or a more descriptive name)
  32. Copyright © 2013 Embecosm and University of Bristol Freely available

    under a Creative Commons license Community Involvement