Skip to main content

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
  1. Analyze: Profile a model — compute FLOPs (baseline) and transistor operations (NEXUS)
  2. Measure: Collect actual hardware energy measurements (GPU via NCU, CPU power monitors)
  3. Diagnose: Identify energy bottlenecks at the layer/operation level
  4. Recommend: Propose targeted optimizations ranked by expected energy impact
  5. 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 ModelBackend for custom frameworks

Hardware

  • NVIDIA GPU — Via Nsight Compute (NCU) and pynvml
  • CPU — Via system power monitoring
  • Extensible — Implement HardwareBackend for 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

Metadata

Release files for nexus-ml-metrics 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nexus-ml-metrics 0.0.1
File Size Uploaded Provenance
nexus_ml_metrics-0.0.1.tar.gz 24.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nexus-ml-metrics 0.0.1
File Interpreter ABI Platform
nexus_ml_metrics-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 47.4 kB

Release files / nexus_ml_metrics-0.0.1.tar.gz

Download URL nexus_ml_metrics-0.0.1.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c1033b6a83cee8352ba9b6578b43a633de7aec3e3b0a28bec7e89a2ee195c34b
BLAKE2b-256 checksum
How to use checksums
7bb90561a27fb8a65f5487f824e801c90a1bbed220ad4b68e9421aec9db50ce4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / nexus_ml_metrics-0.0.1-py3-none-any.whl

Download URL nexus_ml_metrics-0.0.1-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c25aad32e14f4b5ad1904c7478094f67e0aa59f50f2ee57ab420b6b7593b182
BLAKE2b-256 checksum
How to use checksums
5ea210e364c3775dc59071d8b387dd0f805211f3e553898462e46c56b6c5dad9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Security for nexus-ml-metrics 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page