Analytical estimation of the energy cost of the AI lifecycle (J/bit)
Project description
eCAL
Analytical estimation of the energy cost of the AI lifecycle (J/bit).
eCAL computes the total energy consumed across the full AI model lifecycle — data transmission, preprocessing, training, evaluation, and inference — using closed-form FLOP formulas and hardware power profiles.
Published in IEEE Journal on Selected Areas in Communications (JSAC), 2026.
Installation
From source (recommended for development)
git clone https://github.com/sensorlab/eCAL.git
cd eCAL
pip install -e ".[dev]"
From PyPI
pip install ecal-energy
Dependencies only (legacy)
pip install -r requirements.txt
Quickstart
Python API
import ecal
result = ecal.estimate(
model_type="MLP",
model_params={"num_layers": 3, "din": 10, "dout": 2},
num_samples=1000,
num_epochs=50,
hardware="apple_m2",
)
print(f"Total energy: {result['total']:.4f} J")
print(f"eCAL: {result['ecal_j_per_bit']:.2e} J/bit")
CLI
# Estimate energy for an MLP
ecal estimate --model MLP --layers 3 --epochs 50 --hardware apple_m2
# JSON output
ecal estimate --model Transformer --layers 6 --hardware nvidia_h100_sxm --json
# List available hardware profiles
ecal profiles
# Version
ecal --version
Legacy (RunCalculator.py)
# Edit configs/CalculatorConfig.py, then:
python RunCalculator.py
Supported Models
| Model | FLOP Calculator | Key Parameters |
|---|---|---|
| MLP | MLPCalculator |
num_layers, din, dout |
| CNN | CNNCalculator |
num_cnv_layers, num_pool_layers, i_r, k_r |
| KAN | KANCalculator |
num_layers, grid_size, din, dout |
| Transformer | TransformerCalculator |
context_length, embedding_size, num_heads, num_decoder_blocks |
Hardware Profiles
| Profile | FP32 FLOPS | TDP (W) | Device |
|---|---|---|---|
apple_m2 |
3.6 TFLOPS | 22 | mps |
nvidia_a100_80gb |
19.5 TFLOPS | 400 | cuda |
nvidia_h100_sxm |
67 TFLOPS | 700 | cuda |
generic_cpu |
1 TFLOPS | 100 | cpu |
generic_edge |
0.01 TFLOPS | 15 | cpu |
Architecture
ecal.estimate()
|
+--------+-------+-------+--------+
| | | | |
Transmission Preproc Training Eval Inference
| | | | |
v v v v v
Protocol FLOP FLOP FLOP FLOP
Configs Calcs Calcs Calcs Calcs
(per model type)
|
Hardware Profile
(FLOPS, power, TDP)
|
Energy = time * power
|
eCAL = total_E / total_bits
Configuration
Protocol configs are in configs/ProtocolConfigs.py — supports 7 OSI layers with multiple protocol options (HTTP, TCP, IPv4, WiFi, Bluetooth, etc.).
Calculator parameters are in configs/CalculatorConfig.py for the legacy RunCalculator.py interface.
Development
pip install -e ".[dev]"
pytest # run tests
ruff check src/ tests/ # lint
mypy src/ecal/ # type check
Citation
If you use this tool please cite our paper:
@ARTICLE{11298182,
author={Chou, Shih-Kai and Hribar, Jernej and Hanžel, Vid and Mohorčič, Mihael and Fortuna, Carolina},
journal={IEEE Journal on Selected Areas in Communications},
title={The Energy Cost of Artificial Intelligence Lifecycle in Communication Networks},
year={2026},
volume={44},
number={},
pages={2427-2443},
keywords={Artificial intelligence;Measurement;Costs;Energy consumption;Carbon dioxide;Training;Standards;Data centers;Open systems;Energy efficiency;AI model lifecycle;energy consumption;carbon footprint;metric;methodology},
doi={10.1109/JSAC.2025.3642835}}
Other related work:
@INPROCEEDINGS{11349371,
author={Chou, Shih-Kai and Hribar, Jernej and Bertalanič, Blaž and Mohorčič, Mihael and Lagkas, Thomas and Sarigiannidis, Panagiotis and Fortuna, Carolina},
booktitle={2025 IEEE Conference on Network Function Virtualization and Software-Defined Networking (NFV-SDN)},
title={Energy Cost of the AI/ML Workflow in O-RAN},
year={2025},
volume={},
number={},
pages={1-6},
keywords={Training;Measurement;Adaptation models;Costs;Open RAN;Hardware;Energy efficiency;Complexity theory;Artificial intelligence;Optimization;sustainable 6G networks;O-RAN;AI/ML Workflow;eCAL;lifecycle;energy;Carbon Footprint},
doi={10.1109/NFV-SDN66355.2025.11349371}}
@INPROCEEDINGS{10849732,
author={Chou, Shih-Kai and Hribar, Jernej and Mohorčič, Mihael and Fortuna, Carolina},
booktitle={2024 IEEE Conference on Standards for Communications and Networking (CSCN)},
title={Towards the Standardization of Energy Efficiency Metrics of the AI Lifecycle in 6G and Beyond},
year={2024},
volume={},
number={},
pages={187-190},
keywords={Measurement;6G mobile communication;Energy consumption;Costs;Energy measurement;Energy efficiency;Computational efficiency;Quality of experience;Artificial intelligence;Standards;6G;AI-native network;energy efficiency},
doi={10.1109/CSCN63874.2024.10849732}}
License
BSD 3-Clause License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ecal_energy-0.1.0.tar.gz.
File metadata
- Download URL: ecal_energy-0.1.0.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3596ba324710935093c2d092f57ef3be2464a742ea746f626fba654ae86397f
|
|
| MD5 |
56a2f256f8d9b9c37621b3ab4e3e265f
|
|
| BLAKE2b-256 |
cda475f0765a754f4e48a9f7b9d8e1a12d93631862c8318865cc057713cdbecd
|
Provenance
The following attestation bundles were made for ecal_energy-0.1.0.tar.gz:
Publisher:
publish.yml on sensorlab/eCAL
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ecal_energy-0.1.0.tar.gz -
Subject digest:
b3596ba324710935093c2d092f57ef3be2464a742ea746f626fba654ae86397f - Sigstore transparency entry: 2189668980
- Sigstore integration time:
-
Permalink:
sensorlab/eCAL@c049a383090224ed14f830c831ece894843c74ce -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sensorlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c049a383090224ed14f830c831ece894843c74ce -
Trigger Event:
release
-
Statement type:
File details
Details for the file ecal_energy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ecal_energy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f2a544bf3bcbfaf8b8f8fc0ca6fd7bb8f5f7c119ae889600effb058bbc2250f
|
|
| MD5 |
db694aa70909c5c904388ddb1cc1f8e5
|
|
| BLAKE2b-256 |
77c971e092e263a748df345546521627c1f73ea35810f1efddce0ff2e48b18fe
|
Provenance
The following attestation bundles were made for ecal_energy-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on sensorlab/eCAL
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ecal_energy-0.1.0-py3-none-any.whl -
Subject digest:
1f2a544bf3bcbfaf8b8f8fc0ca6fd7bb8f5f7c119ae889600effb058bbc2250f - Sigstore transparency entry: 2189668983
- Sigstore integration time:
-
Permalink:
sensorlab/eCAL@c049a383090224ed14f830c831ece894843c74ce -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/sensorlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c049a383090224ed14f830c831ece894843c74ce -
Trigger Event:
release
-
Statement type: