Skip to content

Commit 8d7acf4

Browse files
authored
Merge pull request #932 from cianc/docs/typo-fixes
Fix some typos and sphinx warnings in documentation.
2 parents 6546c74 + a75b8db commit 8d7acf4

23 files changed

Lines changed: 142 additions & 128 deletions

docs/_sources/advanced_installation.rst.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ This section describes how to deploy CodeCarbon as a system service using Ansibl
122122
It automate the manual installation done in the previous chapter.
123123
124124
What the Playbook Does
125-
--------------------
125+
----------------------
126126
The Ansible playbook automates the following tasks:
127127
128128
* Creates a dedicated system user and group for CodeCarbon
@@ -134,14 +134,14 @@ The Ansible playbook automates the following tasks:
134134
* Starts and enables the service
135135
136136
Prerequisites
137-
------------
137+
-------------
138138
* Ansible installed on your machine
139139
* Debian-based target system(s)
140140
* SSH access to target system(s)
141141
* CodeCarbon API credentials from the dashboard
142142
143143
Directory Structure
144-
-----------------
144+
-------------------
145145
.. code-block:: text
146146
147147
codecarbon/deploy/ansible/codecarbon_cli_as_a_service/
@@ -158,11 +158,11 @@ Directory Structure
158158
└── main.yml
159159
160160
Quick Start
161-
----------
161+
-----------
162162
163163
1. Set the the target to install in ``hosts``:
164164
165-
.. code-block:: txt
165+
.. code-block:: text
166166
167167
yourservername.yourdomain.com hostname=yourservername ansible_user=root ansible_ssh_private_key_file=~/.ssh/id_ed25519
168168

docs/_sources/comet.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Comet Integration
44
===========================
55

66

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.
88

99
.. image:: ./images/comet-workspace.png
1010
:align: center
@@ -19,7 +19,7 @@ To get started with the Comet-CodeCarbon integration, make sure you have comet-m
1919
pip install comet_ml>=3.2.2
2020
2121
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.
2323

2424
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:
2525

docs/_sources/faq.rst.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ Frequently Asked Questions
2222

2323
- When available we use data from `ourworld in data <https://ourworldindata.org/grapher/carbon-intensity-electricity?tab=table>`_
2424

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>`_)
2626

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>`_.
2828

2929

3030
* **How do I offset my emissions?**
3131
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.
3232

3333

3434
* **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.
3636

3737

docs/_sources/installation.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For installing conda, follow the instructions on the
1515
From PyPi repository
1616
--------------------
1717

18-
The package is hosted on the pip repository `here <https://pypi.org/project/codecarbon/>`_.
18+
The package is hosted on the pip repository `here <https://pypi.org/project/codecarbon/>`__.
1919

2020
To install the package, run the following command in your terminal.
2121

@@ -26,7 +26,7 @@ To install the package, run the following command in your terminal.
2626
From conda repository
2727
---------------------
2828

29-
The package is hosted on the conda repository `here <https://anaconda.org/codecarbon/codecarbon>`_.
29+
The package is hosted on the conda repository `here <https://anaconda.org/codecarbon/codecarbon>`__.
3030

3131
To install the package, run the following command in your terminal.
3232

docs/_sources/methodology.rst.txt

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ energy sources that are used to generate electricity, including fossil fuels and
2424
:height: 300px
2525
:width: 350px
2626

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>`__ ).
2828

2929
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:
3030

@@ -63,9 +63,9 @@ Then, for example, if the Energy Mix of the Grid Electricity is 25% Coal, 35% Pe
6363
6464
Net Carbon Intensity = 0.25 * 995 + 0.35 * 816 + 0.26 * 743 + 0.14 * 29 = 731.59 kgCO₂/kWh
6565
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.
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.
6767

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>`__ ).
6969

7070
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.
7171

