# CO2 calculation

## Function for CO2 calculation

To calculate `CO₂ Emissions for Evaluation (kg)` value, we use the following function. You can try to reproduce it yourself:

```python
def calculate_co2_emissions(total_evaluation_time_seconds: float | None) -> float:
    if total_evaluation_time_seconds is None or total_evaluation_time_seconds  Each result file have a `total_evaluation_time_seconds` field.

2. Assumes 8 NVIDIA H100 SXM GPUs with a combined power usage of 5.6 kilowatts (kW), based on each GPU’s maximum 0.7 kW consumption ([source](https://resources.nvidia.com/en-us-tensor-core/nvidia-tensor-core-gpu-datasheet)).

3. Uses an average of 269.8 grams of CO₂ per kilowatt-hour (g CO₂/kWh) for electricity in Virginia, based on U.S. Energy Information Administration data ([source](https://www.eia.gov/electricity/state/virginia/)).

4. Converts the evaluation time from seconds to hours, then calculates total energy usage in kWh.

5. Calculates emissions in grams by multiplying energy use (kWh) by the carbon intensity.

6. Finally, divides the total grams by 1,000 to convert to kilograms.

