Skip to main content

No project description provided

Project description

Have you ever wondered how much energy is used when training your neural network on the MNIST dataset? Want to get scared because of impact you are having on the evironment while doing "valuable" research? Are you interested in knowing how much carbon you are burning playing with DALL-E just to get attention on twitter? If the thing that was missing from your machine learning workflow was existential dread, this is the correct package for you!

Installation

$ pip install git+https://github.com/Helmholtz-AI-Energy/perun

Parallel h5py

To build h5py with mpi support:

CC=mpicc HDF5_MPI="ON" pip install --no-binary h5py h5py

Usage

Command line

To get a quick report of the power usage of a python script simply run

$ perun monitor path/to/your/script.py [args]

Decorator

Or decorate the function that you want analysed

from perun.monitor import monitor

@monitor
def training_loop(args, model, device, train_loader, test_loader, optimizer, scheduler):
    for epoch in range(1, args.epochs + 1):
        train(args, model, device, train_loader, optimizer, epoch)
        test(model, device, test_loader)
        scheduler.step()

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

perun-0.1.0b2.tar.gz (13.7 kB view hashes)

Uploaded Source

Built Distribution

perun-0.1.0b2-py3-none-any.whl (16.9 kB view hashes)

Uploaded Python 3

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