# ============================================================================ # URSA one-step distillation — DiMO-style training configuration # ============================================================================ # Reference: train_onestep_ursa_dimo.py # # DiMO hyperparameter comparison (Meissonic vs. our URSA defaults) # --------------------------------------------------------------- # Param DiMO (Meissonic) URSA (this config) Risk / Note # ───────────────────────────────────────────────────────────────────────── # guidance_scale (CFG) 3.0 (true_cfg) 3.0 (teacher_cfg) ✅ aligned # fake_rounds 2 1 ⚠ try 2 for aux stability # fixed_ratio 0.5 (mask ratio) — N/A (different domain) # distil_loss_type surrogate MSE optional surrogate ✅ toggle via use_surrogate_grad # noise_emb_perturb True — ℹ️ not needed for VQ-based model # cfg_prob 1.0 teacher_cfg_prob=1.0 ✅ aligned # lambda_ent 0.0 (no ent reg) 0.01 ℹ️ our addition for stability # ============================================================================ # ── Paths ──────────────────────────────────────────────────────────────────── teacher_ckpt: "/path/to/URSA" prompt_file: "prompts.txt" out_dir: "./outputs/dimo" # ── Video geometry ─────────────────────────────────────────────────────────── num_frames: 17 height: 256 width: 256 max_prompt_length: 320 # ── Training ───────────────────────────────────────────────────────────────── batch_size: 2 # reduce to 1 if enable_teacher_cfg uses too much VRAM num_steps: 10000 lr_student: 1.0e-5 lr_aux: 1.0e-5 weight_decay: 0.01 grad_clip: 1.0 mixed_precision: "bf16" seed: 42 log_every: 50 save_every: 1000 # ── Loss weights ───────────────────────────────────────────────────────────── lambda_pg: 1.0 lambda_kd: 0.5 lambda_ent: 0.01 # entropy regularisation (0 → DiMO original; 0.01 → our default) tau: 1.0 # student sampling temperature tau_kd: 1.0 # KD softmax temperature # ── Teacher CFG (DiMO true_cfg style) ──────────────────────────────────────── # Set enable_teacher_cfg: false to revert to the prior single-branch behavior. # All other params in this block are ignored when enable_teacher_cfg=false. enable_teacher_cfg: true teacher_cfg_scale: 3.0 # s in z_guided = z_uncond + s*(z_cond - z_uncond) # Matches DiMO true_cfg=3.0 teacher_cfg_prob: 1.0 # Probability of using guided target per batch (after warmup). # 1.0 = always guided (DiMO default). teacher_cfg_warmup_steps: 2000 # Ramp teacher_cfg_prob from 0 → teacher_cfg_prob over this many # steps. Prevents instability at the start of training. teacher_cfg_trunc: 0.9 # When t >= trunc, CFG scale falls to 1 (no guidance at high noise). # Mirrors DiMO's guidance_trunc parameter. lambda_kd_uncond: 0.3 # Weight for uncond-branch KD loss. # Keeps the student uncond-capable for eval-time CFG. reward_use_guided: false # [RISKY] Use guided teacher logits for REINFORCE reward. # Default false: use non-guided cond (more stable). # ── Eval / inference CFG ───────────────────────────────────────────────────── eval_cfg_scale: 3.0 # guidance_scale used during evaluation use_cfg_eval: false # Run eval with inference-time CFG (2× forward) # ── DiMO extensions ────────────────────────────────────────────────────────── use_surrogate_grad: false # DiMO surrogate MSE trick (zero-variance alternative to REINFORCE) lambda_surr: 1.0 fake_rounds: 1 # Aux updates per generator update (DiMO uses 2; try 2 for aux stability) # ── Stability ───────────────────────────────────────────────────────────────── t_curriculum_steps: 10000 # Steps to use t-curriculum (biases t toward larger values) p_mix_corrupt_frac: 0.2 # Fraction of tokens to corrupt in p_init mixing p_init_mix_ratio: 0.2 # Fraction of batch drawn from corrupted x_hat_prev collapse_warn_frac: 0.2 # Warn if tok_hist_entropy drops below this fraction of initial # ── Debug ──────────────────────────────────────────────────────────────────── dry_run: false # Run 1 step, print diagnostics, exit debug_dump: 0 # Dump token histogram + x_hat every N steps (0=off) # ── Recommended quick-start commands ───────────────────────────────────────── # # Smoke test (CFG enabled): # python scripts/train_onestep_ursa_dimo.py \ # --teacher_ckpt /path/to/URSA --prompt_file prompts.txt \ # --enable_teacher_cfg --teacher_cfg_scale 3.0 \ # --num_frames 17 --height 256 --width 256 --dry_run # # # Full training (DiMO-aligned): # python scripts/train_onestep_ursa_dimo.py \ # --teacher_ckpt /path/to/URSA --prompt_file prompts.txt \ # --enable_teacher_cfg --teacher_cfg_scale 3.0 \ # --batch_size 2 --num_steps 10000 --fake_rounds 2 \ # --out_dir ./outputs/dimo_cfg # # # Eval (compare 3 student modes vs teacher): # python scripts/eval_onestep_ursa.py \ # --teacher_ckpt /path/to/URSA \ # --student_ckpt ./outputs/dimo_cfg/final/student.pt \ # --modes no_cfg cfg baked --eval_cfg_scale 3.0 \ # --out_dir ./outputs/eval