mmgp 3.1.1__tar.gz → 3.1.2__tar.gz

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mmgp
3
- Version: 3.1.1
3
+ Version: 3.1.2
4
4
  Summary: Memory Management for the GPU Poor
5
5
  Author-email: deepbeepmeep <deepbeepmeep@yahoo.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mmgp"
3
- version = "3.1.1"
3
+ version = "3.1.2"
4
4
  authors = [
5
5
  { name = "deepbeepmeep", email = "deepbeepmeep@yahoo.com" },
6
6
  ]
@@ -576,7 +576,7 @@ def _quantize(model_to_quantize, weights=qint8, verboseLevel = 1, threshold = 10
576
576
  if hasattr(model_to_quantize, "_quanto_map"):
577
577
  for k, entry in model_to_quantize._quanto_map.items():
578
578
  weights = entry["weights"]
579
- print(f"Model '{model_id}' is already quantized in format '{weights}'")
579
+ print(f"Model '{model_id}' is already quantized to format '{weights}'")
580
580
  return False
581
581
  print(f"Model '{model_id}' is already quantized")
582
582
  return False
@@ -680,7 +680,7 @@ def _quantize(model_to_quantize, weights=qint8, verboseLevel = 1, threshold = 10
680
680
 
681
681
  return True
682
682
 
683
- def load_loras_into_model(model, lora_path, lora_multi = None, verboseLevel = -1):
683
+ def load_loras_into_model(model, lora_path, lora_multi = None, activate_all_loras = True, verboseLevel = -1,):
684
684
  verboseLevel = _compute_verbose_level(verboseLevel)
685
685
 
686
686
  if inject_adapter_in_model == None or set_weights_and_activate_adapters == None or get_peft_kwargs == None:
@@ -731,9 +731,6 @@ def load_loras_into_model(model, lora_path, lora_multi = None, verboseLevel = -1
731
731
 
732
732
  # is_correct_format = all("lora" in key for key in state_dict.keys())
733
733
 
734
-
735
-
736
-
737
734
  # check with first key if is not in peft format
738
735
  # first_key = next(iter(state_dict.keys()))
739
736
  # if "lora_A" not in first_key:
@@ -770,7 +767,17 @@ def load_loras_into_model(model, lora_path, lora_multi = None, verboseLevel = -1
770
767
  pass
771
768
  if verboseLevel >=1:
772
769
  print(f"Lora '{path}' was loaded in model '{_get_module_name(model)}'")
773
- set_weights_and_activate_adapters(model,[ str(i) for i in range(len(lora_multi))], lora_multi)
770
+ if activate_all_loras:
771
+ set_weights_and_activate_adapters(model,[ str(i) for i in range(len(lora_multi))], lora_multi)
772
+
773
+ def activate_loras(model, lora_nos, lora_multi = None ):
774
+ if not isinstance(lora_nos, list):
775
+ lora_nos = [lora_nos]
776
+ lora_nos = [str(l) for l in lora_nos]
777
+ if lora_multi is None:
778
+ lora_multi = [1. for _ in lora_nos]
779
+ set_weights_and_activate_adapters(model, lora_nos, lora_multi)
780
+
774
781
 
775
782
  def move_loras_to_device(model, device="cpu" ):
776
783
  if hasattr( model, "_lora_loadable_modules"):
@@ -1617,7 +1624,7 @@ def profile(pipe_or_dict_of_modules, profile_no: profile_type = profile_type.Ve
1617
1624
  extraModelsToQuantize = default_extraModelsToQuantize
1618
1625
  budgets=default_budgets
1619
1626
  budgets["transformer"] = 400
1620
- asyncTransfers = False
1627
+ #asyncTransfers = False
1621
1628
  info = "You have chosen the slowest profile that requires at least 24 GB of RAM and 10 GB of VRAM."
1622
1629
  else:
1623
1630
  raise Exception("Unknown profile")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mmgp
3
- Version: 3.1.1
3
+ Version: 3.1.2
4
4
  Summary: Memory Management for the GPU Poor
5
5
  Author-email: deepbeepmeep <deepbeepmeep@yahoo.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes