aboutsummaryrefslogtreecommitdiffstats
path: root/extensions-builtin/Lora/network_glora.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-12-16 07:22:51 +0000
committerGitHub <noreply@github.com>2023-12-16 07:22:51 +0000
commitc121f8c31587a21020e8670664977f6f76e68905 (patch)
tree5db19664111d4264d4b018bee6557d7d6b0ec1c4 /extensions-builtin/Lora/network_glora.py
parent60186c7b9d6034ff08f4fe9e213a495b5321302d (diff)
parent8edb9144cc76b39f3d68c0407b3bb990809d1b03 (diff)
downloadstable-diffusion-webui-gfx803-c121f8c31587a21020e8670664977f6f76e68905.tar.gz
stable-diffusion-webui-gfx803-c121f8c31587a21020e8670664977f6f76e68905.tar.bz2
stable-diffusion-webui-gfx803-c121f8c31587a21020e8670664977f6f76e68905.zip
Merge pull request #14031 from AUTOMATIC1111/test-fp8
A big improvement for dtype casting system with fp8 storage type and manual cast
Diffstat (limited to 'extensions-builtin/Lora/network_glora.py')
-rw-r--r--extensions-builtin/Lora/network_glora.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions-builtin/Lora/network_glora.py b/extensions-builtin/Lora/network_glora.py
index 492d4870..efe5c681 100644
--- a/extensions-builtin/Lora/network_glora.py
+++ b/extensions-builtin/Lora/network_glora.py
@@ -22,12 +22,12 @@ class NetworkModuleGLora(network.NetworkModule):
self.w2b = weights.w["b2.weight"]
def calc_updown(self, orig_weight):
- w1a = self.w1a.to(orig_weight.device, dtype=orig_weight.dtype)
- w1b = self.w1b.to(orig_weight.device, dtype=orig_weight.dtype)
- w2a = self.w2a.to(orig_weight.device, dtype=orig_weight.dtype)
- w2b = self.w2b.to(orig_weight.device, dtype=orig_weight.dtype)
+ w1a = self.w1a.to(orig_weight.device)
+ w1b = self.w1b.to(orig_weight.device)
+ w2a = self.w2a.to(orig_weight.device)
+ w2b = self.w2b.to(orig_weight.device)
output_shape = [w1a.size(0), w1b.size(1)]
- updown = ((w2b @ w1b) + ((orig_weight @ w2a) @ w1a))
+ updown = ((w2b @ w1b) + ((orig_weight.to(dtype = w1a.dtype) @ w2a) @ w1a))
return self.finalize_updown(updown, orig_weight, output_shape)