A Python package to monitor energy consumption and CO2 emissions for LLM models and other computational tasks.
Project description
Energy Monitor
A Python package to monitor energy consumption and CO2 emissions for LLM models and other computational tasks. The package provides tools to track power usage of both CPU and GPU, as well as monitor system memory usage. It also estimates CO2 emissions based on energy consumption.
Features
- Monitors CPU power usage
- Monitors GPU power usage (NVIDIA GPUs only)
- Monitors memory usage
- Estimates CO2 emissions based on energy consumption
Installation
You can install the package using pip:
pip install python-energy-monitor
Usage
You can use the EnergyMonitor class to start monitoring energy consumption and CO2 emissions:
from energy_monitor import EnergyMonitor
# Initialize the energy monitor
monitor = EnergyMonitor()
# Log energy consumption data
monitor.log_energy_consumption()
# Stop the emissions tracker and get CO2 emissions
monitor.stop_tracker()
# Shutdown the monitor
monitor.shutdown()
Requirements
- Python 3.6+
- psutil
- pynvml (for NVIDIA GPU monitoring)
- codecarbon (for CO2 emissions tracking)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_energy_monitor-0.0.1.tar.gz.
File metadata
- Download URL: python_energy_monitor-0.0.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2265bf2f78c85b6119ca555ea285bd7287d0504b7063e02c63f0f0b7c7b763f
|
|
| MD5 |
6f2418304da76d5c09bc0e7d96a5bacd
|
|
| BLAKE2b-256 |
61e4fa8a312d355904d88f205c373822db44e93ec111a0baf12807c545018c8c
|
File details
Details for the file python_energy_monitor-0.0.1-py3-none-any.whl.
File metadata
- Download URL: python_energy_monitor-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3728b4f723b42a739ac94325f33ba049cd54b1f4fe1430361c604e7fb803acc7
|
|
| MD5 |
eced5d4990abffe1f9f246be5dd096ba
|
|
| BLAKE2b-256 |
73e9ce1daabe37fdf49443f0826d646d0fb167a5026ec85c9bb758dc819b3b9a
|