diff --git a/.gitignore b/.gitignore index 3b1e627a9..bb4bf6ed8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ __pycache__/ *$py.class *intel_power_gadget_log.csv *powermetrics_log.txt +*macmon_log.txt !tests/test_data/mock* # C extensions diff --git a/codecarbon/core/macmon.py b/codecarbon/core/macmon.py new file mode 100644 index 000000000..da356da20 --- /dev/null +++ b/codecarbon/core/macmon.py @@ -0,0 +1,141 @@ +import os +import shutil +import subprocess +import sys +from typing import Dict + +import pandas as pd + +from codecarbon.core.util import detect_cpu_model +from codecarbon.external.logger import logger + + +def is_macmon_available() -> bool: + try: + macmon = MacMon() + return macmon._log_file_path is not None + except Exception as e: + msg = "Not using macmon, exception occurred while instantiating" + logger.debug(f"{msg} macmon : {e}") + return False + + +class MacMon: + """ + A class to interact with and retrieve power metrics on Apple Silicon devices using + the `macmon` command-line tool. + + This class implements a singleton pattern for the macmon process to avoid + running multiple instances simultaneously. + + Methods: + -------- + __init__(output_dir: str = ".", n_points=10, interval=100, + log_file_name="macmon_log.txt"): + Initializes the Applemacmon instance, setting up the log file path, + system info, and other configurations. + + get_details() -> Dict: + Parses the log file generated by `macmon` and returns a dictionary + containing the average CPU and GPU power consumption and energy deltas. + + start() -> None: + Starts the macmon process if not already running. + """ + + _osx_silicon_exec = "macmon" + + def __init__( + self, + output_dir: str = ".", + n_points=10, + interval=100, + log_file_name="macmon_log.txt", + ) -> None: + # Only initialize once + self._log_file_path = os.path.join(output_dir, log_file_name) + self._system = sys.platform.lower() + self._n_points = n_points + self._interval = interval + self._setup_cli() + self._process = None + + def _setup_cli(self) -> None: + """ + Setup cli command to run macmon + """ + if self._system.startswith("darwin"): + cpu_model = detect_cpu_model() + if cpu_model.startswith("Apple"): + if shutil.which(self._osx_silicon_exec): + self._cli = self._osx_silicon_exec + else: + msg = f"Macmon executable not found on {self._system}, install with `brew install macmon` or checkout https://github.com/vladkens/macmon for installation instructions" + raise FileNotFoundError(msg) + else: + raise SystemError("Platform not supported by MacMon") + + def _log_values(self) -> None: + """ + Logs output from Macmon to a file. If a macmon process is already + running, it will use the existing process instead of starting a new one. + """ + import multiprocessing + + returncode = None + if self._system.startswith("darwin"): + # Run the MacMon command and capture its output + cmd = [ + "macmon", + "-i", + str(self._interval), + "pipe", + "-s", + str(self._n_points), + ] + lock = multiprocessing.Lock() + with lock: + with open(self._log_file_path, "a") as f: # Open file in append mode + returncode = subprocess.call( + cmd, universal_newlines=True, stdout=f, text=True + ) + else: + return None + if returncode != 0: + logger.warning( + "Returncode while logging power values using " + f"Macmon: {returncode}" + ) + return + + def get_details(self) -> Dict: + """ + Fetches the CPU Power Details by fetching values from a logged csv file + in _log_values function + """ + self._log_values() + details = dict() + try: + data = pd.read_json(self._log_file_path, lines=True) + details["CPU Power"] = data["cpu_power"].mean() + details["CPU Energy Delta"] = (self._interval / 1000) * ( + data["cpu_power"].astype(float) + ).sum() + details["GPU Power"] = data["gpu_power"].mean() + details["GPU Energy Delta"] = (self._interval / 1000) * ( + data["gpu_power"].astype(float) + ).sum() + details["RAM Power"] = data["ram_power"].mean() + details["RAM Energy Delta"] = (self._interval / 1000) * ( + data["ram_power"].astype(float) + ).sum() + except Exception as e: + msg = ( + f"Unable to read macmon logged file at {self._log_file_path}\n" + f"Exception occurred {e}" + ) + logger.info(msg, exc_info=True) + return details + + def start(self) -> None: + # Start is handled in _log_values when needed + pass diff --git a/codecarbon/core/measure.py b/codecarbon/core/measure.py index 6f612a5da..3d70814f3 100644 --- a/codecarbon/core/measure.py +++ b/codecarbon/core/measure.py @@ -85,6 +85,13 @@ def do_measure(self) -> None: f"Energy consumed for AppleSilicon GPU : {self._total_gpu_energy.kWh:.6f} kWh" + f".Apple Silicon GPU Power : {self._gpu_power.W} W" ) + elif hardware.chip_part == "RAM": + self._total_ram_energy += energy + self._ram_power = power + logger.info( + f"Energy consumed for AppleSilicon RAM : {self._total_ram_energy.kWh:.6f} kWh." + + f"Apple Silicon RAM Power : {self._ram_power.W} W" + ) else: logger.error(f"Unknown hardware type: {hardware} ({type(hardware)})") h_time = perf_counter() - h_time diff --git a/codecarbon/core/resource_tracker.py b/codecarbon/core/resource_tracker.py index acd89e72e..509455fd1 100644 --- a/codecarbon/core/resource_tracker.py +++ b/codecarbon/core/resource_tracker.py @@ -1,7 +1,7 @@ from collections import Counter from typing import List, Union -from codecarbon.core import cpu, gpu, powermetrics +from codecarbon.core import cpu, gpu, macmon, powermetrics from codecarbon.core.config import parse_gpu_ids from codecarbon.core.util import detect_cpu_model, is_linux_os, is_mac_os, is_windows_os from codecarbon.external.hardware import CPU, GPU, MODE_CPU_LOAD, AppleSiliconChip @@ -17,19 +17,32 @@ def __init__(self, tracker): def set_RAM_tracking(self): logger.info("[setup] RAM Tracking...") - if self.tracker._force_ram_power is not None: - self.ram_tracker = ( - f"User specified constant: {self.tracker._force_ram_power} Watts" - ) - logger.info( - f"Using user-provided RAM power: {self.tracker._force_ram_power} Watts" - ) + + if macmon.is_macmon_available() and "M1" not in detect_cpu_model(): + logger.info("Tracking Apple RAM via MacMon") + self.ram_tracker = "MacMon" + ram = AppleSiliconChip.from_utils(self.tracker._output_dir, chip_part="RAM") + else: - self.ram_tracker = "RAM power estimation model" - ram = RAM( - tracking_mode=self.tracker._tracking_mode, - force_ram_power=self.tracker._force_ram_power, - ) + if macmon.is_macmon_available(): + logger.warning( + "MacMon is installed but cannot track RAM power on M1 chips, reverting to constant RAM power" + ) + + if self.tracker._force_ram_power is not None: + self.ram_tracker = ( + f"User specified constant: {self.tracker._force_ram_power} Watts" + ) + logger.info( + f"Using user-provided RAM power: {self.tracker._force_ram_power} Watts" + ) + else: + self.ram_tracker = "RAM power estimation model" + logger.info("Using RAM power estimation model based on the RAM size") + ram = RAM( + tracking_mode=self.tracker._tracking_mode, + force_ram_power=self.tracker._force_ram_power, + ) self.tracker._conf["ram_total_size"] = ram.machine_memory_GB self.tracker._hardware: List[Union[RAM, CPU, GPU, AppleSiliconChip]] = [ram] @@ -87,37 +100,24 @@ def set_CPU_tracking(self): "The RAPL energy and power reported is divided by 2 for all 'AMD Ryzen Threadripper' as it seems to give better results." ) # change code to check if powermetrics needs to be installed or just sudo setup - elif ( - powermetrics.is_powermetrics_available() - and self.tracker._force_cpu_power is None - ): - logger.info("Tracking Apple CPU and GPU via PowerMetrics") - self.gpu_tracker = "PowerMetrics" + elif macmon.is_macmon_available(): + self.cpu_tracker = "MacMon" + logger.info(f"Tracking Apple CPU using {self.cpu_tracker}") + elif powermetrics.is_powermetrics_available(): self.cpu_tracker = "PowerMetrics" + logger.info(f"Tracking Apple CPU using {self.cpu_tracker}") hardware_cpu = AppleSiliconChip.from_utils( self.tracker._output_dir, chip_part="CPU" ) self.tracker._hardware.append(hardware_cpu) self.tracker._conf["cpu_model"] = hardware_cpu.get_model() - hardware_gpu = AppleSiliconChip.from_utils( - self.tracker._output_dir, chip_part="GPU" - ) - self.tracker._hardware.append(hardware_gpu) - - self.tracker._conf["gpu_model"] = hardware_gpu.get_model() - self.tracker._conf["gpu_count"] = 1 else: # Explain what to install to increase accuracy cpu_tracking_install_instructions = "" if is_mac_os(): - if ( - "M1" in detect_cpu_model() - or "M2" in detect_cpu_model() - or "M3" in detect_cpu_model() - ): - cpu_tracking_install_instructions = "" - cpu_tracking_install_instructions = "Mac OS and ARM processor detected: Please enable PowerMetrics sudo to measure CPU" + if any((m in detect_cpu_model() for m in ["M1", "M2", "M3", "M4"])): + cpu_tracking_install_instructions = "Mac OS and ARM processor detected: Please enable PowerMetrics with sudo or MacMon to measure CPU" else: cpu_tracking_install_instructions = "Mac OS detected: Please install Intel Power Gadget or enable PowerMetrics sudo to measure CPU" elif is_windows_os(): @@ -209,6 +209,24 @@ def set_GPU_tracking(self): gpu_devices.devices.get_gpu_static_info() ) self.gpu_tracker = "pynvml" + + elif macmon.is_macmon_available(): + logger.info("Tracking Apple GPU via MacMon") + hardware_gpu = AppleSiliconChip.from_utils( + self.tracker._output_dir, chip_part="GPU" + ) + self.tracker._hardware.append(hardware_gpu) + self.tracker._conf["gpu_model"] = hardware_gpu.get_model() + self.tracker._conf["gpu_count"] = 1 + + elif powermetrics.is_powermetrics_available(): + logger.info("Tracking Apple GPU via PowerMetrics") + hardware_gpu = AppleSiliconChip.from_utils( + self.tracker._output_dir, chip_part="GPU" + ) + self.tracker._hardware.append(hardware_gpu) + self.tracker._conf["gpu_model"] = hardware_gpu.get_model() + self.tracker._conf["gpu_count"] = 1 else: logger.info("No GPU found.") diff --git a/codecarbon/emissions_tracker.py b/codecarbon/emissions_tracker.py index 9b4294d73..7ced27c1e 100644 --- a/codecarbon/emissions_tracker.py +++ b/codecarbon/emissions_tracker.py @@ -775,6 +775,13 @@ def _do_measurements(self) -> None: f"Energy consumed for all GPUs : {self._total_gpu_energy.kWh:.6f} kWh" + f". Total GPU Power : {self._gpu_power.W} W" ) + elif hardware.chip_part == "RAM": + self._total_ram_energy += energy + self._ram_power = power + logger.info( + f"Energy consumed for RAM : {self._total_ram_energy.kWh:.6f} kWh" + + f". RAM Power : {self._ram_power.W} W" + ) else: logger.error(f"Unknown hardware type: {hardware} ({type(hardware)})") h_time = time.perf_counter() - h_time diff --git a/codecarbon/external/hardware.py b/codecarbon/external/hardware.py index e2b8abc2f..0a0179df4 100644 --- a/codecarbon/external/hardware.py +++ b/codecarbon/external/hardware.py @@ -12,7 +12,8 @@ from codecarbon.core.cpu import IntelPowerGadget, IntelRAPL from codecarbon.core.gpu import AllGPUDevices -from codecarbon.core.powermetrics import ApplePowermetrics +from codecarbon.core.macmon import MacMon, is_macmon_available +from codecarbon.core.powermetrics import ApplePowermetrics, is_powermetrics_available from codecarbon.core.units import Energy, Power, Time from codecarbon.core.util import count_cpus, detect_cpu_model from codecarbon.external.logger import logger @@ -344,7 +345,12 @@ def __init__( ): self._output_dir = output_dir self._model = model - self._interface = ApplePowermetrics(self._output_dir) + if is_macmon_available(): + self._interface = MacMon(self._output_dir) + elif is_powermetrics_available(): + self._interface = ApplePowermetrics(self._output_dir) + else: + raise Exception("No supported interface found for Apple Silicon Chip.") self.chip_part = chip_part def __repr__(self) -> str: @@ -404,3 +410,13 @@ def from_utils( logger.warning("Could not read AppleSiliconChip model.") return cls(output_dir=output_dir, model=model, chip_part=chip_part) + + @property + def machine_memory_GB(self): + """ + Property to compute the machine's total memory in bytes. + + Returns: + float: Total RAM (GB) + """ + return psutil.virtual_memory().total / B_TO_GB diff --git a/docs/_sources/methodology.rst.txt b/docs/_sources/methodology.rst.txt index f235923f1..944502b89 100644 --- a/docs/_sources/methodology.rst.txt +++ b/docs/_sources/methodology.rst.txt @@ -143,15 +143,31 @@ CPU - **On Windows or Mac (Intel)** -Tracks Intel processors energy consumption using the ``Intel Power Gadget``. You need to install it yourself from this `source `_ . But has been discontinued. There is a discussion about it on `github issues #457 `_. +Tracks Intel processors energy consumption using the ``Intel Power Gadget``. You need to install it yourself from this `source `_ . +WARNING : The Intel Power Gadget is not available on Apple Silicon Macs. +WARNING 2 : Intel Power Gadget has been deprecated by Intel, and it is not available for the latest processors. We are looking for alternatives. +There is a discussion about it on `github issues #457 `_. -- **Apple Silicon Chips (M1, M2)** +- **Apple Silicon Chips (M1, M2, M3, M4)** Apple Silicon Chips contain both the CPU and the GPU. -Codecarbon tracks Apple Silicon Chip energy consumption using ``powermetrics``. It should be available natively on any mac. -However, this tool is only usable with ``sudo`` rights and to our current knowledge, there are no other options to track the energy consumption of the Apple Silicon Chip without administrative rights -(if you know of any solution for this do not hesitate and `open an issue with your proposed solution `_). +There are two options to track the energy consumption of the Apple Silicon Chip: + - `Powermetrics `_ The mac native utility to monitor energy consumption on Apple Silicon Macs. + - `macmon `_ : a utility that allows you to monitor the energy consumption of your Apple Silicon Mac, it has the advantage of not requiring sudo privileges. + +In order to provide the easiest for the user, codecarbon uses macmon if it is available, otherwise it falls back to powermetrics, and if none of them are available, it falls back to constant mode using TDP. +Powermetrics should be available natively on any mac, but macmon requires installation. + +To use the ``macmon`` utility, you can use the following command: + +.. code-block:: bash + + brew install macmon + +And ``codecarbon`` will automatically detect and use it. + +If you prefer to use ``powermetrics`` with ``codecarbon`` then you need to give it ``sudo`` rights. To give sudo rights without having to enter a password each time, you can modify the sudoers file with the following command: diff --git a/docs/_static/pygments.css b/docs/_static/pygments.css index 0d49244ed..5f2b0a250 100644 --- a/docs/_static/pygments.css +++ b/docs/_static/pygments.css @@ -6,26 +6,26 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: .highlight .hll { background-color: #ffffcc } .highlight { background: #eeffcc; } .highlight .c { color: #408090; font-style: italic } /* Comment */ -.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .err { border: 1px solid #F00 } /* Error */ .highlight .k { color: #007020; font-weight: bold } /* Keyword */ -.highlight .o { color: #666666 } /* Operator */ +.highlight .o { color: #666 } /* Operator */ .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ .highlight .cp { color: #007020 } /* Comment.Preproc */ .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ +.highlight .cs { color: #408090; background-color: #FFF0F0 } /* Comment.Special */ .highlight .gd { color: #A00000 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ -.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gr { color: #F00 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #00A000 } /* Generic.Inserted */ -.highlight .go { color: #333333 } /* Generic.Output */ -.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .go { color: #333 } /* Generic.Output */ +.highlight .gp { color: #C65D09; font-weight: bold } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .gt { color: #04D } /* Generic.Traceback */ .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ @@ -33,43 +33,43 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #902000 } /* Keyword.Type */ .highlight .m { color: #208050 } /* Literal.Number */ -.highlight .s { color: #4070a0 } /* Literal.String */ -.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .s { color: #4070A0 } /* Literal.String */ +.highlight .na { color: #4070A0 } /* Name.Attribute */ .highlight .nb { color: #007020 } /* Name.Builtin */ -.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.highlight .no { color: #60add5 } /* Name.Constant */ -.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .nc { color: #0E84B5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60ADD5 } /* Name.Constant */ +.highlight .nd { color: #555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #D55537; font-weight: bold } /* Name.Entity */ .highlight .ne { color: #007020 } /* Name.Exception */ -.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nf { color: #06287E } /* Name.Function */ .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ -.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nn { color: #0E84B5; font-weight: bold } /* Name.Namespace */ .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .nv { color: #BB60D5 } /* Name.Variable */ .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .w { color: #BBB } /* Text.Whitespace */ .highlight .mb { color: #208050 } /* Literal.Number.Bin */ .highlight .mf { color: #208050 } /* Literal.Number.Float */ .highlight .mh { color: #208050 } /* Literal.Number.Hex */ .highlight .mi { color: #208050 } /* Literal.Number.Integer */ .highlight .mo { color: #208050 } /* Literal.Number.Oct */ -.highlight .sa { color: #4070a0 } /* Literal.String.Affix */ -.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ -.highlight .sc { color: #4070a0 } /* Literal.String.Char */ -.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ -.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ -.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ -.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ -.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ -.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sa { color: #4070A0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070A0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070A0 } /* Literal.String.Char */ +.highlight .dl { color: #4070A0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070A0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070A0 } /* Literal.String.Double */ +.highlight .se { color: #4070A0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070A0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70A0D0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #C65D09 } /* Literal.String.Other */ .highlight .sr { color: #235388 } /* Literal.String.Regex */ -.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .s1 { color: #4070A0 } /* Literal.String.Single */ .highlight .ss { color: #517918 } /* Literal.String.Symbol */ .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ -.highlight .fm { color: #06287e } /* Name.Function.Magic */ -.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ -.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ -.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ -.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ +.highlight .fm { color: #06287E } /* Name.Function.Magic */ +.highlight .vc { color: #BB60D5 } /* Name.Variable.Class */ +.highlight .vg { color: #BB60D5 } /* Name.Variable.Global */ +.highlight .vi { color: #BB60D5 } /* Name.Variable.Instance */ +.highlight .vm { color: #BB60D5 } /* Name.Variable.Magic */ .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/api.html b/docs/api.html index 7358b97ee..3f66bd831 100644 --- a/docs/api.html +++ b/docs/api.html @@ -116,10 +116,10 @@

