finetune ¶
Supervised finetuning method (algorithm layer).
Classes¶
fastvideo.train.methods.fine_tuning.finetune.FineTuneMethod ¶
Bases: TrainingMethod
Supervised finetuning: only student participates.
Source code in fastvideo/train/methods/fine_tuning/finetune.py
Methods:¶
fastvideo.train.methods.fine_tuning.finetune.FineTuneMethod.backward ¶
backward(loss_map: dict[str, Tensor], outputs: dict[str, Any], *, grad_accum_rounds: int = 1) -> None
Backpropagate an accumulation-scaled loss through the student model.
Delegating to ModelBase.backward lets each model restore its forward context before the distributed wrapper synchronizes parameter gradients.
Source code in fastvideo/train/methods/fine_tuning/finetune.py
fastvideo.train.methods.fine_tuning.finetune.FineTuneMethod.single_train_step ¶
single_train_step(batch: dict[str, Any], iteration: int) -> tuple[dict[str, Tensor], dict[str, Any], dict[str, LogScalar]]
Prepare synchronized targets and compute supervised flow loss.
The returned forward context lets model-specific backward methods restore activation-checkpoint metadata during recomputation.