EdgePowerMeter

A High-Precision Power Profiling Tool for Edge AI Benchmarking

The EdgePowerMeter hardware interface connected to an NVIDIA Jetson Nano for real-time power analysis.

Abstract

EdgePowerMeter is a specialized hardware-software instrument designed for the precise measurement and analysis of power consumption in embedded AI systems. Addressing the need for granular energy profiling in edge computing, this tool combines a custom-designed ESP32-C3 based acquisition board with a high-throughput Python desktop application. It enables researchers to correlate power usage (Watts) with model inference performance (FPS), deriving critical efficiency metrics such as Joules per Inference and FPS/Watt, which are essential for optimizing neural networks on battery-constrained devices.

System Architecture

The system operates on a master-slave architecture where the embedded probe acquires telemetry data and streams it to a host workstation for visualization and logging.

Hardware Acquisition Layer

The sensing unit is built around the INA226, a high-precision current and power monitor with an I2C interface.

  • Microcontroller: ESP32-C3 RISC-V MCU, chosen for its low power consumption and native USB-Serial capabilities.
  • Sampling Rate: Configured for high-frequency sampling to capture transient power spikes typical of GPU workload bursts.
  • Communication: Utilizes a high-speed UART link (921600 baud) to transmit voltage, current, and power readings with minimal latency.

Software Analysis Suite

The host application is developed in Python using the PySide6 (Qt) framework, providing a responsive GUI for real-time data visualization.

  • Real-Time Plotting: Visualizes power consumption waveforms dynamically.
  • Metric Integration: Can ingest external performance logs (e.g., from a running AI model) to compute efficiency metrics in real-time.
  • Data Export: Supports logging to CSV and JSON formats for post-hoc analysis in tools like MATLAB or Pandas.

Implementation Details

Firmware (C++)

The firmware is optimized for throughput. It continuously polls the INA226 registers and formats the data into a lightweight binary or text protocol.

// Snippet: High-speed serial transmission
void loop() {
    float busVoltage = ina.readBusVoltage();
    float current_mA = ina.readShuntCurrent();
    float power_mW = ina.readBusPower();
    
    Serial.printf("%.3f,%.3f,%.3f\n", busVoltage, current_mA, power_mW);
    // Minimal delay to maximize sampling rate
}

Desktop Application (Python)

The desktop app uses multi-threading to decouple serial data acquisition from UI rendering, ensuring smooth performance even at high data rates.

# Snippet: Data Acquisition Thread
class Worker(QThread):
    def run(self):
        while self.running:
            line = self.serial_port.readline().decode('utf-8')
            voltage, current, power = parse_data(line)
            self.data_signal.emit(voltage, current, power)

Experimental Utility

This tool has been instrumental in benchmarking various edge accelerators, including the NVIDIA Jetson family and Raspberry Pi, allowing for:

  • Thermal Throttling Analysis: Observing power drops correlated with thermal events.
  • Model Quantization Impact: Quantifying the energy savings of INT8 vs FP16 inference.
  • Idle vs Load Profiling: Accurately measuring the baseline power consumption of carrier boards.

Resources