diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-14 06:52:23 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-14 07:14:59 +0000 |
commit | b7e0d4a7e171ee1cef73684b8423fe4a20ca7e34 (patch) | |
tree | d82a09ca6eb9ff8c7bcd605f62a636cddbb377d4 /modules/xpu_specific.py | |
parent | 5cb1ce470df8332872af3dfa1067b761062d4608 (diff) | |
download | stable-diffusion-webui-gfx803-b7e0d4a7e171ee1cef73684b8423fe4a20ca7e34.tar.gz stable-diffusion-webui-gfx803-b7e0d4a7e171ee1cef73684b8423fe4a20ca7e34.tar.bz2 stable-diffusion-webui-gfx803-b7e0d4a7e171ee1cef73684b8423fe4a20ca7e34.zip |
Merge pull request #14229 from Nuullll/ipex-embedding
[IPEX] Fix embedding and ControlNet
Diffstat (limited to 'modules/xpu_specific.py')
-rw-r--r-- | modules/xpu_specific.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/xpu_specific.py b/modules/xpu_specific.py index d933c790..d8da94a0 100644 --- a/modules/xpu_specific.py +++ b/modules/xpu_specific.py @@ -48,3 +48,12 @@ if has_xpu: CondFunc('torch.nn.modules.conv.Conv2d.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) + CondFunc('torch.bmm', + lambda orig_func, input, mat2, out=None: orig_func(input.to(mat2.dtype), mat2, out=out), + lambda orig_func, input, mat2, out=None: input.dtype != mat2.dtype) + CondFunc('torch.cat', + lambda orig_func, tensors, dim=0, out=None: orig_func([t.to(tensors[0].dtype) for t in tensors], dim=dim, out=out), + lambda orig_func, tensors, dim=0, out=None: not all(t.dtype == tensors[0].dtype for t in tensors)) + CondFunc('torch.nn.functional.scaled_dot_product_attention', + lambda orig_func, query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False: orig_func(query, key.to(query.dtype), value.to(query.dtype), attn_mask, dropout_p, is_causal), + lambda orig_func, query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False: query.dtype != key.dtype or query.dtype != value.dtype) |