mmgp 3.1.1__py3-none-any.whl → 3.1.2__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 +14 -7
- {mmgp-3.1.1.dist-info → mmgp-3.1.2.dist-info}/METADATA +1 -1
- mmgp-3.1.2.dist-info/RECORD +9 -0
- mmgp-3.1.1.dist-info/RECORD +0 -9
- {mmgp-3.1.1.dist-info → mmgp-3.1.2.dist-info}/LICENSE.md +0 -0
- {mmgp-3.1.1.dist-info → mmgp-3.1.2.dist-info}/WHEEL +0 -0
- {mmgp-3.1.1.dist-info → mmgp-3.1.2.dist-info}/top_level.txt +0 -0
mmgp/offload.py
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
mmgp/__init__.py,sha256=A9qBwyQMd1M7vshSTOBnFGP1MQvS2hXmTcTCMUcmyzE,509
|
|
3
|
+
mmgp/offload.py,sha256=4CuoGrviBgNfKWD87JIK4FCSAV4hjWI85Ta3mL2v1Mw,69958
|
|
4
|
+
mmgp/safetensors2.py,sha256=OkJAvENfWeb-PL0FcxS1-eYeHLbemTaNXYvNxURrzIs,16154
|
|
5
|
+
mmgp-3.1.2.dist-info/LICENSE.md,sha256=HjzvY2grdtdduZclbZ46B2M-XpT4MDCxFub5ZwTWq2g,93
|
|
6
|
+
mmgp-3.1.2.dist-info/METADATA,sha256=j938ccarHciRswKcyiMobN2M1ACrpZZPXSXjr-4Hjdk,12708
|
|
7
|
+
mmgp-3.1.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
8
|
+
mmgp-3.1.2.dist-info/top_level.txt,sha256=waGaepj2qVfnS2yAOkaMu4r9mJaVjGbEi6AwOUogU_U,14
|
|
9
|
+
mmgp-3.1.2.dist-info/RECORD,,
|
mmgp-3.1.1.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
mmgp/__init__.py,sha256=A9qBwyQMd1M7vshSTOBnFGP1MQvS2hXmTcTCMUcmyzE,509
|
|
3
|
-
mmgp/offload.py,sha256=h74eKyWVZmDM--l4KbiZYXdpkcGM8ySUgyvkFtFRtNQ,69593
|
|
4
|
-
mmgp/safetensors2.py,sha256=OkJAvENfWeb-PL0FcxS1-eYeHLbemTaNXYvNxURrzIs,16154
|
|
5
|
-
mmgp-3.1.1.dist-info/LICENSE.md,sha256=HjzvY2grdtdduZclbZ46B2M-XpT4MDCxFub5ZwTWq2g,93
|
|
6
|
-
mmgp-3.1.1.dist-info/METADATA,sha256=wtHNzulNFaWmruVO4cGgcRuIIN2eHPHo47nkgGMOWqw,12708
|
|
7
|
-
mmgp-3.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
8
|
-
mmgp-3.1.1.dist-info/top_level.txt,sha256=waGaepj2qVfnS2yAOkaMu4r9mJaVjGbEi6AwOUogU_U,14
|
|
9
|
-
mmgp-3.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|