Green-Software-Foundation / Green-Software-Foundation/hack

GPU Carbon Estimator

Open
#105 2 comments 0 reactions 1 assignee Claimed by @burtchell View on GitHub
plug-in-project registered submitted
Dominant language
No language data
Stars
16
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### Prize category

Best Plugin

### Overview

At least one plugin that makes progress on an end-to-end method to estimate carbon emissions from GPUs.

Input is GPU power at regular timestamps (source of power measurement is up to the user). The output is carbon emissions in kgCO2.

The intention of the overall project is to function like the [Boavizta plugin](https://github.com/Green-Software-Foundation/if-unofficial-plugins/blob/main/src/lib/boavizta/README.md), but for GPUs. I will encapsulate computations into multiple plugins as needed. I assume GPU energy can easily be converted into carbon emissions using existing plugins, but I'll need to verify that.

### Questions to be answered

- None.

### Have you got a project team yet?

I am working on this project alone.

### Project team: "Meridian"

@dukeofjukes

### Terms of Participation

- [X] I agree to the hackathon [Rules & Terms](https://github.com/Green-Software-Foundation/hack/wiki/Rules-and-Terms) and [Code of Conduct](https://github.com/Green-Software-Foundation/hack/wiki/Code-of-Conduct)

---

## Project Submission

### Summary

I made an IF plugin called [`gpu-carbon-estimator`](https://github.com/dukeofjukes/gpu-carbon-estimator) that estimates carbon emissions from periodic power readings from a GPU.

### Problem

Currently, IF has no plugins that address carbon emissions for GPU. While the logic employed by my plugin is not necessarily unique to GPUs, it presents a first step to creating a workflow to estimate GPU carbon emissions using IF.

### Application

The plugin takes GPU power (watts), duration (seconds), and region as input. From power and duration, it calculates the energy (kWh). With the energy and region, it gets the carbon emissions (kgCO2) from the [Climatiq](https://www.climatiq.io/) API and returns it as output.

### Prize Category

Best Plugin.

### Judging Criteria

#### Overall Impact

This plugin is a first step towards supporting estimations of GPU carbon emissions using IF. Luckily, IF already has plugins that can estimates CPU and memory emissions, so this plugin can be _plugged in_ to a holistic pipeline very easily. Future work would need to investigate how this plugin would work for cloud use cases.

#### Opportunity

As mentioned above, IF does not currently have any GPU support. This plugin enables users of IF to add GPU estimations to their workflow. This plugin may also attract future users due to the fact that it strengthens IF's ability to holistically estimate a machine's carbon emissions.

#### Modular

Since GPU power is the primary input, any method can be used to gather this data. For example, novice users can use [`nvidia-smi`](https://developer.nvidia.com/nvidia-system-management-interface) or its underlying [`NVML`](https://developer.nvidia.com/nvidia-management-library-nvml) to estimate the GPU power of a program or a running system. Or, if a user has access to more accurate, direct measurement tools, they can use those instead.

### Video

https://youtu.be/BG4bEf-eIRY?si=tC_CrKUTj60tUu9D

### Artefacts

Repository: https://github.com/dukeofjukes/gpu-carbon-estimator

### Usage

Instructions to install and run the plugin are found in the repo's [`README.md`](https://github.com/dukeofjukes/gpu-carbon-estimator/blob/main/README.md).

### Process

I looked at a number of existing plugins (e.g., Boavizta, Teads Curve, TDP Finder) to consider the scope of what was possible with IF. In order to keep my plugin as modular as possible, I only wanted to handle the back-end conversion from power to carbon emissions, and leave the difficult problem of measuring/estimating power consumption of a GPU to those with more expertise. With these constraints, I landed on the solution of simply querying an existing carbon database.

### Inspiration

My PhD research is in parallel computing (primarily in GPUs), so I felt that the lack of a GPU plugin in IF was a major blind spot.

### Challenges

As a mostly Python/C/C++/CUDA programmer, the refresher on Typescript/Node.js was the biggest hurdle. Luckily, the documentation of IF and existing plugins alleviated that quickly. I wanted to investigate the cloud computing use case, but my lack of experience in that field and the time limit prevented me from being able to address it fully in this iteration. Perhaps I'll return to this work (or make another plugin) that can address it.

### Accomplishments

I'm glad I was able to get something done in time for the submission deadline!

### Learnings

I learned alot about carbon emissions estimations--mostly that estimating them is not as easy as it would seem. Developing my coding skills was also a nice benefit.

### What's next?

I want to make a simple script that runs a program and measures its power periodically, then writes the measurements to an output manifest for direct input into my pipeline. This hackathon submission is part of a project in my Green Computing course at Texas State University, so making this script will effectively enable the ability of end-to-end measurement/estimation.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.