Skip to content

Commit

Permalink
Updates carbon awareness episode
Browse files Browse the repository at this point in the history
  • Loading branch information
aturner-epcc committed Jan 13, 2025
1 parent b6ea7d1 commit 6cd269f
Showing 1 changed file with 57 additions and 28 deletions.
85 changes: 57 additions & 28 deletions episodes/carbon-awareness.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ exercises: 5

::::::::::::::::::::::::::::::::::::::: objectives

- TBC
- Understand the concept of *carbon intensity* in electricity generation
- Appreciate the level of variation in carbon intensity across the UK and the world
- Understand techniques for greener use of HPC: demand shifting and demand shaping

::::::::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::: questions

- TBC
- How does electricity generation affect GHG emissions?
- What is *carbon instensity* of electricity generation and how does it vary geographically and temporally?
- What techniques can I use to make my use of HPC greener and influence transition to low-carbon electricity generation?

::::::::::::::::::::::::::::::::::::::::::::::::::

Expand All @@ -26,25 +30,41 @@ Carbon awareness is the idea of doing more when more energy comes from low carbo

### Carbon intensity

Carbon intensity measures how much carbon (CO2e) is emitted per kilowatt-hour (KWh) of electricity consumed. The standard unit of carbon intensity is gCO2eq/kWh, or grams of carbon per kilowatt hour.
Carbon intensity measures how much carbon (CO<sub>2</sub>e) is emitted per kilowatt-hour (kWh) of electricity consumed. The standard unit of carbon intensity is gCO<sub>2</sub>e/kWh, or grams of carbon per kilowatt hour.

If your computer is plugged directly into a wind farm, its electricity would have a carbon intensity of 0 gCO2eq/kWh since a wind farm emits no carbon to produce that electricity. However, most people can't plug directly into wind farms; instead, they plug into power grids supplied with electricity from various sources.
If your computer is plugged directly into a wind farm, its electricity would have a carbon intensity of 0 gCO<sub>2</sub>e/kWh since a wind farm emits no carbon to produce that electricity. However, most people can't plug directly into wind farms; instead, they plug into power grids supplied with electricity from various sources.

:::::::::::::::::::::::::::::::::::::::: callout

## Embodied carbon of renewable sources

In reality, the carbon intensity of renewable sources still have some GHG emissions associated with them from the emissions used to build, operate and decommission them. As we will se in a later episode, these emissions are usually amortised across the lifetime of the facility (in this case, the lifetime of the generation facility). By convention, these embodied emissions are not usually included in carbon intensity values for generated energy as they are complex to calculate and the emissions saved by replacing non-renewable sources with renewable sources have vastly outweighed the embodied emissions of renewable sources. These emissions sources will become a more important component of energy generation as electricity grids continue to decarbonise.

::::::::::::::::::::::::::::::::::::::::::::::::::

Once on a grid, you can't control which sources supply the electricity you are using; you simply get a mix of everything. So, your carbon intensity will be a mix of all the current power sources in a grid, both the lower- and the higher-carbon sources.

### Variability of carbon intensity

Carbon intensity varies by location since some regions have an energy mix containing more clean energy sources than others.
Carbon intensity varies by location since some regions have an energy mix containing more clean energy sources than others. This table shows the median carbon intensity for UK regions over 2024 (ref.):

| Region | Median Carbon Intensity (gCO<sub>2</sub>e/kWh) |
|--------|------:|
| S. Scotland | ??? |

![alt_text](./fig/07_variability_CI.png "image_tooltip")
Similarly, this table compares values across the world in 2023 (ref.):

| Country | Median Carbon Intensity (gCO<sub>2</sub>e/kWh) |
|--------|------:|
| UK | ??? |

Carbon intensity also changes over time due to the inherent variability of renewable energy caused by the unpredictability of weather conditions. For example, when it's cloudy or the wind isn't blowing, carbon intensity increases since more of the electricity in your mix comes from sources that emit carbon.

![alt_text](./fig/08_variability_CI.png "image_tooltip")
![Diagram illustrating change in carbon intensity over time due to changes in atmospheric conditions](./fig/08_variability_CI.png "Diagram illustrating change in carbon intensity over time due to changes in atmospheric conditions")

Check warning on line 63 in episodes/carbon-awareness.md

View workflow job for this annotation

GitHub Actions / Build Full Site

[image missing alt-text]: ./fig/08_variability_CI.png

### Dispatchability & curtailment

Electricity demand varies during the day, and supply always needs to be able to meet that demand. A brownout (a dip in the voltage level of the power line) occurs if a utility doesn't produce enough electricity to meet demand. Conversely, if a utility produces more electricity than is required, then to stop infrastructure burning out, breakers trip and we have blackouts.
Electricity demand varies during the day and supply always needs to be able to meet that demand. A brownout (a dip in the voltage level of the power line) occurs if a utility doesn't produce enough electricity to meet demand. Conversely, if a utility produces more electricity than is required, then to stop infrastructure burning out, breakers trip and we have blackouts.

There needs to be a balance between the demand and supply of electricity at all times and the responsibility for this usually falls to the utility provider.

