Skip to content

Commit f4191bd

Browse files
authored
Merge pull request #968 from mlco2/release/3.1.0
Release/3.1.0
2 parents 49b1adf + 2d9a6a2 commit f4191bd

30 files changed

+919
-107
lines changed

codecarbon/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.0.9"
1+
__version__ = "3.1.0"

docs/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 98a25a3ac91cb6e1f1abdeb65b1c4492
3+
config: 5444747ce17d7942890303a4e6aa98ce
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/_sources/index.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CodeCarbon
1616

1717
motivation
1818
methodology
19+
rapl
1920
model_examples
2021
faq
2122

docs/_sources/methodology.rst.txt

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -191,46 +191,13 @@ For example, on a laptop with Intel(R) Core(TM) i7-7600U, Code Carbon will read
191191

192192
RAPL Metrics
193193
------------
194-
RAPL stands for Running Average Power Limit, it is a feature of processors (CPU) that provide the energy consumption of the processor.
194+
RAPL (Running Average Power Limit) is a feature of modern processors that provides energy consumption measurements through hardware counters.
195195

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

198-
Despite the name Intel RAPL, it support AMD processors since kernel 5.8.
199-
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-
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-
205-
For example :
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-
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-
211-
212-
213-
https://user-images.githubusercontent.com/894892/120764898-ecf07280-c518-11eb-9155-92780cabcf52.png
214-
Source :“RAPL in Action: Experiences in Using RAPL for Power Measurements,” (K. N. Khan, M. Hirki, T. Niemi, J. K. Nurminen, and Z. Ou, ACM Trans. Model. Perform. Eval. Comput. Syst., vol. 3, no. 2, pp. 1–26, Apr. 2018, doi: 10.1145/3177754.)
215-
216-
Metric comparison
217-
218-
Desktop computer with AMD Ryzen Threadripper 1950X 16-Core (32 threads) Processor.
219-
Power plug measure when idle (10% CPU): 125 W
220-
package-0-die-0 : 68 W
221-
package-0-die-1 : 68 W
222-
CodeCarbon : 137 W
223-
224-
Power plug measure when loaded (100% CPU): 256 W - 125W in idle = 131 W
225-
CorWatt PkgWatt
226-
133.13 169.82
227-
7.54 169.82
228-
CodeCarbon : 330 W
229-
package-0-die-0 : 166 W
230-
package-0-die-1 : 166 W
231-
232-
RAPL: 234 sec. Joule Counter Range, at 280 Watts
198+
Despite the name "Intel RAPL", it supports AMD processors since Linux kernel 5.8.
233199

200+
Read more about how we use it in :doc:`rapl`.
234201

235202
CPU metrics priority
236203
--------------------
@@ -270,6 +237,8 @@ The measure itself is fast and CodeCarbon is designed to be as light as possible
270237

271238
The scheduler is started when the first ``start`` method is called and stopped when ``stop`` method is called.
272239

240+
Another scheduler (_scheduler_monitor_power) is used to monitor only the power consumption of the hardware every second.
241+
It is needed for hardware that do not have energy counters but only instant power, like in CPU load mode.
273242

274243
Estimation of Equivalent Usage Emissions
275244
----------------------------------------

docs/_sources/parameters.rst.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ Input Parameters
5151
| Estimate it with ``sudo lshw -C memory -short | grep DIMM``
5252
| to get the number of RAM slots used, then do
5353
| *RAM power in W = Number of RAM Slots * 5 Watts*
54+
* - rapl_include_dram
55+
- | Boolean variable indicating if DRAM (memory) power should be included
56+
| in RAPL measurements on Linux systems, defaults to ``False``.
57+
| When ``True``, measures complete hardware power (CPU package + DRAM).
58+
| Set to ``False`` to measure only CPU package power.
59+
| Note: Only affects systems where RAPL exposes separate DRAM domains.
60+
| In a future version DRAM power will probably be included in RAM.
61+
* - rapl_prefer_psys
62+
- | Boolean variable indicating if psys (platform/system) RAPL domain should be
63+
| preferred over package domains on Linux systems, defaults to ``False``.
64+
| When ``True``, uses psys domain for total platform power (CPU + chipset + PCIe).
65+
| When ``False`` (default), uses package domains which are more reliable and
66+
| consistent with CPU TDP specifications.
67+
| Note: psys can report higher values than CPU TDP and may be unreliable on older systems.
5468
* - allow_multiple_runs
5569
- | Boolean variable indicating if multiple instance of CodeCarbon
5670
| on the same machine is allowed,

0 commit comments

Comments
 (0)