Reproduce the single-singer Mandarin OpenVPI DiffSinger baseline on Opencpop in an isolated Python 3.12 environment.
1. Environment setup
The baseline runs in an isolated virtual environment (research/vocalsynth/baselines/diffsinger/.venv) locked to Python 3.12:
uv venv research/vocalsynth/baselines/diffsinger/.venv --python 3.12.12
uv pip sync --python research/vocalsynth/baselines/diffsinger/.venv/bin/python research/vocalsynth/baselines/diffsinger/requirements.lockUpstream OpenVPI DiffSinger source is pinned in research/vocalsynth/baselines/diffsinger/upstream.lock and checked out under local/third_party/diffsinger.
2. Data preparation and binarization
Source annotations and audio reside under local/data/datasets/opencpop. Convert the Opencpop annotations and binarize both acoustic and variance training sets:
PY=research/vocalsynth/baselines/diffsinger/.venv/bin/python
"$PY" research/vocalsynth/baselines/diffsinger/convert_opencpop.py
"$PY" research/vocalsynth/baselines/diffsinger/run.py binarize --config research/vocalsynth/baselines/diffsinger/configs/acoustic-opencpop.yaml
"$PY" research/vocalsynth/baselines/diffsinger/run.py binarize --config research/vocalsynth/baselines/diffsinger/configs/variance-opencpop.yamlProcessed caches are written to local/data/legacy/diffsinger-opencpop-v1/.
3. Training
Local training
Run acoustic and variance training stages sequentially or individually:
# Acoustic training (target: 50,000 updates, batch size: 8)
caffeinate -i research/vocalsynth/baselines/diffsinger/train-full.sh acoustic
# Full training (acoustic followed by variance, target: 40,000 updates)
caffeinate -i research/vocalsynth/baselines/diffsinger/train-full.sh fullCheckpoints are saved under local/runs/diffsinger-opencpop-v1/diffsinger-opencpop-<stage>/checkpoints/.
Modal cloud training
Before starting a baseline run on Modal, copy the example runtime config and fill in your Modal Volume settings:
cp research/vocalsynth/configs/baselines/diffsinger/runtime-modal.example.toml research/vocalsynth/configs/baselines/diffsinger/runtime-modal.tomlUpload the preprocessed DiffSinger dataset and vocoder assets to Modal:
uv run --project research/vocalsynth --extra modal vocalsynth modal upload-diffsinger \
--source-runtime infra/runtime/local.toml \
--runtime research/vocalsynth/configs/baselines/diffsinger/runtime-modal.tomlStart a baseline training run on Modal (--stage accepts acoustic, variance, or both, and defaults to both):
uv run --project research/vocalsynth --extra modal vocalsynth modal diffsinger \
--runtime research/vocalsynth/configs/baselines/diffsinger/runtime-modal.toml \
--stage both \
--run-name opencpop-baselineRe-running with the same --run-name resumes that baseline run from its latest checkpoint.
4. Inference and service
CLI rendering
Render a single utterance through the vocalsynth CLI using a trained DiffSinger baseline checkpoint for side-by-side comparison (--baseline-exp defaults to diffsinger-opencpop-acoustic, and --baseline-ckpt optionally selects a checkpoint step):
uv run --project research/vocalsynth vocalsynth infer \
--config research/preview/configs/preview.toml \
--runtime infra/runtime/local.toml \
--backend diffsinger \
--baseline-exp diffsinger-opencpop-acoustic \
--row 0 \
--output local/outputs/baseline/sample-0Resident worker (for preview editor)
research/vocalsynth/baselines/diffsinger/worker.py keeps models resident in memory to avoid repeated import overhead:
VOCALSYNTH_BASELINE_ACOUSTIC_DEVICE=mps VOCALSYNTH_BASELINE_VOCODER_DEVICE=cpu \
"$PY" research/vocalsynth/baselines/diffsinger/worker.py --exp diffsinger-opencpop-acoustic --ckpt 50000Batch evaluation inference
Render the 20 fixed evaluation selections from local/data/legacy/diffsinger-opencpop-v1/eval/input/:
PY=research/vocalsynth/baselines/diffsinger/.venv/bin/python
EVAL=local/data/legacy/diffsinger-opencpop-v1/eval
OUT=local/runs/diffsinger-opencpop-v1/evaluation-01
# 1. Variance prediction (durations and F0)
for ds in "$EVAL"/input/*.ds; do
id="${ds##*/}"; id="${id%.ds}"
"$PY" research/vocalsynth/baselines/diffsinger/run.py infer variance "$(pwd)/$ds" \
--exp diffsinger-opencpop-variance --out "$OUT/variance" --title "$id" --seed 2026
done
# 2. Acoustic synthesis
for ds in "$OUT"/variance/*.ds; do
id="${ds##*/}"; id="${id%.ds}"
"$PY" research/vocalsynth/baselines/diffsinger/run.py infer acoustic "$ds" \
--exp diffsinger-opencpop-acoustic --out "$OUT/audio" --title "$id" --seed 2026
done5. Quality verification
- Validate sample rate, channel count, duration, finite sample values, and peak/RMS levels on each rendered audio file.
- Run a human listening review through Dashboard pairwise A/B comparison to evaluate pronunciation accuracy, pitch stability, and naturalness.



