E2AM_ResNet50 / README.md
Shanmuk4622's picture
progress push (15 files)
36f2bd4 verified
|
Raw
History Blame Contribute Delete
10.2 kB
metadata
license: apache-2.0
language:
  - en
tags:
  - energy-aware-training
  - image-classification
  - model-efficiency
  - ablation-study
  - resnet50
datasets:
  - cifar10
  - cifar100
  - tiny-imagenet
library_name: pytorch
pretty_name: 'E2AM ablation: ResNet-50'

E2AM Ablation Results: ResNet-50

Energy-aware training ablation study for ResNet-50 across three image-classification datasets: CIFAR-10, CIFAR-100, and Tiny-ImageNet.

Each dataset has 15 training variants (8 individual-method M0..M7, 7 cumulative ablation C0..C6) at 50 epochs, plus a 5-variant deployment pipeline (FP32 baseline, structured pruning, pruning+finetune, INT8 quantization, pruned+INT8).

Status: 45 completed variants, 0 partial.

Quick links

Headline results

Dataset Best variant Top-1 Top-5 Energy (kWh) CO₂ (kg) Time (sec)
CIFAR-10 M5_adaptive_lr_only 0.9397 0.1556 0.0739 7368
CIFAR-100 M5_adaptive_lr_only 0.7482 0.9358 0.1587 0.0754 7578
Tiny-ImageNet C5_cache_amp_gradaccum_adaptivelr_l1 0.6742 0.8651 0.5231 0.2485 24653

Cross-dataset comparison

How the same training variants behave across CIFAR-10, CIFAR-100, and Tiny-ImageNet.

Accuracy By Variant Across Datasets

accuracy_by_variant_across_datasets

Energy By Variant Across Datasets

energy_by_variant_across_datasets

Per-dataset results

CIFAR-10

M-matrix (individual methods)

Variant Epochs Top-1 Top-5 Energy (kWh) CO₂ (kg) Time (s) Status
M0_baseline_fp32 50 0.8298 0.1590 0.0755 7588 completed
M1_cache_only 50 0.8543 0.1561 0.0741 7369 completed
M2_amp_only 50 0.8744 0.0622 0.0295 3006 completed
M3_grad_accum_only 50 0.8720 0.1552 0.0737 7332 completed
M4_l1_sparsity_only 50 0.8387 0.1578 0.0750 7447 completed
M5_adaptive_lr_only 50 0.9397 0.1556 0.0739 7368 completed
M6_eag_only 50 0.8452 0.1611 0.0765 7654 completed
M7_full_e2am 50 0.9088 0.0664 0.0315 3192 completed

C-matrix (cumulative ablation)

Variant Epochs Top-1 Top-5 Energy (kWh) CO₂ (kg) Time (s) Status
C0_baseline 50 0.8442 0.1747 0.0830 8464 completed
C1_cache 50 0.8452 0.1752 0.0832 8495 completed
C2_cache_amp 50 0.8595 0.0663 0.0315 3189 completed
C3_cache_amp_gradaccum 50 0.8700 0.0713 0.0339 3479 completed
C4_cache_amp_gradaccum_adaptivelr 50 0.9084 0.0711 0.0338 3476 completed
C5_cache_amp_gradaccum_adaptivelr_l1 50 0.9151 0.0718 0.0341 3504 completed
C6_full_e2am 50 0.9151 0.0717 0.0340 3503 completed

accuracy_bar.png

energy_bar.png

co2_bar.png

accuracy_vs_energy_scatter.png

CIFAR-100

M-matrix (individual methods)

Variant Epochs Top-1 Top-5 Energy (kWh) CO₂ (kg) Time (s) Status
M0_baseline_fp32 50 0.5913 0.8446 0.1569 0.0745 7414 completed
M1_cache_only 50 0.5947 0.8582 0.1567 0.0744 7415 completed
M2_amp_only 50 0.6081 0.8652 0.0702 0.0334 3377 completed
M3_grad_accum_only 50 0.6228 0.8766 0.1559 0.0741 7380 completed
M4_l1_sparsity_only 50 0.5897 0.8576 0.1581 0.0751 7475 completed
M5_adaptive_lr_only 50 0.7482 0.9358 0.1587 0.0754 7578 completed
M6_eag_only 50 0.5821 0.8440 0.1565 0.0743 7412 completed
M7_full_e2am 50 0.7008 0.9087 0.0648 0.0308 3123 completed

C-matrix (cumulative ablation)

Variant Epochs Top-1 Top-5 Energy (kWh) CO₂ (kg) Time (s) Status
C0_baseline 50 0.5822 0.8628 0.1657 0.0787 7918 completed
C1_cache 50 0.5916 0.8505 0.1621 0.0770 7754 completed
C2_cache_amp 50 0.6307 0.8665 0.0670 0.0318 3233 completed
C3_cache_amp_gradaccum 50 0.6306 0.8761 0.0659 0.0313 3188 completed
C4_cache_amp_gradaccum_adaptivelr 50 0.6918 0.9042 0.0659 0.0313 3190 completed
C5_cache_amp_gradaccum_adaptivelr_l1 50 0.6753 0.8974 0.0667 0.0317 3225 completed
C6_full_e2am 50 0.6753 0.8974 0.0670 0.0318 3224 completed

