mmgp 3.5.8__py3-none-any.whl → 3.5.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mmgp might be problematic. Click here for more details.

mmgp/offload.py CHANGED
@@ -1,4 +1,4 @@
1
- # ------------------ Memory Management 3.5.8 for the GPU Poor by DeepBeepMeep (mmgp)------------------
1
+ # ------------------ Memory Management 3.5.9 for the GPU Poor by DeepBeepMeep (mmgp)------------------
2
2
  #
3
3
  # This module contains multiples optimisations so that models such as Flux (and derived), Mochi, CogView, HunyuanVideo, ... can run smoothly on a 24 GB GPU limited card.
4
4
  # This a replacement for the accelerate library that should in theory manage offloading, but doesn't work properly with models that are loaded / unloaded several
@@ -671,7 +671,7 @@ def _welcome():
671
671
  if welcome_displayed:
672
672
  return
673
673
  welcome_displayed = True
674
- print(f"{BOLD}{HEADER}************ Memory Management for the GPU Poor (mmgp 3.5.8) by DeepBeepMeep ************{ENDC}{UNBOLD}")
674
+ print(f"{BOLD}{HEADER}************ Memory Management for the GPU Poor (mmgp 3.5.9) by DeepBeepMeep ************{ENDC}{UNBOLD}")
675
675
 
676
676
  def change_dtype(model, new_dtype, exclude_buffers = False):
677
677
  for submodule_name, submodule in model.named_modules():
@@ -1179,11 +1179,10 @@ def load_loras_into_model(model, lora_path, lora_multi = None, activate_all_lora
1179
1179
  loras_adapter_data[1] = lora_B.to(module.weight.dtype)
1180
1180
  else:
1181
1181
  loras_adapter_data[2] = diff_b.to(module.weight.dtype)
1182
- if rank != None:
1183
- alpha_key = k[:-len("lora_X.weight")] + "alpha"
1182
+ if rank != None and "lora" in lora_key:
1183
+ alpha_key = k[:-len(lora_key)] + "alpha"
1184
1184
  alpha = lora_alphas.get(alpha_key, None)
1185
- alpha = 1. if alpha == None else alpha / rank
1186
- loras_adapter_data[3] = alpha
1185
+ if alpha is not None: loras_adapter_data[3] = alpha / rank
1187
1186
  lora_A = lora_B = diff = diff_b = v = loras_module_data = loras_adapter_data = lora_alphas = None
1188
1187
 
1189
1188
  if len(invalid_keys) > 0:
@@ -2179,6 +2178,7 @@ class offload:
2179
2178
  scaling = self._get_lora_scaling(loras_scaling, model, active_adapter) * alpha
2180
2179
  if scaling == 0:
2181
2180
  continue
2181
+
2182
2182
  if lora_A == None:
2183
2183
  result.add_(diff_b, alpha=scaling)
2184
2184
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mmgp
3
- Version: 3.5.8
3
+ Version: 3.5.9
4
4
  Summary: Memory Management for the GPU Poor
5
5
  Author-email: deepbeepmeep <deepbeepmeep@yahoo.com>
6
6
  Requires-Python: >=3.10
@@ -15,7 +15,7 @@ Dynamic: license-file
15
15
 
16
16
 
17
17
  <p align="center">
18
- <H2>Memory Management 3.5.8 for the GPU Poor by DeepBeepMeep</H2>
18
+ <H2>Memory Management 3.5.9 for the GPU Poor by DeepBeepMeep</H2>
19
19
  </p>
20
20
 
21
21
 
@@ -0,0 +1,9 @@
1
+ __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ mmgp/__init__.py,sha256=A9qBwyQMd1M7vshSTOBnFGP1MQvS2hXmTcTCMUcmyzE,509
3
+ mmgp/offload.py,sha256=AViVBdUYDN42SnICeeTFa3K3JQ7a8rXB-eC2qPIY2yM,130347
4
+ mmgp/safetensors2.py,sha256=4nKV13qCMabnNEB1TA_ueFbfGYYmiQ9racR_C6SsGug,18693
5
+ mmgp-3.5.9.dist-info/licenses/LICENSE.md,sha256=DD-WIS0BkPoWJ_8hQO3J8hMP9K_1-dyrYv1YCbkxcDU,94
6
+ mmgp-3.5.9.dist-info/METADATA,sha256=PXpq_dDRmAQED1dTW8NKUUB_FcYb54VRqlpjqOY771Y,16309
7
+ mmgp-3.5.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ mmgp-3.5.9.dist-info/top_level.txt,sha256=waGaepj2qVfnS2yAOkaMu4r9mJaVjGbEi6AwOUogU_U,14
9
+ mmgp-3.5.9.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mmgp/__init__.py,sha256=A9qBwyQMd1M7vshSTOBnFGP1MQvS2hXmTcTCMUcmyzE,509
3
- mmgp/offload.py,sha256=Hc3h2JZIQ7rpmDB_Ozq8VM0oVqm2XEV7arJwT_AIwCI,130372
4
- mmgp/safetensors2.py,sha256=4nKV13qCMabnNEB1TA_ueFbfGYYmiQ9racR_C6SsGug,18693
5
- mmgp-3.5.8.dist-info/licenses/LICENSE.md,sha256=DD-WIS0BkPoWJ_8hQO3J8hMP9K_1-dyrYv1YCbkxcDU,94
6
- mmgp-3.5.8.dist-info/METADATA,sha256=23S2c-Z4z6_npl-w2-0hOllnw13dWhiL3dew02XEknU,16309
7
- mmgp-3.5.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- mmgp-3.5.8.dist-info/top_level.txt,sha256=waGaepj2qVfnS2yAOkaMu4r9mJaVjGbEi6AwOUogU_U,14
9
- mmgp-3.5.8.dist-info/RECORD,,
File without changes