@@ -86,7 +86,7 @@ Tracks Nvidia GPUs energy consumption using ``pynvml`` library (installed with t
8686
RAM
8787
~~~~
8888

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>`__ .
9090

9191
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.
9292
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
143143

144144
- **On Windows or Mac (Intel)**
145145

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>`_.
147147

148148
- **Apple Silicon Chips (M1, M2)**
149149

@@ -179,7 +179,7 @@ All CPUs listed in this directory will be tracked.
179179
CPU hardware
180180
------------
181181

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.
183183

184184
In Linux kernel, energy_uj is a current energy counter in micro joules. It is used to measure CPU core's energy consumption.
185185

@@ -191,22 +191,22 @@ For example, on a laptop with Intel(R) Core(TM) i7-7600U, Code Carbon will read
191191

192192
RAPL Metrics
193193
------------
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.
195195

196196
See https://blog.chih.me/read-cpu-power-with-RAPL.html for more information.
197197

198198
Despite the name Intel RAPL, it support AMD processors since kernel 5.8.
199199

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.
202202

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`.
204204

205205
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.
208208

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.
210210

211211

212212

@@ -223,8 +223,8 @@ CodeCarbon : 137 W
223223

224224
Power plug measure when loaded (100% CPU): 256 W - 125W in idle = 131 W
225225
CorWatt PkgWatt
226-
133.13 169.82
227-
7.54 169.82
226+
133.13 169.82
227+
7.54 169.82
228228
CodeCarbon : 330 W
229229
package-0-die-0 : 166 W
230230
package-0-die-1 : 166 W
@@ -237,10 +237,11 @@ CPU metrics priority
237237

238238
CodeCarbon will first try to read the energy consumption of the CPU from low level interface like RAPL or ``powermetrics``.
239239
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.
244245

245246
Here is a drawing of the fallback mode:
246247

@@ -315,13 +316,16 @@ The equivalent emissions are calculated using this formula:
315316

316317
.. math::
317318
\text{Equivalent Emissions} = \frac{\text{Total Emissions (kgCO₂)}}{\text{Emission Factor (kgCO₂/unit)}}
319+
318320
For example:
319321

320322
- **Car Usage**: *1 kWh* of energy consumption is approximately equivalent to:
323+
321324
- *8.33 kilometers driven by a car* (*1 ÷ 0.12*).
322325
- *11.9 hours of TV usage* (*1 ÷ 0.084*), if emissions are considered.
323326

324327
- **US Citizen Emissions**:
328+
325329
- *1 kWh* of energy consumption can be compared to a fraction of the average weekly emissions of a US citizen:
326330

327331
.. math::

docs/_sources/model_examples.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ NB : presented on a log scale
9292

9393
References
9494
----------
95-
`Measuring the Carbon intensity of AI in Cloud Instance <https://facctconference.org/static/pdfs_2022/facct22-145.pdf>`_
95+
`Measuring the Carbon intensity of AI in Cloud Instance <https://dl.acm.org/doi/10.1145/3531146.3533234>`_
9696

9797
Another source comparing models carbon intensity:
9898
`Energy and Policy Considerations for Deep Learning in NLP <https://arxiv.org/pdf/1906.02243.pdf>`_

docs/_sources/parameters.rst.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ Input Parameters
2222
* - measure_power_secs
2323
- Interval (in seconds) to measure hardware power usage, defaults to ``15``
2424
* - tracking_mode
25-
- | ``machine`` measure the power consumptions of the entire machine (defaults)
25+
- | ``machine`` measure the power consumptions of the entire machine (default)
2626
| ``process`` try and isolate the tracked processes in isolation
2727
* - gpu_ids
2828
- | Comma-separated list of GPU ids to track, defaults to ``None``
2929
| These can either be integer indexes of GPUs on the system, or prefixes
3030
| to match against GPU identifiers as described `here <https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#cuda-environment-variables>`_
3131
* - 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),
3333
| "warning", "error", or "critical"
3434
* - co2_signal_api_token
3535
- | API token for co2signal.com (requires sign-up for free beta)
@@ -51,10 +51,10 @@ Input Parameters
5151
| on the same machine is allowed,
5252
| defaults to ``True`` since v3. Used to be ``False`` in v2.
5353
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.
5656

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``.
5858
If you set ``gpu_ids`` manually, it will override the ``CUDA_VISIBLE_DEVICES`` for CodeCarbon measures.
5959

6060
Output parameters
@@ -124,9 +124,9 @@ Specific parameters for offline mode
124124
* - country_iso_code
125125
- | 3-letter ISO Code of the country
126126
| 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>`__
128128
* - 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
130130
| Currently, supported only for US States and Canada
131131
| for example - California or New York, from the `list <https://github.com/mlco2/codecarbon/blob/master/codecarbon/data/private_infra/2016/usa_emissions.json>`_
132132
* - cloud_provider
@@ -159,7 +159,7 @@ Decorator ``track_emissions`` in addition to standard arguments, requires the fo
159159
| defaults to ``False``
160160
* - country_iso_code
161161
- | 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>`__
163163
* - region
164164
- | Optional Name of the Province/State/City, where the infrastructure is hosted
165165
| Currently, supported only for US States

0 commit comments

Comments
 (0)