This project is a profiling and scheduling service for machine learning jobs. It analyzes Python scripts to estimate energy consumption, execution time, and carbon emissions, and allows scheduling jobs with specific power-throttling policies to optimize carbon footprint.
This project relies on several important Python packages:
- FastAPI & Uvicorn: High-performance framework and server for building the REST API.
- PyTorch: Used for machine learning model execution and profiling.
- Zeus-ML: A framework for deep learning energy measurement and optimization.
- NumPy & SciPy: Fundamental packages for scientific computing and data manipulation.
- Matplotlib: Used for plotting and visualizing profiling data.
- Requests: For making HTTP requests to external services (e.g., Electricity Maps API).
python -m venv .venv
source .venv/bin/activate
.venv/bin/pip install -r requirements.txtpython monitor.py <path_to_user_job.py>To start the FastAPI server, run:
python server.pyThe server will be available at http://0.0.0.0:8000.
Alternatively, in case you'd like to deploy the client and the server in different networks, execute:
./start.shThis will start the server and create an ngrok tunneling channel.
There is an example job named test_job.py under the jobs directory.