Skip to content

test_wan_finetune

Per-method GPU smoke test: WanModel + FineTuneMethod.

Establishes the per-method test pattern for fastvideo/train:

  1. Instantiate the model + method via their public constructors (no Trainer setup, no FSDP wrapping).
  2. Feed a synthetic raw_batch dict through method.single_train_step() + method.backward().
  3. Assert that the loss is finite and that the first transformer block received a finite, non-zero gradient.

The first block's gradient is the last one computed during backprop, so a healthy grad there implies the full forward + chain-rule path is intact. Keeping the assertion to a single block keeps the reference surface tiny — a later PR layers a device-keyed grad-norm regression on top of this same harness.

Classes

Functions