Skip to main content

Monitor the power consumption of a function

Project description

CarbonAI

This project aims at creating a python package that allows you to monitor the power consumption of any python function.

Documentation

The complete documentation is available here.

Getting started

Install

First of all you need to install the intel utility allowing you to monitor power consumption (support):

To install this package :

pip install carbonai

Example

There are several ways to use this package depending on how you develop. You just have to import the PowerMeter object, initialize it and call the function you want to monitor. Please insert a description of the running function, the dataset, the model, any info would be useful.

Function decorator

To monitor the power consumption of a function, follow this example:

from carbonai import PowerMeter
power_meter = PowerMeter(project_name="MNIST classifier")

@power_meter.measure_power(
  package="sklearn",
  algorithm="RandomForestClassifier",
  data_type="tabular",
  data_shape=<your_data>.shape,
  algorithm_params="n_estimators=300, max_depth=15",
  comments="Classifier trained on the MNIST dataset, 3rd test"
)
def my_func(arg1, arg2, ...):
  # Do something

Using the with statement

To monitor the power consumption of some specific inline code, you can use with statements

from carbonai import PowerMeter
power_meter = PowerMeter(project_name="MNIST classifier")

with power_meter(
  package="sklearn",
  algorithm="RandomForestClassifier",
  data_type="tabular",
  data_shape=<your_data>.shape,
  algorithm_params="n_estimators=300, max_depth=15",
  comments="Classifier trained on the MNIST dataset, 3rd test"
):
  # Do something

Contribute

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.

You can find details on how to contribute in our guide

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CarbonAI-0.2.1.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

CarbonAI-0.2.1-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

Details for the file CarbonAI-0.2.1.tar.gz.

File metadata

  • Download URL: CarbonAI-0.2.1.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.4.109+

File hashes

Hashes for CarbonAI-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8f212039b337667072c508f9b082d3ebc820607176b7b9bcc2713409a4950995
MD5 fc970aa885a5fbcedd36a4ee2a9726be
BLAKE2b-256 8a961987bc011108cc2955a9fce97cda6200b04953d9c1c5790551f190457f5a

See more details on using hashes here.

File details

Details for the file CarbonAI-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: CarbonAI-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.4.109+

File hashes

Hashes for CarbonAI-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36672f6aa00e54d73bfc910acbd2243e0c498985416b0371b9dddd2cee18f69e
MD5 cc0c1145a1c9e42cde7c97ba61c83955
BLAKE2b-256 67d38f3897095da412aff0e64561156b7b5d107f088403d78c78ce70f43e73b8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page