fusion-bench 0.2.9__py3-none-any.whl → 0.2.11__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.
- fusion_bench/compat/method/__init__.py +5 -0
- fusion_bench/dataset/fer2013.py +1 -0
- fusion_bench/method/DOGE_TA/DOGE_TA.py +364 -0
- fusion_bench/method/DOGE_TA/__init__.py +2 -0
- fusion_bench/method/DOGE_TA/clip_layer_wise_adamerging.py +46 -0
- fusion_bench/method/DOGE_TA/layer_wise_adamerging.py +250 -0
- fusion_bench/method/__init__.py +22 -0
- fusion_bench/method/classification/continual_clip_finetune.py +1 -1
- fusion_bench/method/concrete_subspace/__init__.py +8 -0
- fusion_bench/method/concrete_subspace/clip_post_defense.py +744 -0
- fusion_bench/method/concrete_subspace/clip_safe_concrete_adamerging.py +832 -0
- fusion_bench/method/isotropic_merging/__init__.py +15 -0
- fusion_bench/method/isotropic_merging/iso.py +114 -0
- fusion_bench/method/isotropic_merging/iso_utils.py +176 -0
- fusion_bench/method/task_singular_vector/TSVM.py +22 -2
- fusion_bench/models/wrappers/layer_wise_fusion_doge_ta.py +531 -0
- {fusion_bench-0.2.9.dist-info → fusion_bench-0.2.11.dist-info}/METADATA +1 -1
- {fusion_bench-0.2.9.dist-info → fusion_bench-0.2.11.dist-info}/RECORD +30 -13
- {fusion_bench-0.2.9.dist-info → fusion_bench-0.2.11.dist-info}/WHEEL +1 -1
- fusion_bench_config/method/DOGE_TA/DOGE_TA.yaml +4 -0
- fusion_bench_config/method/concrete_subspace/clip_post_defense_AWM.yaml +38 -0
- fusion_bench_config/method/concrete_subspace/clip_post_defense_SAU.yaml +41 -0
- fusion_bench_config/method/concrete_subspace/clip_safe_concrete_layer_wise_adamerging.yaml +39 -0
- fusion_bench_config/method/concrete_subspace/clip_safe_concrete_task_arithmetic.yaml +40 -0
- fusion_bench_config/method/isotropic_merging/iso_c.yaml +4 -0
- fusion_bench_config/method/isotropic_merging/iso_cts.yaml +5 -0
- fusion_bench_config/method/task_singular_vector/TaskSingularVectorMerging.yaml +6 -0
- {fusion_bench-0.2.9.dist-info → fusion_bench-0.2.11.dist-info}/LICENSE +0 -0
- {fusion_bench-0.2.9.dist-info → fusion_bench-0.2.11.dist-info}/entry_points.txt +0 -0
- {fusion_bench-0.2.9.dist-info → fusion_bench-0.2.11.dist-info}/top_level.txt +0 -0
fusion_bench/method/__init__.py
CHANGED
|
@@ -53,13 +53,24 @@ _import_structure = {
|
|
|
53
53
|
"PWEMoExactParetoOptimalForCLIP",
|
|
54
54
|
],
|
|
55
55
|
"ada_svd": ["AdaSVDMergingForCLIPVisionModel"],
|
|
56
|
+
"DOGE_TA": ["DOGE_TA_Algorithm"],
|
|
56
57
|
"task_singular_vector": ["TaskSingularVectorMerging"],
|
|
58
|
+
"isotropic_merging": [
|
|
59
|
+
"ISO_C_Merge", # alias
|
|
60
|
+
"ISO_CTS_Merge", # alias
|
|
61
|
+
"IsotropicMergingInCommonAndTaskSubspace",
|
|
62
|
+
"IsotropicMergingInCommonSubspace",
|
|
63
|
+
],
|
|
57
64
|
"opcm": ["OPCMForCLIP"],
|
|
58
65
|
# plug-and-play model merging methods
|
|
59
66
|
"concrete_subspace": [
|
|
60
67
|
"ConcreteTaskArithmeticAlgorithmForCLIP",
|
|
61
68
|
"ConcreteTaskWiseAdaMergingForCLIP",
|
|
62
69
|
"ConcreteLayerWiseAdaMergingForCLIP",
|
|
70
|
+
"ConcreteSafeLayerWiseAdaMergingForCLIP",
|
|
71
|
+
"ConcreteSafeTaskWiseAdaMergingForCLIP",
|
|
72
|
+
"PostDefenseAWMAlgorithmForCLIP",
|
|
73
|
+
"PostDefenseSAUAlgorithmForCLIP",
|
|
63
74
|
],
|
|
64
75
|
# model mixing methods
|
|
65
76
|
"depth_upscaling": ["DepthUpscalingAlgorithm", "DepthUpscalingForLlama"],
|
|
@@ -107,12 +118,17 @@ if TYPE_CHECKING:
|
|
|
107
118
|
)
|
|
108
119
|
from .concrete_subspace import (
|
|
109
120
|
ConcreteLayerWiseAdaMergingForCLIP,
|
|
121
|
+
ConcreteSafeLayerWiseAdaMergingForCLIP,
|
|
122
|
+
ConcreteSafeTaskWiseAdaMergingForCLIP,
|
|
110
123
|
ConcreteTaskArithmeticAlgorithmForCLIP,
|
|
111
124
|
ConcreteTaskWiseAdaMergingForCLIP,
|
|
125
|
+
PostDefenseAWMAlgorithmForCLIP,
|
|
126
|
+
PostDefenseSAUAlgorithmForCLIP,
|
|
112
127
|
)
|
|
113
128
|
from .dare import DareSimpleAverage, DareTaskArithmetic, DareTiesMerging
|
|
114
129
|
from .dawe import DataAdaptiveWeightEnsemblingForCLIP
|
|
115
130
|
from .depth_upscaling import DepthUpscalingAlgorithm, DepthUpscalingForLlama
|
|
131
|
+
from .DOGE_TA import DOGE_TA_Algorithm
|
|
116
132
|
from .dummy import DummyAlgorithm
|
|
117
133
|
from .ensemble import (
|
|
118
134
|
MaxModelPredictorAlgorithm,
|
|
@@ -120,6 +136,12 @@ if TYPE_CHECKING:
|
|
|
120
136
|
WeightedEnsembleAlgorithm,
|
|
121
137
|
)
|
|
122
138
|
from .fisher_merging import FisherMergingForCLIPVisionModel
|
|
139
|
+
from .isotropic_merging import (
|
|
140
|
+
ISO_C_Merge,
|
|
141
|
+
ISO_CTS_Merge,
|
|
142
|
+
IsotropicMergingInCommonAndTaskSubspace,
|
|
143
|
+
IsotropicMergingInCommonSubspace,
|
|
144
|
+
)
|
|
123
145
|
from .linear import (
|
|
124
146
|
ExPOAlgorithm,
|
|
125
147
|
ExPOAlgorithmForLlama,
|
|
@@ -26,8 +26,8 @@ from fusion_bench.models.hf_clip import HFCLIPClassifier
|
|
|
26
26
|
from fusion_bench.models.linearized.linearized_model_utils import LinearizedModelWraper
|
|
27
27
|
from fusion_bench.taskpool import CLIPVisionModelTaskPool
|
|
28
28
|
from fusion_bench.utils.data import InfiniteDataLoader
|
|
29
|
-
from fusion_bench.utils.json import load_from_json, save_to_json
|
|
30
29
|
from fusion_bench.utils.fabric import seed_everything_by_time
|
|
30
|
+
from fusion_bench.utils.json import load_from_json, save_to_json
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
class ContinualImageClassificationFineTuningForCLIP(
|
|
@@ -4,3 +4,11 @@ from .clip_concrete_adamerging import (
|
|
|
4
4
|
ConcreteTaskWiseAdaMergingForCLIP,
|
|
5
5
|
)
|
|
6
6
|
from .clip_concrete_task_arithmetic import ConcreteTaskArithmeticAlgorithmForCLIP
|
|
7
|
+
from .clip_post_defense import (
|
|
8
|
+
PostDefenseAWMAlgorithmForCLIP,
|
|
9
|
+
PostDefenseSAUAlgorithmForCLIP,
|
|
10
|
+
)
|
|
11
|
+
from .clip_safe_concrete_adamerging import (
|
|
12
|
+
ConcreteSafeLayerWiseAdaMergingForCLIP,
|
|
13
|
+
ConcreteSafeTaskWiseAdaMergingForCLIP,
|
|
14
|
+
)
|