EPiCarbon is a Python-based tool for estimating the carbon footprint of electro-photonic systems. It calculates the Embodied Carbon Footprint (ECF), Operational Carbon Footprint (OCF), and the Carbon Footprint (CF) of a system based on its architecture
and energy usage
.
-
Ensure you have Python 3.8 or higher installed. You can check your Python version with:
python --version
-
Clone the repository:
git clone https://github.com/bu-icsg/EPiCarbon.git cd EPiCarbon
-
Install the required dependencies:
pip install --upgrade pip # Optional pip install -r requirements.txt
epicarbon.py
: Main script for running the program.src/
: Contains chiplet models, data files, and utility functions.archs/
: Contains example architecture description files in JSON format.
Run the program using the command line:
python epicarbon.py --estimate <metric> [--arch <arch_file>] [--energy <energy_per_inf>] [--verbose]
--estimate
: Select the metric to estimate. Options:ECF
: Embodied Carbon Footprint.OCF
: Operational Carbon Footprint.CF
: Carbon Footprint.
--arch
: Path to the architecture description file in JSON (required forECF
andCF
)--energy
: Energy per inference in joules (required forOCF
andCF
).--verbose
: Enable detailed logging.
-
Calculate ECF:
python epicarbon.py --estimate ECF --arch archs/adept.json --verbose
Alternatively, call the
get_carbon_embodied()
API by importingepicarbon
from another script. -
Calculate OCF:
python epicarbon.py --estimate OCF --energy 1e-3 --verbose
Alternatively, call the
get_carbon_operational()
API by importingepicarbon
from another script. -
Calculate CF:
python epicarbon.py --estimate CF --arch archs/adept.json --energy 1e-3 --verbose
Alternatively, call the
get_carbon_footprint()
API by importingepicarbon
from another script.
Architecture files describe the system's chiplets and packaging. Example files are located in the archs/
directory, such as:
archs/lt.json
archs/adept.json
An architecture file contains the following fields:
chiplets
: A list of chiplets in the system. Each chiplet includes:type
: The type of the chiplet (Options:cmos-logic
orpic-logic
).tech
: The technology node of the chiplet in nanometers (Options: forpic-logic
use-1
, forcmos-logic
choose among28
,20
,14
,10
,8
,7
,5
, or3
nm).area
: The area of the chiplet in square centimeters.num_chiplets
: The number of identical chiplets of this type.
package
: The packaging type of the system (Options:monolithic
,3D
,2.5D-active
,2.5D-passive
).
Below is an example architecture file for a system named "ADEPT":
{
"chiplets": [
{
"type": "cmos-logic",
"tech": 20,
"area": 6.51,
"num_chiplets": 1
},
{
"type": "pic-logic",
"tech": -1,
"area": 0.56,
"num_chiplets": 4
}
],
"package": "3D"
}
Several default parameters are defined in the program that can be changed in code (epicarbon.py
):
- Fabrication (ci_fab): 820 gCO2/kWh (coal-based electricity).
- Operation (ci_op): 11 gCO2/kWh (wind-based electricity).
- Number of inferences per day (num_inf_per_day): 1e9.
- Lifetime (lifetime_days): 5*365 days.
EPiCarbon can be easily extended to support a custom chiplet.
- Simply add your new chiplet inside
src/chiplet_models
folder by inheriting theChiplet
class. You can follow the example ofcmos_logic_chiplet
orpic_logic_chiplet
. - Implement the
get_manufacturing_carbon()
method of your new chiplet. - Update the
build_chiplet()
method insrc/utils.py
to handle your create your new chiplet while parsing the architecture file.
To be updated.
For questions or feedback, please contact [ffayza@bu.edu].