accuracy_bar.png

energy_bar.png

co2_bar.png

accuracy_vs_energy_scatter.png

Tiny-ImageNet

M-matrix (individual methods)

Variant Epochs Top-1 Top-5 Energy (kWh) CO₂ (kg) Time (s) Status
M0_baseline_fp32 50 0.4187 0.6629 1.2832 0.6095 60871 completed
M1_cache_only 50 0.4027 0.6637 1.2088 0.5742 57541 completed
M2_amp_only 50 0.4889 0.7445 0.5128 0.2436 24268 completed
M3_grad_accum_only 50 0.5141 0.7502 1.3058 0.6203 61979 completed
M4_l1_sparsity_only 50 0.4112 0.6874 1.2378 0.5880 58649 completed
M5_adaptive_lr_only 50 0.6243 0.8426 1.1917 0.5661 56539 completed
M6_eag_only 50 0.3996 0.6543 1.2605 0.5987 59534 completed
M7_full_e2am 50 0.6641 0.8580 0.5423 0.2576 25681 completed

C-matrix (cumulative ablation)

Variant Epochs Top-1 Top-5 Energy (kWh) CO₂ (kg) Time (s) Status
C0_baseline 50 0.4121 0.6262 1.3775 0.6543 65154 completed
C1_cache 50 0.4213 0.7007 1.3177 0.6259 62533 completed
C2_cache_amp 50 0.4993 0.7211 0.4929 0.2341 22910 completed
C3_cache_amp_gradaccum 50 0.5505 0.7980 0.5049 0.2398 23604 completed
C4_cache_amp_gradaccum_adaptivelr 50 0.6667 0.8607 0.5437 0.2583 25771 completed
C5_cache_amp_gradaccum_adaptivelr_l1 50 0.6742 0.8651 0.5231 0.2485 24653 completed
C6_full_e2am 49 0.6716 0.8621 0.5163 0.2453 24352 completed

accuracy_bar.png

energy_bar.png

co2_bar.png

accuracy_vs_energy_scatter.png

Deployment results

See paper_tables/deployment_results_table.csv.

Methodology

Model: ResNet-50 (~23.5M params).

Training protocol: from scratch, SGD with momentum 0.9, weight decay 5e-4, initial LR 0.1, 50 epochs, 1 warmup epoch. All variants share the same protocol so ablation comparison stays apples-to-apples across the matrix.

Input: native dataset resolution upsampled to 32x32 in-model via nn.Upsample (FX-traceable to keep D3/D4 INT8 quantization possible).

Optimization toggles (the 5 individual methods and their cumulative combinations):

Method Mechanism
Tensor cache Training images held in RAM as a normalized float tensor
AMP torch.cuda.amp.autocast + GradScaler
Grad accum (x2) Accumulate gradients across 2 mini-batches
L1 sparsity Lambda * sum(
Cosine LR lr(t) = lr_max * 0.5 * (1 + cos(pi*t/T))
EAG early-stop Energy-Aware Gain: stop when accuracy gain per joule plateaus

Energy measurement: GPU power sampled at 1 Hz via nvidia-smi --query-gpu=power.draw. Energy = trapezoidal integration over power-vs-time. CO₂ = energy_kWh * 0.475 (global average grid intensity).

Hardware: Single NVIDIA T4 (14.5 GB) on Kaggle.

Repository structure

runs/
  cifar10/
  cifar100/
  tiny_imagenet/
    individual_methods/M0..M7/   (history.csv, metrics_summary.json,
                                  best_model.pt, last_model.pt, config.yaml)
    cumulative_ablation/C0..C6/  (same)
paper_tables/                     (6 unified CSV tables)
comparison_plots/<dataset>/       (per-dataset plots)
comparison_plots/cross_dataset/   (cross-dataset plots)
README.md                         (this file)

Reproducibility

Each variant directory has a config.yaml with the exact configuration used. To reproduce:

  1. huggingface-cli download Shanmuk4622/E2AM_ResNet50 --repo-type dataset
  2. Load the e2am.py library and call the appropriate config factory
  3. Run e2am.train_one_run(cfg)

Limitations

  • Energy measurement is GPU-only (via nvidia-smi); CPU/memory power not included
  • Pruning is mask-based; no wall-clock speedup without sparsity-aware runtime
  • INT8 (D3/D4) is CPU FX static quantization (fbgemm); may fail on transformer blocks. Failures logged in metrics.json rather than crashing.
  • Single-T4 reproduction; multi-GPU not validated
  • SGD@0.1 is suboptimal for some architectures; the paper compares variant-to-variant deltas which remain meaningful regardless

Citation

@misc{e2am_ablation_resnet50,
  title  = {E2AM: Energy-Aware Adaptive Model Training Ablation Study (ResNet-50)},
  author = {Shanmuk},
  year   = {2026},
  howpublished = {\url{https://huggingface.co/datasets/Shanmuk4622/E2AM_ResNet50}},
}

This README was auto-generated on 2026-07-02 08:14 UTC. Source repo: Shanmuk4622/E2AM_ResNet50