This folder is set up for the mini-project. Most of the boilerplate is already in place, so you can focus on running and modifying experiments instead of wiring everything from scratch.
- Dataset:
oftverse/control-celeba-hq - Reference implementation:
huggingface/peft/examples/boft_controlnet - Training uses
torchrunwith a simple distributed setup (single or multi-node)
The repo already covers the standard workflow:
- Entry points for training, testing, and evaluation
- A small wrapper for distributed initialization
- Auto-fetching of the official
boft_controlnetcode intovendor/ - YAML-based configs under
configs/ - Scripts for running on 2×A100
-
configs/train_small.yaml— quick sanity check -
configs/train_full.yaml— full training run (for submission) -
configs/test_eval.yaml— test + eval using finetuned weights -
configs/test_eval_baseline.yaml— base model (no PEFT), for comparison -
src/distributed.py— distributed init utilities -
src/fetch_vendor.py— pulls official code intovendor/boft_controlnet -
src/train.py— training entry point -
src/test.py— test entry point -
src/eval.py— evaluation entry point -
scripts/run_train_2a100.sh— training on 2 GPUs -
scripts/run_test.sh— run generation -
scripts/run_eval.sh— run evaluation -
scripts/compare_ft_vs_base.sh— compare finetuned vs baseline (sameseed/max_eval_samples) -
models/— checkpoints (optional) -
datasets/— local datasets (optional) -
outputs/— logs, outputs, checkpoints
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt- Quick sanity run:
bash scripts/run_train_2a100.sh configs/train_small.yaml- Full training:
bash scripts/run_train_2a100.sh configs/train_full.yaml- Run test generation:
bash scripts/run_test.sh configs/test_eval.yaml- Run evaluation:
bash scripts/run_eval.sh configs/test_eval.yamlIf you only want to evaluate a subset, set max_eval_samples in configs/test_eval.yaml (e.g. 100). Use the same value for both test and eval.
seed controls which samples are picked after shuffling, so keep it fixed if you want reproducible comparisons.
If needed, re-run src/fetch_vendor.py to apply the LOCAL_FIX_MAX_EVAL_SAMPLES patch. Alternatively, delete:
vendor/boft_controlnet/test_controlnet.py
vendor/boft_controlnet/eval.py
vendor/boft_controlnet/utils/args_loader.py
and let it fetch again.
-
In
configs/test_eval.yaml: Setoutput_dirandcheckpoint_name. Outputs go tooutput_dir/checkpoint_name/(predictions inresults/by default). -
In
configs/test_eval_baseline.yaml: No checkpoint is used. Withbaseline_mode: true, just useoutput_diras the root. Predictions go tooutput_dir/<results_subdir>/(resultsorresults_baseline). -
You can still set
checkpoint_namein the baseline config if you want a nested folder structure, but it won’t load any weights.
Make sure seed and max_eval_samples match between the two configs so both runs use the same data.
bash scripts/compare_ft_vs_base.sh configs/test_eval.yaml configs/test_eval_baseline.yamlYou can also run src/test.py and src/eval.py manually with each config.
This comparison relies on the LOCAL_FIX_BASELINE_COMPARE patch (handled in fetch_vendor.py).