Skip to content

Commit b41ab93

Browse files
author
benoit-cty
committed
Add GPU process limitation
1 parent be87461 commit b41ab93

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

docs/explanation/methodology.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,17 @@ Currently, the package supports the following hardware infrastructure.
8989

9090
### Tracking Modes
9191

92-
CodeCarbon operates in two distinct modes to determine how power consumption is attributed to your work. Choosing the right mode is essential for data accuracy:
92+
CodeCarbon operates in two distinct modes to determine how power consumption is attributed to your work. Choosing the right mode is essential for data accuracy.
9393

94-
**Machine Mode (Default)**: Tracks the energy consumption of the entire hardware stack(all CPUs, GPUs, and RAM modules). This provides the most precise physical measurement because it reads directly from hardware counters (like Intel RAPL). It is ideal for dedicated servers or personal computers where you are the only one running heavy tasks.
94+
The `tracking_mode` parameter (values: `"machine"` or `"process"`, default `"machine"`) controls the **scope** of power attribution:
9595

96-
**Process Mode**: Attempts to isolate only the energy used by your specific Python process. This is a software-based estimation that "filters out" other applications. It is the preferred choice for shared environments (like HPC clusters) to ensure you aren't "charged" for a colleague's background computation.
96+
**Machine Mode** (`tracking_mode="machine"`): Measures the total energy consumed by the whole hardware stack (all CPUs, GPUs, and RAM). This is the most straightforward measurement and is ideal for dedicated machines where the tracked workload dominates resource usage.
9797

98-
**Note on Fallbacks**: If CodeCarbon cannot access low-level hardware interfaces due to lack of permissions, it will automatically switch to the most reliable estimation method available for your current environment.
98+
**Process Mode** (`tracking_mode="process"`): Estimates the energy attributable to your Python process (and its child processes) by sampling their CPU time relative to total CPU capacity. This is a software-based approximation — it does **not** read hardware counters directly — and is preferable on shared environments where other workloads are running in parallel.
99+
100+
> ⚠️ **GPU limitation**: Process Mode only affects CPU and RAM attribution. GPU power is always measured at the device level, so if you share a GPU with other users or processes, CodeCarbon will still account for the **entire GPU's** power consumption, not just your share.
101+
102+
Note: The underlying measurement method (Intel RAPL, Intel Power Gadget, TDP-based CPU-load estimation…) is chosen automatically based on hardware availability and software permissions. It applies independently of the tracking mode.
99103

100104
### GPU
101105

0 commit comments

Comments
 (0)