You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_sources/comet.rst.txt
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Comet Integration
4
4
===========================
5
5
6
6
7
-
CodeCarbon can be automatically integrated with `Comet <https://www.comet.ml/site/>`_ 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.
7
+
CodeCarbon can be automatically integrated with `Comet <https://www.comet.ml/site/>`__ 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.
8
8
9
9
.. image:: ./images/comet-workspace.png
10
10
:align:center
@@ -19,7 +19,7 @@ To get started with the Comet-CodeCarbon integration, make sure you have comet-m
19
19
pip install comet_ml>=3.2.2
20
20
21
21
22
-
Go to `Comet's website <https://www.comet.ml/site/>`_ and create a free account. From your account settings page, copy your personal API key.
22
+
Go to `Comet's website <https://www.comet.ml/site/>`__ and create a free account. From your account settings page, copy your personal API key.
23
23
24
24
In the `mnist-comet.py <https://github.com/mlco2/codecarbon/blob/master/examples/mnist-comet.py>`_ example file, replace the placeholder code with your API key:
Copy file name to clipboardExpand all lines: docs/_sources/faq.rst.txt
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,16 +22,16 @@ Frequently Asked Questions
22
22
23
23
- When available we use data from `ourworld in data <https://ourworldindata.org/grapher/carbon-intensity-electricity?tab=table>`_
24
24
25
-
- if not available we use the electricity mix of the country find on `globalpetrolprices.com <https://www.globalpetrolprices.com/energy_mix.php>`_ that we multiply by the carbon intensity of the source of electricity (`that you can find here <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/carbon_intensity_per_source.json>`_)
25
+
- If not available we use the electricity mix of the country find on `globalpetrolprices.com <https://www.globalpetrolprices.com/energy_mix.php>`_ that we multiply by the carbon intensity of the source of electricity (`that you can find here <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/carbon_intensity_per_source.json>`_)
26
26
27
-
- if we have neither we default to a world average of 475 gCO2.eq/KWh from `IEA <https://www.iea.org/reports/global-energy-co2-status-report-2019/emissions>`_.
27
+
- If we have neither we default to a world average of 475 gCO2.eq/KWh from `IEA <https://www.iea.org/reports/global-energy-co2-status-report-2019/emissions>`_.
28
28
29
29
30
30
* **How do I offset my emissions?**
31
31
There are many offsetting schemes, and it is hard to recommend any single one. For one-shot offsetting, the `Gold Standard <https://www.goldstandard.org/>`_ is often used, and has many offsetting projects to choose from at different prices. There are often local initiatives as well, so try researching what exists in your region/country. For a recurring offset, `Project Wren <https://projectwren.com/>`_ lets you estimate your monthly carbon emissions and offset them via a monthly subscription. Keep in mind that offsetting is a good choice, but *reducing your emissions* should be the priority.
32
32
33
33
34
34
* **How can I help?**
35
-
If you find a functionality missing in the CodeCarbon repo, please `open an issue <https://github.com/mlco2/codecarbon/issues>`_ so that you (and others!) can help add it. We did our best to cover all use cases and options, but we count on the open source community to help make the package an even greater success.
35
+
If you find any functionality missing in the CodeCarbon repo, please `open an issue <https://github.com/mlco2/codecarbon/issues>`_ so that you (and others!) can help add it. We did our best to cover all use cases and options, but we count on the open source community to help make the package an even greater success.
Copy file name to clipboardExpand all lines: docs/_sources/methodology.rst.txt
+23-19Lines changed: 23 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ energy sources that are used to generate electricity, including fossil fuels and
24
24
:height:300px
25
25
:width:350px
26
26
27
-
When available, CodeCarbon uses global carbon intensity of electricity per cloud provider ( `here <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/cloud/impact.csv>`_ ) or per country ( `here <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/global_energy_mix.json>`_ ).
27
+
When available, CodeCarbon uses global carbon intensity of electricity per cloud provider ( `here <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/cloud/impact.csv>`__) or per country ( `here <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/global_energy_mix.json>`__ ).
28
28
29
29
If we don't have the global carbon intensity or electricity of a country, but we have its electricity mix, we used to compute the carbon intensity of electricity using this table:
30
30
@@ -63,9 +63,9 @@ Then, for example, if the Energy Mix of the Grid Electricity is 25% Coal, 35% Pe
But it doesn't happen anymore because Our World in Data now provides the global carbon intensity of electricity per country ( `source <https://ourworldindata.org/grapher/carbon-intensity-electricity#explore-the-data>`_ ). Some countries are missing data for last year, so we use the previous year data available.
66
+
But it doesn't happen anymore because Our World in Data now provides the global carbon intensity of electricity per country ( `source <https://ourworldindata.org/grapher/carbon-intensity-electricity#explore-the-data>`__ ). Some countries are missing data for last year, so we use the previous year data available.
67
67
68
-
If ever we have neither the global carbon intensity of a country nor it's electricity mix, we apply a world average of 475 gCO2.eq/KWh ( `source <https://www.iea.org/reports/global-energy-co2-status-report-2019/emissions>`_ ).
68
+
If ever we have neither the global carbon intensity of a country nor it's electricity mix, we apply a world average of 475 gCO2.eq/KWh ( `source <https://www.iea.org/reports/global-energy-co2-status-report-2019/emissions>`__ ).
69
69
70
70
As you can see, we try to be as accurate as possible in estimating carbon intensity of electricity. Still there is room for improvement and all contributions are welcome.
71
71
@@ -86,7 +86,7 @@ Tracks Nvidia GPUs energy consumption using ``pynvml`` library (installed with t
86
86
RAM
87
87
~~~~
88
88
89
-
CodeCarbon v2 uses a 3 Watts for 8 GB ratio `source <https://www.crucial.com/support/articles-faq-memory/how-much-power-does-memory-use>`_ .
89
+
CodeCarbon v2 uses a 3 Watts for 8 GB ratio `source <https://www.crucial.com/support/articles-faq-memory/how-much-power-does-memory-use>`__ .
90
90
91
91
But this is not a good measure because it doesn't take into account the number of RAM slots used in the machine, that really drive the power consumption, not the amount of RAM.
92
92
For example, in servers you could have thousands of GB of RAM but the power consumption would not be proportional to the amount of memory used, but to the number of memory modules used.
@@ -143,7 +143,7 @@ CPU
143
143
144
144
- **On Windows or Mac (Intel)**
145
145
146
-
Tracks Intel processors energy consumption using the ``Intel Power Gadget``. You need to install it yourself from this `source <https://www.intel.com/content/www/us/en/developer/articles/tool/power-gadget.html>`_ . But has been discontinued. There is a discussion about it on `github issues #457 <https://github.com/mlco2/codecarbon/issues/457>`_.
146
+
Tracks Intel processors energy consumption using the ``Intel Power Gadget``. You need to install it yourself from this `source <https://www.intel.com/content/www/us/en/developer/articles/tool/power-gadget.html>`__ . But has been discontinued. There is a discussion about it on `github issues #457 <https://github.com/mlco2/codecarbon/issues/457>`_.
147
147
148
148
- **Apple Silicon Chips (M1, M2)**
149
149
@@ -179,7 +179,7 @@ All CPUs listed in this directory will be tracked.
179
179
CPU hardware
180
180
------------
181
181
182
-
The CPU die is the processing unit itself. It's a piece of semiconductor that has been sculpted/etched/deposited by various manufacturing processes into a net of logic blocks that do stuff that makes computing possible1. The processor package is what you get when you buy a single processor. It contains one or more dies, plastic/ceramic housing for dies and gold-plated contacts that match those on your motherboard.
182
+
The CPU die is the processing unit itself. It's a piece of semiconductor that has been sculpted/etched/deposited by various manufacturing processes into a net of logic blocks that do stuff that makes computing possible. The processor package is what you get when you buy a single processor. It contains one or more dies, plastic/ceramic housing for dies and gold-plated contacts that match those on your motherboard.
183
183
184
184
In Linux kernel, energy_uj is a current energy counter in micro joules. It is used to measure CPU core's energy consumption.
185
185
@@ -191,22 +191,22 @@ For example, on a laptop with Intel(R) Core(TM) i7-7600U, Code Carbon will read
191
191
192
192
RAPL Metrics
193
193
------------
194
-
RAPL stand for Running Average Power Limit, it is a feature of processors (CPU) that provide the energy consumption of the processor.
194
+
RAPL stands for Running Average Power Limit, it is a feature of processors (CPU) that provide the energy consumption of the processor.
195
195
196
196
See https://blog.chih.me/read-cpu-power-with-RAPL.html for more information.
197
197
198
198
Despite the name Intel RAPL, it support AMD processors since kernel 5.8.
199
199
200
-
It is some files in /sys/class/powercap/intel-rapl/subsystem/ that give the energy consumption of the CPU, and sometime RAM.
201
-
There are folder for each `domain`, and in each folder there are a file `name` with the name of the domain and a `energy_uj` for the amount of energy in micro-joules.
200
+
It is some files in /sys/class/powercap/intel-rapl/subsystem/ that give the energy consumption of the CPU, and sometimes RAM.
201
+
There are folders for each `domain`, and in each folder there is a file `name` with the name of the domain and an `energy_uj` for the amount of energy in micro-joules.
202
202
203
-
The drawback of RAPL is that not every CPU use it the same way. We focus on the `package` domain, but some CPU have more domain like `core`, `uncore`, `dram`, `psys`, `gpu`, `psys` and `psys-io`.
203
+
The drawback of RAPL is that not every CPU uses it the same way. We focus on the `package` domain, but some CPUs have more domains like `core`, `uncore`, `dram`, `psys`, `gpu`, `psys` and `psys-io`.
204
204
205
205
For example :
206
-
- Intel put all the physical cores consumption in `core` and the `package` include `core`.
207
-
- For AMD, `core` have very low energy, so we don't know if it is included in the `package` or not.
206
+
- Intel puts all the physical cores consumption in `core` and the `package` includes `core`.
207
+
- For AMD, `core` has very low energy, so we don't know if it is included in the `package` or not.
208
208
209
-
Our friend from Scaphandre, a tool to monitor energy consumption, have a good article about RAPL https://hubblo-org.github.io/scaphandre-documentation/explanations/rapl-domains.html and also a discussion with good references: https://github.com/hubblo-org/scaphandre/issues/116#issuecomment-854453231 and point out that this topic is not well documented.
209
+
Our friends from Scaphandre, a tool to monitor energy consumption, have a good article about RAPL https://hubblo-org.github.io/scaphandre-documentation/explanations/rapl-domains.html and also a discussion with good references: https://github.com/hubblo-org/scaphandre/issues/116#issuecomment-854453231 and point out that this topic is not well documented.
210
210
211
211
212
212
@@ -223,8 +223,8 @@ CodeCarbon : 137 W
223
223
224
224
Power plug measure when loaded (100% CPU): 256 W - 125W in idle = 131 W
225
225
CorWatt PkgWatt
226
-
133.13 169.82
227
-
7.54 169.82
226
+
133.13 169.82
227
+
7.54 169.82
228
228
CodeCarbon : 330 W
229
229
package-0-die-0 : 166 W
230
230
package-0-die-1 : 166 W
@@ -237,10 +237,11 @@ CPU metrics priority
237
237
238
238
CodeCarbon will first try to read the energy consumption of the CPU from low level interface like RAPL or ``powermetrics``.
239
239
If none of the tracking tools are available, CodeCarbon will be switched to a fallback mode:
240
-
- It will first detect which CPU hardware is currently in use, and then map it to a data source listing 2000+ Intel and AMD CPUs and their corresponding thermal design powers (TDPs).
241
-
- If the CPU is not found in the data source, a global constant will be applied.
242
-
- If ``psutil`` is available, CodeCarbon will try to estimate the energy consumption from the TDP and the CPU load.
243
-
- CodeCarbon assumes that 50% of the TDP will be the average power consumption to make this approximation.
240
+
241
+
- It will first detect which CPU hardware is currently in use, and then map it to a data source listing 2000+ Intel and AMD CPUs and their corresponding thermal design powers (TDPs).
242
+
- If the CPU is not found in the data source, a global constant will be applied.
243
+
- If ``psutil`` is available, CodeCarbon will try to estimate the energy consumption from the TDP and the CPU load.
244
+
- CodeCarbon assumes that 50% of the TDP will be the average power consumption to make this approximation.
244
245
245
246
Here is a drawing of the fallback mode:
246
247
@@ -315,13 +316,16 @@ The equivalent emissions are calculated using this formula:
Copy file name to clipboardExpand all lines: docs/_sources/parameters.rst.txt
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,14 @@ Input Parameters
22
22
* - measure_power_secs
23
23
- Interval (in seconds) to measure hardware power usage, defaults to ``15``
24
24
* - tracking_mode
25
-
- | ``machine`` measure the power consumptions of the entire machine (defaults)
25
+
- | ``machine`` measure the power consumptions of the entire machine (default)
26
26
|``process`` try and isolate the tracked processes in isolation
27
27
* - gpu_ids
28
28
- | Comma-separated list of GPU ids to track, defaults to ``None``
29
29
|These can either be integer indexes of GPUs on the system, or prefixes
30
30
|to match against GPU identifiers as described `here <https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#cuda-environment-variables>`_
31
31
* - log_level
32
-
- | Global codecarbon log level (by order of verbosity): "debug", "info" (defaults),
32
+
- | Global codecarbon log level (by order of verbosity): "debug", "info" (default),
33
33
|"warning", "error", or "critical"
34
34
* - co2_signal_api_token
35
35
- | API token for co2signal.com (requires sign-up for free beta)
@@ -51,10 +51,10 @@ Input Parameters
51
51
|on the same machine is allowed,
52
52
|defaults to ``True`` since v3. Used to be ``False`` in v2.
53
53
54
-
PUE is a multiplication factor provided by the user, so it is up to the user to get it from his cloud provider.
55
-
Old data-centers have a PUE up to 2.2, where new green one could be as low as 1.1.
54
+
PUE is a multiplication factor provided by the user, so it is up to the user to get it from their cloud provider.
55
+
Old data-centers have a PUE up to 2.2, where new greener ones could be as low as 1.1.
56
56
57
-
If you, or your provider, use ``CUDA_VISIBLE_DEVICES`` to set the GPU you want to use, CodeCarbon will automaticly set this value to ``gpu_ids``.
57
+
If you, or your provider, use ``CUDA_VISIBLE_DEVICES`` to set the GPUs you want to use, CodeCarbon will automaticly populate this value into ``gpu_ids``.
58
58
If you set ``gpu_ids`` manually, it will override the ``CUDA_VISIBLE_DEVICES`` for CodeCarbon measures.
59
59
60
60
Output parameters
@@ -124,9 +124,9 @@ Specific parameters for offline mode
124
124
* - country_iso_code
125
125
- | 3-letter ISO Code of the country
126
126
|where the experiment is being run.
127
-
|Available countries are listed in `global_energy_mix.json <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/global_energy_mix.json>`_
127
+
|Available countries are listed in `global_energy_mix.json <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/global_energy_mix.json>`__
128
128
* - region
129
-
- | Optional Name of the Province/State/City, where the infrastructure is hosted
129
+
- | Optional name of the Province/State/City, where the infrastructure is hosted
130
130
|Currently, supported only for US States and Canada
131
131
|for example - California or New York, from the `list <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/2016/usa_emissions.json>`_
132
132
* - cloud_provider
@@ -159,7 +159,7 @@ Decorator ``track_emissions`` in addition to standard arguments, requires the fo
159
159
|defaults to ``False``
160
160
* - country_iso_code
161
161
- | 3 letter ISO Code of the country where the experiment is being run.
162
-
|Available countries are listed in `global_energy_mix.json <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/2016/global_energy_mix.json>`_
162
+
|Available countries are listed in `global_energy_mix.json <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/2016/global_energy_mix.json>`__
163
163
* - region
164
164
- | Optional Name of the Province/State/City, where the infrastructure is hosted
0 commit comments