mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
IPEX fix hypernetwork training
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import torch
|
||||
import intel_extension_for_pytorch as ipex
|
||||
import torch.nn.functional as F
|
||||
import diffusers #1.19.3
|
||||
import diffusers #0.20.2
|
||||
|
||||
Attention = diffusers.models.attention_processor.Attention
|
||||
|
||||
|
||||
@@ -90,6 +90,10 @@ def ipex_hijacks():
|
||||
CondFunc('torch.nn.modules.GroupNorm.forward',
|
||||
lambda orig_func, self, input: orig_func(self, input.to(self.weight.data.dtype)),
|
||||
lambda orig_func, self, input: input.dtype != self.weight.data.dtype)
|
||||
#Hypernetwork training:
|
||||
CondFunc('torch.nn.modules.linear.Linear.forward',
|
||||
lambda orig_func, self, input: orig_func(self, input.to(self.weight.data.dtype)),
|
||||
lambda orig_func, self, input: input.dtype != self.weight.data.dtype)
|
||||
#Embedding FP32:
|
||||
CondFunc('torch.bmm',
|
||||
lambda orig_func, input, mat2, *args, **kwargs: orig_func(input, mat2.to(input.dtype), *args, **kwargs),
|
||||
|
||||
Reference in New Issue
Block a user