fix train / val step mismatch

This commit is contained in:
H1yori233
2026-03-15 20:55:53 -07:00
parent 375ffd3fd5
commit 0ca75db738
2 changed files with 18 additions and 1 deletions
@@ -20,6 +20,7 @@ method:
generator_update_interval: 5
real_score_guidance_scale: 1.0
dmd_denoising_steps: [1000, 750, 500, 250]
warp_denoising_step: true
chunk_size: 3
student_sample_type: sde
@@ -88,6 +89,7 @@ callbacks:
max_grad_norm: 1.0
validation:
pipeline_target: fastvideo.pipelines.basic.wan.wangame_causal_dmd_pipeline.WangameCausalSdeDMDPipeline
scheduler_target: fastvideo.models.schedulers.scheduling_self_forcing_flow_match.SelfForcingFlowMatchScheduler
dataset_file: examples/training/finetune/WanGame2.1_1.3b_i2v/validation_4.json
every_steps: 5
sampling_steps: [4]
+16 -1
View File
@@ -145,6 +145,7 @@ class ValidationCallback(Callback):
self._last_scalar_metrics: dict[str, float] = {}
self._last_mf_angle_err_mean: float = float("inf")
self._last_eval_step: int = -1
self._logged_sampling_step_configs: set[int] = set()
# ----------------------------------------------------------
# Callback hooks
@@ -626,6 +627,8 @@ class ValidationCallback(Callback):
for s in pk["dmd_denoising_steps"]
]
self._logged_sampling_step_configs.add(int(num_inference_steps))
# ----------------------------------------------------------
# Pipeline management
# ----------------------------------------------------------
@@ -696,7 +699,19 @@ class ValidationCallback(Callback):
SchedulerCls = resolve_target(
self.scheduler_target
)
return SchedulerCls(shift=float(flow_shift))
scheduler = SchedulerCls(shift=float(flow_shift))
if SchedulerCls.__name__ == "SelfForcingFlowMatchScheduler":
if hasattr(scheduler, "sigma_min"):
scheduler.sigma_min = 0.0
if hasattr(scheduler, "extra_one_step"):
scheduler.extra_one_step = True
if hasattr(scheduler, "set_timesteps"):
scheduler.set_timesteps(
num_inference_steps=1000,
training=True,
)
return scheduler
# ----------------------------------------------------------
# Batch preparation