Environment configuration
Conda virtual env
The preferred option to setup your environment is through conda environment.
The setup of environment can be done in two steps. Navigate to the root of the downloaded repository, then
Create a conda environment:
conda env create -f env/conda_env.yml
or
conda env create -f env/conda_gpu_env.yml
if you want to install PyTorch with cuda support.
Activate the conda environment:
conda activate supernnova
or
conda activate supernnova-cuda
if you create environment from “conda_gpu_env.yml”.
A python project management tool
poetry(2.x) is installed via the above steps. Verify it and install python dependencies for this project:
which poetry # should print <conda env>/bin/poetry
poetry install
For developers (including testing local documentation), please refer to Python environments for development.
Mise
You can also use mise, a tool to manage multiple python environments.
Make sure mise is activated in your shell
eval "$(mise activate bash)" # or zsh
Install Python 3.11 + uv
mise install
Install SuperNNova + dev deps
mise run install
Install PyTorch (pick one depending if you want cuda support or not)
mise run install-torch # CPU
mise run install-torch-cuda # CUDA 12.1
Run tests
mise run test
Docker
You can also use docker. The Docker image uses uv to install Python 3.11 and all dependencies (instead of conda), so there are no Anaconda Terms-of-Service prompts during the build.
Install docker: Docker.
Create a docker image:
make {image}
where image is one of cpu or gpu (for the latest supported CUDA version; currently 12.3.1) or gpu9 (for cuda 9.0)
This image contains all of this repository’s dependencies.
Image construction will typically take a few minutes
Enter docker environment by calling:
python env/launch_docker.py --image <image> --dump_dir </path/to/data>
Add
--image imagewhere image iscpuorgpu(latest version) orgpu9(for cuda 9)Add
--dump_dir /path/to/datato mount the folder where you stored the data (see Data walkthrough) into the container. If unspecified, will use the default location (i.e.snndump)
This will launch an interactive session in the docker container, with zsh support.