You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to knowing how much carbon a computation emits, it can also be insightful and more importantly actionable to know how much it would cost to offset that emission. I have a small demo script that uses the rates reported by two services: terrapass and cotap.
"""Requirements: pip install codecarbon pint"""# Use pint for easy unit conversionimportpintfromcodecarbonimportEmissionsTrackerreg=pint.UnitRegistry()
reg.define('CO2 = []')
reg.define('dollar = []')
CO2_ton=reg.CO2*reg.metric_tonCO2_kg=reg.CO2*reg.kgCO2_pound=reg.CO2*reg.pound# ====================# Carbon tracking code# ====================tracker=EmissionsTracker()
tracker.start()
# GPU Intensive code goes hereforiinrange(100):
pass# tracker returns CO2 emissions in kgsemissions=tracker.stop() *CO2_kg# Pretend that we did a lot more than we didpretend_factor=1000000000compute_emissions=emissions*pretend_factor# ========================================# That's all there is too carbon tracking!# ========================================# Calculate cost to offset with one of these carbon capture services:co2_offset_costs= {
'terrapass': (100.75*reg.dollars) / (20_191*CO2_pound).to(CO2_ton),
'cotap': (15*reg.dollars) / (1*CO2_ton),
}
service='cotap'# cotap is non-profit, lets use themdollar_per_co2ton=co2_offset_costs[service]
cost_to_offset= (compute_emissions*dollar_per_co2ton).to_base_units()
print(f'It will cost roughly ${cost_to_offset:.2f} to offset this emission')
I think gathering information on available carbon offsetting services and increasing awareness of them would be a great direction for this project.
The text was updated successfully, but these errors were encountered:
I personally think this is a great next step, action after information and we don't want people being stuck and satisfied with info only.
However I'm not sure whether we should include offsetting as a part of the package, or at least not associated with any particular organisation.
We can also discuss the opportunity for even recommending offsetting. While I agree with the intention I know some people have reservations, + sobriety is probably the actual goal (re: Jevons paradox) and some infrastructures (such as cloud services) already offset emissions linked to computations.
It is not my area of expertise, so if you want to help and contribute something like a Wiki page that would be great :)
In addition to knowing how much carbon a computation emits, it can also be insightful and more importantly actionable to know how much it would cost to offset that emission. I have a small demo script that uses the rates reported by two services: terrapass and cotap.
I think gathering information on available carbon offsetting services and increasing awareness of them would be a great direction for this project.
The text was updated successfully, but these errors were encountered: