fastvideo.v1.training.training_pipeline
#
Module Contents#
Classes#
A pipeline for training a model. All training pipelines should inherit from this class. All reusable components and code should be implemented in this class. |
Data#
API#
- class fastvideo.v1.training.training_pipeline.TrainingPipeline(model_path: str, fastvideo_args: fastvideo.v1.fastvideo_args.FastVideoArgs, config: Optional[Dict[str, Any]] = None, required_config_modules: Optional[List[str]] = None)[source]#
Bases:
fastvideo.v1.pipelines.ComposedPipelineBase
,abc.ABC
A pipeline for training a model. All training pipelines should inherit from this class. All reusable components and code should be implemented in this class.
Initialization
Initialize the pipeline. After init, the pipeline should be ready to use. The pipeline should be stateless and not hold any batch state.
- create_pipeline_stages(fastvideo_args: fastvideo.v1.fastvideo_args.FastVideoArgs)[source]#
- gradient_check_parameters(transformer, latents, encoder_hidden_states, encoder_attention_mask, timesteps, target, eps=0.05, max_params_to_check=2000) float [source]#
Verify gradients using finite differences for FSDP models with GRADIENT_CHECK_DTYPE. Uses standard tolerances for GRADIENT_CHECK_DTYPE precision.
- initialize_training_pipeline(training_args: fastvideo.v1.fastvideo_args.TrainingArgs)[source]#
- abstract initialize_validation_pipeline(training_args: fastvideo.v1.fastvideo_args.TrainingArgs)[source]#
- setup_gradient_check(args, loader_iter, noise_scheduler, noise_random_generator) float | None [source]#
Setup and perform gradient check on a fresh batch.
- Parameters:
args β Training arguments
loader_iter β Data loader iterator
noise_scheduler β Noise scheduler for diffusion
noise_random_generator β Random number generator for noise
- Returns:
Maximum gradient error or None if check is disabled/fails
- Return type:
float or None