NEXUS: A Novel Energy eXamination Using Switching-activity-based Tokens — Physics-grounded energy efficiency framework for machine learning systems
Project description
NEXUS-ML
NEXUS: A Novel Energy eXamination Using Switching-activity-based Tokens
A physics-grounded energy efficiency framework for machine learning systems.
⚠️ Pre-alpha: This package is under active development as part of PhD research.
Overview
NEXUS moves beyond traditional FLOP-based energy proxies to transistor-level energy modeling derived from semiconductor circuit physics. It provides a complete pipeline for understanding, measuring, and optimizing the energy consumption of ML models.
The Problem
FLOPs are a poor proxy for energy consumption. A single memory access costs 100× more energy than a compute operation, yet FLOP counts treat all operations equally. This leads to misleading efficiency comparisons and misguided optimization efforts.
The NEXUS Approach
NEXUS uses β-coefficients derived from Horowitz (ISSCC 2014) semiconductor data to decompose model energy into transistor operations, then computes six novel metrics that reveal where energy actually goes:
| Metric | What It Measures |
|---|---|
| SAF-T | Switching Activity Factor per Token |
| LSRT | Logic State Residence Time |
| ECU | Energy per Capability Unit |
| MCER | Memory-Compute Energy Ratio |
| DDEV | Data-Dependent Energy Variation |
| CpTO | Capability per Transistor Operation |
Pipeline
Analyze → Measure → Diagnose → Recommend → Optimize
- Analyze: Profile a model — compute FLOPs (baseline) and transistor operations (NEXUS)
- Measure: Collect actual hardware energy measurements (GPU via NCU, CPU power monitors)
- Diagnose: Identify energy bottlenecks at the layer/operation level
- Recommend: Propose targeted optimizations ranked by expected energy impact
- Optimize: Apply optimizations (quantization, pruning, activation swaps) guided by NEXUS metrics
Installation
# Core (metrics computation only)
pip install nexus-ml
# With PyTorch support
pip install nexus-ml[pytorch]
# With hardware measurement support
pip install nexus-ml[measurement]
# Everything
pip install nexus-ml[all]
Quick Start
import nexus_ml
# Coming soon — API is under active development
Supported Backends
ML Frameworks
- PyTorch — Full support (CNNs, RNNs, Transformers)
- XGBoost — Gradient boosted decision trees
- scikit-learn — Traditional ML models
- Extensible — Implement
ModelBackendfor custom frameworks
Hardware
- NVIDIA GPU — Via Nsight Compute (NCU) and pynvml
- CPU — Via system power monitoring
- Extensible — Implement
HardwareBackendfor custom hardware
Development
# Clone the repository
git clone https://github.com/jemsbhai/nexus-ml.git
cd nexus-ml
# Create virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1
# Install in development mode with all dependencies
pip install -e ".[all]"
# Run tests
pytest tests/ -v
# Run tests with coverage
pytest tests/ -v --cov=nexus_ml --cov-report=term
Project Structure
nexus-ml/
├── src/nexus_ml/ # Main package
│ ├── core/ # β-coefficients, TO counting, energy model
│ ├── metrics/ # NEXUS metrics + baseline (FLOPs) metrics
│ ├── analyze/ # Model profiling & decomposition
│ ├── measure/ # Hardware energy measurement
│ ├── diagnose/ # Bottleneck identification
│ ├── recommend/ # Optimization suggestions
│ ├── optimize/ # Apply optimizations
│ ├── backends/ # ML framework adapters (pluggable)
│ ├── hardware/ # Hardware adapters (pluggable)
│ └── report/ # Visualization & export
├── tests/ # Test suite (TDD)
├── examples/ # Usage examples
├── docs/ # Documentation
└── packages/ # Future ports (JS/TS)
Citation
If you use NEXUS in your research, please cite:
@inproceedings{syed2026toml,
title={TOML: Transistor Operations for Machine Learning -- A Physics-Grounded Energy Efficiency Framework},
author={Syed, Muntaser and Silaghi, Marius},
booktitle={Proceedings of the Florida Artificial Intelligence Research Society (FLAIRS-39)},
year={2026}
}
License
MIT License — see LICENSE for details.
Acknowledgments
- β-coefficient data derived from Horowitz, "Computing's Energy Problem (and what we can do about it)", ISSCC 2014
- PhD research conducted at Florida Institute of Technology under Dr. Marius Silaghi
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 nexus_ml_metrics-0.0.1.tar.gz.
File metadata
- Download URL: nexus_ml_metrics-0.0.1.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1033b6a83cee8352ba9b6578b43a633de7aec3e3b0a28bec7e89a2ee195c34b
|
|
| MD5 |
69e50bf01834b3fc4833399cd1041a9c
|
|
| BLAKE2b-256 |
7bb90561a27fb8a65f5487f824e801c90a1bbed220ad4b68e9421aec9db50ce4
|
File details
Details for the file nexus_ml_metrics-0.0.1-py3-none-any.whl.
File metadata
- Download URL: nexus_ml_metrics-0.0.1-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c25aad32e14f4b5ad1904c7478094f67e0aa59f50f2ee57ab420b6b7593b182
|
|
| MD5 |
177618ec8bccb78dc69854cbfe75b3b3
|
|
| BLAKE2b-256 |
5ea210e364c3775dc59071d8b387dd0f805211f3e553898462e46c56b6c5dad9
|