CodeCarbon API

Or use the API in your code:

-
from codecarbon import track_emissions
+
from codecarbon import track_emissions
 
 @track_emissions(save_to_api=True)
-def train_model():
+def train_model():
     # GPU intensive training code  goes here
 
 if __name__ =="__main__":
@@ -132,7 +132,7 @@ 

CodeCarbon APIAnd so on for your team, project and experiment.

You then have to set you experiment id in CodeCarbon, with two options:

In the code:

-
from codecarbon import track_emissions
+
diff --git a/docs/edit/methodology.rst b/docs/edit/methodology.rst
index d4ac7c05c..da04155ec 100644
--- a/docs/edit/methodology.rst
+++ b/docs/edit/methodology.rst
@@ -142,15 +142,31 @@ CPU
 
 - **On Windows or Mac (Intel)**
 
-Tracks Intel processors energy consumption using the ``Intel Power Gadget``. You need to install it yourself from this `source `_ . But has been discontinued. There is a discussion about it on `github issues #457 `_.
+Tracks Intel processors energy consumption using the ``Intel Power Gadget``. You need to install it yourself from this `source `_ .
+WARNING : The Intel Power Gadget is not available on Apple Silicon Macs. 
+WARNING 2 : Intel Power Gadget has been deprecated by Intel, and it is not available for the latest processors. We are looking for alternatives.
+There is a discussion about it on `github issues #457 `_.
 
-- **Apple Silicon Chips (M1, M2)**
+- **Apple Silicon Chips (M1, M2, M3, M4)**
 
 Apple Silicon Chips contain both the CPU and the GPU.
 
-Codecarbon tracks Apple Silicon Chip energy consumption using ``powermetrics``. It should be available natively on any mac.
-However, this tool is only usable with ``sudo`` rights and to our current knowledge, there are no other options to track the energy consumption of the Apple Silicon Chip without administrative rights
-(if you know of any solution for this do not hesitate and `open an issue with your proposed solution `_).
+There are two options to track the energy consumption of the Apple Silicon Chip:
+ - `Powermetrics `_ The mac native utility to monitor energy consumption on Apple Silicon Macs.
+ - `macmon `_ : a utility that allows you to monitor the energy consumption of your Apple Silicon Mac, it has the advantage of not requiring sudo privileges.
+
+In order to provide the easiest for the user, codecarbon uses macmon if it is available, otherwise it falls back to powermetrics, and if none of them are available, it falls back to constant mode using TDP.
+Powermetrics should be available natively on any mac, but macmon requires installation.
+
+To use the ``macmon`` utility, you can use the following command:
+
+.. code-block:: bash
+
+    brew install macmon
+
+And ``codecarbon`` will automatically detect and use it.
+
+If you prefer to use ``powermetrics`` with ``codecarbon`` then you need to give it ``sudo`` rights.
 
 To give sudo rights without having to enter a password each time, you can modify the sudoers file with the following command:
 
diff --git a/docs/examples.html b/docs/examples.html
index b0c3fc04f..45dfd08ce 100644
--- a/docs/examples.html
+++ b/docs/examples.html
@@ -103,12 +103,12 @@
 

Using the Decorator

This is the simplest way to use the CodeCarbon tracker with two lines of code. You just need to copy-paste from codecarbon import track_emissions and add the @track_emissions decorator to your training function. The emissions will be tracked automatically and printed at the end of the training.

But you can’t get them in your code, see the Context Manager section below for that.

-
import tensorflow as tf
-from codecarbon import track_emissions
+
import tensorflow as tf
+from codecarbon import track_emissions
 
 
 @track_emissions(project_name="mnist")
-def train_model():
+def train_model():
     mnist = tf.keras.datasets.mnist
     (x_train, y_train), (x_test, y_test) = mnist.load_data()
     x_train, x_test = x_train / 255.0, x_test / 255.0
@@ -137,9 +137,9 @@ 

Using the Decorator

Using the Context Manager

We think this is the best way to use CodeCarbon. Still only two lines of code, and you can get the emissions in your code.

-
import tensorflow as tf
+
import tensorflow as tf
 
-from codecarbon import EmissionsTracker
+from codecarbon import EmissionsTracker
 
 mnist = tf.keras.datasets.mnist
 
@@ -173,9 +173,9 @@ 

Using the Explicit Object
import tensorflow as tf
+
import tensorflow as tf
 
-from codecarbon import EmissionsTracker
+from codecarbon import EmissionsTracker
 
 mnist = tf.keras.datasets.mnist
 
diff --git a/docs/methodology.html b/docs/methodology.html
index baefde0f2..2e9a06a12 100644
--- a/docs/methodology.html
+++ b/docs/methodology.html
@@ -244,14 +244,29 @@ 