Expand All @@ -58,9 +78,9 @@ Marginal carbon intensity is the carbon intensity of the power plant that would

Fossil-fueled power plants rarely scale down to 0. They have a minimum functioning threshold, and some don't scale; they are considered a consistent, always-on baseload. Because of this, we sometimes have the scenario where we curtail (throw away) renewable energy while still consuming energy from fossil fuel power plants.

![alt_text](./fig/09_marginal_CI.png "image_tooltip")
![Diagram illustrating marginal carbon intensity and curtailment](./fig/09_marginal_CI.png "Diagram illustrating marginal carbon intensity and curtailment")

In these situations, the marginal carbon intensity will be 0 gCO2eq/kWh since we know that any new demand will match the renewable energy we are curtailing.
In these situations, the marginal carbon intensity will be 0 gCO<sub>2</sub>e/kWh since we know that any new demand will match the renewable energy we are curtailing.

### Energy markets

Expand All @@ -70,25 +90,26 @@ When the demand for electricity goes down, utilities need to **reduce** the supp

1. **Buy less energy from fossil fuel plants.**

![alt_text](./fig/10_marginal_CI.png "image_tooltip")
![Diagram illustrating reduction in demand from fossil fuel plants](./fig/10_marginal_CI.png "Diagram illustrating reduction in demand from fossil fuel plants")
Energy from fossil fuel plants is usually the most expensive so this is the preferred method. This directly translates to burning fewer fossil fuels.

2. **Buy less energy from renewable sources**.
Renewable sources are the cheapest, so they prefer not to do this. If a renewable source doesn't manage to sell all of its electricity, it has to throw the rest away.

Reducing the amount of electricity consumed in your applications can help decrease the energy's carbon intensity seeing as the first thing to be scaled back are fossil fuels.
Renewable sources are the cheapest, so they prefer not to do this. If a renewable source doesn't manage to sell all of its electricity, it has to throw the rest away.

Reducing the amount of electricity consumed by your use of HPC can help decrease the energy's carbon intensity as the first thing to be scaled back are fossil fuels.

When the demand for electricity goes up, utilities need to increase the supply to balance supply and demand. They can do this in one of two ways:

1. **Buy more energy from renewable sources that are currently being curtailed**

![alt_text](./fig/11_marginal_CI.png "image_tooltip")
![Diagram illustrating increase in demand from renewable sources](./fig/10_marginal_CI.png "Diagram illustrating increase in demand from renewable sources")

If you are curtailing, it means you have excess energy you could dispatch. Renewable energy is already the cheapest, so curtailed renewable energy will be the cheapest dispatchable energy source. Renewable plants will then sell the energy they would have had to curtail.

2. **Buy more energy from fossil fuel plants**.

![alt_text](./fig/12_marginal_CI.png "image_tooltip")
![Diagram illustrating increase in demand from non-renewable sources](./fig/12_marginal_CI.png "Diagram illustrating increase in demand from non-renewable sources")

Fossil fuels are inherently dispatchable; they can quickly increase energy production by burning more. However, coal costs money, so this is the least preferred solution.

Expand All @@ -102,35 +123,43 @@ Using electricity when the carbon intensity is low is the best way to ensure inv

:::

![alt_text](./fig/13_carbon_aware.png "image_tooltip")
![Image of transition from high-carbon to low-carbon energy sources](./fig/13_carbon_aware.png "Image of transition from high-carbon to low-carbon energy sources")

There is a global transformation happening right now. All around the world, electricity grids are changing from primarily burning fossil fuels to sourcing energy from lower carbon sources like wind and solar. This is one of our best hopes for meeting our global reduction targets. As green software practitioners, let's see some of the ways we can help accelerate that transition.
There is a global transformation happening right now. All around the world, electricity grids are changing from primarily burning fossil fuels to sourcing energy from lower carbon sources like wind and solar. This is one of our best hopes for meeting our global reduction targets. As green users of HPC, let's see some of the ways we can help accelerate that transition.

The primary driver for the transition is economic rather than any sustainability target. Renewables are winning because they are cheaper and getting even more affordable over time. So, to help accelerate the transition, we need to make renewable plants more profitable and fossil fuel plants less profitable. The best way to do that is to use more electricity when it's coming from lower-carbon sources like renewables and less electricity when it's coming from higher-carbon sources.

Carbon intensity is lower when more energy comes from lower-carbon sources and higher when it comes from higher-carbon sources.

### Demand shifting

Being carbon aware means responding to shifts in carbon intensity by increasing or decreasing your demand. If your work allows you to be flexible with when and where you run workloads, you can shift accordingly - consuming electricity when the carbon intensity is lower and pausing production when it is higher. For example, training a Machine Learning model at a different time or region with much lower carbon intensity.
Being carbon aware means responding to shifts in carbon intensity by increasing or decreasing your demand. If your work allows you to be flexible with when and where you run workloads, you can shift accordingly - consuming electricity when the carbon intensity is lower and pausing production when it is higher. For example, running a simulation or model at a different time or region with much lower carbon intensity.

