{"id":324693,"name":"carbontracker","description":"Track and predict the energy consumption and carbon footprint of training deep learning models.","url":"https://github.com/saintslab/carbontracker","last_synced_at":"2026-04-07T04:30:14.317Z","repository":{"id":59743843,"uuid":"257581525","full_name":"saintslab/carbontracker","owner":"saintslab","description":"Track and predict the energy consumption and carbon footprint of training deep learning models.","archived":false,"fork":false,"pushed_at":"2026-03-16T09:40:13.000Z","size":3117,"stargazers_count":475,"open_issues_count":14,"forks_count":39,"subscribers_count":12,"default_branch":"master","last_synced_at":"2026-04-02T09:52:10.703Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saintslab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-21T12:01:38.000Z","updated_at":"2026-03-21T01:58:13.000Z","dependencies_parsed_at":"2024-01-12T04:48:50.852Z","dependency_job_id":"83f565b9-d87e-4ba2-ac3b-d6fbf3486c55","html_url":"https://github.com/saintslab/carbontracker","commit_stats":{"total_commits":124,"total_committers":6,"mean_commits":"20.666666666666668","dds":0.5483870967741935,"last_synced_commit":"1e001abfb93c4db91f3449a6bd5b8d0b58b83ac1"},"previous_names":["saintslab/carbontracker","lfwa/carbontracker"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/saintslab/carbontracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintslab%2Fcarbontracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintslab%2Fcarbontracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintslab%2Fcarbontracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintslab%2Fcarbontracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saintslab","download_url":"https://codeload.github.com/saintslab/carbontracker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintslab%2Fcarbontracker/sbom","scorecard":{"id":586888,"data":{"date":"2025-08-11","repo":{"name":"github.com/lfwa/carbontracker","commit":"8beb2b9dc124f910deeef9aaae39c45a9b017ca5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/deploy-docs.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-docs.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/deploy-docs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy-docs.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/deploy-docs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/publish.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:85: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/lfwa/carbontracker/test.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/deploy-docs.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:25","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:26","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:47","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:48","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:49","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:69","Warn: pipCommand not pinned by hash: .github/workflows/publish.yml:70","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:28","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:29","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:33","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:35","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of  13 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:57"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T20:45:28.942Z","repository_id":59743843,"created_at":"2025-08-20T20:45:28.942Z","updated_at":"2025-08-20T20:45:28.942Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31458838,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"owner":{"login":"saintslab","name":"Saints Lab ","uuid":"111062370","kind":"organization","description":"Team of researchers working on Sustainable Artificial INTelligence for Sciences","email":null,"website":null,"location":"Denmark","twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/111062370?v=4","repositories_count":1,"last_synced_at":"2023-09-21T09:55:04.791Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/saintslab","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2023-09-21T09:55:04.793Z","updated_at":"2023-09-21T09:55:04.793Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saintslab","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saintslab/repositories"},"packages":[],"commits":{"id":11179875,"full_name":"saintslab/carbontracker","default_branch":"master","total_commits":205,"total_committers":8,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":25.625,"dds":0.7219512195121951,"past_year_total_commits":22,"past_year_total_committers":2,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":11.0,"past_year_dds":0.18181818181818177,"last_synced_at":"2026-04-04T03:01:11.676Z","last_synced_commit":"4370afd8674d115e1823b9a49fd2f63bc19313b8","created_at":"2025-09-16T00:08:58.511Z","updated_at":"2026-04-04T03:00:53.869Z","committers":[{"name":"Lasse","email":"lassewolffanthony@gmail.com","login":"lfwa","count":57},{"name":"Rasmus Hag Løvstad","email":"rasmus.hag.lovstad@gmail.com","login":"Snailed","count":44},{"name":"kanding","email":"bmk1212@live.dk","login":"kanding","count":39},{"name":"Pedram Bakh","email":"56321501+PedramBakh","login":"PedramBakh","count":31},{"name":"dadyownes15","email":"mikkeljanusdahl@gmail.com","login":"dadyownes15","count":18},{"name":"Raghav","email":"raghav@di.ku.dk","login":"raghavian","count":14},{"name":"Laurențiu Nicola","email":"lnicola","login":"lnicola","count":1},{"name":"Andreas Fehlner","email":"fehlner@arcor.de","login":"andife","count":1}],"past_year_committers":[{"name":"dadyownes15","email":"mikkeljanusdahl@gmail.com","login":"dadyownes15","count":18},{"name":"Pedram Bakh","email":"56321501+PedramBakh","login":"PedramBakh","count":4}],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintslab%2Fcarbontracker/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-06T00:00:08.903Z","repositories_count":6211373,"commits_count":922180372,"contributors_count":35695556,"owners_count":1143952,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"saintslab/carbontracker","html_url":"https://github.com/saintslab/carbontracker","last_synced_at":"2026-01-16T17:05:54.210Z","status":null,"issues_count":1,"pull_requests_count":0,"avg_time_to_close_issue":null,"avg_time_to_close_pull_request":null,"issues_closed_count":0,"pull_requests_closed_count":0,"pull_request_authors_count":0,"issue_authors_count":1,"avg_comments_per_issue":2.0,"avg_comments_per_pull_request":null,"merged_pull_requests_count":0,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":1,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":1,"past_year_avg_comments_per_issue":2.0,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"created_at":"2025-09-16T00:08:58.910Z","updated_at":"2026-01-16T17:05:54.211Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintslab%2Fcarbontracker","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/saintslab%2Fcarbontracker/issues","issue_labels_count":{},"pull_request_labels_count":{},"issue_author_associations_count":{"NONE":1},"pull_request_author_associations_count":{},"issue_authors":{"iakkus":1},"pull_request_authors":{},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-02T00:00:07.988Z","repositories_count":14036822,"issues_count":34411009,"pull_requests_count":112524537,"authors_count":11216039,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{"NONE":1},"past_year_pull_request_author_associations_count":{},"past_year_issue_authors":{"iakkus":1},"past_year_pull_request_authors":{},"maintainers":[],"active_maintainers":[]},"events":{"total":{"ReleaseEvent":1,"DeleteEvent":1,"IssuesEvent":2,"WatchEvent":8,"IssueCommentEvent":2,"PushEvent":4,"CreateEvent":1},"last_year":{"ReleaseEvent":1,"DeleteEvent":1,"IssuesEvent":2,"WatchEvent":8,"IssueCommentEvent":2,"PushEvent":4,"CreateEvent":1}},"keywords":[],"dependencies":[{"ecosystem":"actions","filepath":".github/workflows/publish.yml","sha":null,"kind":"manifest","created_at":"2023-09-21T19:23:58.962Z","updated_at":"2023-09-21T19:23:58.962Z","repository_link":"https://github.com/saintslab/carbontracker/blob/master/.github/workflows/publish.yml","dependencies":[{"id":13856659123,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false},{"id":13856659124,"package_name":"actions/setup-python","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false},{"id":13856659125,"package_name":"pypa/gh-action-pypi-publish","ecosystem":"actions","requirements":"v1.4.2","direct":true,"kind":"composite","optional":false}]},{"ecosystem":"actions","filepath":".github/workflows/test.yml","sha":null,"kind":"manifest","created_at":"2023-09-21T19:23:59.191Z","updated_at":"2023-09-21T19:23:59.191Z","repository_link":"https://github.com/saintslab/carbontracker/blob/master/.github/workflows/test.yml","dependencies":[{"id":13856659128,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false},{"id":13856659129,"package_name":"actions/setup-python","ecosystem":"actions","requirements":"v3","direct":true,"kind":"composite","optional":false}]},{"ecosystem":"pypi","filepath":"pyproject.toml","sha":null,"kind":"manifest","created_at":"2023-09-21T19:23:59.587Z","updated_at":"2023-09-21T19:23:59.587Z","repository_link":"https://github.com/saintslab/carbontracker/blob/master/pyproject.toml","dependencies":[{"id":13856659131,"package_name":"requests","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false},{"id":13856659132,"package_name":"numpy","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false},{"id":13856659133,"package_name":"pandas","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false},{"id":13856659134,"package_name":"geocoder","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false},{"id":13856659135,"package_name":"pynvml","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false},{"id":13856659136,"package_name":"psutil","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false},{"id":13856659137,"package_name":"importlib-metadata","ecosystem":"pypi","requirements":"*","direct":true,"kind":"runtime","optional":false}]}],"score":8.271804031154709,"created_at":"2025-09-16T00:08:50.114Z","updated_at":"2026-04-07T04:30:14.318Z","avatar_url":"https://github.com/saintslab.png","language":"Python","category":"Consumption","sub_category":"Computation and Communication","monthly_downloads":0,"total_dependent_repos":0,"total_dependent_packages":0,"readme":"# **carbontracker**\n[![Build](https://github.com/lfwa/carbontracker/actions/workflows/publish.yml/badge.svg)](https://github.com/lfwa/carbontracker/actions)\n[![PyPI](https://img.shields.io/pypi/v/carbontracker?label=PyPI)](https://pypi.org/project/carbontracker/)\n[![Python](https://img.shields.io/badge/python-%3E%3D3.7-blue)](https://www.python.org/downloads/)\n[![Unit Tests](https://github.com/lfwa/carbontracker/actions/workflows/test.yml/badge.svg)](https://github.com/lfwa/carbontracker/actions)\n[![License](https://img.shields.io/github/license/lfwa/carbontracker)](https://github.com/lfwa/carbontracker/blob/master/LICENSE)\n[![Downloads](https://static.pepy.tech/badge/carbontracker)](https://pepy.tech/project/carbontracker)\n\n[Website](https://carbontracker.info)\n\n## About\n**carbontracker** is a tool for tracking and predicting the energy consumption and carbon footprint of training deep learning models as described in [Anthony et al. (2020)](https://arxiv.org/abs/2007.03051).\n\n## Citation\nKindly cite our work if you use **carbontracker** in a scientific publication:\n```\n@misc{anthony2020carbontracker,\n  title={Carbontracker: Tracking and Predicting the Carbon Footprint of Training Deep Learning Models},\n  author={Lasse F. Wolff Anthony and Benjamin Kanding and Raghavendra Selvan},\n  howpublished={ICML Workshop on Challenges in Deploying and monitoring Machine Learning Systems},\n  month={July},\n  note={arXiv:2007.03051},\n  year={2020}}\n```\n_\n## Installation\n### PyPI\n```\npip install carbontracker\n```\n\n### Optional Dependencies\nTo generate PDF reports from carbontracker logs, install with the `pdfreport` extra:\n```\npip install 'carbontracker[pdfreport]'\n```\n\n## Basic usage\n\n### Command Line Mode\nWrap any of your scripts (python, bash, etc.):\n\n`carbontracker python script.py\n`\n### Embed into Python Scripts\n\n#### Required arguments\n- `epochs`:\n  Total epochs of your training loop.\n#### Optional arguments\n- `epochs_before_pred` (default=1):\n  Epochs to monitor before outputting predicted consumption. Set to -1 for all epochs. Set to 0 for no prediction.\n- `monitor_epochs` (default=1):\n  Total number of epochs to monitor. Outputs actual consumption when reached. Set to -1 for all epochs. Cannot be less than `epochs_before_pred` or equal to 0.\n- `update_interval` (default=10):\n  Interval in seconds between power usage measurements are taken.\n- `interpretable` (default=True):\n  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.\n- `stop_and_confirm` (default=False):\n  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.\n- `ignore_errors` (default=False):\n  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.\n- `components` (default=\"all\"):\n  Comma-separated string of which components to monitor. Options are: \"all\", \"gpu\", \"cpu\", or \"gpu,cpu\".\n- `devices_by_pid` (default=False):\n  If True, only devices (under the chosen components) running processes associated with the main process are measured. If False, all available devices are measured (see Section 'Notes' for jobs running on SLURM or in containers). Note that this requires your devices to have active processes before instantiating the `CarbonTracker` class.\n- `log_dir` (default=None):\n  Path to the desired directory to write log files. If None, then no logging will be done.\n- `log_file_prefix` (default=\"\"):\n  Prefix to add to the log file name.\n- `verbose` (default=1):\n  Sets the level of verbosity.\n- `decimal_precision` (default=6):\n  Desired decimal precision of reported values.\n- `sim_cpu` (default=None):\n  Name of the simulated CPU. If set, will use simulated CPU power measurements.\n- `sim_cpu_tdp` (default=None):\n  Thermal Design Power (TDP) in Watts for the simulated CPU. Required if `sim_cpu` is set.\n- `sim_cpu_util` (default=None):\n  CPU utilization factor between 0 and 1. If not set, defaults to 0.5 (50% utilization).\n- `sim_gpu` (default=None):\n  Name of the simulated GPU. If set, will use simulated GPU power measurements.\n- `sim_gpu_watts` (default=None):\n  Power consumption in Watts for the simulated GPU. Required if `sim_gpu` is set.\n- `sim_gpu_util` (default=None):\n  GPU utilization factor between 0 and 1. If not set, defaults to 0.5 (50% utilization).\n\n#### Example usage\n\n```python\nfrom carbontracker.tracker import CarbonTracker\n\ntracker = CarbonTracker(epochs=max_epochs)\n\n# Training loop.\nfor epoch in range(max_epochs):\n    tracker.epoch_start()\n    \n    # Your model training.\n\n    tracker.epoch_end()\n\n# Optional: Add a stop in case of early termination before all monitor_epochs has\n# been monitored to ensure that actual consumption is reported.\ntracker.stop()\n```\n\n#### Example output\n##### Default settings\n```\nCarbonTracker: \nActual consumption for 1 epoch(s):\n        Time:   0:00:10\n        Energy: 0.000038 kWh\n        CO2eq:  0.003130 g\n        This is equivalent to:\n        0.000026 km travelled by car\nCarbonTracker: \nPredicted consumption for 1000 epoch(s):\n        Time:   2:52:22\n        Energy: 0.038168 kWh\n        CO2eq:  4.096665 g\n        This is equivalent to:\n        0.034025 km travelled by car\nCarbonTracker: Finished monitoring.\n```\n##### verbose=2\n```\nCarbonTracker: The following components were found: CPU with device(s) cpu:0.\nCarbonTracker: Average carbon intensity during training was 82.00 gCO2eq/kWh at detected location: Copenhagen, Capital Region, DK.\nCarbonTracker: \nActual consumption for 1 epoch(s):\n        Time:   0:00:10\n        Energy: 0.000041 kWh\n        CO2eq:  0.003357 g\n        This is equivalent to:\n        0.000028 km travelled by car\nCarbonTracker: Carbon intensity for the next 2:59:06 is predicted to be 107.49 gCO2eq/kWh at detected location: Copenhagen, Capital Region, DK.\nCarbonTracker: \nPredicted consumption for 1000 epoch(s):\n        Time:   2:59:06\n        Energy: 0.040940 kWh\n        CO2eq:  4.400445 g\n        This is equivalent to:\n        0.036549 km travelled by car\nCarbonTracker: Finished monitoring.\n```\n\n## Parsing log files\n\n### Aggregating log files\n**carbontracker** supports aggregating all log files in a specified directory to a single estimate of the carbon footprint.\n#### Example usage\n```python\nfrom carbontracker import parser\n\nparser.print_aggregate(log_dir=\"./my_log_directory/\")\n```\n#### Example output\n```\nThe training of models in this work is estimated to use 4.494 kWh of electricity contributing to 0.423 kg of CO2eq. This is equivalent to 3.515 km travelled by car. Measured by carbontracker (https://github.com/lfwa/carbontracker).\n```\n\n### Convert logs to dictionary objects\nLog files can be parsed into dictionaries using `parser.parse_all_logs()` or `parser.parse_logs()`.\n#### Example usage\n```python\nfrom carbontracker import parser\n\nlogs = parser.parse_all_logs(log_dir=\"./logs/\")\nfirst_log = logs[0]\n\nprint(f\"Output file name: {first_log['output_filename']}\")\nprint(f\"Standard file name: {first_log['standard_filename']}\")\nprint(f\"Stopped early: {first_log['early_stop']}\")\nprint(f\"Measured consumption: {first_log['actual']}\")\nprint(f\"Predicted consumption: {first_log['pred']}\")\nprint(f\"Measured GPU devices: {first_log['components']['gpu']['devices']}\")\n```\n#### Example output\n```\nOutput file name: ./logs/2020-05-17T19:02Z_carbontracker_output.log\nStandard file name: ./logs/2020-05-17T19:02Z_carbontracker.log\nStopped early: False\nMeasured consumption: {'epochs': 1, 'duration (s)': 8.0, 'energy (kWh)': 6.5e-05, 'co2eq (g)': 0.019201, 'equivalents': {'km travelled by car': 0.000159}}\nPredicted consumption: {'epochs': 3, 'duration (s)': 25.0, 'energy (kWh)': 1000.000196, 'co2eq (g)': 10000.057604, 'equivalents': {'km travelled by car': 10000.000478}}\nMeasured GPU devices: ['Tesla T4']\n```\n\n### Generating PDF reports\nCarbontracker can generate detailed PDF reports from log files. This feature requires the optional `reportlab` dependency.\n\n\u003e **Note:** You must install the PDF report dependencies first:\n\u003e ```\n\u003e pip install 'carbontracker[pdfreport]'\n\u003e ```\n\n#### Example usage\n```python\nfrom carbontracker.report import generate_report_from_log\n\ngenerate_report_from_log(\"./logs/carbontracker.log\", \"./report.pdf\")\n```\n\nThe generated PDF includes:\n- Energy consumption metrics and visualizations\n- Carbon footprint analysis with CO2eq calculations\n- Power usage breakdown by component (CPU/GPU)\n- Training duration and efficiency metrics\n\n\n## Compatibility\n**carbontracker** is compatible with:\n- NVIDIA GPUs that support [NVIDIA Management Library (NVML)](https://developer.nvidia.com/nvidia-management-library-nvml)\n- Intel CPUs that support [Intel RAPL](http://web.eece.maine.edu/~vweaver/projects/rapl/rapl_support.html)\n- Slurm\n- Google Colab / Jupyter Notebook\n\n\n## Notes\n### Availability of GPUs and Slurm\n- Available GPU devices are determined by first checking the environment variable `CUDA_VISIBLE_DEVICES` (only if `devices_by_pid`=False otherwise we find devices by PID). This ensures that for Slurm we only fetch GPU devices associated with the current job and not the entire cluster. If this fails we measure all available GPUs.\n- NVML cannot find processes for containers spawned without `--pid=host`. This affects the `device_by_pids` parameter and means that it will never find any active processes for GPUs in affected containers. \n\n## Extending **carbontracker**\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Star History\n[![Star History Chart](https://api.star-history.com/svg?repos=lfwa/carbontracker\u0026type=Date)](https://star-history.com/#lfwa/carbontracker\u0026Date)\n\n## carbontracker in media\n* Official press release from University of Copenhagen can be obtained here: [en](https://news.ku.dk/all_news/2020/11/students-develop-tool-to-predict-the-carbon-footprint-of-algorithms/) [da](https://nyheder.ku.dk/alle_nyheder/2020/11/studerende-opfinder-vaerktoej-der-forudsiger-algoritmers-co2-aftryk/)\n\n* Carbontracker has recieved some attention in popular science forums within, and outside of, Denmark [[1](https://videnskab.dk/teknologi-innovation/kunstig-intelligens-er-en-kaempe-klimasynder-men-unge-danskeres-nye-vaerktoej)][[2](https://www.anthropocenemagazine.org/2020/11/time-to-talk-about-carbon-footprint-artificial-intelligence/)][[3](https://www.theregister.com/2020/11/04/gpt3_carbon_footprint_estimate/)][[4](https://jyllands-posten.dk/nyviden/ECE12533278/kunstig-intelligens-er-en-kaempe-klimasynder-men-nyt-dansk-vaerktoej-skal-hjaelpe/)][[5](https://www.sciencenewsforstudents.org/article/training-ai-energy-emissions-climate-risk)][[6](https://www.digitaltrends.com/news/carbontracker-deep-learning-sustainability/)][[7](https://www.prosa.dk/artikel/detail/news/effektivt-vaaben-mod-klimaforandringer/)][[8](https://medium.com/techtalkers/artificial-intelligence-contributes-to-climate-change-heres-how-405ff919186e)]\n\n\n\n","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":["automl"],"project_url":"https://ost.ecosyste.ms/api/v1/projects/324693","html_url":"https://ost.ecosyste.ms/projects/324693"}