mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-14 10:30:05 +08:00
Fix fp8 model training
This commit is contained in:
parent
eea608e48f
commit
4a976adcd7
13
comfy/ops.py
13
comfy/ops.py
@ -336,12 +336,13 @@ class fp8_ops(manual_cast):
|
||||
return None
|
||||
|
||||
def forward_comfy_cast_weights(self, input):
|
||||
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))
|
||||
if not self.training:
|
||||
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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user