Configuration Guide
This guide explains how to configure and customize the benchmark. As mentioned in the quickstart, you need two configuration files:
--parallel-config— SLURM cluster settings (CPUs, GPUs, walltime, modules)--config— Experiment definition (datasets, solvers, parameters, execution grid)
Available Configuration Files
All configuration files are located in the configs/ directory:
File |
Purpose |
|---|---|
|
SLURM cluster configuration |
|
High-resolution image reconstruction |
|
2D tomography experiments |
|
3D tomography experiments |
Parallel Configuration (SLURM)
The --parallel-config file (e.g., configs/config_parallel.yml) defines cluster-level settings. Here is an example for a SLURM cluster (Jean-Zay):
backend: submitit
slurm_time: 30 # Job walltime in minutes
slurm_additional_parameters:
cpus-per-task: 10 # CPU cores per job
qos: qos_gpu-dev # Queue used for the jobs
account: your_account_here # Your cluster account
constraint: v100-32g # GPU type (e.g., V100 with 32GB)
slurm_setup: # Commands run before job starts
- module purge
- module load pytorch-gpu/py3/2.7.0
- export NCCL_DEBUG=INFO
Key parameters to customize:
cpus-per-task— Number of CPU cores per jobslurm_time— Maximum runtime (minutes)constraint— GPU type (e.g.,v100-32g,a100)slurm_setup— Environment modules and variables for your cluster
Note: The number of GPUs per job is specified in the main config file, not here.
Main Configuration (Experiments)
The --config file (e.g., configs/highres_imaging.yml) defines what experiments to run. Let’s walk through its structure:
1. Dataset Configuration
Specify the dataset and its parameters:
dataset:
- highres_color_image:
...
Dataset implementations are in datasets/ (e.g., datasets/highres_color_image.py).
2. Solver Configuration
Define which reconstruction algorithms to run:
solver:
- PnP:
...
Available solvers are in solvers/ (e.g., solvers/pnp.py).
3. Execution Grid
This section defines GPU configurations and parallelization strategies. Each row specifies one complete experiment configuration:
slurm_gres, slurm_ntasks_per_node, slurm_nodes, distribute_physics, distribute_denoiser, patch_size, overlap, max_batch_size: [
["gpu:1", 1, 1, false, false, 0, 0, 0],
["gpu:2", 2, 1, true, true, 448, 32, 0],
["gpu:4", 4, 1, true, true, 448, 32, 0],
]
Key fields:
slurm_gres— GPU resource request ("gpu:1"= 1 GPU,"gpu:2"= 2 GPUs)slurm_ntasks_per_node— Number of parallel tasks per nodeslurm_nodes— Number of compute nodesdistribute_physics— Parallelize physics operators across GPUsdistribute_denoiser— Enable spatial tiling: split large images into patches and process them in parallel on available GPUs
Example configurations:
Single GPU (no parallelization):
["gpu:1", 1, 1, false, false, 0, 0, 0]
Uses 1 GPU with no distributed processing.
Multi-GPU (2 GPUs in parallel):
["gpu:2", 2, 1, true, true, 448, 32, 0]
Uses 2 GPUs in parallel on one node, distributing both physics operators and denoiser. For more details on distributed computing, see the DeepInv distributed documentation.
Customizing Your Configuration
To create your own experiment:
Copy an existing config:
cp configs/highres_imaging.yml configs/my_experiment.yml
Edit dataset parameters (image size, noise levels, etc.)
Adjust solver hyperparameters (step size, iterations, denoiser settings)
Configure GPU resources in the execution grid
Run your benchmark:
benchopt run . \ --parallel-config ./configs/config_parallel.yml \ --config ./configs/my_experiment.yml