tanganke commited on
Commit
9b6b780
·
verified ·
1 Parent(s): ff9b119

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - facebook/convnext-base-224
4
+ library_name: transformers
5
+ tags:
6
+ - fusion-bench
7
+ - merge
8
+ ---
9
+ # Deep Model Fusion
10
+
11
+ Fine-tuned ResNet model on dataset emnist_letters.
12
+
13
+ ## Models Merged
14
+
15
+ This is a merged model created using [fusion-bench](https://github.com/tanganke/fusion_bench).
16
+
17
+ The following models were included in the merge:
18
+
19
+
20
+ - base model: facebook/convnext-base-224
21
+
22
+
23
+ ## Configuration
24
+
25
+ The following YAML configuration was used to produce this model:
26
+
27
+ ### Algorithm Configuration
28
+
29
+ ```yaml
30
+ _recursive_: false
31
+ _target_: fusion_bench.method.classification.image_classification_finetune.ImageClassificationFineTuning
32
+ _usage_: null
33
+ _version_: 0.2.31.dev0
34
+ dataloader_kwargs:
35
+ batch_size: 64
36
+ num_workers: 8
37
+ pin_memory: true
38
+ label_smoothing: 0
39
+ lr_scheduler: null
40
+ max_epochs: -1
41
+ max_steps: 4000
42
+ optimizer:
43
+ _target_: torch.optim.SGD
44
+ lr: 0.01
45
+ momentum: 0.9
46
+ weight_decay: 0.0001
47
+ save_interval: 1000
48
+ save_on_train_epoch_end: false
49
+ save_top_k: -1
50
+ training_data_ratio: null
51
+ ```
52
+
53
+ ### Model Pool Configuration
54
+
55
+ ```yaml
56
+ _recursive_: false
57
+ _target_: fusion_bench.modelpool.convnext_for_image_classification.ConvNextForImageClassificationPool
58
+ _usage_: null
59
+ _version_: 0.2.31.dev0
60
+ models:
61
+ _pretrained_:
62
+ config_path: facebook/convnext-base-224
63
+ dataset_name: emnist_letters
64
+ pretrained: true
65
+ test_datasets: null
66
+ train_datasets:
67
+ emnist_letters:
68
+ _target_: datasets.load_dataset
69
+ path: tanganke/emnist_letters
70
+ split: train
71
+ val_datasets:
72
+ emnist_letters:
73
+ _target_: datasets.load_dataset
74
+ path: tanganke/emnist_letters
75
+ split: test
76
+ ```
77
+
cli.log ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [2026-01-08 20:06:09,718][fusion_bench.programs.fusion_program][INFO] - Running the model fusion program.
2
+ [2026-01-08 20:06:09,722][fusion_bench.programs.fusion_program][INFO] - loading model pool
3
+ [2026-01-08 20:06:12,117][fusion_bench.programs.fusion_program][INFO] - loading method
4
+ [2026-01-08 20:06:12,180][fusion_bench.method.classification.image_classification_finetune][INFO] - Training interval: step
5
+ [2026-01-08 20:06:12,181][fusion_bench.method.classification.image_classification_finetune][INFO] - Max epochs: -1, max steps: 4000
6
+ [2026-01-08 20:06:12,182][fusion_bench.programs.fusion_program][INFO] - loading task pool
7
+ [2026-01-08 20:06:13,960][fusion_bench.method.classification.image_classification_finetune][INFO] - Number of classes for dataset emnist_letters: 26
8
+ [2026-01-08 20:06:13,972][datasets.load][WARNING] - Using the latest cached version of the dataset since tanganke/emnist_letters couldn't be found on the Hugging Face Hub (offline mode is enabled).
9
+ [2026-01-08 20:06:13,982][datasets.packaged_modules.cache.cache][WARNING] - Found the latest cached dataset configuration 'emnist-letters' at /data/dataset/datasets/tanganke___emnist_letters/emnist-letters/0.0.0/4236c26fe034bc5b23851adc00067fa87b8ac16b (last modified on Mon Jan 5 04:58:28 2026).
10
+ [2026-01-08 20:06:14,656][fusion_bench.method.classification.image_classification_finetune][INFO] - Training dataset size: 124800
11
+ [2026-01-08 20:06:14,687][datasets.load][WARNING] - Using the latest cached version of the dataset since tanganke/emnist_letters couldn't be found on the Hugging Face Hub (offline mode is enabled).
12
+ [2026-01-08 20:06:14,696][datasets.packaged_modules.cache.cache][WARNING] - Found the latest cached dataset configuration 'emnist-letters' at /data/dataset/datasets/tanganke___emnist_letters/emnist-letters/0.0.0/4236c26fe034bc5b23851adc00067fa87b8ac16b (last modified on Mon Jan 5 04:58:28 2026).
13
+ [2026-01-08 20:06:14,818][fusion_bench.method.classification.image_classification_finetune][INFO] - optimizer:
14
+ SGD (
15
+ Parameter Group 0
16
+ dampening: 0
17
+ differentiable: False
18
+ foreach: None
19
+ fused: None
20
+ lr: 0.01
21
+ maximize: False
22
+ momentum: 0.9
23
+ nesterov: False
24
+ weight_decay: 0.0001
25
+ )
26
+ [2026-01-08 20:29:04,217][fusion_bench.method.classification.image_classification_finetune][INFO] - Saving the final model to outputs/convnext-base-224/emnist_letters/batch_size=64,lr=0.01/raw_checkpoints/final
config.json ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ConvNextForImageClassification"
4
+ ],
5
+ "depths": [
6
+ 3,
7
+ 3,
8
+ 27,
9
+ 3
10
+ ],
11
+ "drop_path_rate": 0.0,
12
+ "dtype": "float32",
13
+ "hidden_act": "gelu",
14
+ "hidden_sizes": [
15
+ 128,
16
+ 256,
17
+ 512,
18
+ 1024
19
+ ],
20
+ "id2label": {
21
+ "0": "A",
22
+ "1": "B",
23
+ "2": "C",
24
+ "3": "D",
25
+ "4": "E",
26
+ "5": "F",
27
+ "6": "G",
28
+ "7": "H",
29
+ "8": "I",
30
+ "9": "J",
31
+ "10": "K",
32
+ "11": "L",
33
+ "12": "M",
34
+ "13": "N",
35
+ "14": "O",
36
+ "15": "P",
37
+ "16": "Q",
38
+ "17": "R",
39
+ "18": "S",
40
+ "19": "T",
41
+ "20": "U",
42
+ "21": "V",
43
+ "22": "W",
44
+ "23": "X",
45
+ "24": "Y",
46
+ "25": "Z"
47
+ },
48
+ "image_size": 224,
49
+ "initializer_range": 0.02,
50
+ "label2id": {
51
+ "A": 0,
52
+ "B": 1,
53
+ "C": 2,
54
+ "D": 3,
55
+ "E": 4,
56
+ "F": 5,
57
+ "G": 6,
58
+ "H": 7,
59
+ "I": 8,
60
+ "J": 9,
61
+ "K": 10,
62
+ "L": 11,
63
+ "M": 12,
64
+ "N": 13,
65
+ "O": 14,
66
+ "P": 15,
67
+ "Q": 16,
68
+ "R": 17,
69
+ "S": 18,
70
+ "T": 19,
71
+ "U": 20,
72
+ "V": 21,
73
+ "W": 22,
74
+ "X": 23,
75
+ "Y": 24,
76
+ "Z": 25
77
+ },
78
+ "layer_norm_eps": 1e-12,
79
+ "layer_scale_init_value": 1e-06,
80
+ "model_type": "convnext",
81
+ "num_channels": 3,
82
+ "num_stages": 4,
83
+ "out_features": [
84
+ "stage4"
85
+ ],
86
+ "out_indices": [
87
+ 4
88
+ ],
89
+ "patch_size": 4,
90
+ "stage_names": [
91
+ "stem",
92
+ "stage1",
93
+ "stage2",
94
+ "stage3",
95
+ "stage4"
96
+ ],
97
+ "transformers_version": "4.57.3"
98
+ }
config.yaml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ path:
2
+ root_dir: ${oc.env:FUSION_BENCH_PROJECT_ROOT,"."}
3
+ output_dir: ${.root_dir}/outputs
4
+ data_dir: ${oc.env:FUSION_BENCH_DATA_DIR,${.root_dir}/data}
5
+ cache_dir: ${oc.env:FUSION_BENCH_CACHE_DIR,${.output_dir}/cache}
6
+ log_dir: outputs/convnext-base-224/emnist_letters/batch_size=64,lr=0.01
7
+ work_dir: ${hydra:runtime.cwd}
8
+ modelpool:
9
+ _target_: fusion_bench.modelpool.ConvNextForImageClassificationPool
10
+ _recursive_: false
11
+ models:
12
+ _pretrained_:
13
+ config_path: facebook/convnext-base-224
14
+ pretrained: true
15
+ dataset_name: emnist_letters
16
+ train_datasets:
17
+ emnist_letters:
18
+ _target_: datasets.load_dataset
19
+ path: tanganke/emnist_letters
20
+ split: train
21
+ val_datasets:
22
+ emnist_letters:
23
+ _target_: datasets.load_dataset
24
+ path: tanganke/emnist_letters
25
+ split: test
26
+ test_datasets: null
27
+ method:
28
+ _target_: fusion_bench.method.classification.ImageClassificationFineTuning
29
+ max_epochs: -1
30
+ max_steps: 4000
31
+ save_top_k: -1
32
+ save_interval: 1000
33
+ save_on_train_epoch_end: false
34
+ training_data_ratio: null
35
+ label_smoothing: 0
36
+ optimizer:
37
+ _target_: torch.optim.SGD
38
+ lr: 0.01
39
+ momentum: 0.9
40
+ weight_decay: 0.0001
41
+ lr_scheduler: null
42
+ dataloader_kwargs:
43
+ batch_size: 64
44
+ num_workers: 8
45
+ pin_memory: true
46
+ taskpool:
47
+ _target_: fusion_bench.taskpool.DummyTaskPool
48
+ model_save_path: null
49
+ _target_: fusion_bench.programs.ModelFusionProgram
50
+ _recursive_: false
51
+ seed: 0
52
+ fast_dev_run: false
53
+ dry_run: false
54
+ print_config: true
55
+ print_function_call: true
56
+ merged_model_save_path: null
57
+ merged_model_save_kwargs: null
58
+ report_save_path: '{log_dir}/program_report.json'
events.out.tfevents.1767902775.pt-b7552130803b44b59bdfb04f6bb732f9-worker-0.101887.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e46a86e54b27209a56ddfef49a9d6001709ed226ab1af9b1cef53425467915b5
3
+ size 2406120
hparams.yaml ADDED
@@ -0,0 +1 @@
 
 
1
+ {}
hydra.yaml ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ hydra:
2
+ run:
3
+ dir: ${path.log_dir}
4
+ sweep:
5
+ dir: ${oc.env:FUSION_BENCH_PROJECT_ROOT,"."}/outputs/multirun/${hydra.job.config_name}/${now:%Y-%m-%d_%H-%M-%S}
6
+ subdir: ${hydra.job.num}
7
+ launcher:
8
+ _target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher
9
+ sweeper:
10
+ _target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
11
+ max_batch_size: null
12
+ params: null
13
+ help:
14
+ app_name: fusion_bench
15
+ header: == ${hydra.help.app_name} ==
16
+ footer: 'Powered by Hydra (https://hydra.cc)
17
+
18
+ Use --hydra-help to view Hydra specific help'
19
+ template: '${hydra.help.header}
20
+
21
+
22
+ fusion_bench is the command line interface for running model fusion benchmarks
23
+ in the FusionBench project.
24
+
25
+ It provides a flexible way to configure and execute various fusion algorithms
26
+ on different model pools and evaluate them across multiple tasks.
27
+
28
+
29
+ == Configuration groups ==
30
+
31
+ Compose your configuration from these groups (method, modelpool, taskpool are
32
+ the most important):
33
+
34
+
35
+ $APP_CONFIG_GROUPS
36
+
37
+
38
+ == Config ==
39
+
40
+ You can override options, for example:
41
+
42
+ fusion_bench method=task_arithmetic modelpool=clip-vit-base-patch32_svhn_and_mnist
43
+ taskpool=clip-vit-base-patch32_svhn_and_mnist
44
+
45
+
46
+ == Basic usage ==
47
+
48
+ fusion_bench [--config-path CONFIG_PATH] [--config-name CONFIG_NAME] OPTION_1=VALUE_1
49
+ OPTION_2=VALUE_2 ...
50
+
51
+
52
+ == Key options ==
53
+
54
+ --help, -h : Print this help message and exit
55
+
56
+ --hydra-help : Hydra''s help
57
+
58
+ --cfg, -c : Show config instead of running [job|hydra|all]
59
+
60
+ --config-path, -cp : Overrides the config_path
61
+
62
+ --config-name, -cn : Overrides the config_name
63
+
64
+ --shell-completion, -sc : Install or Uninstall shell completion
65
+
66
+
67
+ For more detailed information on options and usage, please refer to the online
68
+ documentation:
69
+
70
+ https://tanganke.github.io/fusion_bench/cli/fusion_bench/
71
+
72
+
73
+ ${hydra.help.footer}'
74
+ hydra_help:
75
+ template: 'Hydra (${hydra.runtime.version})
76
+
77
+ See https://hydra.cc for more info.
78
+
79
+
80
+ == Flags ==
81
+
82
+ $FLAGS_HELP
83
+
84
+
85
+ == Configuration groups ==
86
+
87
+ Compose your configuration from those groups (For example, append hydra/job_logging=disabled
88
+ to command line)
89
+
90
+
91
+ $HYDRA_CONFIG_GROUPS
92
+
93
+
94
+ Use ''--cfg hydra'' to Show the Hydra config.
95
+
96
+ '
97
+ hydra_help: ???
98
+ hydra_logging:
99
+ version: 1
100
+ formatters:
101
+ simple:
102
+ format: '[%(asctime)s][HYDRA] %(message)s'
103
+ handlers:
104
+ console:
105
+ class: logging.StreamHandler
106
+ formatter: simple
107
+ stream: ext://sys.stdout
108
+ root:
109
+ level: INFO
110
+ handlers:
111
+ - console
112
+ loggers:
113
+ logging_example:
114
+ level: DEBUG
115
+ disable_existing_loggers: false
116
+ job_logging:
117
+ version: 1
118
+ formatters:
119
+ simple:
120
+ format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
121
+ rich_handler:
122
+ format: '%(message)s'
123
+ handlers:
124
+ console:
125
+ class: rich.logging.RichHandler
126
+ formatter: rich_handler
127
+ file:
128
+ class: logging.FileHandler
129
+ formatter: simple
130
+ filename: ${hydra.runtime.output_dir}/${hydra.job.name}.log
131
+ root:
132
+ level: INFO
133
+ handlers:
134
+ - console
135
+ - file
136
+ disable_existing_loggers: false
137
+ env: {}
138
+ mode: RUN
139
+ searchpath: []
140
+ callbacks: {}
141
+ output_subdir: ''
142
+ overrides:
143
+ hydra:
144
+ - hydra.mode=RUN
145
+ task:
146
+ - path.log_dir="outputs/convnext-base-224/emnist_letters/batch_size=64,lr=0.01"
147
+ - seed=0
148
+ - method=classification/image_classification_finetune
149
+ - method.max_epochs=-1
150
+ - method.max_steps=4000
151
+ - method.save_top_k=-1
152
+ - method.save_interval=1000
153
+ - method.save_on_train_epoch_end=false
154
+ - method.optimizer.lr=0.01
155
+ - method.lr_scheduler=null
156
+ - method.dataloader_kwargs.batch_size=64
157
+ - modelpool=ConvNextForImageClassification/convnext-base-224
158
+ - modelpool.models._pretrained_.dataset_name=emnist_letters
159
+ - +dataset/image_classification/train@modelpool.train_datasets=emnist_letters
160
+ - +dataset/image_classification/test@modelpool.val_datasets=emnist_letters
161
+ job:
162
+ name: cli
163
+ chdir: null
164
+ override_dirname: +dataset/image_classification/test@modelpool.val_datasets=emnist_letters,+dataset/image_classification/train@modelpool.train_datasets=emnist_letters,method.dataloader_kwargs.batch_size=64,method.lr_scheduler=null,method.max_epochs=-1,method.max_steps=4000,method.optimizer.lr=0.01,method.save_interval=1000,method.save_on_train_epoch_end=false,method.save_top_k=-1,method=classification/image_classification_finetune,modelpool.models._pretrained_.dataset_name=emnist_letters,modelpool=ConvNextForImageClassification/convnext-base-224,path.log_dir="outputs/convnext-base-224/emnist_letters/batch_size=64,lr=0.01",seed=0
165
+ id: ???
166
+ num: ???
167
+ config_name: model_fusion
168
+ env_set:
169
+ HYDRA_FULL_ERROR: ${oc.env:HYDRA_FULL_ERROR,1}
170
+ env_copy: []
171
+ config:
172
+ override_dirname:
173
+ kv_sep: '='
174
+ item_sep: ','
175
+ exclude_keys: []
176
+ runtime:
177
+ version: 1.3.2
178
+ version_base: '1.3'
179
+ cwd: /data/users/anke/fusion_bench
180
+ config_sources:
181
+ - path: hydra.conf
182
+ schema: pkg
183
+ provider: hydra
184
+ - path: /data/users/anke/fusion_bench/config
185
+ schema: file
186
+ provider: main
187
+ - path: ''
188
+ schema: structured
189
+ provider: schema
190
+ output_dir: /data/users/anke/fusion_bench/outputs/convnext-base-224/emnist_letters/batch_size=64,lr=0.01
191
+ choices:
192
+ dataset/image_classification/test@modelpool.val_datasets: emnist_letters
193
+ dataset/image_classification/train@modelpool.train_datasets: emnist_letters
194
+ taskpool: dummy
195
+ method: classification/image_classification_finetune
196
+ modelpool: ConvNextForImageClassification/convnext-base-224
197
+ path: default
198
+ hydra: default
199
+ hydra/env: default
200
+ hydra/callbacks: null
201
+ hydra/job_logging: rich_logging
202
+ hydra/hydra_logging: default
203
+ hydra/hydra_help: default
204
+ hydra/help: fusion_bench_help
205
+ hydra/sweeper: basic
206
+ hydra/launcher: basic
207
+ hydra/output: default
208
+ verbose: false
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73b1109ca51d01400419806a0192054b97d126c40e5e6e7f95bb9dfd00c92b2b
3
+ size 350413648
overrides.yaml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ - path.log_dir="outputs/convnext-base-224/emnist_letters/batch_size=64,lr=0.01"
2
+ - seed=0
3
+ - method=classification/image_classification_finetune
4
+ - method.max_epochs=-1
5
+ - method.max_steps=4000
6
+ - method.save_top_k=-1
7
+ - method.save_interval=1000
8
+ - method.save_on_train_epoch_end=false
9
+ - method.optimizer.lr=0.01
10
+ - method.lr_scheduler=null
11
+ - method.dataloader_kwargs.batch_size=64
12
+ - modelpool=ConvNextForImageClassification/convnext-base-224
13
+ - modelpool.models._pretrained_.dataset_name=emnist_letters
14
+ - +dataset/image_classification/train@modelpool.train_datasets=emnist_letters
15
+ - +dataset/image_classification/test@modelpool.val_datasets=emnist_letters
preprocessor_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_pct": 0.875,
3
+ "do_normalize": true,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "image_mean": [
7
+ 0.485,
8
+ 0.456,
9
+ 0.406
10
+ ],
11
+ "image_processor_type": "ConvNextImageProcessor",
12
+ "image_std": [
13
+ 0.229,
14
+ 0.224,
15
+ 0.225
16
+ ],
17
+ "resample": 3,
18
+ "rescale_factor": 0.00392156862745098,
19
+ "size": {
20
+ "shortest_edge": 224
21
+ }
22
+ }
program_report.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"model_info": {"trainable_params": 87593114, "all_params": 87593114, "trainable_percentage": 1.0}}