# Strategies of Automated Machine Learning for Energy Sustainability in Green Artificial Intelligence
## 4 Metrics with Environmental Implications
### Energy Consumption of CPUs, GPUs, and TPUs  
Quantifying the energy consumption of central processing units (CPUs), graphics processing units (GPUs), and tensor processing units (TPUs) provides a practical and straightforward method for assessing environmental impact. However, this metric can be ambiguous, as its calculation can be based on both the actual clock time and the actual activity time, which can lead to different interpretations of the environmental impact.  
Despite its usefulness, counting usage hours presents itself as a suboptimal indicator of efficiency, largely due to its dependence on specific hardware. Even so, this metric remains one of the most practical thanks to its ease of measurement and its relatively simple ability to estimate the carbon footprint. This, of course, assumes that the devices consume a constant amount of energy and that the composition of the energy combination used is known.  
Below, we present the key mathematical expressions for comprehending and quantifying the environmental impact of computational processes, with a specific focus on energy consumption and the associated carbon footprint. The power calculation for all CPU devices is denoted by \(E_{CPU}\) (Equation (5)). This formula calculates the total energy consumed by the CPU over a time period of (0) to (\(n\)), taking into account the varying workload.  
\[E_{CPU}= TDP_{CPU}\int_{0}^{n}W_{CPU}(t)dt \tag{5}\]  
here, \( TDP_{CPU}\) represents the maximum amount of power the cooling system in a computer is required to dissipate under any workload. It is a constant value specific to the CPU model, and \(W_{CPU}\) is the workload on the CPU at any given time (\(t\)), expressed as a fraction of the maximum load the CPU can handle.  
Analogously, the total power consumption of all active GPUs, denoted as \(E_{GPU}\), is calculated using a similar formula (Equation (6)):  
\[E_{GPU}= TDP_{GPU}\int_{0}^{n}W_{CPU}(t)dt \tag{6}\]  
where \( TDP_{GPU}\) is similar to the CPU's TDP, but specific to the GPU model, and \(W_{GPU}\) is the workload on the GPU at the time (\(t\)).  
Correspondingly, the total energy consumption of all active TPUs denoted as \(E_{TPU}\), is calculated using a mathematical expression (Equation (7)). To determine the energy consumption of one or more TPUs, we sum the product of the voltage \(V_{i}\) and the current \(C_{i}\) of each TPU (where \(V_{i}\) and \(C_{i}\) represent the voltage and the current of the \(i\)-th TPU), multiplied by the usage time \(T_{usage}\), in addition to the sum of the energy consumption of each TPU when operating sequentially. Here, \(T_{usage}\) represents the usage time for the TPU, and \(TPUec_{i}\) is the base energy consumption of the i-th TPU, assuming it might have different power requirements.  
\[E_{TPU}=\sum_{i=1}^{n}(V_{i}\cdot C_{i}\cdot T_{usage})+\sum_{i=1}^{n}(TPUec_{ i}) \tag{7}\]The total power consumption of the system, denoted as \(E_{TCGT}\) (Equation (8)), is obtained by adding the total power consumption of the CPUs (Equation (5)), GPUs (Equation (6)), and TPUs (Equation (7)):  
\[E_{TCGT}=E_{CPU}+E_{GPU}+E_{TPU} \tag{8}\]  
The formula allows us to calculate the total energy consumption of the system, taking into account the main processing units, such as CPUs, GPUs, and TPUs [68; 69]. This provides us with a comprehensive view of the environmental impact of these processing units collectively. It is important to note that this calculation includes the contribution from all these processing sources, which aids us in better understanding how they affect the system's total energy consumption when performing algorithm computations.