Green Computing: A Myth or Achievable Reality
Green Computing

Green Computing: A Myth or Achievable Reality

Introduction:

In the arena of Generative AI, increased carbon footprint poses a significant threat to the society which includes managing the set of hardware, training the large language models and generating inferences from them. The following Figure 1 depicts the same.


Figure 1: Major Sources of Carbon Production

Tools and Techniques for Carbon Emission Calculation:

There are a few APIs (the common one is Electricity Map) which tell us real-time data on electricity sources and their carbon footprints.?It also provides the breakdown of various energy sources which comprises of nuclear sources, geothermal, biomass, coal, wind, solar, hydro, gas, oil, hydro discharge etc. The steps are briefly described in the following example towards getting the same.

Step 1:

Get the free API key (for Electricity Map API) from the below site: api-portal.electricitymaps.com and save the same.

Step 2:

Import the necessary libraries and initialize the header with the API key.

import requests
import json
### Get the API Key
headers = {"auth-token": "API Key"}        

Step 3:

Provide the coordinate as latitude and longitude of the place for which we want to measure the carbon intensity and other energy details.

coordinates = {"lat":34.00906474557528, "lon": -118.4984580927553}        

Step 4:

Build the URL for Carbon Intensity using Electricity Map API

# Build the URL
url=f"https://api.electricitymap.org/v3/carbon-intensity/latest?lat={coordinates['lat']}&lon={coordinates['lon']}"        

Step 5:

Execute the Request and Get the Carbon Intensity of the Place

request = requests.get( url, headers={"auth-token": "Sample Key"})
json.loads(request.content)        

{'zone': 'US-CAL-LDWP',

?'carbonIntensity': 700,

?'datetime': '2024-07-14T13:00:00.000Z',

?'updatedAt': '2024-07-14T12:45:19.776Z',

?'createdAt': '2024-07-11T13:49:32.287Z',

?'emissionFactorType': 'lifecycle',

?'isEstimated': True,

?'estimationMethod': 'TIME_SLICER_AVERAGE'}


Step 6:

Build the URL for power breakdown using Electricity Map API

url = f"https://api.electricitymap.org/v3/power-breakdown/latest?lat={coordinates['lat']}&lon={coordinates['lon']}"        

Step 7:

Execute the Request and Get the power breakdown of the Place

request = requests.get( url, headers={"auth-token": "API Key"})
json.loads(request.content)
power_breakdown = json.loads(request.content)
power_breakdown        

{'zone': 'US-CAL-LDWP',

?'datetime': '2024-07-14T13:00:00.000Z',

?'updatedAt': '2024-07-14T12:45:19.776Z',

?'createdAt': '2024-07-11T13:49:32.287Z',

?'powerConsumptionBreakdown': {'nuclear': 0,

? 'geothermal': 0,

? 'biomass': 0,

? 'coal': 0,

? 'wind': 0,

? 'solar': 0,

? 'hydro': 0,

? 'gas': 0,

? 'oil': 0,

? 'unknown': 235,

? 'hydro discharge': 0,

? 'battery discharge': 0},

?'powerProductionBreakdown': {'nuclear': None,

? 'geothermal': None,

? 'biomass': None,

? 'coal': None,

? 'wind': None,

? 'solar': None,

? 'hydro': None,

? 'gas': None,

? 'oil': None,

? 'unknown': 235,

? 'hydro discharge': None,

? 'battery discharge': None},

?'powerImportBreakdown': {},

?'powerExportBreakdown': {},

?'fossilFreePercentage': 0,

?'renewablePercentage': 0,

?'powerConsumptionTotal': 235,

?'powerProductionTotal': 235,

?'powerImportTotal': None,

?'powerExportTotal': None,

?'isEstimated': True,

?'estimationMethod': 'TIME_SLICER_AVERAGE'}


Step 8: Insights

From the above results, we can easily get the total carbon intensity of the place and the breakdown into various types of sources like nuclear, geothermal, biomass, coal, wind, solar etc. This is crucial because it helps us to monitor the real-time carbon intensity — essentially how much CO2 is produced per unit of electricity consumed. Additionally, understanding the mix of renewable versus non-renewable energy sources in the area helps us to decide the best strategy.

Calculating Emissions: Use the formula?Carbon Emitted = Carbon per Unit of Energy (gCO2/kWh) x Energy Used (kWh)?to determine your impact.


Strategies towards Green Computing: Optimization is the Key

Following Figure 2 presents three major deciding factors towards green computing. The tradeoff among these three features ultimately provides the minimum carbon emission.

Figure 3: Green Computing - A Trade Off among the three Features


Optimal Location: We need to select our servers/data centers where the grid is greener. The above APIs can be used to measure the carbon intensity and other energy sources of the selected data center location. Additionally, we can identify the low carbon regions from Google cloud regions map and we can run the model training job in those regions by specifying the region name in the program. Similarly, other services can also be used.

Optimal Time:?Training models are highly time and resource intensive jobs. Hence, scheduling the batch process need to be done when renewable electricity is the highest. As an example, daytime can be selected if that place is blessed with solar energy. On the other hand, nighttime can be selected if that place is near the beach; hence energy can come from wind. Hence, optimization is the key to success.

Demand Shaping: Batch processing should be scheduled based on the power demand. As an example, only mandatory jobs should run when emission is high.

Hence, GREEN COMPUTING is minimizing the carbon emission by optimally selecting the server location and time for scheduling the batches along with considering the demand shaping.

Thanks to DeepLearning.AI for introducing Carbon Aware Computing for GenAI Developers course to enlighten us towards the same!

?


Amit Chakraborty

Pragmatic Certified AI Product Management || Content Intelligence || ML and Gen AI Architect || PhD Scholar || 5 AI Patents

8 个月

An interesting research will be to map the source of power (like solar, geothermal etc.) from the grid level API. I know some ESG governance software has the capability to do so but have never seen it done automatically, so i am not sure if that is doable.

回复

要查看或添加评论,请登录

Anindita Desarkar, PhD的更多文章

社区洞察

其他会员也浏览了