Quantifying how energy-efficient techniques applied at different stages of an AI pipeline interact, stack, and occasionally collide.
- Project Goals
- Supported Tasks & Models
- Repository Layout
- Running an Experiment
- Energy & Carbon Instrumentation
- Result Files
Large-scale AI systems burn substantial energy across five canonical stages:
- Data preparation
- Model Architecture design / selection
- Training or fine-tuning
- System-level deployment
- Inference
This study builds multiple variants of the same end-to-end pipeline, each enabling energy-saving techniques in one or more of those stages. By comparing energy usage, carbon footprint, latency and task accuracy across variants, we ask:
Do savings add up linearly, cancel one another out, or compound super-linearly?
Does "optimise everywhere" always beat "optimise the bottleneck"?
Task | Dataset | Model(s) | Notes |
---|---|---|---|
Vulnerability Detection | BigVul | ModernBERT | Binary vulnerability classification |
Each pipeline variant re-uses the same datasets & model checkpoints so that only the energy-efficiency knobs differ.
green-pipeline-study/
├── variants/ # One folder per experimental pipeline
│ ├── v0_baseline/ # Baseline implementation
│ ├── v1_gradient_checkpointing/
│ ├── v2_lora_peft/ # Parameter efficient fine-tuning
│ ├── v3_quantization/ # Model quantization
│ ├── v4_tokenizer/ # Tokenizer optimizations
│ ├── v5_power_limit_100W/ # Power limiting
│ ├── v6_optimizer/ # Optimizer configurations
│ ├── v7_f16/ # FP16 precision
│ ├── v8_sequence_length_trimming/
│ ├── v9_inference_engine/
│ ├── v10_dataloader_pin_memory/
│ ├── v11_torch_compile/
│ ├── v12_attention/
│ ├── v13_layer_pruning_4_top/
│ └── ... # Additional variants
│
├── common/ # Shared components
│ ├── layer_drop.py # Layer pruning utilities
│ └── generate_configs.py # Configuration generation
│
├── analysis_results/ # Analysis outputs
├── energy_modelling.py # Energy modeling utilities
├── analysis.py # Analysis scripts
├── requirements.txt # Project dependencies
└── README.md # This file
Each variant in variants/
is self-contained with:
config.yaml
– structured hyper-parameterstrain_all_variants.sh
– pipeline execution script
# 1. Set up environment
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 2. Run a pipeline variant
cd variants/v0_baseline # or any other variant
python3 train.py
All energy, carbon and performance numbers are saved under analysis_results/
.
Layer | Tool | What it Measures |
---|---|---|
CPU/GPU/RAM system | CodeCarbon | Process-level energy + g CO₂/kWh |
Each stage starts an energy session; deltas are aggregated into the final analysis.
A run produces:
<VARIANT>/results/*
You can also find the analyzed and combined result along with plots in analysis_results/
.
analysis_results/aggregated_metrics.json
– comprehensive analysis across all variants- Training progress logs under
training_progress.log