Repository: mlco2/codecarbon (language: python)

Issue:
CodeCarbon spams Slurm controler with `scontrol`
Hello,

We are facing some issues with CodeCarbon in our facility because it spams our Slurm controler with `scontrol`.

If rate-limiting is enabled this also means that the jobs that use CodeCarbon are slowed down because they spend a lot of time waiting for `scontrol` to return.

As far as I could tell, the values that are read from `scontrol` won't change during the run so they could be cached by CodeCarbon instead of being fetched everytime.

We are willing to provide a PR if needed. If caching is used somewhere else, feel free to point us to the relevant code so that we use a similar implementation.

Rémi 


Discussion / hints:
Hello,
Thanks for reporting this. `scontrol` is used at the tracker initialization to detect hardware values. It is then surprising that your execution context is spammed with it.
Could you please provide some codecarbon-related logs surrounding the `scontrol` calls, and the tracker instantiation context ?
I think that's true for the `count_cpus` function
https://github.com/mlco2/codecarbon/blob/d99fe87604791ad667a4c0ec54a10f8182dea0ab/codecarbon/core/util.py#L77
but the `slurm_memory_GB` function is indirectly used by `measure_power_and_energy` which is called in a loop:
https://github.com/mlco2/codecarbon/blob/d99fe87604791ad667a4c0ec54a10f8182dea0ab/codecarbon/external/hardware.py#L312
Hello,
Good point, feel free to propose a PR to not compute `slurm_memory_GB` value each time. We, CodeCarbon contributors, do not have access to Slurm cluster.

Do you know the rate that is problematic ? Because `measure_power_secs` default value is 15 seconds.

Fix patch:
diff --git a/.conda/meta.yaml b/.conda/meta.yaml
index f9978a010..9b3f6726b 100644
--- a/.conda/meta.yaml
+++ b/.conda/meta.yaml
@@ -1,4 +1,4 @@
-{% set version = "2.3.1" %}
+{% set version = "2.3.2" %}
 
 package:
   name: codecarbon
diff --git a/codecarbon/_version.py b/codecarbon/_version.py
index 3a5935a2d..ef6497d05 100644
--- a/codecarbon/_version.py
+++ b/codecarbon/_version.py
@@ -1,1 +1,1 @@
-__version__ = "2.3.1"
+__version__ = "2.3.2"
diff --git a/codecarbon/core/util.py b/codecarbon/core/util.py
index b2708a6ec..7bf66edb3 100644
--- a/codecarbon/core/util.py
+++ b/codecarbon/core/util.py
@@ -11,6 +11,11 @@
 
 from codecarbon.external.logger import logger
 
+SLURM_JOB_ID = os.environ.get(
+    "SLURM_JOB_ID",  # default
+    os.environ.get("SLURM_JOBID"),  # deprecated but may still be used
+)
+
 
 @contextmanager
 def suppress(*exceptions):
@@ -75,16 +80,20 @@ def detect_cpu_model() -> str:
 
 
 def count_cpus() -> int:
-    if os.environ.get("SLURM_JOB_ID") is None:
+    if SLURM_JOB_ID is None:
         return psutil.cpu_count()
 
     try:
+        logger.debug(
+            "SLURM environment detected for job {SLURM_JOB_ID}, running"
+            + " `scontrol show job $SLURM_JOB_ID` to count SLURM-available cpus."
+        )
         scontrol = subprocess.check_output(
-            ["scontrol show job $SLURM_JOBID"], shell=True
+            [f"scontrol show job {SLURM_JOB_ID}"], shell=True
         ).decode()
     except subprocess.CalledProcessError:
         logger.warning(
-            "Error running `scontrol show job $SLURM_JOBID` "
+            "Error running `scontrol show job $SLURM_JOB_ID` "
             + "to count SLURM-available cpus. Using the machine's cpu count."
         )
         return psutil.cpu_count()
@@ -93,17 +102,18 @@ def count_cpus() -> int:
 
     if len(num_cpus_matches) == 0:
         logger.warning(
-            "Could not find NumCPUs= after running `scontrol show job $SLURM_JOBID` "
+            "Could not find NumCPUs= after running `scontrol show job $SLURM_JOB_ID` "
             + "to count SLURM-available cpus. Using the machine's cpu count."
         )
         return psutil.cpu_count()
 
     if len(num_cpus_matches) > 1:
         logger.warning(
-            "Unexpected output after running `scontrol show job $SLURM_JOBID` "
+            "Unexpected output after running `scontrol show job $SLURM_JOB_ID` "
             + "to count SLURM-available cpus. Using the machine's cpu count."
         )
         return psutil.cpu_count()
 
     num_cpus = num_cpus_matches[0].replace("NumCPUs=", "")
+    logger.debug(f"Detected {num_cpus} cpus available on SLURM.")
     return int(num_cpus)
diff --git a/codecarbon/external/hardware.py b/codecarbon/external/hardware.py
index 9ecc13a9f..dd5668589 100644
--- a/codecarbon/external/hardware.py
+++ b/codecarbon/external/hardware.py
@@ -1,8 +1,6 @@
 """
 Encapsulates external dependencies to retrieve hardware metadata
 """
-
-import os
 import re
 import subprocess
 from abc import ABC, abstractmethod
@@ -14,7 +12,7 @@
 from codecarbon.core.cpu import IntelPowerGadget, IntelRAPL
 from codecarbon.core.gpu import AllGPUDevices
 from codecarbon.core.units import Energy, Power, Time
-from codecarbon.core.util import detect_cpu_model
+from codecarbon.core.util import SLURM_JOB_ID, detect_cpu_model
 from codecarbon.external.logger import logger
 
 # default W value for a CPU if no model is found in the ref csv
@@ -238,6 +236,7 @@ class RAM(BaseHardware):
     # 3 watts of power for every 8GB of DDR3 or DDR4 memory
     # https://www.crucial.com/support/articles-faq-memory/how-much-power-does-memory-use
     power_per_GB = 3 / 8  # W/GB
