#!/usr/bin/env bash # Night of 2026-11-26, part 6 (GPU 1, queued ~03:00 UTC, starts when night3b ends ~03:40). # Fit vocoder C to T2's pairs (T2 = texture loss from 1 kHz; its own motion matches the real # speaker in every band) WITH a vocoder texture term (scripts/train_vocoder_texture.py, # VOCODER_TEXTURE=5 from 1 kHz). Plain pairs fitting (Ctex, mel 5) averaged T's motion away, # because it does not line up with the recording. The term asks the vocoder's output to change # from frame to frame as much as the recording does. # Part 6 = part 5 with VOCODER_TEXTURE=15 instead of 5, to bracket the weight. At 5 the term fell # only from 0.063 to 0.044 in the first 4k steps. # Same recipe as Ctex otherwise: init C 132k, fresh cosine 5e-5, 500 warm-up, mel 5, 20k steps. # Run detached in the v3 image: # docker compose run -d --name tiny-voca-dk-night6 kit-v3 \ # bash -c "bash scripts/night6_chain.sh > checks/night6-chain.log 2>&1" set -uo pipefail cd /opt/kit stamp() { echo "== stage $1 $(date -u +%FT%TZ)"; } wait_gpu() { # device index, free bytes needed until CUDA_VISIBLE_DEVICES=$1 python -c "import sys, torch; sys.exit(0 if torch.cuda.mem_get_info(0)[0] > $2 else 1)" 2>/dev/null do sleep 30; done; } GPU=${GPU:-1} OUT=runs/vocoder-r13-CT2-vtex15 stamp wait-night3 # night3-chain.log already has one exit line (the 00:42 stop); wait for night3b's own. until [ "$(grep -c "^exit=" checks/night3-chain.log)" -ge 2 ]; do sleep 60; done START=(--init-from runs/vocoder-r7-C/last.pt --fresh-schedule); [[ -f "$OUT/last.pt" ]] && START=(--resume) wait_gpu "$GPU" 8e9 stamp vocoder CUDA_VISIBLE_DEVICES=$GPU VOCODER_TEXTURE=15 VOCODER_TEXTURE_LOW_HZ=1000 python scripts/train_vocoder_texture.py "${START[@]}" \ --prior --prior-high-hz 2500 --prior-high-gain 0.05 --prior-gain-range 0.0 0.1 --mel-weight 5 \ --manifests data/full-features/train.jsonl --validation data/full-features/validation.jsonl --output "$OUT" \ --steps 152000 --learning-rate 5e-5 --warmup 500 --batch 32 --teacher vocos --distill-mode spectrum --distill-weight 4 \ --pairs data/vocoder-pairs-tex1k140k/train/pairs.jsonl --pair-fraction 0.7 \ --device cuda --workers 6 --save-every 1000 --keep-every 4000 >> "$OUT.log" 2>&1 code=$? [[ $code -eq 0 ]] && cp --update=none "$OUT/vocoder.pt" models/vocoder-r13-CT2-vtex15-s152000.pt echo "exit=$code $(date -u +%FT%TZ)"