diffusion in fp8 landed

This commit is contained in:
lllyasviel
2024-08-06 16:47:39 -07:00
committed by GitHub
parent dd8997ee2e
commit 71c94799d1
7 changed files with 96 additions and 46 deletions

View File

@@ -171,3 +171,10 @@ def using_forge_operations(parameters_manual_cast=False, operations=None):
for op_name in op_names:
setattr(torch.nn, op_name, backups[op_name])
return
def shift_manual_cast(model, enabled):
for m in model.modules():
if hasattr(m, 'parameters_manual_cast'):
m.parameters_manual_cast = enabled
return