1
mirror of https://github.com/comfyanonymous/ComfyUI.git synced 2025-08-02 15:04:50 +08:00

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

View File

@@ -336,9 +336,12 @@ class fp8_ops(manual_cast):
return None return None
def forward_comfy_cast_weights(self, input): def forward_comfy_cast_weights(self, input):
out = fp8_linear(self, input) try:
if out is not None: out = fp8_linear(self, input)
return out 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) weight, bias = cast_bias_weight(self, input)
return torch.nn.functional.linear(input, weight, bias) return torch.nn.functional.linear(input, weight, bias)