Skip to content

Commit e7de7d8

Browse files
authored
[wan] fix layerwise upcasting tests on CPU (#13039)
up
1 parent a2ea45a commit e7de7d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/diffusers/models/transformers/transformer_wan_animate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ def forward(self, face_image: torch.Tensor, channel_dim: int = 1) -> torch.Tenso
340340
weight = self.motion_synthesis_weight + 1e-8
341341
# Upcast the QR orthogonalization operation to FP32
342342
original_motion_dtype = motion_feat.dtype
343-
motion_feat = motion_feat.to(weight.dtype)
343+
motion_feat = motion_feat.to(torch.float32)
344+
weight = weight.to(torch.float32)
344345

345346
Q = torch.linalg.qr(weight)[0].to(device=motion_feat.device)
346347

0 commit comments

Comments
 (0)