Fallback to regular op when fp8 op throws exception. (#8761)

This commit is contained in:
comfyanonymous 2025-07-01 21:57:13 -07:00 committed by GitHub
parent 79ed752748
commit 111f583e00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -336,9 +336,12 @@ class fp8_ops(manual_cast):
return None
def forward_comfy_cast_weights(self, input):
out = fp8_linear(self, input)
if out is not None:
return out
try:
out = fp8_linear(self, input)
if out is not None:
return out
except Exception as e:
logging.info("Exception during fp8 op: {}".format(e))
weight, bias = cast_bias_weight(self, input)
return torch.nn.functional.linear(input, weight, bias)