Skip to content

Commit 111f583

Browse files
Fallback to regular op when fp8 op throws exception. (comfyanonymous#8761)
1 parent 79ed752 commit 111f583

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

comfy/ops.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,12 @@ def reset_parameters(self):
336336
return None
337337

338338
def forward_comfy_cast_weights(self, input):
339-
out = fp8_linear(self, input)
340-
if out is not None:
341-
return out
339+
try:
340+
out = fp8_linear(self, input)
341+
if out is not None:
342+
return out
343+
except Exception as e:
344+
logging.info("Exception during fp8 op: {}".format(e))
342345

343346
weight, bias = cast_bias_weight(self, input)
344347
return torch.nn.functional.linear(input, weight, bias)

0 commit comments

Comments
 (0)