mmgp 3.2.8__py3-none-any.whl → 3.3.0__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.2.8 for the GPU Poor by DeepBeepMeep (mmgp)------------------
1
+ # ------------------ Memory Management 3.3.0 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
@@ -882,10 +882,11 @@ def load_loras_into_model(model, lora_path, lora_multi = None, activate_all_lora
882
882
  return source + CrLf + text
883
883
 
884
884
  def trunc(text, sz):
885
+ text = str(text)
885
886
  if len(text) < sz:
886
- return str(text)
887
+ return text
887
888
  else:
888
- return str(text)[0:sz] + '...'
889
+ return text[0:sz] + '...'
889
890
 
890
891
  if not isinstance(lora_path, list):
891
892
  lora_path = [lora_path]
@@ -1408,7 +1409,9 @@ def extract_models(obj = None, prefix = None):
1408
1409
  elif prefix[ -1:] != "/":
1409
1410
  prefix + "/"
1410
1411
 
1411
- for name in dir(obj):
1412
+ for name in dir(obj):
1413
+ if name in ["_execution_device"]:
1414
+ continue
1412
1415
  element = getattr(obj,name)
1413
1416
  if name in ("pipeline", "pipe"):
1414
1417
  pipeline = element
@@ -1550,7 +1553,7 @@ class offload:
1550
1553
  lora_A, lora_B, alpha = lora_data
1551
1554
  key = adapter + '_GPU'
1552
1555
  if to_GPU:
1553
- lora_module[key] = [lora_A.cuda(), lora_B.cuda(), alpha]
1556
+ lora_module[key] = [lora_A.cuda(non_blocking=True), lora_B.cuda(non_blocking=True), alpha]
1554
1557
  elif key in lora_module:
1555
1558
  del lora_module[key]
1556
1559
 
@@ -1594,8 +1597,8 @@ class offload:
1594
1597
  lora_data = loras_model_data.get(parent_module, None)
1595
1598
  if lora_data != None:
1596
1599
  loras_modules[parent_module]= lora_data
1597
- if len(loras_modules) > 0:
1598
- self._move_loras(loras_active_adapters, loras_modules, True)
1600
+ if len(loras_modules) > 0:
1601
+ self._move_loras(loras_active_adapters, loras_modules, True)
1599
1602
 
1600
1603
  loaded_block = self.loaded_blocks[model_id]
1601
1604
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: mmgp
3
- Version: 3.2.8
3
+ Version: 3.3.0
4
4
  Summary: Memory Management for the GPU Poor
5
5
  Author-email: deepbeepmeep <deepbeepmeep@yahoo.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -13,10 +13,11 @@ Requires-Dist: optimum-quanto
13
13
  Requires-Dist: accelerate
14
14
  Requires-Dist: safetensors
15
15
  Requires-Dist: psutil
16
+ Dynamic: license-file
16
17
 
17
18
 
18
19
  <p align="center">
19
- <H2>Memory Management 3.2.8 for the GPU Poor by DeepBeepMeep</H2>
20
+ <H2>Memory Management 3.3.0 for the GPU Poor by DeepBeepMeep</H2>
20
21
  </p>
21
22
 
22
23
 
@@ -0,0 +1,9 @@
1
+ __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ mmgp/__init__.py,sha256=A9qBwyQMd1M7vshSTOBnFGP1MQvS2hXmTcTCMUcmyzE,509
3
+ mmgp/offload.py,sha256=xdlYbB8nKUywAAMPcfCzJmCxYHvBB5vcZgv2wEQTtbE,105329
4
+ mmgp/safetensors2.py,sha256=DCdlRH3769CTyraAmWAB3b0XrVua7z6ygQ-OyKgJN6A,16453
5
+ mmgp-3.3.0.dist-info/licenses/LICENSE.md,sha256=HjzvY2grdtdduZclbZ46B2M-XpT4MDCxFub5ZwTWq2g,93
6
+ mmgp-3.3.0.dist-info/METADATA,sha256=33eB_YmC6PciTkzi_Z_gsWWzoz6RJgyLbEItFatVghk,16153
7
+ mmgp-3.3.0.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
8
+ mmgp-3.3.0.dist-info/top_level.txt,sha256=waGaepj2qVfnS2yAOkaMu4r9mJaVjGbEi6AwOUogU_U,14
9
+ mmgp-3.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.1.0)
2
+ Generator: setuptools (77.0.3)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,9 +0,0 @@
1
- __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- mmgp/__init__.py,sha256=A9qBwyQMd1M7vshSTOBnFGP1MQvS2hXmTcTCMUcmyzE,509
3
- mmgp/offload.py,sha256=Wwk3uV3ZJv3ApyX-vpzukOllkBOTkLwGm5qDadmqVqQ,105209
4
- mmgp/safetensors2.py,sha256=DCdlRH3769CTyraAmWAB3b0XrVua7z6ygQ-OyKgJN6A,16453
5
- mmgp-3.2.8.dist-info/LICENSE.md,sha256=HjzvY2grdtdduZclbZ46B2M-XpT4MDCxFub5ZwTWq2g,93
6
- mmgp-3.2.8.dist-info/METADATA,sha256=_3nE_8-UHpItfJsJsb4KUIs_WdROc68SCTNTP5lj_ho,16131
7
- mmgp-3.2.8.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
8
- mmgp-3.2.8.dist-info/top_level.txt,sha256=waGaepj2qVfnS2yAOkaMu4r9mJaVjGbEi6AwOUogU_U,14
9
- mmgp-3.2.8.dist-info/RECORD,,