Quick Start

Last updated: Oct 28th,2025

Software Library Energy Meter (SLEM) : An Automated Energy Measurement Tool for Software Libraries


Tool Description

SLEM is an energy measurement tool designed to measure energy consumption seamlessly across various software frameworks, libraries, and custom scripts. At its core, SLEM utilizes the Intel Running Average Power Limit (RAPL) interface, a widely recognized mechanism for monitoring and reporting the energy consumption of vari- ous system-on-chip (SoC) power domains.
The tool features a user-friendly interface that eliminates the need for manual script writing, allowing users to seamlessly specify input parameters for API-level energy consumption measurements.
The current version of the tool supports only Linux , with plans to extend support to Windows and MacOS in future updates.

Installation

Requirements

  • Intel processors from the Celeron, Pentium, Core i3, i7, i9, and Xeon series, featuring the Sandy Bridge or newer architecture.
  • Linux distribution Debian based operating system. We have tested on Ubuntu 20.04.6 LTS
  • Python version 3.7.0 and above. Install from here

Github Repo

Our entire codebase is in this Github repo : https://github.com/rishalab/SLEM.git, you can either clone or download it to check it.

git clone https://github.com/rishalab/SLEM.git

Usage

  1. Granting Access to Energy RAPL for Experimentation
  2. To measure energy consumption using RAPL domains, ensure that your system provides the necessary read access to the powercap files. By default, these files are often restricted, and you may need to grant temporary access during experiments.
    sudo chmod -R +r /sys/class/powercap/
  3. Navigate to the src folder:
  4. cd path/to/SLEM/src
  5. Run the main.py file:
  6. python3 main.py
    or
    python main.py
  7. Upon running main.py, the following screen will appear:
  8. SLEM interface
  9. The interface contains the following sections:
    1. Module Selection
    2. File Selection
    3. Dataset Selection
    4. Module Manager
    5. Dataset Manager
    6. Reporting Module
    7. Parameter Configuration Screen
  10. To measure the energy consumption of a specific module (e.g., numpy), follow these steps:
    • Enter the module name in the Module Manager (e.g., numpy).
    • Click the Add button.
    • The module will then be available in the Module Selection dropdown on the left side of the screen.
  11. Select the desired module from the dropdown to display all its functions, as shown below:
  12. Module functions
  13. Select the checkbox of the function you want to measure. The parameters of the selected function will appear in the Parameter Configuration Screen.
  14. Adjust the parameters as needed, specify the frequency (number of iterations), and set the interval time (time gap between iterations in seconds).
  15. Click the Run button to execute the experiment. The results will be displayed in the Reporting Module at the bottom.
  16. You can also define your own functions in a Python file (e.g., measure_energy.py).
    • Click the Browse button in the File Selection module to navigate to and select your file.
    • Select your file from the Module Selection dropdown. All defined functions in the file will be displayed below.
  17. To upload a dataset:
    • Click the Browse button in the Dataset Manager section and select the desired dataset.
    • Each loaded dataset is assigned a dataframe ID (e.g., df_0), visible in the Dataset Manager section at the bottom right.
    Dataset Manager
  18. The dataframe ID (e.g., df_0) can be used as an argument in functions requiring dataset input.

Architecture Overview

The tool consists of three primary components, as shown in Fig. 1 and described below:

  • Energy Measurement Engine (Main):
    At the core of SLEM is the energy measurement module, which utilizes the powercap interface to interact with hardware-level interfaces and collect real-time energy consumption data for specific functions.
  • Graphical User Interface (GUI):
    A user-friendly GUI enables seamless interaction, providing an intuitive platform for selecting files, datasets, functions, and parameters for profiling.
  • Execution and Reporting Module (RUNNER):
    This component handles the execution of selected functions with user-defined parameters and generates energy consumption reports for analysis.
elegant icons

Functional Workflow

  1. File and Dataset Selection:
    Upon launching SLEM, the user is presented with an interface to select the source file, the modules within the file, and the datasets. This step ensures that the tool is adaptable for various projects and applications.
  2. Function Identification:
    Once a file is loaded, the tool analyzes the source code to extract the list of functions. These functions are displayed to the user in a selectable list format.
  3. Parameter Configuration:
    After selecting a function, the user is prompted to configure profiling parameters:
    • Frequency: The number of times the selected function is executed to minimize random errors and improve precision.
    • Time Interval: The duration between consecutive runs of the selected function, enabling precise control over execution timing.
  4. Execution:
    A Run button initiates the execution of the selected function with the configured parameters. The energy measurement engine tracks the energy consumption in real-time during the execution.
  5. Results Visualization:
    The energy profiling results are stored in a CSV file generated after the function is run. This file contains package, core, uncore, and DRAM energy values.

Example Functionality

  1. Testing for custom script in the SLEM tool

    screenshot

Goal

The goal of SLEM is to provide an intuitive and efficient platform for profiling the energy consumption of software functions, enabling developers and researchers to optimize performance and reduce energy usage. By offering real-time energy measurement, comprehensive reporting, and a user-friendly interface, the tool empowers users to make data-driven decisions for energy-efficient software development and analysis.

Limitations

The current setup includes energy overhead from the GUI, impacting the accuracy of computational task measurements. We plan to develop a command-line version to reduce this overhead. Additionally, the tool is currently unavailable on Windows and macOS, with plans for future cross-platform compatibility.

Results

For this evaluation, the Adult dataset and the US Census dataset, both widely recognized benchmarks in machine learning and data processing, were utilied. The dataframe processing tasks executed during the evaluation were consistent with those described by Shanbhag et al., ensuring methodological alignment. The evaluation results can be found here : Results

Demo Video

Contributors

Akilesh P, Shivadharshan S, Rajrupa chattaraj, Sridhar Chimalakonda, Vibhu Saujanya Sharma, Vikrant Kaulgud