+    memory_size = None
 
     def __init__(
         self,
@@ -273,13 +272,29 @@ def _get_children_memories(self):
 
     def _read_slurm_scontrol(self):
         try:
-            return subprocess.check_output(
-                ["scontrol show job $SLURM_JOBID"], shell=True
-            ).decode()
+            logger.debug(
+                "SLURM environment detected, running `scontrol show job $SLURM_JOB_ID`..."
+            )
+            return (
+                subprocess.check_output(
+                    [f"scontrol show job {SLURM_JOB_ID}"], shell=True
+                )
+                .decode()
+                .strip()
+            )
         except subprocess.CalledProcessError:
             return
 
     def _parse_scontrol_memory_GB(self, mem):
+        """
+        Parse the memory string (B) returned by scontrol to a float (GB)
+
+        Args:
+            mem (str): Memory string (B) as `[amount][unit]` (e.g. `128G`)
+
+        Returns:
+            float: Memory (GB)
+        """
         nb = int(mem[:-1])
         unit = mem[-1]
         if unit == "T":
@@ -292,16 +307,16 @@ def _parse_scontrol_memory_GB(self, mem):
             return nb / (1000**2)
 
     def _parse_scontrol(self, scontrol_str):
-        mem_matches = re.findall(r"mem=\d+[A-Z]", scontrol_str)
+        mem_matches = re.findall(r"AllocTRES=.*?,mem=(\d+[A-Z])", scontrol_str)
         if len(mem_matches) == 0:
             logger.warning(
-                "Could not find mem= after running `scontrol show job $SLURM_JOBID` "
+                "Could not find mem= after running `scontrol show job $SLURM_JOB_ID` "
                 + "to count SLURM-available RAM. Using the machine's total RAM."
             )
             return psutil.virtual_memory().total / B_TO_GB
         if len(mem_matches) > 1:
             logger.warning(
-                "Unexpected output after running `scontrol show job $SLURM_JOBID` "
+                "Unexpected output after running `scontrol show job $SLURM_JOB_ID` "
                 + "to count SLURM-available RAM. Using the machine's total RAM."
             )
             return psutil.virtual_memory().total / B_TO_GB
@@ -310,17 +325,27 @@ def _parse_scontrol(self, scontrol_str):
 
     @property
     def slurm_memory_GB(self):
+        """
+        Property to compute the SLURM-available RAM in GigaBytes.
+
+        Returns:
+            float: Memory allocated to the job (GB)
+        """
+        # Prevent calling scontrol at each mesure
+        if self.memory_size:
+            return self.memory_size
         scontrol_str = self._read_slurm_scontrol()
         if scontrol_str is None:
             logger.warning(
-                "Error running `scontrol show job $SLURM_JOBID` "
+                "Error running `scontrol show job $SLURM_JOB_ID` "
                 + "to retrieve SLURM-available RAM."
                 + "Using the machine's total RAM."
             )
             return psutil.virtual_memory().total / B_TO_GB
         mem = self._parse_scontrol(scontrol_str)
         if isinstance(mem, str):
-            return self._parse_scontrol_memory_GB(mem)
+            mem = self._parse_scontrol_memory_GB(mem)
+        self.memory_size = mem
         return mem
 
     @property
@@ -338,9 +363,15 @@ def process_memory_GB(self):
 
     @property
     def machine_memory_GB(self):
+        """
+        Property to compute the machine's total memory in bytes.
+
+        Returns:
+            float: Total RAM (GB)
+        """
         return (
             self.slurm_memory_GB
-            if os.environ.get("SLURM_JOB_ID")
+            if SLURM_JOB_ID
             else psutil.virtual_memory().total / B_TO_GB
         )
 
diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js
index 2b961e6b3..5f585ac23 100644
--- a/docs/_static/documentation_options.js
+++ b/docs/_static/documentation_options.js
@@ -1,5 +1,5 @@
 const DOCUMENTATION_OPTIONS = {
-    VERSION: '2.3.1',
+    VERSION: '2.3.2',
     LANGUAGE: 'en',
     COLLAPSE_INDEX: false,
     BUILDER: 'html',
@@ -10,4 +10,4 @@ const DOCUMENTATION_OPTIONS = {
     NAVIGATION_WITH_KEYS: false,
     SHOW_SEARCH_SUMMARY: true,
     ENABLE_SEARCH_SHORTCUTS: true,
-};
\ No newline at end of file
+};
diff --git a/docs/_static/jquery-3.5.1.js b/docs/_static/jquery-3.5.1.js
index 50937333b..baabef27d 100644
--- a/docs/_static/jquery-3.5.1.js
+++ b/docs/_static/jquery-3.5.1.js
@@ -3761,7 +3761,7 @@ jQuery.extend( {
 
 									returned = handler.apply( that, args );
 
-									// Support: Promises/A+ section 2.3.1
+									// Support: Promises/A+ section 2.3.2
 									// https://promisesaplus.com/#point-48
 									if ( returned === deferred.promise() ) {
 										throw new TypeError( "Thenable self-resolution" );
diff --git a/docs/_static/jquery-3.6.0.js b/docs/_static/jquery-3.6.0.js
index fc6c299b7..1ff4826c5 100644
--- a/docs/_static/jquery-3.6.0.js
+++ b/docs/_static/jquery-3.6.0.js
@@ -3765,7 +3765,7 @@ jQuery.extend( {
 
 									returned = handler.apply( that, args );
 
-									// Support: Promises/A+ section 2.3.1
+									// Support: Promises/A+ section 2.3.2
 									// https://promisesaplus.com/#point-48
 									if ( returned === deferred.promise() ) {
 										throw new TypeError( "Thenable self-resolution" );
diff --git a/docs/api.html b/docs/api.html
index ccf3681d8..108fe892d 100644
--- a/docs/api.html
+++ b/docs/api.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>CodeCarbon API &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>CodeCarbon API &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Parameters" href="parameters.html" />
-    <link rel="prev" title="Quickstart" href="usage.html" /> 
+    <link rel="prev" title="Quickstart" href="usage.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -92,7 +92,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="codecarbon-api">
 <span id="api"></span><h1>CodeCarbon API<a class="headerlink" href="#codecarbon-api" title="Link to this heading"></a></h1>
 <section id="id1">
@@ -164,7 +164,7 @@ <h2>CodeCarbon API<a class="headerlink" href="#id1" title="Link to this heading"
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -175,7 +175,7 @@ <h2>CodeCarbon API<a class="headerlink" href="#id1" title="Link to this heading"
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/comet.html b/docs/comet.html
index dc4930c3b..432c984b9 100644
--- a/docs/comet.html
+++ b/docs/comet.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Comet Integration &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Comet Integration &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Output" href="output.html" />
-    <link rel="prev" title="Examples" href="examples.html" /> 
+    <link rel="prev" title="Examples" href="examples.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -89,7 +89,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="comet-integration">
 <span id="comet"></span><h1>Comet Integration<a class="headerlink" href="#comet-integration" title="Link to this heading"></a></h1>
 <p>CodeCarbon can be automatically integrated with <a class="reference external" href="https://www.comet.ml/site/">Comet</a> for experiment tracking and visualization. Comet provides data scientists with powerful tools to track, compare, explain, and reproduce their experiments. Now, with CodeCarbon you can easily track the carbon footprint of your jobs along with your training metrics, hyperparameters, dataset samples, artifacts, and more.</p>
@@ -128,7 +128,7 @@
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -139,7 +139,7 @@
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/edit/conf.py b/docs/edit/conf.py
index 66c9adbad..2330a9148 100644
--- a/docs/edit/conf.py
+++ b/docs/edit/conf.py
@@ -23,7 +23,7 @@
 author = "BCG GAMMA, Comet.ml, Haverford College, MILA, Data For Good"
 
 # The full version, including alpha/beta/rc tags
-release = "2.3.1"
+release = "2.3.2"
 
 
 # -- General configuration ---------------------------------------------------
diff --git a/docs/examples.html b/docs/examples.html
index 31a72dd30..6604f5a5e 100644
--- a/docs/examples.html
+++ b/docs/examples.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Examples &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Examples &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Comet Integration" href="comet.html" />
-    <link rel="prev" title="Parameters" href="parameters.html" /> 
+    <link rel="prev" title="Parameters" href="parameters.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -94,7 +94,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="examples">
 <span id="id1"></span><h1>Examples<a class="headerlink" href="#examples" title="Link to this heading"></a></h1>
 <p>Following are examples to train a Deep Learning model on MNIST Data to recognize digits in images using TensorFlow.</p>
@@ -214,7 +214,7 @@ <h2>Using the Decorator<a class="headerlink" href="#using-the-decorator" title="
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -225,7 +225,7 @@ <h2>Using the Decorator<a class="headerlink" href="#using-the-decorator" title="
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/faq.html b/docs/faq.html
index 2e7a6e161..4564c55ec 100644
--- a/docs/faq.html
+++ b/docs/faq.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Frequently Asked Questions &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Frequently Asked Questions &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Installing CodeCarbon" href="installation.html" />
-    <link rel="prev" title="Model Comparisons" href="model_examples.html" /> 
+    <link rel="prev" title="Model Comparisons" href="model_examples.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -89,7 +89,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="frequently-asked-questions">
 <span id="faq"></span><h1>Frequently Asked Questions<a class="headerlink" href="#frequently-asked-questions" title="Link to this heading"></a></h1>
 <ul>
@@ -147,7 +147,7 @@
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -158,7 +158,7 @@
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/genindex.html b/docs/genindex.html
index 95ae712a1..51040abf2 100644
--- a/docs/genindex.html
+++ b/docs/genindex.html
@@ -3,13 +3,13 @@
 <head>
   <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Index &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Index &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -17,17 +17,17 @@
         <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
     <script src="_static/js/theme.js"></script>
     <link rel="index" title="Index" href="#" />
-    <link rel="search" title="Search" href="search.html" /> 
+    <link rel="search" title="Search" href="search.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -85,12 +85,12 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
 
 <h1 id="index">Index</h1>
 
 <div class="genindex-jumpbox">
- 
+
 </div>
 
 
@@ -107,7 +107,7 @@ <h1 id="index">Index</h1>
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -118,7 +118,7 @@ <h1 id="index">Index</h1>
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/index.html b/docs/index.html
index cdf05923b..01e3259ec 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>CodeCarbon &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>CodeCarbon &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -19,17 +19,17 @@
     <script src="_static/js/theme.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
-    <link rel="next" title="Motivation" href="motivation.html" /> 
+    <link rel="next" title="Motivation" href="motivation.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="#" class="icon icon-home">
             CodeCarbon
           </a>
@@ -88,7 +88,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="codecarbon">
 <h1>CodeCarbon<a class="headerlink" href="#codecarbon" title="Link to this heading"></a></h1>
 <img alt="Banner" class="align-center" src="_images/banner.png" />
@@ -198,7 +198,7 @@ <h2>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Li
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -209,7 +209,7 @@ <h2>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Li
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/installation.html b/docs/installation.html
index 42d1ba099..5f8f1b659 100644
--- a/docs/installation.html
+++ b/docs/installation.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Installing CodeCarbon &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Installing CodeCarbon &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Quickstart" href="usage.html" />
-    <link rel="prev" title="Frequently Asked Questions" href="faq.html" /> 
+    <link rel="prev" title="Frequently Asked Questions" href="faq.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -94,7 +94,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="installing-codecarbon">
 <span id="installation"></span><h1>Installing CodeCarbon<a class="headerlink" href="#installing-codecarbon" title="Link to this heading"></a></h1>
 <p>Create a virtual environment using <cite>conda</cite> for easier management of dependencies and packages.
@@ -159,7 +159,7 @@ <h2>Dependencies<a class="headerlink" href="#dependencies" title="Link to this h
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -170,7 +170,7 @@ <h2>Dependencies<a class="headerlink" href="#dependencies" title="Link to this h
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/methodology.html b/docs/methodology.html
index 5535279fa..2cec0aa73 100644
--- a/docs/methodology.html
+++ b/docs/methodology.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Methodology &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Methodology &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Model Comparisons" href="model_examples.html" />
-    <link rel="prev" title="Motivation" href="motivation.html" /> 
+    <link rel="prev" title="Motivation" href="motivation.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -102,7 +102,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="methodology">
 <span id="id1"></span><h1>Methodology<a class="headerlink" href="#methodology" title="Link to this heading"></a></h1>
 <p>Carbon dioxide (CO₂) emissions, expressed as kilograms of CO₂-equivalents [CO₂eq], are the product of two main factors :</p>
@@ -238,7 +238,7 @@ <h3>How CodeCarbon Works<a class="headerlink" href="#how-codecarbon-works" title
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -249,7 +249,7 @@ <h3>How CodeCarbon Works<a class="headerlink" href="#how-codecarbon-works" title
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/model_examples.html b/docs/model_examples.html
index 317d57934..2f0ac62d7 100644
--- a/docs/model_examples.html
+++ b/docs/model_examples.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Model Comparisons &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Model Comparisons &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Frequently Asked Questions" href="faq.html" />
-    <link rel="prev" title="Methodology" href="methodology.html" /> 
+    <link rel="prev" title="Methodology" href="methodology.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -94,7 +94,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="model-comparisons">
 <span id="model-examples"></span><h1>Model Comparisons<a class="headerlink" href="#model-comparisons" title="Link to this heading"></a></h1>
 <p>The following table shows the different electricity consumption of popular NLP and Computer visions models</p>
@@ -213,7 +213,7 @@ <h2>References<a class="headerlink" href="#references" title="Link to this headi
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -224,7 +224,7 @@ <h2>References<a class="headerlink" href="#references" title="Link to this headi
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/motivation.html b/docs/motivation.html
index 67ab6fb76..ac4951c01 100644
--- a/docs/motivation.html
+++ b/docs/motivation.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Motivation &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Motivation &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Methodology" href="methodology.html" />
-    <link rel="prev" title="CodeCarbon" href="index.html" /> 
+    <link rel="prev" title="CodeCarbon" href="index.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -89,7 +89,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="motivation">
 <span id="id1"></span><h1>Motivation<a class="headerlink" href="#motivation" title="Link to this heading"></a></h1>
 <p>In recent years, Artificial Intelligence, and more specifically Machine Learning, has become remarkably efficient at performing human-level tasks: recognizing objects and faces in images, driving cars, and playing sophisticated games like chess and Go.</p>
@@ -115,7 +115,7 @@
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -126,7 +126,7 @@
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/output.html b/docs/output.html
index a69aebe6b..ca89a65a0 100644
--- a/docs/output.html
+++ b/docs/output.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Output &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Output &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Collecting emissions to a logger" href="to_logger.html" />
-    <link rel="prev" title="Comet Integration" href="comet.html" /> 
+    <link rel="prev" title="Comet Integration" href="comet.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -100,7 +100,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="output">
 <span id="id1"></span><h1>Output<a class="headerlink" href="#output" title="Link to this heading"></a></h1>
 <section id="csv">
@@ -290,7 +290,7 @@ <h2>Logger Output<a class="headerlink" href="#logger-output" title="Link to this
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -301,7 +301,7 @@ <h2>Logger Output<a class="headerlink" href="#logger-output" title="Link to this
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/parameters.html b/docs/parameters.html
index ca381470a..14ef46dc2 100644
--- a/docs/parameters.html
+++ b/docs/parameters.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Parameters &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Parameters &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Examples" href="examples.html" />
-    <link rel="prev" title="CodeCarbon API" href="api.html" /> 
+    <link rel="prev" title="CodeCarbon API" href="api.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -95,7 +95,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="parameters">
 <span id="id1"></span><h1>Parameters<a class="headerlink" href="#parameters" title="Link to this heading"></a></h1>
 <p>A set of parameters are supported by API to help users provide additional details per project.</p>
@@ -370,7 +370,7 @@ <h2>&#64;track_emissions<a class="headerlink" href="#track-emissions" title="Lin
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -381,7 +381,7 @@ <h2>&#64;track_emissions<a class="headerlink" href="#track-emissions" title="Lin
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/search.html b/docs/search.html
index 569d9d5e2..0d4fe5313 100644
--- a/docs/search.html
+++ b/docs/search.html
@@ -3,14 +3,14 @@
 <head>
   <meta charset="utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Search &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Search &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
-    
+
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <script src="_static/searchtools.js"></script>
     <script src="_static/language_data.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
-    <link rel="search" title="Search" href="#" /> 
+    <link rel="search" title="Search" href="#" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -88,7 +88,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <noscript>
   <div id="fallback" class="admonition warning">
     <p class="last">
@@ -97,9 +97,9 @@
   </div>
   </noscript>
 
-  
+
   <div id="search-results">
-  
+
   </div>
 
            </div>
@@ -115,7 +115,7 @@
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -130,10 +130,10 @@
   <script>
     jQuery(function() { Search.loadIndex("searchindex.js"); });
   </script>
-  
+
   <script id="searchindexloader"></script>
-   
+
 
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/to_logger.html b/docs/to_logger.html
index b76828f34..10ab5fdff 100644
--- a/docs/to_logger.html
+++ b/docs/to_logger.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Collecting emissions to a logger &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Collecting emissions to a logger &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="Visualize" href="visualize.html" />
-    <link rel="prev" title="Output" href="output.html" /> 
+    <link rel="prev" title="Output" href="output.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -99,7 +99,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="collecting-emissions-to-a-logger">
 <span id="id1"></span><h1>Collecting emissions to a logger<a class="headerlink" href="#collecting-emissions-to-a-logger" title="Link to this heading"></a></h1>
 <p>The <code class="docutils literal notranslate"><span class="pre">LoggerOutput</span></code> class (and <code class="docutils literal notranslate"><span class="pre">GoogleCloudLoggerOutput</span></code> subclass) allows to send emissions tracking to a logger.
@@ -182,7 +182,7 @@ <h3>Example<a class="headerlink" href="#example" title="Link to this heading">
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -193,7 +193,7 @@ <h3>Example<a class="headerlink" href="#example" title="Link to this heading">
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/usage.html b/docs/usage.html
index ae1829b4a..596a62bc4 100644
--- a/docs/usage.html
+++ b/docs/usage.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Quickstart &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Quickstart &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -20,17 +20,17 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="CodeCarbon API" href="api.html" />
-    <link rel="prev" title="Installing CodeCarbon" href="installation.html" /> 
+    <link rel="prev" title="Installing CodeCarbon" href="installation.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -108,7 +108,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="quickstart">
 <span id="usage"></span><h1>Quickstart<a class="headerlink" href="#quickstart" title="Link to this heading"></a></h1>
 <p>The CO2 tracking tool can be used along with any computing framework. It supports both <code class="docutils literal notranslate"><span class="pre">online</span></code> (with internet access) and
@@ -348,7 +348,7 @@ <h2>Access internet through proxy server<a class="headerlink" href="#access-inte
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -359,7 +359,7 @@ <h2>Access internet through proxy server<a class="headerlink" href="#access-inte
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/docs/visualize.html b/docs/visualize.html
index 2ee0e76c6..f473b829b 100644
--- a/docs/visualize.html
+++ b/docs/visualize.html
@@ -4,13 +4,13 @@
   <meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
 
   <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <title>Visualize &mdash; CodeCarbon 2.3.1 documentation</title>
+  <title>Visualize &mdash; CodeCarbon 2.3.2 documentation</title>
       <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
       <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
   <!--[if lt IE 9]>
     <script src="_static/js/html5shiv.min.js"></script>
   <![endif]-->
-  
+
         <script src="_static/jquery.js?v=5d32c60e"></script>
         <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
         <script src="_static/documentation_options.js?v=67b02a41"></script>
@@ -19,17 +19,17 @@
     <script src="_static/js/theme.js"></script>
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
-    <link rel="prev" title="Collecting emissions to a logger" href="to_logger.html" /> 
+    <link rel="prev" title="Collecting emissions to a logger" href="to_logger.html" />
 </head>
 
-<body class="wy-body-for-nav"> 
+<body class="wy-body-for-nav">
   <div class="wy-grid-for-nav">
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
       <div class="wy-side-scroll">
         <div class="wy-side-nav-search" >
 
-          
-          
+
+
           <a href="index.html" class="icon icon-home">
             CodeCarbon
           </a>
@@ -103,7 +103,7 @@
 </div>
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
            <div itemprop="articleBody">
-             
+
   <section id="visualize">
 <span id="id1"></span><h1>Visualize<a class="headerlink" href="#visualize" title="Link to this heading"></a></h1>
 <section id="offline">
@@ -188,7 +188,7 @@ <h3>Electricity production carbon intensity per country<a class="headerlink" hre
   Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
     <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
     provided by <a href="https://readthedocs.org">Read the Docs</a>.
-   
+
 
 </footer>
         </div>
@@ -199,7 +199,7 @@ <h3>Electricity production carbon intensity per country<a class="headerlink" hre
       jQuery(function () {
           SphinxRtdTheme.Navigation.enable(true);
       });
-  </script> 
+  </script>
 
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/setup.py b/setup.py
index daab2e609..68c52a814 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@
 
 setuptools.setup(
     name="codecarbon",
-    version="2.3.1",
+    version="2.3.2",
     author="Mila, DataForGood, BCG GAMMA, Comet.ml, Haverford College",
     long_description=long_description,
     long_description_content_type="text/markdown",


Test patch:
diff --git a/tests/test_ram.py b/tests/test_ram.py
index 618e7e47f..bc12c7e90 100644
--- a/tests/test_ram.py
+++ b/tests/test_ram.py
@@ -1,4 +1,5 @@
 import unittest
+from textwrap import dedent
 
 import numpy as np
 
@@ -34,3 +35,50 @@ def test_ram_diff(self):
                     msg=f"{array_size}, {n_gb}, {n_gb_W}, {is_close}",
                 )
                 del array
+
+    def test_ram_slurm(self):
+        scontrol_str = dedent(
+            """\
+            scontrol show job $SLURM_JOB_ID
+            JobId=XXXX JobName=gpu-jupyterhub
+               UserId=XXXX GroupId=XXXX MCS_label=N/A
+               Priority=255342 Nice=0 Account=puk@v100 QOS=qos_gpu-t3
+               JobState=RUNNING Reason=None Dependency=(null)
+               Requeue=1 Restarts=0 BatchFlag=1 Reboot=0 ExitCode=0:0
+               RunTime=00:33:42 TimeLimit=08:00:00 TimeMin=N/A
+               SubmitTime=2023-10-23T10:45:25 EligibleTime=2023-10-23T10:45:25
+               AccrueTime=2023-10-23T10:45:25
+               StartTime=2023-10-23T10:45:35 EndTime=2023-10-23T18:45:35 Deadline=N/A
+               SuspendTime=None SecsPreSuspend=0 LastSchedEval=2023-10-23T10:45:35 Scheduler=Main
+               Partition=gpu_p13 AllocNode:Sid=idrsrv12-ib0:500994
+               ReqNodeList=(null) ExcNodeList=(null)
+               NodeList=r13i5n0
+               BatchHost=r13i5n0
+               NumNodes=1 NumCPUs=64 NumTasks=1 CPUs/Task=32 ReqB:S:C:T=0:0:*:1
+               ReqTRES=cpu=32,mem=128G,node=1,billing=40,gres/gpu=4
+               AllocTRES=cpu=64,mem=128G,node=1,billing=40,gres/gpu=4
+               Socks/Node=* NtasksPerN:B:S:C=0:0:*:* CoreSpec=*
+               MinCPUsNode=32 MinMemoryCPU=4G MinTmpDiskNode=0
+               Features=v100-16g DelayBoot=00:00:00
+               OverSubscribe=OK Contiguous=0 Licenses=(null) Network=(null)
+               Command=(null)
+               WorkDir=/linkhome/rech/gendxh01/uei48xr
+               StdErr=/linkhome/rech/gendxh01/uei48xr/jupyterhub_slurm.err
+               StdIn=/dev/null
+               StdOut=/linkhome/rech/gendxh01/uei48xr/jupyterhub_slurm.out
+               Power=
+               TresPerNode=gres:gpu:4
+            """
+        )
+        ram = RAM(tracking_mode="slurm")
+        ram_size = ram._parse_scontrol(scontrol_str)
+        self.assertEqual(ram_size, "128G")
+        scontrol_str = dedent(
+            """\
+            ReqTRES=cpu=32,mem=134G,node=1,billing=40,gres/gpu=4
+            AllocTRES=cpu=64,mem=42K,node=1,billing=40,gres/gpu=4
+            """
+        )
+        ram = RAM(tracking_mode="slurm")
+        ram_size = ram._parse_scontrol(scontrol_str)
+        self.assertEqual(ram_size, "42K")