From dcf7738cbc5bee7e80ce3102792b0615c40d59e7 Mon Sep 17 00:00:00 2001 From: William Lin Date: Sat, 31 May 2025 22:06:29 -0700 Subject: [PATCH] [Misc] disable cast_forward_inputs (#460) --- fastvideo/v1/models/loader/fsdp_load.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fastvideo/v1/models/loader/fsdp_load.py b/fastvideo/v1/models/loader/fsdp_load.py index 6e0cd0a75..07fc7ab75 100644 --- a/fastvideo/v1/models/loader/fsdp_load.py +++ b/fastvideo/v1/models/loader/fsdp_load.py @@ -102,10 +102,12 @@ def load_fsdp_model( output_dtype: Optional[torch.dtype] = None, ) -> torch.nn.Module: + # NOTE(will): cast_forward_inputs=True shouldn't be needed as we are + # manually casting the inputs to the model mp_policy = MixedPrecisionPolicy(param_dtype, reduce_dtype, output_dtype, - cast_forward_inputs=True) + cast_forward_inputs=False) with set_default_dtype(default_dtype), torch.device("meta"): model = model_cls(**init_params)