CPU
  • On Windows or Mac (Intel)

  • -

    Tracks Intel processors energy consumption using the Intel Power Gadget. You need to install it yourself from this source . But has been discontinued. There is a discussion about it on github issues #457.

    +

    Tracks Intel processors energy consumption using the Intel Power Gadget. You need to install it yourself from this source . +WARNING : The Intel Power Gadget is not available on Apple Silicon Macs. +WARNING 2 : Intel Power Gadget has been deprecated by Intel, and it is not available for the latest processors. We are looking for alternatives. +There is a discussion about it on github issues #457.

      -
    • Apple Silicon Chips (M1, M2)

    • +
    • Apple Silicon Chips (M1, M2, M3, M4)

    Apple Silicon Chips contain both the CPU and the GPU.

    -

    Codecarbon tracks Apple Silicon Chip energy consumption using powermetrics. It should be available natively on any mac. -However, this tool is only usable with sudo rights and to our current knowledge, there are no other options to track the energy consumption of the Apple Silicon Chip without administrative rights -(if you know of any solution for this do not hesitate and open an issue with your proposed solution).

    +
    +
    There are two options to track the energy consumption of the Apple Silicon Chip:
      +
    • Powermetrics The mac native utility to monitor energy consumption on Apple Silicon Macs.

    • +
    • macmon : a utility that allows you to monitor the energy consumption of your Apple Silicon Mac, it has the advantage of not requiring sudo privileges.

    • +
    +
    +
    +

    In order to provide the easiest for the user, codecarbon uses macmon if it is available, otherwise it falls back to powermetrics, and if none of them are available, it falls back to constant mode using TDP. +Powermetrics should be available natively on any mac, but macmon requires installation.

    +

    To use the macmon utility, you can use the following command:

    +
    brew install macmon
    +
    +
    +

    And codecarbon will automatically detect and use it.

    +

    If you prefer to use powermetrics with codecarbon then you need to give it sudo rights.

    To give sudo rights without having to enter a password each time, you can modify the sudoers file with the following command:

    sudo visudo
     
    diff --git a/docs/objects.inv b/docs/objects.inv index bb2a2911b..084531bb5 100644 Binary files a/docs/objects.inv and b/docs/objects.inv differ diff --git a/docs/searchindex.js b/docs/searchindex.js index e930a3915..d35ea0e64 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles": {"@track_emissions": [[23, "track-emissions"]], "Access internet through proxy server": [[26, "access-internet-through-proxy-server"]], "Advanced Installation": [[12, null]], "Authentication": [[25, "authentication"]], "CPU": [[19, "cpu"]], "CPU hardware": [[19, "cpu-hardware"]], "CPU metrics priority": [[19, "cpu-metrics-priority"]], "CSV": [[22, "csv"]], "Calculation Formula": [[19, "calculation-formula"]], "Car Usage": [[19, "car-usage"]], "Carbon Intensity": [[19, "carbon-intensity"]], "Carbon Intensity Across Energy Sources": [[19, "id6"]], "Cloud Regions": [[27, "cloud-regions"]], "CodeCarbon": [[17, null]], "CodeCarbon API": [[13, null], [13, "id1"], [22, "codecarbon-api"]], "Collecting emissions to a logger": [[25, null]], "Comet Integration": [[14, null]], "Command line": [[26, "command-line"]], "Comparisons": [[20, "comparisons"]], "Configuration": [[26, "configuration"]], "Configuration priority": [[26, "configuration-priority"]], "Context manager": [[26, "context-manager"], [26, "id2"]], "Create a logger": [[25, "create-a-logger"]], "Create an EmissionTracker": [[25, "create-an-emissiontracker"]], "Data Fields Logged for Each Experiment": [[22, "id4"]], "Decorator": [[26, "decorator"], [26, "id3"]], "Dependencies": [[18, "dependencies"]], "Deploy CodeCarbon CLI as a Service using Ansible": [[12, "deploy-codecarbon-cli-as-a-service-using-ansible"]], "Directory Structure": [[12, "directory-structure"]], "Electricity consumption of AI cloud instance": [[20, "id1"]], "Electricity production carbon intensity per country": [[27, "electricity-production-carbon-intensity-per-country"]], "Estimation of Equivalent Usage Emissions": [[19, "estimation-of-equivalent-usage-emissions"]], "Example": [[25, "example"]], "Examples": [[15, null]], "Explicit Object": [[26, "explicit-object"], [26, "id1"]], "Frequently Asked Questions": [[16, null]], "From PyPi repository": [[18, "from-pypi-repository"]], "From conda repository": [[18, "from-conda-repository"]], "GPU": [[19, "gpu"]], "Getting Started": [[17, null]], "Google Cloud Logging": [[25, "google-cloud-logging"]], "HTTP Output": [[22, "http-output"]], "How CodeCarbon Works": [[19, "how-codecarbon-works"]], "How to test in local": [[22, "how-to-test-in-local"]], "How to use it": [[22, "how-to-use-it"]], "Impact of time of year and region": [[20, "impact-of-time-of-year-and-region"]], "Indices and tables": [[17, "indices-and-tables"]], "Input Parameters": [[23, "input-parameters"], [23, "id7"]], "Input Parameters to @track_emissions": [[23, "id10"]], "Input Parameters to OfflineEmissionsTracker": [[23, "id9"]], "Install CodeCarbon as a Linux service": [[12, "install-codecarbon-as-a-linux-service"]], "Installing CodeCarbon": [[18, null]], "Introduction": [[17, null]], "Logfire": [[22, "logfire"]], "Logger Output": [[22, "logger-output"]], "Logging": [[17, null]], "Methodology": [[19, null]], "Model Comparisons": [[20, null]], "Motivation": [[21, null]], "Offline": [[27, "offline"]], "Offline Mode": [[26, "offline-mode"]], "Online (Beta)": [[27, "online-beta"]], "Online Mode": [[26, "online-mode"]], "Output": [[22, null]], "Output Parameters": [[23, "id8"]], "Output parameters": [[23, "output-parameters"]], "Parameters": [[23, null]], "Power Usage": [[19, "power-usage"]], "Prerequisites": [[12, "prerequisites"]], "Prometheus": [[22, "prometheus"]], "Python logger": [[25, "python-logger"]], "Quick Start": [[12, "quick-start"]], "Quickstart": [[26, null]], "RAM": [[19, "ram"]], "RAPL Metrics": [[19, "rapl-metrics"]], "References": [[19, "references"], [20, "references"]], "Regional Comparisons": [[27, "regional-comparisons"]], "Source Code": [[19, "source-code"]], "Specific parameters for offline mode": [[23, "specific-parameters-for-offline-mode"]], "Summary and Equivalents": [[27, "summary-and-equivalents"]], "TV Usage": [[19, "tv-usage"]], "Test of CodeCarbon on Scaleway hardware": [[24, null]], "The MIT License (MIT)": [[2, null], [8, null]], "US Citizen Weekly Emissions": [[19, "us-citizen-weekly-emissions"]], "Using CodeCarbon with logfire": [[22, "using-codecarbon-with-logfire"]], "Using CodeCarbon with prometheus": [[22, "using-codecarbon-with-prometheus"]], "Using the Context Manager": [[15, "using-the-context-manager"]], "Using the Decorator": [[15, "using-the-decorator"]], "Using the Explicit Object": [[15, "using-the-explicit-object"]], "Visualize": [[27, null]], "What the Playbook Does": [[12, "what-the-playbook-does"]], "detailed": [[27, "detailed"]], "from global\u2026": [[27, "from-global"]], "to more and more\u2026": [[27, "to-more-and-more"]]}, "docnames": [".venv/lib/python3.10/site-packages/Jinja2-3.1.2.dist-info/LICENSE", ".venv/lib/python3.10/site-packages/MarkupSafe-2.1.2.dist-info/LICENSE", ".venv/lib/python3.10/site-packages/imagesize-1.4.1.dist-info/LICENSE", ".venv/lib/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/base", ".venv/lib/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/class", ".venv/lib/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/module", ".venv/lib64/python3.10/site-packages/Jinja2-3.1.2.dist-info/LICENSE", ".venv/lib64/python3.10/site-packages/MarkupSafe-2.1.2.dist-info/LICENSE", ".venv/lib64/python3.10/site-packages/imagesize-1.4.1.dist-info/LICENSE", ".venv/lib64/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/base", ".venv/lib64/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/class", ".venv/lib64/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/module", "advanced_installation", "api", "comet", "examples", "faq", "index", "installation", "methodology", "model_examples", "motivation", "output", "parameters", "test_on_scaleway", "to_logger", "usage", "visualize"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": [".venv/lib/python3.10/site-packages/Jinja2-3.1.2.dist-info/LICENSE.rst", ".venv/lib/python3.10/site-packages/MarkupSafe-2.1.2.dist-info/LICENSE.rst", ".venv/lib/python3.10/site-packages/imagesize-1.4.1.dist-info/LICENSE.rst", ".venv/lib/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/base.rst", ".venv/lib/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/class.rst", ".venv/lib/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/module.rst", ".venv/lib64/python3.10/site-packages/Jinja2-3.1.2.dist-info/LICENSE.rst", ".venv/lib64/python3.10/site-packages/MarkupSafe-2.1.2.dist-info/LICENSE.rst", ".venv/lib64/python3.10/site-packages/imagesize-1.4.1.dist-info/LICENSE.rst", ".venv/lib64/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/base.rst", ".venv/lib64/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/class.rst", ".venv/lib64/python3.10/site-packages/sphinx/ext/autosummary/templates/autosummary/module.rst", "advanced_installation.rst", "api.rst", "comet.rst", "examples.rst", "faq.rst", "index.rst", "installation.rst", "methodology.rst", "model_examples.rst", "motivation.rst", "output.rst", "parameters.rst", "test_on_scaleway.rst", "to_logger.rst", "usage.rst", "visualize.rst"], "indexentries": {}, "objects": {}, "objnames": {}, "objtypes": {}, "terms": {"": [12, 14, 19, 21, 22, 23, 26, 27], "0": [12, 15, 19, 20, 22, 24, 26], "0000": 26, "02": 20, "03": 20, "04": 20, "0440": 12, "084": 19, "1": [19, 20, 22, 23, 26], "10": [12, 15, 19, 22, 26], "100": 19, "1000": 15, "1065g7": 22, "1080": 22, "10w": 19, "11": [19, 20, 22], "1145": 19, "116": 19, "11eb": 19, "12": [19, 24], "120764898": 19, "121": 20, "123": 22, "1240": 24, "125": 19, "125w": 19, "128": [15, 19], "128gb": 19, "13": [19, 20], "131": 19, "133": 19, "137": 19, "138": 19, "14": 19, "15": [19, 23], "159": 24, "16": 19, "166": 19, "169": [19, 20], "17": 19, "19": 20, "19044": 22, "192": 20, "1950x": 19, "1tb": 19, "2": [14, 15, 19, 20, 22, 23, 24], "20": 19, "2000": 19, "2007": [0, 6], "201": 20, "2010": [1, 7], "2016": [2, 8], "2018": 19, "2023": 19, "207": 24, "20w": 19, "21": [19, 20], "214": 24, "216": 20, "234": 19, "235b1da5": 26, "237": 20, "2400": 19, "25": 19, "255": 15, "256": [19, 20], "26": 19, "2620": 24, "28": 15, "280": 19, "29": 19, "3": [14, 18, 19, 20, 22, 23, 26], "30": [12, 13], "30ghz": 22, "3177754": 19, "32": [19, 27], "32gb": 19, "33": 19, "330": 19, "3333": 27, "35": 19, "36": 20, "37": [19, 20], "38": 19, "3w": 19, "4": [13, 19, 20, 26], "40ghz": 24, "40w": 19, "457": 19, "475": [16, 19], "48": 19, "4f": 15, "4gib": 19, "5": [12, 19, 23], "50": 19, "51": 24, "52": 19, "54": 19, "59": 19, "5w": 19, "6": [19, 20], "60": 24, "64": [19, 24], "64gb": 19, "68": 19, "6b": 20, "7": [19, 20], "70": 19, "731": 19, "743": 19, "7600u": 19, "7777": 26, "77778e": 19, "8": [18, 19, 20, 22, 23], "80": 19, "8008": 26, "8024p": 24, "8050": 27, "812": 20, "816": 19, "82": 19, "85": 24, "854453231": 19, "893681599d2c": 26, "894892": 19, "8gb": 19, "8x128gb": 19, "9": 19, "90": [19, 20], "9090": 22, "9155": 19, "92780cabcf52": 19, "93": 20, "960": 24, "995": 19, "A": [0, 1, 2, 6, 7, 8, 19, 23, 25, 26, 27], "AND": [0, 1, 2, 6, 7, 8], "AS": [0, 1, 2, 6, 7, 8], "And": [13, 14], "As": [19, 21], "BE": [0, 1, 2, 6, 7, 8], "BUT": [0, 1, 2, 6, 7, 8], "BY": [0, 1, 6, 7], "But": [15, 16, 19], "By": 22, "FOR": [0, 1, 2, 6, 7, 8], "For": [16, 18, 19, 21, 22, 23, 24, 26], "IF": [0, 1, 6, 7], "IN": [0, 1, 2, 6, 7, 8], "IT": 16, "If": [15, 16, 19, 22, 23, 26, 27], "In": [13, 14, 19, 20, 21, 25, 26], "It": [12, 13, 16, 19, 22, 25, 26], "NO": [0, 1, 2, 6, 7, 8], "NOT": [0, 1, 2, 6, 7, 8], "OF": [0, 1, 2, 6, 7, 8], "ON": [0, 1, 6, 7], "OR": [0, 1, 2, 6, 7, 8], "On": [19, 20], "One": 22, "Or": [13, 26], "SUCH": [0, 1, 6, 7], "THE": [0, 1, 2, 6, 7, 8], "TO": [0, 1, 2, 6, 7, 8], "The": [12, 13, 15, 18, 19, 20, 22, 23, 25, 26, 27], "Then": [13, 19], "There": [16, 19], "These": 19, "To": [12, 14, 18, 19, 24], "WITH": [2, 8], "With": 21, "_": 26, "__main__": [13, 15], "__name__": [13, 15], "_channel": 25, "_logger": 25, "a100": 20, "aaaa": 26, "abl": [14, 22], "about": [16, 19, 26], "abov": [0, 1, 2, 6, 7, 8, 12, 18, 19], "absenc": 26, "access": [12, 17, 19], "account": [12, 14, 19], "accur": [16, 19], "accuraci": [15, 19], "achiev": 21, "acm": 19, "across": [20, 21, 22, 27], "action": [2, 8, 19], "activ": [15, 18, 19, 27], "actual": [16, 19], "adam": 15, "add": [14, 15, 16, 19, 23, 24, 25], "addhandl": 25, "addit": [19, 23, 26], "administr": 19, "advanc": [17, 21], "advis": [0, 1, 6, 7], "after": [12, 15, 25], "agenc": [19, 20], "ai": 21, "alert": 22, "algorithm": 19, "all": [2, 8, 13, 16, 19, 22, 26, 27], "allow": [22, 23, 25, 26], "allow_multiple_run": 23, "along": [14, 18, 26], "alongsid": 14, "alphabet": [22, 26], "also": [19, 21, 25, 26, 27], "although": 16, "alwai": [12, 15], "amazon": 16, "amd": [19, 24], "american": 27, "amount": [19, 21, 27], "an": [2, 8, 12, 13, 14, 15, 16, 19, 22, 26, 27], "analyz": 16, "ani": [0, 1, 2, 6, 7, 8, 16, 19, 26], "annual": 19, "anoth": [20, 27], "ansibl": 17, "ansible_ssh_private_key_fil": 12, "ansible_us": 12, "anymor": 19, "api": [12, 14, 17, 23, 26, 27], "api_call_interv": [12, 13, 23, 26], "api_endpoint": [12, 23], "api_kei": [12, 14, 23], "app": 27, "appear": 22, "append": [19, 23], "appl": 19, "appli": 19, "approach": [19, 21], "approx": 19, "approxim": 19, "apr": 19, "apt": [12, 24], "ar": [0, 1, 6, 7, 12, 15, 16, 18, 19, 20, 21, 22, 23, 25, 27], "argument": [23, 27], "aris": [0, 1, 2, 6, 7, 8], "arm": 19, "arrow": 18, "art": 21, "articl": 19, "artifact": [14, 23], "artifici": 21, "asia": 22, "ask": [17, 22], "associ": [2, 8, 19], "assum": 19, "assumpt": 19, "attribut": 26, "auth": 22, "author": [2, 8], "autom": 12, "automat": [14, 15, 19], "automaticli": 23, "avail": [15, 16, 19, 22, 23, 24, 25, 26, 27], "averag": [12, 16, 19, 20, 27], "aw": 22, "awar": [19, 26], "azur": [20, 22], "b112x": 24, "back": [14, 19, 24], "background": 15, "bar": 27, "barchart": 27, "base": [12, 19, 20, 22, 25, 26], "baseoutput": 22, "becaus": [16, 19, 24, 26], "becom": 21, "been": 19, "befor": 13, "begin": [15, 26], "being": [23, 27], "below": [12, 15, 20, 27], "benchmark": 27, "bert": 20, "bert_infer": 26, "best": [15, 16], "beta": [17, 23], "better": [19, 27], "between": 23, "bin": [12, 19, 24], "binari": [0, 1, 6, 7], "biomass": 19, "black": 20, "block": [5, 11, 15, 19, 26], "blog": 19, "blue": 20, "bookworm": 24, "boolean": 23, "both": [19, 21, 26], "brazilsouth": 22, "brief": 24, "broader": 21, "bubbl": 27, "bui": 19, "build": [25, 26], "build_model": 26, "built": [22, 27], "busi": [0, 1, 6, 7], "c": [18, 19, 23, 26], "c518": 19, "calcul": 16, "california": 23, "call": [15, 19, 22, 23, 26], "can": [13, 14, 15, 16, 19, 20, 21, 22, 24, 25, 26, 27], "canada": 23, "capac": 19, "capita": 19, "car": 21, "carbon": [14, 16, 17, 20, 21, 26], "carbonboard": 27, "case": [16, 20, 22, 26, 27], "caus": [0, 1, 6, 7], "cd": 24, "cell": 26, "center": 23, "central": [13, 25], "ceram": 19, "chang": 12, "chapter": 12, "charg": [2, 8], "chart": 27, "check": 12, "checkout": 24, "chess": 21, "chih": 19, "chip": 19, "chmod": [12, 24], "choic": 16, "choos": [16, 23, 24], "chose": 27, "chown": 12, "citi": [22, 23], "claim": [2, 8], "class": [12, 19, 22, 24, 25], "cli": [17, 18, 26, 27], "click": [14, 18, 27], "client": [18, 25], "clone": 24, "cloud": [16, 19, 22, 23], "cloud_provid": [22, 23], "cloud_region": [22, 23], "co2": [19, 26], "co2_signal_api_token": [23, 26], "co2eq": 15, "co2sign": 23, "coal": 19, "code": [0, 1, 6, 7, 13, 14, 15, 16, 22, 23, 24, 26], "codecarbon": [14, 15, 16, 20, 23, 25, 26, 27], "codecarbon_": [22, 26], "codecarbon_cli_as_a_servic": 12, "codecarbon_gpu_id": 26, "codecarbon_log_level": 26, "colin": 24, "collect": [17, 22], "collector": 25, "com": [12, 16, 19, 23, 24], "combust": 21, "come": [26, 27], "comet": 17, "comet_ml": 14, "command": [18, 19, 24, 27], "commun": 16, "compar": [14, 19, 20, 27], "compare_cpu_load_and_rapl": 24, "comparison": [17, 19], "compil": 15, "complet": 26, "compos": [22, 26], "comput": [15, 16, 19, 20, 21, 22, 26], "concern": 27, "conda": 17, "condit": [0, 1, 2, 6, 7, 8, 19, 22], "conf": 12, "config": [12, 13, 26], "configpars": 26, "configur": [12, 17, 19, 22], "connect": [2, 8, 24, 25, 27], "consequ": 21, "consequenti": [0, 1, 6, 7], "consid": 19, "consider": 20, "consol": 24, "constant": 19, "consum": [19, 21, 27], "consumpt": [19, 23, 27], "consumption_percentag": 23, "contact": 19, "contain": [19, 27], "context": 17, "continu": 15, "contract": [0, 1, 2, 6, 7, 8], "contribut": 19, "contributor": [0, 1, 6, 7], "convert": 19, "copi": [2, 8, 14, 15], "copyright": [0, 1, 2, 6, 7, 8], "core": [19, 22], "correspond": [19, 26], "corwatt": 19, "could": [13, 19, 20, 23, 26], "count": [16, 19], "counter": 19, "countri": [16, 19, 22, 23, 26], "country_2letter_iso_cod": 23, "country_iso_cod": [22, 23, 26], "country_nam": 22, "cover": 16, "co\u2082": [19, 21, 22], "co\u2082eq": [19, 21, 22], "cpu": [17, 22, 23, 24], "cpu_count": 22, "cpu_energi": 22, "cpu_load_profil": 24, "cpu_model": 22, "cpu_pow": 22, "cpuinfo": 18, "crash": 15, "creat": [12, 13, 14, 17, 18, 26], "credenti": 12, "critic": [23, 25], "csv": [17, 23, 24, 26, 27], "ctrl": 26, "cuda_visible_devic": 23, "current": [19, 21, 22, 23, 26, 27], "curtail": 21, "custom": 22, "cycl": 16, "dai": 19, "daili": [19, 27], "damag": [0, 1, 2, 6, 7, 8], "dash": 27, "dashboard": [12, 13, 19], "data": [0, 1, 6, 7, 13, 14, 15, 16, 19, 21, 23, 24, 25, 27], "databas": 22, "datacent": 16, "dataset": [14, 15, 26], "ddr4": 19, "deal": [2, 8], "debian": [12, 24], "debug": [23, 25, 26], "decor": [17, 23], "decreas": 19, "dedic": [12, 23, 25], "deep": [15, 20], "def": [13, 15, 26], "default": [13, 14, 16, 19, 22, 23, 25, 26, 27], "defin": 19, "definit": 14, "delet": 24, "demonstr": 25, "dens": [15, 20], "depend": [17, 21, 26], "deploi": [17, 21, 22], "deposit": 19, "deriv": [0, 1, 6, 7, 19, 22], "describ": [12, 20], "descript": [12, 22, 23], "design": 19, "desktop": 19, "despit": 19, "detail": [14, 23, 26], "detect": 19, "develop": [20, 21, 22, 26], "devic": 22, "di": 19, "did": 16, "die": 19, "differ": [16, 19, 20, 21, 27], "digit": 15, "dimm": [19, 23], "dioxid": [19, 21], "direct": [0, 1, 6, 7, 16, 19], "directori": [19, 22, 23, 26], "disclaim": [0, 1, 6, 7], "discontinu": 19, "discuss": 19, "disk": 26, "displai": [15, 20, 22, 27], "distinct": 25, "distribut": [0, 1, 2, 6, 7, 8], "dive": 27, "divid": [19, 22, 27], "do": [2, 8, 13, 16, 19, 23, 24, 26], "docker": [22, 26], "document": [0, 1, 2, 6, 7, 8, 19, 25, 26], "doe": 16, "doesn": 19, "doi": 19, "domain": 19, "don": [15, 19], "done": [12, 16, 22], "dram": 19, "draw": 19, "drawback": 19, "drive": [19, 21], "driven": [19, 27], "dropout": 15, "dt": 22, "durat": 22, "dure": [15, 19, 21], "e": [15, 19, 22], "e3": 24, "e5": 24, "each": [19, 26, 27], "easier": 18, "easili": 14, "east": 22, "east1": 22, "ecf07280": 19, "echo": 12, "eco": 27, "ecolog": 19, "effect": 23, "effici": [19, 21], "electr": [16, 19, 21, 23, 26], "els": 14, "em": 24, "emiss": [13, 14, 15, 16, 17, 20, 21, 22, 23, 26, 27], "emissions_endpoint": 26, "emissions_r": 22, "emissionstrack": [14, 15, 25, 26], "emissiontrack": 22, "emit": [19, 20, 21], "enabl": [12, 21, 26], "encapsul": 23, "end": [15, 19, 23], "endblock": [5, 11], "endfor": [5, 11], "endif": [5, 11], "endors": [0, 1, 6, 7], "endpoint": [23, 26], "energi": [16, 20, 21, 22, 27], "energy_consum": 22, "energy_uj": [12, 19], "enhanc": 22, "enorm": 21, "ensur": [15, 19], "ensurepath": 24, "entail": 21, "enter": 19, "enterpris": 16, "entir": 23, "entireti": 16, "entri": 26, "environ": [12, 14, 18, 19, 22, 26], "environment": [19, 20, 21], "eof": 12, "epoch": 15, "epyc": 24, "eq": [16, 19], "equival": [17, 20, 21, 22], "eras": 23, "error": [15, 23], "escap": [3, 4, 5, 9, 10, 11], "estim": [16, 17, 20, 21, 23], "etc": [12, 25], "etch": 19, "european": 19, "eval": 19, "evalu": 22, "even": [0, 1, 6, 7, 15, 16], "event": [0, 1, 2, 6, 7, 8], "ever": [19, 27], "everi": [12, 14, 19, 23], "everyth": [14, 26], "exact": 19, "exampl": [14, 17, 19, 21, 22, 23, 24, 26, 27], "except": [15, 19], "execstart": 12, "execut": 27, "exemplari": [0, 1, 6, 7, 27], "exist": [16, 19, 23, 26, 27], "experi": [13, 14, 19, 21, 23, 26, 27], "experiment_id": [12, 13, 23, 26], "explain": 14, "explan": 19, "explicit": 17, "explor": 27, "export": [24, 26], "expos": 22, "express": [0, 1, 2, 6, 7, 8, 19, 21, 22], "f": 15, "face": 21, "fact": 21, "factor": [16, 19, 23], "fall": 19, "fallback": 19, "fals": [12, 23, 26], "fast": 19, "featur": [19, 21], "fetch": 26, "fief": 18, "file": [2, 8, 12, 13, 14, 19, 22, 23, 25, 26, 27], "filehandl": 25, "filepath": 27, "filter": 25, "final": [15, 26], "final_emiss": 15, "final_emissions_data": 15, "find": 16, "finish": 15, "fintetun": 20, "first": [12, 19, 20, 22, 25, 26], "fit": [0, 1, 2, 6, 7, 8, 15], "flatten": 15, "float": [15, 25], "flush": [23, 26], "fn": 23, "focu": [16, 19], "folder": [19, 26], "follow": [0, 1, 2, 6, 7, 8, 12, 15, 16, 18, 19, 20, 22, 23, 24, 26, 27], "footprint": [14, 16, 19, 21], "forbid": 25, "forc": 23, "force_cpu_pow": 23, "force_ram_pow": [19, 23], "forg": 18, "form": [0, 1, 6, 7], "format": 22, "former": 23, "fossil": [19, 21], "found": [14, 19, 26], "fourth": 20, "frac": 19, "fraction": 19, "framework": 26, "free": [2, 8, 14, 23], "french": 19, "frequent": [17, 19], "friend": 19, "friendli": 27, "from": [0, 1, 2, 6, 7, 8, 12, 13, 14, 15, 16, 17, 19, 20, 22, 23, 24, 25, 26], "from_logit": 15, "fuel": [19, 21], "full": [19, 24], "fullnam": [3, 4, 5, 9, 10, 11], "function": [15, 16, 23, 26], "furnish": [2, 8], "further": 19, "g": [12, 15, 19, 22], "ga": 19, "gadget": 19, "galleri": 14, "game": 21, "gase": 21, "gb": [19, 24], "gco2": [16, 19], "gcp": 22, "geforc": 22, "gener": [19, 21, 26, 27], "geograph": 22, "geotherm": 19, "get": [12, 13, 14, 15, 19, 23, 24, 26, 27], "getlogg": 25, "git": 24, "github": [15, 19, 24], "githubusercont": 19, "give": [12, 19], "given": 22, "global": [16, 19, 21, 23, 26], "global_energy_mix": 23, "globalpetrolpric": 16, "go": [12, 14, 21, 22], "goe": [13, 26], "gold": [16, 19], "good": [0, 1, 6, 7, 16, 19, 22], "googl": [16, 23], "google_project_nam": 25, "googlecloudloggeroutput": 25, "gpu": [13, 20, 22, 23, 26], "gpu_count": 22, "gpu_energi": 22, "gpu_id": [23, 26], "gpu_model": 22, "gpu_pow": 22, "grant": [2, 8], "graph": [14, 20], "great": 20, "greater": 16, "green": 23, "greenhous": 21, "grep": [19, 23], "grid": [19, 21, 27], "group": 12, "grow": 21, "gtx": 22, "h": [20, 22], "ha": [15, 16, 19, 20, 21, 22, 26, 27], "habit": 16, "hand": 27, "handler": [23, 25], "happen": 27, "hard": 16, "hardwar": [17, 23], "hatch": 24, "have": [13, 14, 16, 19, 20, 21, 22, 23, 26], "header": 26, "help": [16, 19, 23], "here": [13, 16, 18, 19, 20, 25, 26], "herebi": [2, 8], "hesit": 19, "heurist": 19, "hi": 23, "hierarch": 26, "high": 19, "highest": 19, "hirki": 19, "histor": 22, "holder": [0, 1, 2, 6, 7, 8], "home": [24, 26], "hood": 26, "host": [12, 18, 22, 23, 26, 27], "hostnam": 12, "hour": [19, 20, 21], "hous": 19, "household": 27, "how": [12, 16, 26], "howev": [0, 1, 6, 7, 19, 26], "html": 19, "htop": 24, "http": [12, 17, 19, 23, 24, 26], "http_proxi": 26, "https_proxi": 26, "hubblo": 19, "huge": 20, "human": 21, "hydroelectr": 19, "hyperparamet": 14, "i": [0, 1, 2, 6, 7, 8, 12, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27], "i120": 24, "i7": [19, 22], "id": [13, 22, 23], "id_ed25519": 12, "idl": 19, "iea": [16, 19], "illustr": 27, "imag": [15, 19, 21], "imdb": 26, "imdb_emiss": 26, "impact": [17, 19, 21, 23], "implement": [22, 26], "impli": [0, 1, 2, 6, 7, 8], "import": [13, 15, 21, 25, 26], "improv": [16, 19], "inch": 27, "incident": [0, 1, 6, 7], "includ": [0, 1, 2, 6, 7, 8, 19, 23], "incred": 21, "index": 17, "indic": 23, "indirect": [0, 1, 6, 7], "industri": 21, "infer": 26, "info": [23, 25], "inform": [12, 16, 19, 26, 27], "infra": 16, "infrastructur": [16, 19, 22, 23, 26, 27], "ini": 26, "init": [13, 19], "initi": [16, 26], "input": [17, 22], "input_shap": 15, "instal": [14, 17, 19, 24], "install_codecarbon": 12, "instanc": [23, 26], "instanti": [15, 19, 26], "instruct": [12, 18], "integr": 17, "intel": [12, 19, 22, 24], "intellig": 21, "intens": [13, 16, 17, 20, 23, 26], "interact": 15, "interfac": [13, 19, 22], "interfer": 26, "intern": 26, "internet": 17, "interrupt": [0, 1, 6, 7], "interv": [19, 22, 23], "io": [12, 19, 23], "iso": [22, 23, 26], "isol": 23, "issu": [16, 19], "issuecom": 19, "item": [5, 11], "its": [0, 1, 6, 7, 16, 19, 20, 22, 25, 27], "itself": [18, 19], "j": 19, "j2": 12, "job": 14, "joul": 19, "journalctl": 12, "json": 23, "jupyt": 26, "just": [15, 19, 26], "k": 19, "keep": [16, 19, 26], "kei": [12, 14, 23], "kera": 15, "kernel": 19, "kg": [19, 22], "kgco\u2082": 19, "khan": 19, "kilogram": [19, 21], "kilomet": 19, "kilowatt": [19, 21], "kind": [2, 8], "king": 24, "km": 22, "km\u00b2": 22, "know": [19, 23], "knowledg": 19, "known": [19, 23], "kwh": [16, 19, 20, 22], "lack": 25, "languag": 20, "laptop": 19, "larg": [19, 20, 21], "last": [19, 26], "latest": 18, "latitud": 22, "launchpadlib": 24, "layer": 15, "lcd": 27, "learn": [15, 20, 21], "least": 19, "left": [14, 27], "let": 16, "letter": [22, 23, 26], "level": [19, 21, 23, 25, 27], "leverag": [21, 25], "liabil": [0, 1, 2, 6, 7, 8], "liabl": [0, 1, 2, 6, 7, 8], "librari": [19, 26], "life": [16, 27], "light": [19, 20], "like": [19, 21, 26], "limit": [0, 1, 2, 6, 7, 8, 12, 19], "line": [15, 19, 20], "linear": 19, "linearli": 19, "link": 14, "linux": [17, 19], "list": [0, 1, 6, 7, 18, 19, 23, 26], "ll": 14, "load": [19, 24, 26], "load_data": 15, "load_dataset": 26, "local": [16, 19, 24, 25, 26], "localhost": [22, 26], "localis": 20, "locat": [20, 23], "log": [12, 20, 23, 27], "log_level": [12, 23, 26], "log_nam": 25, "logfir": [17, 23], "logger": [17, 23, 27], "logger_preambl": 23, "loggeroutput": [23, 25], "logging_demo": 25, "logging_logg": [23, 25], "logic": 19, "login": 12, "longitud": 22, "loss": [0, 1, 6, 7, 15], "loss_fn": 15, "low": [19, 23], "lshw": [19, 23], "m": [12, 19, 22], "m1": 19, "m2": 19, "mac": 19, "machin": [12, 13, 19, 21, 22, 23], "made": 16, "mai": [0, 1, 6, 7, 25], "main": [12, 19], "major": 22, "make": [14, 16, 19], "manag": [17, 18], "mandatori": 23, "mani": 16, "manner": 26, "manual": [12, 23, 26], "manufactur": 19, "map": [19, 23], "match": 19, "materi": [0, 1, 6, 7], "matrixprod": 24, "matter": 21, "max": [19, 23], "mb": 19, "me": 19, "measur": [12, 19, 20, 21, 23, 26], "measure_power_sec": [12, 13, 19, 23, 26], "medium": 19, "memori": [19, 23], "mention": 19, "merchant": [0, 1, 2, 6, 7, 8], "merg": [2, 8], "messag": [23, 25], "met": [0, 1, 6, 7], "metadata": 27, "method": [15, 19, 24], "methodologi": 17, "metric": [14, 15, 17, 22, 24], "mhz": 19, "micro": 19, "microsoft": [16, 20], "might": 20, "mile": 27, "mind": 16, "minim": 26, "minimum": 19, "minut": 12, "miss": [16, 19], "mix": [16, 19, 27], "mixtur": 19, "mkdir": [12, 24], "ml": 14, "mlco2": 24, "mnist": [14, 15], "mode": [12, 13, 17, 19, 22], "model": [15, 17, 19, 21, 26], "model_emiss": 26, "modern": 19, "modif": [0, 1, 6, 7], "modifi": [2, 8, 19, 26], "modul": [5, 11, 17, 19], "monitor": [12, 13, 19, 22, 26], "month": 21, "monthli": 16, "more": [13, 14, 19, 21, 26], "most": [20, 27], "motherboard": 19, "motiv": 17, "much": 16, "multi": 12, "multipl": 23, "multipli": 16, "must": [0, 1, 6, 7, 26], "mwh": 19, "my": 16, "my_logg": 25, "n": [19, 22], "name": [0, 1, 6, 7, 18, 19, 22, 23, 25, 26], "nativ": 19, "natur": 19, "nb": 20, "ncarbon": 15, "ndetail": 15, "nearbi": 19, "necessari": 19, "need": [13, 14, 15, 19, 22, 25, 26, 27], "neglig": [0, 1, 6, 7], "neither": [0, 1, 6, 7, 16, 19], "net": [19, 27], "network": [12, 25], "never": 15, "new": [23, 24], "ng": 24, "nice": 13, "niemi": 19, "nlp": 20, "none": [19, 23], "noninfring": [2, 8], "nopasswd": 19, "nor": [0, 1, 6, 7, 19], "normal": [19, 26], "notabl": 16, "note": [19, 26, 27], "notebook": [15, 24, 26], "noth": 22, "notic": [0, 1, 2, 6, 7, 8], "now": [12, 14, 19, 24, 27], "nuclear": 19, "number": [19, 22, 23, 27], "nurminen": 19, "nvidia": [19, 22], "nvme": 24, "o": [22, 24, 26], "object": [14, 17, 21, 23], "observ": 22, "obtain": [2, 8], "occur": 15, "offici": 18, "offlin": 17, "offlineemissionstrack": [22, 26], "offlineemissiontrack": 25, "offset": 16, "often": 16, "old": [19, 23], "on_cloud": 22, "on_csv_writ": 23, "onc": [14, 22], "one": [13, 16, 19, 22, 23, 25, 27], "onli": [15, 16, 19, 23], "onlin": 17, "open": [16, 19], "openapi": 13, "opt": 12, "optim": 15, "option": [13, 16, 19, 23, 25, 26, 27], "order": [21, 23, 25], "org": 19, "organ": 13, "organis": 27, "organization_id": 12, "other": [0, 1, 2, 6, 7, 8, 12, 15, 16, 19, 21, 25], "otherwis": [0, 1, 2, 6, 7, 8, 25], "ou": 19, "our": [16, 19], "ourworld": 16, "out": [0, 1, 2, 6, 7, 8, 16, 19], "output": [17, 25], "output_dir": [22, 23, 26], "output_fil": 23, "output_handl": 23, "overhead": [19, 26], "overrid": [19, 23, 26], "overwrit": 26, "own": [13, 20], "owner": 12, "ownership": 12, "p": 24, "p40": 20, "packag": [12, 14, 16, 18, 19, 21, 22, 25, 27], "page": [14, 17], "pallet": [0, 1, 6, 7], "panda": 18, "panel": 14, "parallel": 25, "param": 26, "paramet": [17, 19, 22, 26], "part": [19, 21], "particular": [0, 1, 2, 6, 7, 8, 27], "pass": [19, 26], "passeng": 19, "password": 19, "past": 15, "path": [19, 23, 24, 27], "pattern": 21, "per": [19, 21, 22, 23], "perf": 24, "perform": [19, 21], "permiss": [0, 1, 2, 6, 7, 8, 12, 19], "permit": [0, 1, 2, 6, 7, 8], "person": [2, 8, 14], "petroleum": 19, "physic": 19, "pi": 19, "piec": [19, 26], "pip": [12, 14, 18], "pipx": 24, "pkgwatt": 19, "place": 22, "placehold": 14, "plai": [16, 21], "plastic": 19, "plate": 19, "platform": [16, 22], "pleas": [16, 18, 25, 26], "plug": 19, "png": 19, "point": [19, 20, 26, 27], "polici": 20, "popular": 20, "port": 27, "portion": [2, 8], "possibl": [0, 1, 6, 7, 19], "possible1": 19, "potenti": 21, "power": [12, 14, 17, 21, 22, 23, 25, 27], "power_const": 23, "powercap": [12, 19, 24], "powermetr": 19, "pp": 19, "ppa": 24, "precis": 22, "present": 20, "pretrain": 20, "prevent": 26, "preview": 27, "previou": [12, 19], "price": 16, "print": 15, "prior": [0, 1, 6, 7], "prioriti": [16, 17], "privaci": 22, "privat": [16, 22, 25, 26], "process": [19, 21, 22, 23, 25, 26, 27], "processor": [19, 21], "procur": [0, 1, 6, 7], "produc": [16, 21, 27], "product": [0, 1, 6, 7, 19], "profit": [0, 1, 6, 7], "program": [15, 21], "project": [13, 15, 16, 22, 23, 25, 27], "project_id": 12, "project_nam": [15, 22, 23, 26], "prometheu": [17, 23], "prometheus_cli": 18, "prometheus_password": 22, "prometheus_url": 23, "prometheus_usernam": 22, "promot": [0, 1, 6, 7], "prompt": 26, "proport": 19, "propos": 19, "protect": [20, 22], "provid": [0, 1, 2, 6, 7, 8, 14, 19, 22, 23, 25, 26, 27], "provinc": [22, 23], "proxi": 17, "psutil": [18, 19], "psy": 19, "public": [13, 14, 16, 26, 27], "publicli": 19, "publish": [2, 8, 16], "pue": 23, "purpos": [0, 1, 2, 6, 7, 8, 21], "push": 22, "pushgatewai": 22, "put": 19, "py": [14, 18, 19, 22, 24, 25], "pynvml": [18, 19], "pypi": 17, "pyproject": 18, "python": [12, 18, 24, 26], "python3": [12, 24], "python_vers": 22, "quantifi": [16, 19], "quartil": 20, "question": 17, "questionari": 18, "quickstart": 17, "r": [12, 19, 22, 24], "ram": [22, 23], "ram_energi": 22, "ram_pow": 22, "ram_total_s": 22, "rang": [19, 22], "rapidfuzz": 18, "rapl": [12, 17, 24], "rapsberri": 19, "raspberri": 19, "rather": 19, "ratio": 19, "re": 26, "read": [12, 19, 26], "real": 24, "realli": 19, "reason": [19, 21], "recent": 21, "recogn": [15, 16, 19, 21], "recommend": [15, 16, 18, 26, 27], "record": 26, "recur": 16, "redistribut": [0, 1, 6, 7], "reduc": [16, 19, 22], "refer": [17, 18, 25, 26], "region": [16, 17, 19, 22, 23, 26], "releas": 16, "relev": 20, "reli": 26, "relu": 15, "remain": 26, "remark": 21, "render": 14, "renew": 19, "replac": 14, "repo": 16, "report": [19, 25], "repositori": [15, 17, 24], "repres": 20, "reproduc": [0, 1, 6, 7, 14], "request": [18, 26], "requir": [22, 23, 26], "research": [14, 16], "resource_track": 19, "respect": [22, 26], "restart": 12, "restrict": [2, 8, 26], "result": [20, 22, 24, 26], "retain": [0, 1, 6, 7], "return": [15, 26], "rich": 18, "right": [2, 8, 19, 20, 27], "room": 19, "root": [12, 19], "row": 23, "rubric": [5, 11], "rule": 22, "run": [12, 13, 14, 15, 16, 18, 19, 22, 23, 24, 26, 27], "run_id": 23, "runtim": 27, "ryzen": 19, "same": [19, 23, 26], "sampl": 14, "save": [13, 14, 23, 25, 26], "save_to_api": [13, 23, 26], "save_to_fil": [23, 26], "save_to_logfir": [22, 23], "save_to_logg": [23, 25], "save_to_prometheu": [22, 23], "scale": [19, 20], "scaphandr": 19, "scenario": 24, "schedul": [15, 19, 26], "scheme": 16, "scientist": 14, "scp": 24, "script": 26, "sculpt": 19, "sdk": 25, "search": [14, 17, 22], "sec": 19, "second": [12, 19, 22, 23], "section": [12, 15, 26], "sector": 21, "see": [14, 15, 19, 22, 23, 24, 25, 26, 27], "self": 22, "sell": [2, 8], "semiconductor": 19, "send": [12, 22, 23, 25, 26], "sent": [22, 27], "sequenti": 15, "seri": 27, "server": [13, 17, 19, 22, 23, 24], "servic": [0, 1, 6, 7, 17, 22], "set": [12, 13, 14, 22, 23, 25, 26], "setlevel": 25, "sever": 27, "shall": [0, 1, 2, 6, 7, 8], "share": 27, "shell": 26, "shibukawa": [2, 8], "short": [19, 23], "shot": 16, "should": [16, 19, 23], "show": [20, 27], "shown": 27, "side": [20, 27], "sidebar": 14, "sign": 23, "signific": [19, 21], "significantli": 19, "silicon": 19, "simplest": 15, "sinc": [19, 23], "singl": [16, 19, 26], "size": 19, "slot": [19, 23], "small": [19, 20, 26], "so": [2, 8, 13, 15, 16, 19, 22, 23, 26], "softwar": [0, 1, 2, 6, 7, 8], "solar": 19, "solut": 19, "some": [19, 25, 26], "sometim": 19, "soon": 26, "sophist": 21, "sourc": [0, 1, 6, 7, 16, 20], "sp0": 22, "sparsecategoricalcrossentropi": 15, "special": [0, 1, 6, 7], "specif": [0, 1, 6, 7, 17, 19, 21, 25, 26], "specifi": [13, 22, 23, 25], "split": 26, "ssd": 24, "ssh": [12, 24], "stand": 19, "standard": [16, 19, 21, 23], "start": [14, 15, 19, 22, 25, 26], "start_task": 26, "state": [21, 22, 23], "stdout": 14, "stick": 19, "still": [15, 19, 25], "stop": [15, 19, 22, 25, 26], "stop_task": 26, "stream": 25, "stress": 24, "strict": [0, 1, 6, 7], "string": 23, "structur": 26, "studi": 20, "stuff": 19, "subclass": 25, "subject": [2, 8, 19], "sublicens": [2, 8], "subscript": 16, "substanti": [2, 8], "substitut": [0, 1, 6, 7], "subsystem": [19, 24], "success": 16, "sudo": [12, 19, 23, 24], "sudoer": 19, "suffix": 22, "sum": 22, "suppli": 19, "support": [19, 23, 25, 26], "sure": 14, "sustain": 16, "switch": [19, 27], "sy": [12, 19, 24], "synchron": 19, "syntax": 26, "sysf": 12, "sysfsutil": 12, "syst": 19, "system": [12, 14, 19, 22, 25], "systemat": 23, "systemctl": 12, "systemd": 12, "systemd_servic": 12, "t": [15, 19, 24, 26], "tab": 14, "tabl": [19, 20], "take": 19, "taken": 14, "target": [12, 22], "task": [12, 21, 26], "tdp": [19, 23, 24], "team": 13, "tee": 12, "televis": 19, "tell": 13, "templat": 12, "tensorflow": 15, "termin": 18, "test": 26, "text": 19, "tf": 15, "than": [19, 25], "thei": 19, "them": [15, 16, 19], "theori": [0, 1, 6, 7], "therefor": 16, "thermal": 19, "thi": [0, 1, 2, 6, 7, 8, 12, 13, 15, 16, 19, 20, 21, 22, 23, 25, 26, 27], "think": 15, "those": [19, 27], "thousand": 19, "thread": 19, "threadripp": 19, "through": 17, "thu": 21, "ti": 22, "time": [14, 17, 19, 22, 26, 27], "timeseri": 13, "timestamp": 22, "tini": 20, "tm": [19, 22], "token": [23, 26], "toml": 18, "ton": 19, "tool": [14, 19, 20, 26], "toolkit": 19, "top": 27, "topic": 19, "tort": [0, 1, 2, 6, 7, 8], "total": [19, 22, 27], "trace": 12, "track": [14, 15, 19, 21, 22, 23, 25, 26], "track_emiss": [13, 15, 17, 26], "tracker": [15, 19, 22, 23, 25, 26], "tracking_mod": [22, 23, 26], "train": [13, 14, 15, 20, 21, 26], "train_model": [13, 15], "training_loop": 26, "tran": 19, "transf": 20, "transit": 19, "trigger": [22, 25], "true": [13, 15, 22, 23, 25, 26], "try": [15, 16, 19, 23, 26], "tv": 27, "two": [13, 15, 19, 26], "typer": 18, "typic": 25, "u": [12, 20, 22, 23], "ubiquit": 21, "ubuntu": [12, 19, 24], "ui": 14, "unbuff": 19, "unchang": 26, "uncor": 19, "under": [19, 26], "underli": [19, 21], "underlin": [3, 4, 5, 9, 10, 11], "understand": [19, 27], "unfortun": 16, "unit": [12, 19], "unregist": 19, "up": [12, 19, 22, 23, 26], "updat": [12, 23, 24], "upload": 13, "url": 23, "us": [0, 1, 2, 6, 7, 8, 13, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27], "usa": 22, "usabl": [19, 25], "usag": [17, 23], "user": [12, 19, 23, 26, 27], "useradd": 12, "usernam": 19, "usr": 19, "usual": 22, "uuid": 26, "v100": 20, "v2": [19, 23], "v3": [19, 23, 24], "valid": 25, "valu": [19, 22, 23, 26], "var": 12, "variabl": [12, 23, 26], "variat": 19, "variou": [19, 21, 25, 27], "vast": 21, "ve": 14, "vehicl": 19, "venv": 12, "verbos": [12, 23], "veri": 19, "version": [22, 24, 26], "via": [16, 21], "victor": 26, "view": [14, 16], "virtual": [12, 18], "vision": 20, "visual": [14, 17], "visudo": 19, "vit": 20, "voil\u00e0": 14, "vol": 19, "w": [19, 22, 23, 24], "wa": 19, "wai": [0, 1, 6, 7, 15, 19, 26], "wait": 12, "want": [19, 23, 26], "wantedbi": 12, "warm": 21, "warn": [12, 23, 26], "warranti": [0, 1, 2, 6, 7, 8], "watch": 27, "watt": [19, 23], "we": [15, 16, 18, 19, 21, 24, 26], "web": [13, 26], "webhook": 22, "websit": [14, 18], "week": [19, 21], "weekli": 27, "weight": 19, "welcom": 19, "well": [16, 19], "wh": 19, "what": [16, 19], "when": [14, 16, 19, 22, 23, 26], "where": [19, 22, 23, 26], "whether": [0, 1, 2, 6, 7, 8], "which": [19, 21, 23, 26], "who": 27, "whom": [2, 8], "wikipedia": 26, "wind": 19, "window": [19, 22], "within": 26, "without": [0, 1, 2, 6, 7, 8, 19, 26], "wonder": 26, "work": [12, 16, 21, 26], "workingdirectori": 12, "world": [16, 19, 24], "would": [19, 20, 21], "wrap": 26, "wren": 16, "write": 26, "written": [0, 1, 6, 7, 23, 26], "x": [19, 22, 23, 24], "x86": 19, "x_test": 15, "x_train": 15, "xeon": 24, "xxx": 24, "y": [22, 24], "y_test": 15, "y_train": 15, "year": [17, 19, 21], "yet": 26, "yield": 26, "yml": 12, "york": 23, "yoshiki": [2, 8], "you": [12, 13, 14, 15, 16, 19, 22, 23, 24, 26, 27], "your": [12, 13, 14, 15, 16, 18, 19, 22, 23, 26, 27], "your_api_kei": 12, "your_experiment_id": 12, "your_org_id": 12, "your_project_id": 12, "yourdomain": 12, "yourself": 19, "yourservernam": 12, "z": 19, "zone": 23}, "titles": ["<no title>", "<no title>", "The MIT License (MIT)", "<no title>", "<no title>", "<no title>", "<no title>", "<no title>", "The MIT License (MIT)", "<no title>", "<no title>", "<no title>", "Advanced Installation", "CodeCarbon API", "Comet Integration", "Examples", "Frequently Asked Questions", "CodeCarbon", "Installing CodeCarbon", "Methodology", "Model Comparisons", "Motivation", "Output", "Parameters", "Test of CodeCarbon on Scaleway hardware", "Collecting emissions to a logger", "Quickstart", "Visualize"], "titleterms": {"The": [2, 8], "access": 26, "across": 19, "advanc": 12, "ai": 20, "an": 25, "ansibl": 12, "api": [13, 22], "ask": 16, "authent": 25, "beta": 27, "calcul": 19, "car": 19, "carbon": [19, 27], "citizen": 19, "cli": 12, "cloud": [20, 25, 27], "code": 19, "codecarbon": [12, 13, 17, 18, 19, 22, 24], "collect": 25, "comet": 14, "command": 26, "comparison": [20, 27], "conda": 18, "configur": 26, "consumpt": 20, "context": [15, 26], "countri": 27, "cpu": 19, "creat": 25, "csv": 22, "data": 22, "decor": [15, 26], "depend": 18, "deploi": 12, "detail": 27, "directori": 12, "doe": 12, "each": 22, "electr": [20, 27], "emiss": [19, 25], "emissiontrack": 25, "energi": 19, "equival": [19, 27], "estim": 19, "exampl": [15, 25], "experi": 22, "explicit": [15, 26], "field": 22, "formula": 19, "frequent": 16, "from": [18, 27], "get": 17, "global": 27, "googl": 25, "gpu": 19, "hardwar": [19, 24], "how": [19, 22], "http": 22, "impact": 20, "indic": 17, "input": 23, "instal": [12, 18], "instanc": 20, "integr": 14, "intens": [19, 27], "internet": 26, "introduct": 17, "licens": [2, 8], "line": 26, "linux": 12, "local": 22, "log": [17, 22, 25], "logfir": 22, "logger": [22, 25], "manag": [15, 26], "methodologi": 19, "metric": 19, "mit": [2, 8], "mode": [23, 26], "model": 20, "more": 27, "motiv": 21, "object": [15, 26], "offlin": [23, 26, 27], "offlineemissionstrack": 23, "onlin": [26, 27], "output": [22, 23], "paramet": 23, "per": 27, "playbook": 12, "power": 19, "prerequisit": 12, "prioriti": [19, 26], "product": 27, "prometheu": 22, "proxi": 26, "pypi": 18, "python": 25, "question": 16, "quick": 12, "quickstart": 26, "ram": 19, "rapl": 19, "refer": [19, 20], "region": [20, 27], "repositori": 18, "scalewai": 24, "server": 26, "servic": 12, "sourc": 19, "specif": 23, "start": [12, 17], "structur": 12, "summari": 27, "tabl": 17, "test": [22, 24], "through": 26, "time": 20, "track_emiss": 23, "tv": 19, "u": 19, "us": [12, 15, 22], "usag": 19, "visual": 27, "weekli": 19, "what": 12, "work": 19, "year": 20}}) \ No newline at end of file +Search.setIndex({"alltitles": {"@track_emissions": [[11, "track-emissions"]], "Access internet through proxy server": [[14, "access-internet-through-proxy-server"]], "Advanced Installation": [[0, null]], "Authentication": [[13, "authentication"]], "CPU": [[7, "cpu"]], "CPU hardware": [[7, "cpu-hardware"]], "CPU metrics priority": [[7, "cpu-metrics-priority"]], "CSV": [[10, "csv"]], "Calculation Formula": [[7, "calculation-formula"]], "Car Usage": [[7, "car-usage"]], "Carbon Intensity": [[7, "carbon-intensity"]], "Carbon Intensity Across Energy Sources": [[7, "id6"]], "Cloud Regions": [[15, "cloud-regions"]], "CodeCarbon": [[5, null]], "CodeCarbon API": [[1, null], [1, "id1"], [10, "codecarbon-api"]], "Collecting emissions to a logger": [[13, null]], "Comet Integration": [[2, null]], "Command line": [[14, "command-line"]], "Comparisons": [[8, "comparisons"]], "Configuration": [[14, "configuration"]], "Configuration priority": [[14, "configuration-priority"]], "Context manager": [[14, "context-manager"], [14, "id2"]], "Create a logger": [[13, "create-a-logger"]], "Create an EmissionTracker": [[13, "create-an-emissiontracker"]], "Data Fields Logged for Each Experiment": [[10, "id4"]], "Decorator": [[14, "decorator"], [14, "id3"]], "Dependencies": [[6, "dependencies"]], "Deploy CodeCarbon CLI as a Service using Ansible": [[0, "deploy-codecarbon-cli-as-a-service-using-ansible"]], "Directory Structure": [[0, "directory-structure"]], "Electricity consumption of AI cloud instance": [[8, "id1"]], "Electricity production carbon intensity per country": [[15, "electricity-production-carbon-intensity-per-country"]], "Estimation of Equivalent Usage Emissions": [[7, "estimation-of-equivalent-usage-emissions"]], "Example": [[13, "example"]], "Examples": [[3, null]], "Explicit Object": [[14, "explicit-object"], [14, "id1"]], "Frequently Asked Questions": [[4, null]], "From PyPi repository": [[6, "from-pypi-repository"]], "From conda repository": [[6, "from-conda-repository"]], "GPU": [[7, "gpu"]], "Getting Started": [[5, null]], "Google Cloud Logging": [[13, "google-cloud-logging"]], "HTTP Output": [[10, "http-output"]], "How CodeCarbon Works": [[7, "how-codecarbon-works"]], "How to test in local": [[10, "how-to-test-in-local"]], "How to use it": [[10, "how-to-use-it"]], "Impact of time of year and region": [[8, "impact-of-time-of-year-and-region"]], "Indices and tables": [[5, "indices-and-tables"]], "Input Parameters": [[11, "input-parameters"], [11, "id7"]], "Input Parameters to @track_emissions": [[11, "id10"]], "Input Parameters to OfflineEmissionsTracker": [[11, "id9"]], "Install CodeCarbon as a Linux service": [[0, "install-codecarbon-as-a-linux-service"]], "Installing CodeCarbon": [[6, null]], "Introduction": [[5, null]], "Logfire": [[10, "logfire"]], "Logger Output": [[10, "logger-output"]], "Logging": [[5, null]], "Methodology": [[7, null]], "Model Comparisons": [[8, null]], "Motivation": [[9, null]], "Offline": [[15, "offline"]], "Offline Mode": [[14, "offline-mode"]], "Online (Beta)": [[15, "online-beta"]], "Online Mode": [[14, "online-mode"]], "Output": [[10, null]], "Output Parameters": [[11, "id8"]], "Output parameters": [[11, "output-parameters"]], "Parameters": [[11, null]], "Power Usage": [[7, "power-usage"]], "Prerequisites": [[0, "prerequisites"]], "Prometheus": [[10, "prometheus"]], "Python logger": [[13, "python-logger"]], "Quick Start": [[0, "quick-start"]], "Quickstart": [[14, null]], "RAM": [[7, "ram"]], "RAPL Metrics": [[7, "rapl-metrics"]], "References": [[7, "references"], [8, "references"]], "Regional Comparisons": [[15, "regional-comparisons"]], "Source Code": [[7, "source-code"]], "Specific parameters for offline mode": [[11, "specific-parameters-for-offline-mode"]], "Summary and Equivalents": [[15, "summary-and-equivalents"]], "TV Usage": [[7, "tv-usage"]], "Test of CodeCarbon on Scaleway hardware": [[12, null]], "US Citizen Weekly Emissions": [[7, "us-citizen-weekly-emissions"]], "Using CodeCarbon with logfire": [[10, "using-codecarbon-with-logfire"]], "Using CodeCarbon with prometheus": [[10, "using-codecarbon-with-prometheus"]], "Using the Context Manager": [[3, "using-the-context-manager"]], "Using the Decorator": [[3, "using-the-decorator"]], "Using the Explicit Object": [[3, "using-the-explicit-object"]], "Visualize": [[15, null]], "What the Playbook Does": [[0, "what-the-playbook-does"]], "detailed": [[15, "detailed"]], "from global\u2026": [[15, "from-global"]], "to more and more\u2026": [[15, "to-more-and-more"]]}, "docnames": ["advanced_installation", "api", "comet", "examples", "faq", "index", "installation", "methodology", "model_examples", "motivation", "output", "parameters", "test_on_scaleway", "to_logger", "usage", "visualize"], "envversion": {"sphinx": 64, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["advanced_installation.rst", "api.rst", "comet.rst", "examples.rst", "faq.rst", "index.rst", "installation.rst", "methodology.rst", "model_examples.rst", "motivation.rst", "output.rst", "parameters.rst", "test_on_scaleway.rst", "to_logger.rst", "usage.rst", "visualize.rst"], "indexentries": {}, "objects": {}, "objnames": {}, "objtypes": {}, "terms": {"": [0, 2, 7, 9, 10, 11, 14, 15], "0": [0, 3, 7, 8, 10, 12, 14], "0000": 14, "02": 8, "03": 8, "04": 8, "0440": 0, "084": 7, "1": [7, 8, 10, 11, 14], "10": [0, 3, 7, 10, 14], "100": 7, "1000": 3, "1065g7": 10, "1080": 10, "10w": 7, "11": [7, 8, 10], "1145": 7, "116": 7, "11eb": 7, "12": [7, 12], "120764898": 7, "121": 8, "123": 10, "1240": 12, "125": 7, "125w": 7, "128": [3, 7], "128gb": 7, "13": [7, 8], "131": 7, "133": 7, "137": 7, "138": 7, "14": 7, "15": [7, 11], "159": 12, "16": 7, "166": 7, "169": [7, 8], "17": 7, "19": 8, "19044": 10, "192": 8, "1950x": 7, "1tb": 7, "2": [2, 3, 7, 8, 10, 11, 12], "20": 7, "2000": 7, "201": 8, "2018": 7, "2023": 7, "207": 12, "20w": 7, "21": [7, 8], "214": 12, "216": 8, "234": 7, "235b1da5": 14, "237": 8, "2400": 7, "25": 7, "255": 3, "256": [7, 8], "26": 7, "2620": 12, "28": 3, "280": 7, "29": 7, "3": [2, 6, 7, 8, 10, 11, 14], "30": [0, 1], "30ghz": 10, "3177754": 7, "32": [7, 15], "32gb": 7, "33": 7, "330": 7, "3333": 15, "35": 7, "36": 8, "37": [7, 8], "38": 7, "3w": 7, "4": [1, 7, 8, 14], "40ghz": 12, "40w": 7, "457": 7, "475": [4, 7], "48": 7, "4f": 3, "4gib": 7, "5": [0, 7, 11], "50": 7, "51": 12, "52": 7, "54": 7, "59": 7, "5w": 7, "6": [7, 8], "60": 12, "64": [7, 12], "64gb": 7, "68": 7, "6b": 8, "7": [7, 8], "70": 7, "731": 7, "743": 7, "7600u": 7, "7777": 14, "77778e": 7, "8": [6, 7, 8, 10, 11], "80": 7, "8008": 14, "8024p": 12, "8050": 15, "812": 8, "816": 7, "82": 7, "85": 12, "854453231": 7, "893681599d2c": 14, "894892": 7, "8gb": 7, "8x128gb": 7, "9": 7, "90": [7, 8], "9090": 10, "9155": 7, "92780cabcf52": 7, "93": 8, "960": 12, "995": 7, "A": [7, 11, 13, 14, 15], "And": [1, 2, 7], "As": [7, 9], "But": [3, 4, 7], "By": 10, "For": [4, 6, 7, 9, 10, 11, 12, 14], "IT": 4, "If": [3, 4, 7, 10, 11, 14, 15], "In": [1, 2, 7, 8, 9, 13, 14], "It": [0, 1, 4, 7, 10, 13, 14], "On": [7, 8], "One": 10, "Or": [1, 14], "The": [0, 1, 3, 6, 7, 8, 10, 11, 13, 14, 15], "Then": [1, 7], "There": [4, 7], "These": 7, "To": [0, 2, 6, 7, 12], "With": 9, "_": 14, "__main__": [1, 3], "__name__": [1, 3], "_channel": 13, "_logger": 13, "a100": 8, "aaaa": 14, "abl": [2, 10], "about": [4, 7, 14], "abov": [0, 6, 7], "absenc": 14, "access": [0, 5, 7], "account": [0, 2, 7], "accur": [4, 7], "accuraci": [3, 7], "achiev": 9, "acm": 7, "across": [8, 9, 10, 15], "action": 7, "activ": [3, 6, 7, 15], "actual": [4, 7], "adam": 3, "add": [2, 3, 4, 7, 11, 12, 13], "addhandl": 13, "addit": [7, 11, 14], "advanc": [5, 9], "advantag": 7, "after": [0, 3, 13], "agenc": [7, 8], "ai": 9, "alert": 10, "algorithm": 7, "all": [1, 4, 7, 10, 14, 15], "allow": [7, 10, 11, 13, 14], "allow_multiple_run": 11, "along": [2, 6, 14], "alongsid": 2, "alphabet": [10, 14], "also": [7, 9, 13, 14, 15], "altern": 7, "although": 4, "alwai": [0, 3], "amazon": 4, "amd": [7, 12], "american": 15, "amount": [7, 9, 15], "an": [0, 1, 2, 3, 4, 7, 10, 14, 15], "analyz": 4, "ani": [4, 7, 14], "annual": 7, "anoth": [8, 15], "ansibl": 5, "ansible_ssh_private_key_fil": 0, "ansible_us": 0, "anymor": 7, "api": [0, 2, 5, 11, 14, 15], "api_call_interv": [0, 1, 11, 14], "api_endpoint": [0, 11], "api_kei": [0, 2, 11], "app": 15, "appear": 10, "append": [7, 11], "appl": 7, "appli": 7, "approach": [7, 9], "approx": 7, "approxim": 7, "apr": 7, "apt": [0, 12], "ar": [0, 3, 4, 6, 7, 8, 9, 10, 11, 13, 15], "argument": [11, 15], "arm": 7, "arrow": 6, "art": 9, "articl": 7, "artifact": [2, 11], "artifici": 9, "asia": 10, "ask": [5, 10], "associ": 7, "assum": 7, "assumpt": 7, "attribut": 14, "auth": 10, "autom": 0, "automat": [2, 3, 7], "automaticli": 11, "avail": [3, 4, 7, 10, 11, 12, 13, 14, 15], "averag": [0, 4, 7, 8, 15], "aw": 10, "awar": [7, 14], "azur": [8, 10], "b112x": 12, "back": [2, 7, 12], "background": 3, "bar": 15, "barchart": 15, "base": [0, 7, 8, 10, 13, 14], "baseoutput": 10, "becaus": [4, 7, 12, 14], "becom": 9, "been": 7, "befor": 1, "begin": [3, 14], "being": [11, 15], "below": [0, 3, 8, 15], "benchmark": 15, "bert": 8, "bert_infer": 14, "best": [3, 4], "beta": [5, 11], "better": [7, 15], "between": 11, "bin": [0, 7, 12], "biomass": 7, "black": 8, "block": [3, 7, 14], "blog": 7, "blue": 8, "bookworm": 12, "boolean": 11, "both": [7, 9, 14], "brazilsouth": 10, "brew": 7, "brief": 12, "broader": 9, "bubbl": 15, "bui": 7, "build": [13, 14], "build_model": 14, "built": [10, 15], "c": [6, 7, 11, 14], "c518": 7, "calcul": 4, "california": 11, "call": [3, 7, 10, 11, 14], "can": [1, 2, 3, 4, 7, 8, 9, 10, 12, 13, 14, 15], "canada": 11, "capac": 7, "capita": 7, "car": 9, "carbon": [2, 4, 5, 8, 9, 14], "carbonboard": 15, "case": [4, 8, 10, 14, 15], "cd": 12, "cell": 14, "center": 11, "central": [1, 13], "ceram": 7, "chang": 0, "chapter": 0, "chart": 15, "check": 0, "checkout": 12, "chess": 9, "chih": 7, "chip": 7, "chmod": [0, 12], "choic": 4, "choos": [4, 11, 12], "chose": 15, "chown": 0, "citi": [10, 11], "class": [0, 7, 10, 12, 13], "cli": [5, 6, 14, 15], "click": [2, 6, 15], "client": [6, 13], "clone": 12, "cloud": [4, 7, 10, 11], "cloud_provid": [10, 11], "cloud_region": [10, 11], "co2": [7, 14], "co2_signal_api_token": [11, 14], "co2eq": 3, "co2sign": 11, "coal": 7, "code": [1, 2, 3, 4, 10, 11, 12, 14], "codecarbon": [2, 3, 4, 8, 11, 13, 14, 15], "codecarbon_": [10, 14], "codecarbon_cli_as_a_servic": 0, "codecarbon_gpu_id": 14, "codecarbon_log_level": 14, "colin": 12, "collect": [5, 10], "collector": 13, "com": [0, 4, 7, 11, 12], "combust": 9, "come": [14, 15], "comet": 5, "comet_ml": 2, "command": [6, 7, 12, 15], "commun": 4, "compar": [2, 7, 8, 15], "compare_cpu_load_and_rapl": 12, "comparison": [5, 7], "compil": 3, "complet": 14, "compos": [10, 14], "comput": [3, 4, 7, 8, 9, 10, 14], "concern": 15, "conda": 5, "condit": [7, 10], "conf": 0, "config": [0, 1, 14], "configpars": 14, "configur": [0, 5, 7, 10], "connect": [12, 13, 15], "consequ": 9, "consid": 7, "consider": 8, "consol": 12, "constant": 7, "consum": [7, 9, 15], "consumpt": [7, 11, 15], "consumption_percentag": 11, "contact": 7, "contain": [7, 15], "context": 5, "continu": 3, "contribut": 7, "convert": 7, "copi": [2, 3], "core": [7, 10], "correspond": [7, 14], "corwatt": 7, "could": [1, 7, 8, 11, 14], "count": [4, 7], "counter": 7, "countri": [4, 7, 10, 11, 14], "country_2letter_iso_cod": 11, "country_iso_cod": [10, 11, 14], "country_nam": 10, "cover": 4, "co\u2082": [7, 9, 10], "co\u2082eq": [7, 9, 10], "cpu": [5, 10, 11, 12], "cpu_count": 10, "cpu_energi": 10, "cpu_load_profil": 12, "cpu_model": 10, "cpu_pow": 10, "cpuinfo": 6, "crash": 3, "creat": [0, 1, 2, 5, 6, 14], "credenti": 0, "critic": [11, 13], "csv": [5, 11, 12, 14, 15], "ctrl": 14, "cuda_visible_devic": 11, "current": [7, 9, 10, 11, 14, 15], "curtail": 9, "custom": 10, "cycl": 4, "dai": 7, "daili": [7, 15], "dash": 15, "dashboard": [0, 1, 7], "data": [1, 2, 3, 4, 7, 9, 11, 12, 13, 15], "databas": 10, "datacent": 4, "dataset": [2, 3, 14], "ddr4": 7, "debian": [0, 12], "debug": [11, 13, 14], "decor": [5, 11], "decreas": 7, "dedic": [0, 11, 13], "deep": [3, 8], "def": [1, 3, 14], "default": [1, 2, 4, 7, 10, 11, 13, 14, 15], "defin": 7, "definit": 2, "delet": 12, "demonstr": 13, "dens": [3, 8], "depend": [5, 9, 14], "deploi": [5, 9, 10], "deposit": 7, "deprec": 7, "deriv": [7, 10], "describ": [0, 8], "descript": [0, 10, 11], "design": 7, "desktop": 7, "despit": 7, "detail": [2, 11, 14], "detect": 7, "develop": [8, 9, 10, 14], "devic": 10, "di": 7, "did": 4, "die": 7, "differ": [4, 7, 8, 9, 15], "digit": 3, "dimm": [7, 11], "dioxid": [7, 9], "direct": [4, 7], "directori": [7, 10, 11, 14], "discuss": 7, "disk": 14, "displai": [3, 8, 10, 15], "distinct": 13, "dive": 15, "divid": [7, 10, 15], "do": [1, 4, 7, 11, 12, 14], "docker": [10, 14], "document": [7, 13, 14], "doe": 4, "doesn": 7, "doi": 7, "domain": 7, "don": [3, 7], "done": [0, 4, 10], "dram": 7, "draw": 7, "drawback": 7, "drive": [7, 9], "driven": [7, 15], "dropout": 3, "dt": 10, "durat": 10, "dure": [3, 7, 9], "e": [3, 7, 10], "e3": 12, "e5": 12, "each": [7, 14, 15], "easier": 6, "easiest": 7, "easili": 2, "east": 10, "east1": 10, "ecf07280": 7, "echo": 0, "eco": 15, "ecolog": 7, "effect": 11, "effici": [7, 9], "electr": [4, 7, 9, 11, 14], "els": 2, "em": 12, "emiss": [1, 2, 3, 4, 5, 8, 9, 10, 11, 14, 15], "emissions_endpoint": 14, "emissions_r": 10, "emissionstrack": [2, 3, 13, 14], "emissiontrack": 10, "emit": [7, 8, 9], "enabl": [0, 9, 14], "encapsul": 11, "end": [3, 7, 11], "endpoint": [11, 14], "energi": [4, 8, 9, 10, 15], "energy_consum": 10, "energy_uj": [0, 7], "enhanc": 10, "enorm": 9, "ensur": [3, 7], "ensurepath": 12, "entail": 9, "enter": 7, "enterpris": 4, "entir": 11, "entireti": 4, "entri": 14, "environ": [0, 2, 6, 7, 10, 14], "environment": [7, 8, 9], "eof": 0, "epoch": 3, "epyc": 12, "eq": [4, 7], "equival": [5, 8, 9, 10], "eras": 11, "error": [3, 11], "estim": [4, 5, 8, 9, 11], "etc": [0, 13], "etch": 7, "european": 7, "eval": 7, "evalu": 10, "even": [3, 4], "ever": [7, 15], "everi": [0, 2, 7, 11], "everyth": [2, 14], "exact": 7, "exampl": [2, 5, 7, 9, 10, 11, 12, 14, 15], "except": [3, 7], "execstart": 0, "execut": 15, "exemplari": 15, "exist": [4, 7, 11, 14, 15], "experi": [1, 2, 7, 9, 11, 14, 15], "experiment_id": [0, 1, 11, 14], "explain": 2, "explan": 7, "explicit": 5, "explor": 15, "export": [12, 14], "expos": 10, "express": [7, 9, 10], "f": 3, "face": 9, "fact": 9, "factor": [4, 7, 11], "fall": 7, "fallback": 7, "fals": [0, 11, 14], "fast": 7, "featur": [7, 9], "fetch": 14, "fief": 6, "file": [0, 1, 2, 7, 10, 11, 13, 14, 15], "filehandl": 13, "filepath": 15, "filter": 13, "final": [3, 14], "final_emiss": 3, "final_emissions_data": 3, "find": 4, "finish": 3, "fintetun": 8, "first": [0, 7, 8, 10, 13, 14], "fit": 3, "flatten": 3, "float": [3, 13], "flush": [11, 14], "fn": 11, "focu": [4, 7], "folder": [7, 14], "follow": [0, 3, 4, 6, 7, 8, 10, 11, 12, 14, 15], "footprint": [2, 4, 7, 9], "forbid": 13, "forc": 11, "force_cpu_pow": 11, "force_ram_pow": [7, 11], "forg": 6, "format": 10, "former": 11, "fossil": [7, 9], "found": [2, 7, 14], "fourth": 8, "frac": 7, "fraction": 7, "framework": 14, "free": [2, 11], "french": 7, "frequent": [5, 7], "friend": 7, "friendli": 15, "from": [0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 12, 13, 14], "from_logit": 3, "fuel": [7, 9], "full": [7, 12], "function": [3, 4, 11, 14], "further": 7, "g": [0, 3, 7, 10], "ga": 7, "gadget": 7, "galleri": 2, "game": 9, "gase": 9, "gb": [7, 12], "gco2": [4, 7], "gcp": 10, "geforc": 10, "gener": [7, 9, 14, 15], "geograph": 10, "geotherm": 7, "get": [0, 1, 2, 3, 7, 11, 12, 14, 15], "getlogg": 13, "git": 12, "github": [3, 7, 12], "githubusercont": 7, "give": [0, 7], "given": 10, "global": [4, 7, 9, 11, 14], "global_energy_mix": 11, "globalpetrolpric": 4, "go": [0, 2, 9, 10], "goe": [1, 14], "gold": [4, 7], "good": [4, 7, 10], "googl": [4, 11], "google_project_nam": 13, "googlecloudloggeroutput": 13, "gpu": [1, 8, 10, 11, 14], "gpu_count": 10, "gpu_energi": 10, "gpu_id": [11, 14], "gpu_model": 10, "gpu_pow": 10, "graph": [2, 8], "great": 8, "greater": 4, "green": 11, "greenhous": 9, "grep": [7, 11], "grid": [7, 9, 15], "group": 0, "grow": 9, "gtx": 10, "h": [8, 10], "ha": [3, 4, 7, 8, 9, 10, 14, 15], "habit": 4, "hand": 15, "handler": [11, 13], "happen": 15, "hard": 4, "hardwar": [5, 11], "hatch": 12, "have": [1, 2, 4, 7, 8, 9, 10, 11, 14], "header": 14, "help": [4, 7, 11], "here": [1, 4, 6, 7, 8, 13, 14], "heurist": 7, "hi": 11, "hierarch": 14, "high": 7, "highest": 7, "hirki": 7, "histor": 10, "home": [12, 14], "hood": 14, "host": [0, 6, 10, 11, 14, 15], "hostnam": 0, "hour": [7, 8, 9], "hous": 7, "household": 15, "how": [0, 4, 14], "howev": 14, "html": 7, "htop": 12, "http": [0, 5, 7, 11, 12, 14], "http_proxi": 14, "https_proxi": 14, "hubblo": 7, "huge": 8, "human": 9, "hydroelectr": 7, "hyperparamet": 2, "i": [0, 3, 4, 6, 7, 9, 10, 11, 12, 13, 14, 15], "i120": 12, "i7": [7, 10], "id": [1, 10, 11], "id_ed25519": 0, "idl": 7, "iea": [4, 7], "illustr": 15, "imag": [3, 7, 9], "imdb": 14, "imdb_emiss": 14, "impact": [5, 7, 9, 11], "implement": [10, 14], "import": [1, 3, 9, 13, 14], "improv": [4, 7], "inch": 15, "includ": [7, 11], "incred": 9, "index": 5, "indic": 11, "industri": 9, "infer": 14, "info": [11, 13], "inform": [0, 4, 7, 14, 15], "infra": 4, "infrastructur": [4, 7, 10, 11, 14, 15], "ini": 14, "init": [1, 7], "initi": [4, 14], "input": [5, 10], "input_shap": 3, "instal": [2, 5, 7, 12], "install_codecarbon": 0, "instanc": [11, 14], "instanti": [3, 7, 14], "instruct": [0, 6], "integr": 5, "intel": [0, 7, 10, 12], "intellig": 9, "intens": [1, 4, 5, 8, 11, 14], "interact": 3, "interfac": [1, 7, 10], "interfer": 14, "intern": 14, "internet": 5, "interv": [7, 10, 11], "io": [0, 7, 11], "iso": [10, 11, 14], "isol": 11, "issu": [4, 7], "issuecom": 7, "its": [4, 7, 8, 10, 13, 15], "itself": [6, 7], "j": 7, "j2": 0, "job": 2, "joul": 7, "journalctl": 0, "json": 11, "jupyt": 14, "just": [3, 7, 14], "k": 7, "keep": [4, 7, 14], "kei": [0, 2, 11], "kera": 3, "kernel": 7, "kg": [7, 10], "kgco\u2082": 7, "khan": 7, "kilogram": [7, 9], "kilomet": 7, "kilowatt": [7, 9], "king": 12, "km": 10, "km\u00b2": 10, "know": [7, 11], "known": [7, 11], "kwh": [4, 7, 8, 10], "lack": 13, "languag": 8, "laptop": 7, "larg": [7, 8, 9], "last": [7, 14], "latest": [6, 7], "latitud": 10, "launchpadlib": 12, "layer": 3, "lcd": 15, "learn": [3, 8, 9], "least": 7, "left": [2, 15], "let": 4, "letter": [10, 11, 14], "level": [7, 9, 11, 13, 15], "leverag": [9, 13], "librari": [7, 14], "life": [4, 15], "light": [7, 8], "like": [7, 9, 14], "limit": [0, 7], "line": [3, 7, 8], "linear": 7, "linearli": 7, "link": 2, "linux": [5, 7], "list": [6, 7, 11, 14], "ll": 2, "load": [7, 12, 14], "load_data": 3, "load_dataset": 14, "local": [4, 7, 12, 13, 14], "localhost": [10, 14], "localis": 8, "locat": [8, 11], "log": [0, 8, 11, 15], "log_level": [0, 11, 14], "log_nam": 13, "logfir": [5, 11], "logger": [5, 11, 15], "logger_preambl": 11, "loggeroutput": [11, 13], "logging_demo": 13, "logging_logg": [11, 13], "logic": 7, "login": 0, "longitud": 10, "look": 7, "loss": 3, "loss_fn": 3, "low": [7, 11], "lshw": [7, 11], "m": [0, 7, 10], "m1": 7, "m2": 7, "m3": 7, "m4": 7, "mac": 7, "machin": [0, 1, 7, 9, 10, 11], "macmon": 7, "made": 4, "mai": 13, "main": [0, 7], "major": 10, "make": [2, 4, 7], "manag": [5, 6], "mandatori": 11, "mani": 4, "manner": 14, "manual": [0, 11, 14], "manufactur": 7, "map": [7, 11], "match": 7, "matrixprod": 12, "matter": 9, "max": [7, 11], "mb": 7, "me": 7, "measur": [0, 7, 8, 9, 11, 14], "measure_power_sec": [0, 1, 7, 11, 14], "medium": 7, "memori": [7, 11], "mention": 7, "messag": [11, 13], "metadata": 15, "method": [3, 7, 12], "methodologi": 5, "metric": [2, 3, 5, 10, 12], "mhz": 7, "micro": 7, "microsoft": [4, 8], "might": 8, "mile": 15, "mind": 4, "minim": 14, "minimum": 7, "minut": 0, "miss": [4, 7], "mix": [4, 7, 15], "mixtur": 7, "mkdir": [0, 12], "ml": 2, "mlco2": 12, "mnist": [2, 3], "mode": [0, 1, 5, 7, 10], "model": [3, 5, 7, 9, 14], "model_emiss": 14, "modern": 7, "modifi": [7, 14], "modul": [5, 7], "monitor": [0, 1, 7, 10, 14], "month": 9, "monthli": 4, "more": [1, 2, 7, 9, 14], "most": [8, 15], "motherboard": 7, "motiv": 5, "much": 4, "multi": 0, "multipl": 11, "multipli": 4, "must": 14, "mwh": 7, "my": 4, "my_logg": 13, "n": [7, 10], "name": [6, 7, 10, 11, 13, 14], "nativ": 7, "natur": 7, "nb": 8, "ncarbon": 3, "ndetail": 3, "nearbi": 7, "necessari": 7, "need": [1, 2, 3, 7, 10, 13, 14, 15], "neither": [4, 7], "net": [7, 15], "network": [0, 13], "never": 3, "new": [11, 12], "ng": 12, "nice": 1, "niemi": 7, "nlp": 8, "none": [7, 11], "nopasswd": 7, "nor": 7, "normal": [7, 14], "notabl": 4, "note": [7, 14, 15], "notebook": [3, 12, 14], "noth": 10, "now": [0, 2, 7, 12, 15], "nuclear": 7, "number": [7, 10, 11, 15], "nurminen": 7, "nvidia": [7, 10], "nvme": 12, "o": [10, 12, 14], "object": [2, 5, 9, 11], "observ": 10, "occur": 3, "offici": 6, "offlin": 5, "offlineemissionstrack": [10, 14], "offlineemissiontrack": 13, "offset": 4, "often": 4, "old": [7, 11], "on_cloud": 10, "on_csv_writ": 11, "onc": [2, 10], "one": [1, 4, 7, 10, 11, 13, 15], "onli": [3, 4, 7, 11], "onlin": 5, "open": 4, "openapi": 1, "opt": 0, "optim": 3, "option": [1, 4, 7, 11, 13, 14, 15], "order": [7, 9, 11, 13], "org": 7, "organ": 1, "organis": 15, "organization_id": 0, "other": [0, 3, 4, 9, 13], "otherwis": [7, 13], "ou": 7, "our": [4, 7], "ourworld": 4, "out": [4, 7], "output": [5, 13], "output_dir": [10, 11, 14], "output_fil": 11, "output_handl": 11, "overhead": [7, 14], "overrid": [7, 11, 14], "overwrit": 14, "own": [1, 8], "owner": 0, "ownership": 0, "p": 12, "p40": 8, "packag": [0, 2, 4, 6, 7, 9, 10, 13, 15], "page": [2, 5], "panda": 6, "panel": 2, "parallel": 13, "param": 14, "paramet": [5, 7, 10, 14], "part": [7, 9], "particular": 15, "pass": [7, 14], "passeng": 7, "password": 7, "past": 3, "path": [7, 11, 12, 15], "pattern": 9, "per": [7, 9, 10, 11], "perf": 12, "perform": [7, 9], "permiss": [0, 7], "person": 2, "petroleum": 7, "physic": 7, "pi": 7, "piec": [7, 14], "pip": [0, 2, 6], "pipx": 12, "pkgwatt": 7, "place": 10, "placehold": 2, "plai": [4, 9], "plastic": 7, "plate": 7, "platform": [4, 10], "pleas": [4, 6, 13, 14], "plug": 7, "png": 7, "point": [7, 8, 14, 15], "polici": 8, "popular": 8, "port": 15, "possibl": 7, "possible1": 7, "potenti": 9, "power": [0, 2, 5, 9, 10, 11, 13, 15], "power_const": 11, "powercap": [0, 7, 12], "powermetr": 7, "pp": 7, "ppa": 12, "precis": 10, "prefer": 7, "present": 8, "pretrain": 8, "prevent": 14, "preview": 15, "previou": [0, 7], "price": 4, "print": 3, "prioriti": [4, 5], "privaci": 10, "privat": [4, 10, 13, 14], "privileg": 7, "process": [7, 9, 10, 11, 13, 14, 15], "processor": [7, 9], "produc": [4, 9, 15], "product": 7, "program": [3, 9], "project": [1, 3, 4, 10, 11, 13, 15], "project_id": 0, "project_nam": [3, 10, 11, 14], "prometheu": [5, 11], "prometheus_cli": 6, "prometheus_password": 10, "prometheus_url": 11, "prometheus_usernam": 10, "prompt": 14, "proport": 7, "protect": [8, 10], "provid": [2, 7, 10, 11, 13, 14, 15], "provinc": [10, 11], "proxi": 5, "psutil": [6, 7], "psy": 7, "public": [1, 2, 4, 14, 15], "publicli": 7, "publish": 4, "pue": 11, "purpos": 9, "push": 10, "pushgatewai": 10, "put": 7, "py": [2, 6, 7, 10, 12, 13], "pynvml": [6, 7], "pypi": 5, "pyproject": 6, "python": [0, 6, 12, 14], "python3": [0, 12], "python_vers": 10, "quantifi": [4, 7], "quartil": 8, "question": 5, "questionari": 6, "quickstart": 5, "r": [0, 7, 10, 12], "ram": [10, 11], "ram_energi": 10, "ram_pow": 10, "ram_total_s": 10, "rang": [7, 10], "rapidfuzz": 6, "rapl": [0, 5, 12], "rapsberri": 7, "raspberri": 7, "rather": 7, "ratio": 7, "re": 14, "read": [0, 7, 14], "real": 12, "realli": 7, "reason": [7, 9], "recent": 9, "recogn": [3, 4, 7, 9], "recommend": [3, 4, 6, 14, 15], "record": 14, "recur": 4, "reduc": [4, 7, 10], "refer": [5, 6, 13, 14], "region": [4, 5, 7, 10, 11, 14], "releas": 4, "relev": 8, "reli": 14, "relu": 3, "remain": 14, "remark": 9, "render": 2, "renew": 7, "replac": 2, "repo": 4, "report": [7, 13], "repositori": [3, 5, 12], "repres": 8, "reproduc": 2, "request": [6, 14], "requir": [7, 10, 11, 14], "research": [2, 4], "resource_track": 7, "respect": [10, 14], "restart": 0, "restrict": 14, "result": [8, 10, 12, 14], "return": [3, 14], "rich": 6, "right": [7, 8, 15], "room": 7, "root": [0, 7], "row": 11, "rule": 10, "run": [0, 1, 2, 3, 4, 6, 7, 10, 11, 12, 14, 15], "run_id": 11, "runtim": 15, "ryzen": 7, "same": [7, 11, 14], "sampl": 2, "save": [1, 2, 11, 13, 14], "save_to_api": [1, 11, 14], "save_to_fil": [11, 14], "save_to_logfir": [10, 11], "save_to_logg": [11, 13], "save_to_prometheu": [10, 11], "scale": [7, 8], "scaphandr": 7, "scenario": 12, "schedul": [3, 7, 14], "scheme": 4, "scientist": 2, "scp": 12, "script": 14, "sculpt": 7, "sdk": 13, "search": [2, 5, 10], "sec": 7, "second": [0, 7, 10, 11], "section": [0, 3, 14], "sector": 9, "see": [2, 3, 7, 10, 11, 12, 13, 14, 15], "self": 10, "semiconductor": 7, "send": [0, 10, 11, 13, 14], "sent": [10, 15], "sequenti": 3, "seri": 15, "server": [1, 5, 7, 10, 11, 12], "servic": [5, 10], "set": [0, 1, 2, 10, 11, 13, 14], "setlevel": 13, "sever": 15, "share": 15, "shell": 14, "short": [7, 11], "shot": 4, "should": [4, 7, 11], "show": [8, 15], "shown": 15, "side": [8, 15], "sidebar": 2, "sign": 11, "signific": [7, 9], "significantli": 7, "silicon": 7, "simplest": 3, "sinc": [7, 11], "singl": [4, 7, 14], "size": 7, "slot": [7, 11], "small": [7, 8, 14], "so": [1, 3, 4, 7, 10, 11, 14], "solar": 7, "some": [7, 13, 14], "sometim": 7, "soon": 14, "sophist": 9, "sourc": [4, 8], "sp0": 10, "sparsecategoricalcrossentropi": 3, "specif": [5, 7, 9, 13, 14], "specifi": [1, 10, 11, 13], "split": 14, "ssd": 12, "ssh": [0, 12], "stand": 7, "standard": [4, 7, 9, 11], "start": [2, 3, 7, 10, 13, 14], "start_task": 14, "state": [9, 10, 11], "stdout": 2, "stick": 7, "still": [3, 7, 13], "stop": [3, 7, 10, 13, 14], "stop_task": 14, "stream": 13, "stress": 12, "string": 11, "structur": 14, "studi": 8, "stuff": 7, "subclass": 13, "subject": 7, "subscript": 4, "subsystem": [7, 12], "success": 4, "sudo": [0, 7, 11, 12], "sudoer": 7, "suffix": 10, "sum": 10, "suppli": 7, "support": [7, 11, 13, 14], "sure": 2, "sustain": 4, "switch": [7, 15], "sy": [0, 7, 12], "synchron": 7, "syntax": 14, "sysf": 0, "sysfsutil": 0, "syst": 7, "system": [0, 2, 7, 10, 13], "systemat": 11, "systemctl": 0, "systemd": 0, "systemd_servic": 0, "t": [3, 7, 12, 14], "tab": 2, "tabl": [7, 8], "take": 7, "taken": 2, "target": [0, 10], "task": [0, 9, 14], "tdp": [7, 11, 12], "team": 1, "tee": 0, "televis": 7, "tell": 1, "templat": 0, "tensorflow": 3, "termin": 6, "test": 14, "text": 7, "tf": 3, "than": [7, 13], "thei": 7, "them": [3, 4, 7], "therefor": 4, "thermal": 7, "thi": [0, 1, 3, 4, 7, 8, 9, 10, 11, 13, 14, 15], "think": 3, "those": [7, 15], "thousand": 7, "thread": 7, "threadripp": 7, "through": 5, "thu": 9, "ti": 10, "time": [2, 5, 7, 10, 14, 15], "timeseri": 1, "timestamp": 10, "tini": 8, "tm": [7, 10], "token": [11, 14], "toml": 6, "ton": 7, "tool": [2, 7, 8, 14], "toolkit": 7, "top": 15, "topic": 7, "total": [7, 10, 15], "trace": 0, "track": [2, 3, 7, 9, 10, 11, 13, 14], "track_emiss": [1, 3, 5, 14], "tracker": [3, 7, 10, 11, 13, 14], "tracking_mod": [10, 11, 14], "train": [1, 2, 3, 8, 9, 14], "train_model": [1, 3], "training_loop": 14, "tran": 7, "transf": 8, "transit": 7, "trigger": [10, 13], "true": [1, 3, 10, 11, 13, 14], "try": [3, 4, 7, 11, 14], "tv": 15, "two": [1, 3, 7, 14], "typer": 6, "typic": 13, "u": [0, 8, 10, 11], "ubiquit": 9, "ubuntu": [0, 7, 12], "ui": 2, "unbuff": 7, "unchang": 14, "uncor": 7, "under": [7, 14], "underli": [7, 9], "understand": [7, 15], "unfortun": 4, "unit": [0, 7], "unregist": 7, "up": [0, 7, 10, 11, 14], "updat": [0, 11, 12], "upload": 1, "url": 11, "us": [1, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15], "usa": 10, "usabl": 13, "usag": [5, 11], "user": [0, 7, 11, 14, 15], "useradd": 0, "usernam": 7, "usr": 7, "usual": 10, "util": 7, "uuid": 14, "v100": 8, "v2": [7, 11], "v3": [7, 11, 12], "valid": 13, "valu": [7, 10, 11, 14], "var": 0, "variabl": [0, 11, 14], "variat": 7, "variou": [7, 9, 13, 15], "vast": 9, "ve": 2, "vehicl": 7, "venv": 0, "verbos": [0, 11], "veri": 7, "version": [10, 12, 14], "via": [4, 9], "victor": 14, "view": [2, 4], "virtual": [0, 6], "vision": 8, "visual": [2, 5], "visudo": 7, "vit": 8, "voil\u00e0": 2, "vol": 7, "w": [7, 10, 11, 12], "wa": 7, "wai": [3, 7, 14], "wait": 0, "want": [7, 11, 14], "wantedbi": 0, "warm": 9, "warn": [0, 7, 11, 14], "watch": 15, "watt": [7, 11], "we": [3, 4, 6, 7, 9, 12, 14], "web": [1, 14], "webhook": 10, "websit": [2, 6], "week": [7, 9], "weekli": 15, "weight": 7, "welcom": 7, "well": [4, 7], "wh": 7, "what": [4, 7], "when": [2, 4, 7, 10, 11, 14], "where": [7, 10, 11, 14], "which": [7, 9, 11, 14], "who": 15, "wikipedia": 14, "wind": 7, "window": [7, 10], "within": 14, "without": [7, 14], "wonder": 14, "work": [0, 4, 9, 14], "workingdirectori": 0, "world": [4, 7, 12], "would": [7, 8, 9], "wrap": 14, "wren": 4, "write": 14, "written": [11, 14], "x": [7, 10, 11, 12], "x86": 7, "x_test": 3, "x_train": 3, "xeon": 12, "xxx": 12, "y": [10, 12], "y_test": 3, "y_train": 3, "year": [5, 7, 9], "yet": 14, "yield": 14, "yml": 0, "york": 11, "you": [0, 1, 2, 3, 4, 7, 10, 11, 12, 14, 15], "your": [0, 1, 2, 3, 4, 6, 7, 10, 11, 14, 15], "your_api_kei": 0, "your_experiment_id": 0, "your_org_id": 0, "your_project_id": 0, "yourdomain": 0, "yourself": 7, "yourservernam": 0, "z": 7, "zone": 11}, "titles": ["Advanced Installation", "CodeCarbon API", "Comet Integration", "Examples", "Frequently Asked Questions", "CodeCarbon", "Installing CodeCarbon", "Methodology", "Model Comparisons", "Motivation", "Output", "Parameters", "Test of CodeCarbon on Scaleway hardware", "Collecting emissions to a logger", "Quickstart", "Visualize"], "titleterms": {"access": 14, "across": 7, "advanc": 0, "ai": 8, "an": 13, "ansibl": 0, "api": [1, 10], "ask": 4, "authent": 13, "beta": 15, "calcul": 7, "car": 7, "carbon": [7, 15], "citizen": 7, "cli": 0, "cloud": [8, 13, 15], "code": 7, "codecarbon": [0, 1, 5, 6, 7, 10, 12], "collect": 13, "comet": 2, "command": 14, "comparison": [8, 15], "conda": 6, "configur": 14, "consumpt": 8, "context": [3, 14], "countri": 15, "cpu": 7, "creat": 13, "csv": 10, "data": 10, "decor": [3, 14], "depend": 6, "deploi": 0, "detail": 15, "directori": 0, "doe": 0, "each": 10, "electr": [8, 15], "emiss": [7, 13], "emissiontrack": 13, "energi": 7, "equival": [7, 15], "estim": 7, "exampl": [3, 13], "experi": 10, "explicit": [3, 14], "field": 10, "formula": 7, "frequent": 4, "from": [6, 15], "get": 5, "global": 15, "googl": 13, "gpu": 7, "hardwar": [7, 12], "how": [7, 10], "http": 10, "impact": 8, "indic": 5, "input": 11, "instal": [0, 6], "instanc": 8, "integr": 2, "intens": [7, 15], "internet": 14, "introduct": 5, "line": 14, "linux": 0, "local": 10, "log": [5, 10, 13], "logfir": 10, "logger": [10, 13], "manag": [3, 14], "methodologi": 7, "metric": 7, "mode": [11, 14], "model": 8, "more": 15, "motiv": 9, "object": [3, 14], "offlin": [11, 14, 15], "offlineemissionstrack": 11, "onlin": [14, 15], "output": [10, 11], "paramet": 11, "per": 15, "playbook": 0, "power": 7, "prerequisit": 0, "prioriti": [7, 14], "product": 15, "prometheu": 10, "proxi": 14, "pypi": 6, "python": 13, "question": 4, "quick": 0, "quickstart": 14, "ram": 7, "rapl": 7, "refer": [7, 8], "region": [8, 15], "repositori": 6, "scalewai": 12, "server": 14, "servic": 0, "sourc": 7, "specif": 11, "start": [0, 5], "structur": 0, "summari": 15, "tabl": 5, "test": [10, 12], "through": 14, "time": 8, "track_emiss": 11, "tv": 7, "u": 7, "us": [0, 3, 10], "usag": 7, "visual": 15, "weekli": 7, "what": 0, "work": 7, "year": 8}}) \ No newline at end of file diff --git a/docs/to_logger.html b/docs/to_logger.html index 587a24096..3e73e07fe 100644 --- a/docs/to_logger.html +++ b/docs/to_logger.html @@ -113,7 +113,7 @@

    Create a logger

    Python logger

    -
    import logging
    +
    import logging
     
     # Create a dedicated logger (log name can be the CodeCarbon project name for example)
     _logger = logging.getLogger(log_name)
    @@ -133,7 +133,7 @@ 

    Python logger

    Google Cloud Logging

    -
    import google.cloud.logging
    +
    import google.cloud.logging
     
     
     # Create a Cloud Logging client (specify project name if needed, otherwise Google SDK default project name is used)
    diff --git a/docs/usage.html b/docs/usage.html
    index 273e9be82..de6acfdc2 100644
    --- a/docs/usage.html
    +++ b/docs/usage.html
    @@ -145,7 +145,7 @@ 

    Command line

    In the case of absence of a single entry and stop point for the training code base, users can instantiate a EmissionsTracker object and pass it as a parameter to function calls to start and stop the emissions tracking of the compute section.

    -
    from codecarbon import EmissionsTracker
    +
    from codecarbon import EmissionsTracker
     tracker = EmissionsTracker()
     tracker.start()
     try:
    @@ -178,7 +178,7 @@ 

    Explicit Object

    Context manager

    The Emissions tracker also works as a context manager.

    -
    from codecarbon import EmissionsTracker
    +
    from codecarbon import EmissionsTracker
     
     with EmissionsTracker() as tracker:
         # Compute intensive training code goes here
    @@ -190,10 +190,10 @@ 

    Context manager

    In case the training code base is wrapped in a function, users can use the decorator @track_emissions within the function to enable tracking emissions of the training code.

    -
    from codecarbon import track_emissions
    +
    from codecarbon import track_emissions
     
     @track_emissions
    -def training_loop():
    +def training_loop():
         # Compute intensive training code goes here
     
    @@ -211,7 +211,7 @@

    Offline Mode

    Explicit Object

    Developers can use the OfflineEmissionsTracker object to track emissions as follows:

    -
    from codecarbon import OfflineEmissionsTracker
    +
    from codecarbon import OfflineEmissionsTracker
     tracker = OfflineEmissionsTracker(country_iso_code="CAN")
     tracker.start()
     # GPU intensive training code
    @@ -222,7 +222,7 @@ 

    Explicit Object

    Context manager

    The OfflineEmissionsTracker also works as a context manager

    -
    from codecarbon import OfflineEmissionsTracker
    +
    from codecarbon import OfflineEmissionsTracker
     
     with OfflineEmissionsTracker() as tracker:
     # GPU intensive training code  goes here
    @@ -236,9 +236,9 @@ 

    Decorator<
  • offline needs to be set to True, which defaults to False for online mode.

  • country_iso_code the 3-letter alphabet ISO Code of the country where the compute infrastructure is hosted

  • -
    from codecarbon import track_emissions
    +
    from codecarbon import track_emissions
     @track_emissions(offline=True, country_iso_code="CAN")
    -def training_loop():
    +def training_loop():
         # training code goes here
         pass
     
    @@ -338,7 +338,7 @@

    Access internet through proxy server
    import os
    +
    import os
     
     os.environ["HTTPS_PROXY"] = "http://0.0.0.0:0000"
     
    diff --git a/tests/test_data/mock_macmon_log.txt b/tests/test_data/mock_macmon_log.txt new file mode 100644 index 000000000..5f2986741 --- /dev/null +++ b/tests/test_data/mock_macmon_log.txt @@ -0,0 +1,10 @@ +{"temp":{"cpu_temp_avg":47.99754,"gpu_temp_avg":44.168976},"memory":{"ram_total":8589934592,"ram_usage":7016267776,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1221,0.059566148],"pcpu_usage":[2813,0.12654762],"gpu_usage":[396,0.052929282],"cpu_power":0.47729987,"gpu_power":0.025773834,"ane_power":0.0,"all_power":0.5030737,"sys_power":12.617373,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":47.99754,"gpu_temp_avg":44.834038},"memory":{"ram_total":8589934592,"ram_usage":7019053056,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1496,0.10201424],"pcpu_usage":[2434,0.11360246],"gpu_usage":[396,0.063834384],"cpu_power":0.43330622,"gpu_power":0.02971501,"ane_power":0.0,"all_power":0.46302122,"sys_power":12.617373,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":47.99754,"gpu_temp_avg":44.834038},"memory":{"ram_total":8589934592,"ram_usage":7019937792,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1261,0.10726784],"pcpu_usage":[2209,0.07984778],"gpu_usage":[396,0.054138985],"cpu_power":0.17238411,"gpu_power":0.023141222,"ane_power":0.0,"all_power":0.19552533,"sys_power":12.617373,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":47.99754,"gpu_temp_avg":44.834038},"memory":{"ram_total":8589934592,"ram_usage":7019937792,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1368,0.13209346],"pcpu_usage":[2653,0.085086405],"gpu_usage":[396,0.051508717],"cpu_power":0.1759564,"gpu_power":0.023062157,"ane_power":0.0,"all_power":0.19901855,"sys_power":12.617373,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":47.99754,"gpu_temp_avg":44.834038},"memory":{"ram_total":8589934592,"ram_usage":7019937792,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1561,0.13995293],"pcpu_usage":[2342,0.077804655],"gpu_usage":[396,0.05396843],"cpu_power":0.20275298,"gpu_power":0.023571063,"ane_power":0.0,"all_power":0.22632404,"sys_power":12.072607,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":47.99754,"gpu_temp_avg":44.834038},"memory":{"ram_total":8589934592,"ram_usage":7019937792,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1498,0.13700348],"pcpu_usage":[2471,0.0862776],"gpu_usage":[396,0.05373454],"cpu_power":0.21767727,"gpu_power":0.03300677,"ane_power":0.0,"all_power":0.25068402,"sys_power":12.072607,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":47.99754,"gpu_temp_avg":44.834038},"memory":{"ram_total":8589934592,"ram_usage":7019937792,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1513,0.28408676],"pcpu_usage":[2005,0.17747135],"gpu_usage":[396,0.057192028],"cpu_power":0.86930436,"gpu_power":0.029238673,"ane_power":0.0,"all_power":0.89854306,"sys_power":12.072607,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":47.99754,"gpu_temp_avg":44.834038},"memory":{"ram_total":8589934592,"ram_usage":7019937792,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1478,0.16347156],"pcpu_usage":[2230,0.083416276],"gpu_usage":[396,0.050722033],"cpu_power":0.22681558,"gpu_power":0.020034816,"ane_power":0.0,"all_power":0.2468504,"sys_power":12.072607,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":46.749672,"gpu_temp_avg":44.735157},"memory":{"ram_total":8589934592,"ram_usage":7017316352,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1522,0.22398606],"pcpu_usage":[2076,0.10601956],"gpu_usage":[396,0.052908726],"cpu_power":0.5067222,"gpu_power":0.014275403,"ane_power":0.0,"all_power":0.52099764,"sys_power":12.072607,"ram_power":0.0,"gpu_ram_power":0.0} +{"temp":{"cpu_temp_avg":46.749672,"gpu_temp_avg":44.735157},"memory":{"ram_total":8589934592,"ram_usage":7012958208,"swap_total":6442450944,"swap_usage":5806751744},"ecpu_usage":[1756,0.11604428],"pcpu_usage":[1914,0.13429697],"gpu_usage":[396,0.09375177],"cpu_power":0.7002688,"gpu_power":0.099837735,"ane_power":0.0,"all_power":0.8001065,"sys_power":12.072607,"ram_power":0.0,"gpu_ram_power":0.0} diff --git a/tests/test_macmon.py b/tests/test_macmon.py new file mode 100644 index 000000000..b792c0eaf --- /dev/null +++ b/tests/test_macmon.py @@ -0,0 +1,49 @@ +import os +import unittest +import unittest.result +from unittest import mock + +import numpy as np +import pytest + +from codecarbon.core.macmon import MacMon, is_macmon_available + + +class TestMacMon(unittest.TestCase): + @pytest.mark.integ_test + def test_macmon(self): + if is_macmon_available(): + output_dir = os.path.join(os.path.dirname(__file__), "test_data") + log_file_path = os.path.join(output_dir, "macmon_log.txt") + power_gadget = MacMon( + output_dir=output_dir, + log_file_name="macmon_log.txt", + ) + details = power_gadget.get_details() + + assert len(details) > 0 + + # Cleanup + if os.path.exists(log_file_path): + os.remove(log_file_path) + + # @pytest.mark.integ_test + @mock.patch("codecarbon.core.macmon.MacMon._log_values") + @mock.patch("codecarbon.core.macmon.MacMon._setup_cli") + def test_get_details(self, mock_setup, mock_log_values): + expected_details = { + "CPU Power": np.float64(0.398248779), + "CPU Energy Delta": np.float64(0.398248779), + "GPU Power": np.float64(0.0321656683), + "GPU Energy Delta": np.float64(0.0321656683), + "RAM Power": np.float64(0.0), + "RAM Energy Delta": np.float64(0.0), + } + if is_macmon_available(): + macmon = MacMon( + output_dir=os.path.join(os.path.dirname(__file__), "test_data"), + log_file_name="mock_macmon_log.txt", + ) + details = macmon.get_details() + + self.assertDictEqual(expected_details, details)