[Studies](https://ieeexplore.ieee.org/document/6128960) show these actions can result in 45% to 99% carbon reductions depending on the number of renewables powering the grid.

Demand shifting can be further broken down into spatial and temporal shifting.

#### Spatial shifting

Spatial shifting means moving your computation to another physical location where the current carbon intensity is lower. It might be a region that naturally has lower carbon sources of energy. For example, moving to different hemispheres depending on the season for more sunlight hours.
Spatial shifting means moving your computation to another physical location where the current carbon intensity is lower. It might be a region that naturally has lower carbon sources of energy. For example, using an HPC facility sited in a location that is currently windy and so has a high proportion of wind power.

![Diagram illustrating spatial demand shifting](./fig/14_spatial_shifting.png "Diagram illustrating spatial demand shifting")

![alt_text](./fig/14_spatial_shifting.png "image_tooltip")
This requires you to have the ability to run on different HPC resources in different locations - for example, you could chose between running on a local HPC resource or a national HPC resource located elsewhere.

<!-- TODO: Maybe add advantages and disadvantages -->

<!-- TODO: Also mention impact of cooling overheads, different seasons in different hemispheres, cooler locations -->

#### Temporal shifting

If you can't shift your computation spatially to another region, another option you have is to shift to another time. Perhaps later in the day or night when it's sunnier or windier and, therefore, the carbon intensity is lower. This is called temporal demand shifting. We can predict future carbon intensity reasonably well through advances in weather forecasting.

![alt_text](./fig/15_temporal_shifting.png "image_tooltip")
![Diagram illustrating spatial demand shifting](./fig/15_temporal_shifting.png "Diagram illustrating spatial demand shifting")

An example of a service that can predict carbon intensity to enable temporal demand shifting is the [carbonintensity.org.uk website and API](https://carbonintensity.org.uk).

Some of the biggest technology companies have recognised the importance of carbon awareness and are using advanced modeling techniques to implement demand shifting.
Some of the large technology companies have recognised the importance of carbon awareness and are using advanced modeling techniques to implement demand shifting.

- **Google Carbon Aware Data Centers** - Google launched a project to [make some of the cloud workloads carbon aware](https://blog.google/outreach-initiatives/sustainability/carbon-aware-computing-location/). They created models to predict tomorrow's carbon intensity and workload. They then shaped large-scale workloads so more would happen when and where the carbon intensity is lowest, but in such a way that they could still handle the expected load.
- **Microsoft Carbon Aware Windows** - [Microsoft announced a project to make Windows 11 more sustainable](https://www.techradar.com/news/windows-11-is-getting-an-eco-friendly-update-but-could-microsoft-do-more). Initially, this means running Windows updates when the carbon intensity is lower.
Expand All @@ -139,16 +168,16 @@ Some of the biggest technology companies have recognised the importance of carbo

Demand shifting is the strategy of moving computation to regions or times when the carbon intensity is lowest. Demand shaping is a similar strategy. However, instead of moving demand to a different region or time, we shape our computation to match the existing supply.

![alt_text](./fig/16_demand_shaping.png "image_tooltip")
![Diagram illustrating demand shaping](./fig/16_demand_shaping.png "Diagram illustrating demand shaping")

- If carbon intensity is low, increase the demand; do more in your applications.
- If carbon intensity is high, decrease demand; do less in your applications.
- If carbon intensity is low, increase the demand; do more (or faster) calculations.
- If carbon intensity is high, decrease demand; do less (or slower) calculations.

Demand shaping for carbon-aware applications is all about the supply of carbon. When the carbon cost of running your application becomes high, shape the demand to match the supply of carbon. This can happen automatically, or the user can make a choice.
Demand shaping for carbon-aware HPC use is all about the supply of carbon. When the carbon cost of running your simulation or model becomes high, shape the demand to match the supply of carbon. This can happen automatically, or the user can make a choice.

Eco mode is an example of demand shaping. Eco modes are found in everyday appliances like cars or washing machines. When activated, some amount of performance is sacrificed in order to consume fewer resources (gas or electricity). Because there is this trade-off with performance, eco modes are always presented to a user as a choice.

Software applications can also have eco modes that can - either automatically or with user consent - make decisions to reduce carbon emissions.
Software or HPC services can also have eco modes that can - either automatically or with user consent - make decisions to reduce carbon emissions.

One example of this is video conferencing software that adjusts streaming quality automatically. Rather than streaming at the highest quality possible at all times, it reduces the video quality to prioritize audio when the bandwidth is low.

Expand All @@ -158,7 +187,7 @@ A third example is progressive enhancement with the web. The web experience impr

Demand shaping is related to a broader concept in sustainability, which is to reduce consumption. We can achieve a lot by becoming more efficient with resources, but we also need to consume less at some point.

As Green Software practitioners, we would consider canceling a process when the carbon intensity is high instead of demand shifting - reducing the demands of our application and the expectations of our end users.
As green users of HPC, we would consider cancelling or reducing the power intensity of our workflow when the carbon intensity is high instead of demand shifting - reducing the energy demands of our work.

:::::::::::::::::::::::::::::::::::::::: keypoints

Expand Down

0 comments on commit 6cd269f

Please sign in to comment.