Skip to main content

Tracking and predicting the carbon footprint of training deep learning models.

Project description

CarbonTracker

License: MIT

About

CarbonTracker is a tool for tracking and predicting the carbon footprint of training deep learning models.

Installation

PyPi install

pip install carbontracker

Basic usage

Required arguments

  • epochs: Total epochs of your training loop.

Optional arguments

  • epochs_before_pred (default=1): Epochs to monitor before outputting prediction. Set to -1 for all epochs.
  • monitor_epochs (default=1): Total number of epochs to monitor. Set to -1 for all epochs. Cannot be less than epochs_before_pred.
  • update_interval (default=10): Interval in seconds between power usage measurements are taken.
  • interpretable (default=True): If set to True then the CO2eq are also converted to interpretable numbers such as the equivalent distance travelled in a car, etc. Otherwise, no conversions are done.
  • stop_and_confirm (default=False): If set to True then the main thread (with your training loop) is paused after epochs_before_pred epochs to output the prediction and the user will need to confirm to continue training. Otherwise, prediction is output and training is continued instantly.
  • ignore_errors (default=False): If set to True then all errors will cause energy monitoring to be stopped and training will continue. Otherwise, training will be interrupted as with regular errors.
  • components (default="all"): Comma-separated string of which components to monitor. Options are: "all", "gpu", "cpu", or "gpu,cpu".
  • log_dir (default=None): Path to the desired directory to write log files. If None, then no logging will be done.
  • verbose (default=0): Sets the level of verbosity.

Example:

from carbontracker.tracker import CarbonTracker

tracker = CarbonTracker(epochs=max_epochs)

# Training loop.
for epoch in range(max_epochs):
    tracker.epoch_start()

    # Your model training

    tracker.epoch_end()

Compatability

CarbonTracker is compatible with:

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

carbontracker-1.0.4.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carbontracker-1.0.4-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file carbontracker-1.0.4.tar.gz.

File metadata

  • Download URL: carbontracker-1.0.4.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.5

File hashes

Hashes for carbontracker-1.0.4.tar.gz
Algorithm Hash digest
SHA256 882c4d6807319b3f25cd57943a742c1569c11428a00e7c66014c82e6c279c1a7
MD5 16c42a384bcce0bb7e0bb7075fb04671
BLAKE2b-256 507d1df0e3dc0f4158852b8009ad5465e4f23f11d87ec4a4588dcbfefd2cf187

See more details on using hashes here.

File details

Details for the file carbontracker-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: carbontracker-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.5

File hashes

Hashes for carbontracker-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fab90ab8cfff8d4bd09ef7b1b52711ea816d6602d0d3b61dda4a84a950870a02
MD5 6bbc48bf662de9dc632bd2ebed5a5df0
BLAKE2b-256 d779475b87a2fac8bd7cc8e54921f6ed1d01ac6da4a51f8bec7e14ef153bad24

See more details on using hashes here.

Supported by

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