mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1.18k stars 178 forks source link

RoCm support #445

Open fxmarty opened 1 year ago

fxmarty commented 1 year ago

Description

It would be great to add RoCm support to codecarbon. For now, codecarbon requires and depends on pynvml, that is an interface only for Nvidia GPUs. However, using AMD GPUs is becoming easier and easier, and we can expect some researchers to make the switch from Nvidia.

A WIP alternative for RoCm seem to be https://github.com/RadeonOpenCompute/pyrsmi

I could possibly submit a PR if there is interest.

benoit-cty commented 1 year ago

Hello, Thank you, I will be happy to help you made a PR for this. You have to modify https://github.com/mlco2/codecarbon/blob/master/codecarbon/core/gpu.py.

IlyasMoutawwakil commented 10 months ago

@fxmarty @benoit-cty I was able to perform all pynvml operations in gpu.py using amd-smi, pyrsmi lacks a lot of the metrics, I will submit a PR.