Skip to content

Repository files navigation

eProf

eProf is an energy profiler for machine learning systems. Currently, it can provide energy consumption of each CUDA kernel in a Python application.

Build from source

Install dependencies

You need to install uv, clang-18, g++-13, and boost-1.74 to build the project. On Ubuntu, you can install them by:

# Install python and uv
sudo apt install -y python3 python3-pip clang g++ libboost-all-dev
pip3 install uv

If you are using Ubuntu 22.04, you should manually install clang-18, g++-13 by:

# Install clang-18
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
sudo apt update
sudo apt install -y clang-18
# Install g++-13
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install -y gcc-13 g++-13
sudo apt install -y libboost-all-dev

Build

Clone the repository:

git clone https://github.com/Conless/eprof.git
cd eprof

Install the project:

uv venv --python 3.10
uv pip install --no-build-isolation ./python

--no-build-isolation is required, not a preference: the extension links the libtorch that will import it, and an isolated build environment would install a second one for it to link instead.

If clang++-18 is not the default compiler, point CXX at it.

This installs two things: magneton, the python package, and eprof, the profiler itself, which is Rust and C++.

Running the examples

examples/ covers PyTorch, Hugging Face, vLLM, TensorFlow and more, whose requirements contradict each other. One script builds an environment for each group and runs them:

scripts/ae.py

See docs/ARTIFACT_EVALUATION.md.

About

Magneton: Optimizing Energy Efficiency of ML Systems via Differential Energy Debugging [NSDI'27]

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages