Skip to content

Commit 19dc242

Browse files
committed
fix fsdp to cpu
1 parent 79bb061 commit 19dc242

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
@@ -74,7 +74,7 @@ def forward_native(
7474
# TODO(wenxuan): When using CPU offload, FSDP has a bug that doesn't unwrap DTensor in final_layer_norm.
7575
# Report this
7676
if isinstance(self.weight, DTensor):
77-
x = x * self.weight.to(x.device).full_tensor()
77+
x = x * self.weight.to_local().to(x.device)
7878
else:
7979
x = x * self.weight
8080
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)