Skip to content

Commit 2fa4ecf

Browse files
committed
fix fsdp to cpu
1 parent 17cc0cd commit 2fa4ecf

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

fastvideo/v1/layers/layernorm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def forward_native(
8080
# TODO(wenxuan): When using CPU offload, FSDP has a bug that doesn't unwrap DTensor in final_layer_norm.
8181
# Report this
8282
if isinstance(self.weight, DTensor):
83-
x = x * self.weight.to(x.device).full_tensor()
83+
x = x * self.weight.to_local().to(x.device)
8484
else:
8585
x = x * self.weight
8686
if residual is None:

fastvideo/v1/pipelines/stages/text_encoding.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ def forward(
107107
batch.negative_attention_mask.append(
108108
negative_attention_mask)
109109

110-
if fastvideo_args.text_encoder_offload:
111-
text_encoder.to('cpu')
112-
113110
return batch
114111

115112
def verify_input(self, batch: ForwardBatch,

0 commit comments

Comments
 (0)