Upload folder using huggingface_hub

#32
This view is limited to 50 files because it contains too many changes.  See the raw diff here.
Files changed (50) hide show
  1. .gitattributes +7 -0
  2. sft/smoe_refine_665k_llava/added_tokens.json +13 -0
  3. sft/smoe_refine_665k_llava/checkpoint-13312/0409_1627_llava...u_val_llava_model_args_029179/mmmu_val.json +0 -0
  4. sft/smoe_refine_665k_llava/checkpoint-13312/0409_1627_llava...u_val_llava_model_args_029179/rank0_metric_eval_done.txt +1 -0
  5. sft/smoe_refine_665k_llava/checkpoint-13312/0409_1627_llava...u_val_llava_model_args_029179/results.json +66 -0
  6. sft/smoe_refine_665k_llava/checkpoint-13312/added_tokens.json +13 -0
  7. sft/smoe_refine_665k_llava/checkpoint-13312/config.json +200 -0
  8. sft/smoe_refine_665k_llava/checkpoint-13312/generation_config.json +12 -0
  9. sft/smoe_refine_665k_llava/checkpoint-13312/latest +1 -0
  10. sft/smoe_refine_665k_llava/checkpoint-13312/model-00001-of-00003.safetensors +3 -0
  11. sft/smoe_refine_665k_llava/checkpoint-13312/model-00002-of-00003.safetensors +3 -0
  12. sft/smoe_refine_665k_llava/checkpoint-13312/model-00003-of-00003.safetensors +3 -0
  13. sft/smoe_refine_665k_llava/checkpoint-13312/model.safetensors.index.json +0 -0
  14. sft/smoe_refine_665k_llava/checkpoint-13312/rng_state_0.pth +3 -0
  15. sft/smoe_refine_665k_llava/checkpoint-13312/rng_state_1.pth +3 -0
  16. sft/smoe_refine_665k_llava/checkpoint-13312/rng_state_2.pth +3 -0
  17. sft/smoe_refine_665k_llava/checkpoint-13312/rng_state_3.pth +3 -0
  18. sft/smoe_refine_665k_llava/checkpoint-13312/special_tokens_map.json +24 -0
  19. sft/smoe_refine_665k_llava/checkpoint-13312/tokenizer.model +3 -0
  20. sft/smoe_refine_665k_llava/checkpoint-13312/tokenizer_config.json +132 -0
  21. sft/smoe_refine_665k_llava/checkpoint-13312/trainer_state.json +0 -0
  22. sft/smoe_refine_665k_llava/checkpoint-13312/training_args.bin +3 -0
  23. sft/smoe_refine_665k_llava/checkpoint-13312/zero_to_fp32.py +604 -0
  24. sft/smoe_refine_665k_llava/checkpoint-16632/added_tokens.json +13 -0
  25. sft/smoe_refine_665k_llava/checkpoint-16632/config.json +200 -0
  26. sft/smoe_refine_665k_llava/checkpoint-16632/generation_config.json +12 -0
  27. sft/smoe_refine_665k_llava/checkpoint-16632/latest +1 -0
  28. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/mmerealworld_lite.json +3 -0
  29. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/ocrbench.json +0 -0
  30. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/pope.json +3 -0
  31. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/rank0_metric_eval_done.txt +1 -0
  32. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/rank1_metric_eval_done.txt +1 -0
  33. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/rank2_metric_eval_done.txt +1 -0
  34. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/rank3_metric_eval_done.txt +1 -0
  35. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/results.json +257 -0
  36. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/results/ocrbench_results.txt +18 -0
  37. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/submissions/textvqa_submission_2025-04-09-17-19-18.json +0 -0
  38. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/textvqa_val.json +3 -0
  39. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/ai2d.json +0 -0
  40. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/mmbench_en_dev.json +3 -0
  41. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/mmmu_val.json +0 -0
  42. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/mmstar.json +0 -0
  43. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/rank0_metric_eval_done.txt +1 -0
  44. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/rank1_metric_eval_done.txt +1 -0
  45. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/rank2_metric_eval_done.txt +1 -0
  46. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/rank3_metric_eval_done.txt +1 -0
  47. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/results.json +298 -0
  48. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/submissions/mmbench_en_dev_results.json +1 -0
  49. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/submissions/mmbench_en_dev_results.xlsx +3 -0
  50. sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1843_llava...image_llava_model_args_7bd459/rank1_metric_eval_done.txt +1 -0
.gitattributes CHANGED
@@ -33,3 +33,10 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/mmerealworld_lite.json filter=lfs diff=lfs merge=lfs -text
37
+ sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/pope.json filter=lfs diff=lfs merge=lfs -text
38
+ sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/textvqa_val.json filter=lfs diff=lfs merge=lfs -text
39
+ sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/mmbench_en_dev.json filter=lfs diff=lfs merge=lfs -text
40
+ sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/submissions/mmbench_en_dev_results.xlsx filter=lfs diff=lfs merge=lfs -text
41
+ sft/smoe_refine_665k_llava/checkpoint-3328/logs/0409_1820_llava...mstar_llava_model_args_b94fe7/mmbench_en_dev.json filter=lfs diff=lfs merge=lfs -text
42
+ sft/smoe_refine_665k_llava/checkpoint-3328/logs/0409_1820_llava...mstar_llava_model_args_b94fe7/submissions/mmbench_en_dev_results.xlsx filter=lfs diff=lfs merge=lfs -text
sft/smoe_refine_665k_llava/added_tokens.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|assistant|>": 32001,
3
+ "<|endoftext|>": 32000,
4
+ "<|end|>": 32007,
5
+ "<|placeholder1|>": 32002,
6
+ "<|placeholder2|>": 32003,
7
+ "<|placeholder3|>": 32004,
8
+ "<|placeholder4|>": 32005,
9
+ "<|placeholder5|>": 32008,
10
+ "<|placeholder6|>": 32009,
11
+ "<|system|>": 32006,
12
+ "<|user|>": 32010
13
+ }
sft/smoe_refine_665k_llava/checkpoint-13312/0409_1627_llava...u_val_llava_model_args_029179/mmmu_val.json ADDED
The diff for this file is too large to render. See raw diff
 
sft/smoe_refine_665k_llava/checkpoint-13312/0409_1627_llava...u_val_llava_model_args_029179/rank0_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 0 eval done
sft/smoe_refine_665k_llava/checkpoint-13312/0409_1627_llava...u_val_llava_model_args_029179/results.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "results": {
3
+ "mmmu_val": {
4
+ "mmmu_acc,none": 0.42333,
5
+ "mmmu_acc_stderr,none": "N/A",
6
+ "alias": "mmmu_val"
7
+ }
8
+ },
9
+ "configs": {
10
+ "mmmu_val": {
11
+ "task": "mmmu_val",
12
+ "dataset_path": "lmms-lab/MMMU",
13
+ "test_split": "validation",
14
+ "doc_to_visual": "<function mmmu_doc_to_visual at 0x7f2d4c033820>",
15
+ "doc_to_text": "<function mmmu_doc_to_text at 0x7f2d4bfb94c0>",
16
+ "doc_to_target": "answer",
17
+ "process_results": "<function mmmu_process_results at 0x7f2d4be73310>",
18
+ "description": "",
19
+ "target_delimiter": " ",
20
+ "fewshot_delimiter": "\n\n",
21
+ "metric_list": [
22
+ {
23
+ "metric": "mmmu_acc",
24
+ "aggregation": "<function mmmu_aggregate_results at 0x7f2d4be371f0>",
25
+ "higher_is_better": true
26
+ }
27
+ ],
28
+ "output_type": "generate_until",
29
+ "generation_kwargs": {
30
+ "max_new_tokens": 128,
31
+ "until": [
32
+ "\n\n"
33
+ ],
34
+ "image_aspect_ratio": "original"
35
+ },
36
+ "repeats": 1,
37
+ "should_decontaminate": false,
38
+ "metadata": [
39
+ {
40
+ "version": 0.0
41
+ }
42
+ ],
43
+ "model_specific_generation_kwargs": {
44
+ "llava": {
45
+ "image_aspect_ratio": "original"
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "versions": {
51
+ "mmmu_val": "Yaml"
52
+ },
53
+ "n-shot": {
54
+ "mmmu_val": 0
55
+ },
56
+ "model_configs": {
57
+ "model": "llava",
58
+ "model_args": "pretrained=/cm/archive/namnv78/checkpoints/Xphi35-siglip224/sft/SMOE/Full_smoe/checkpoint-13312,conv_template=phi35",
59
+ "batch_size": "1",
60
+ "device": null,
61
+ "limit": null,
62
+ "bootstrap_iters": 100000,
63
+ "gen_kwargs": ""
64
+ },
65
+ "git_hash": "bf33b90"
66
+ }
sft/smoe_refine_665k_llava/checkpoint-13312/added_tokens.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|assistant|>": 32001,
3
+ "<|endoftext|>": 32000,
4
+ "<|end|>": 32007,
5
+ "<|placeholder1|>": 32002,
6
+ "<|placeholder2|>": 32003,
7
+ "<|placeholder3|>": 32004,
8
+ "<|placeholder4|>": 32005,
9
+ "<|placeholder5|>": 32008,
10
+ "<|placeholder6|>": 32009,
11
+ "<|system|>": 32006,
12
+ "<|user|>": 32010
13
+ }
sft/smoe_refine_665k_llava/checkpoint-13312/config.json ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/cm/archive/namnv78/checkpoints/phi35-siglip224/pft",
3
+ "architectures": [
4
+ "LlavaPhiForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "auto_map": {
9
+ "AutoConfig": "configuration_phi3.Phi3Config",
10
+ "AutoModelForCausalLM": "modeling_phi3.Phi3ForCausalLM"
11
+ },
12
+ "bal_comp_loss_coef": 0.01,
13
+ "balance_loss_coef": 0.01,
14
+ "bos_token_id": 1,
15
+ "clip_smoe": true,
16
+ "diversity_loss_coef": 0.01,
17
+ "dropout": false,
18
+ "e_loss_coef": 0.001,
19
+ "embd_pdrop": 0.0,
20
+ "entropy_advance_loss": false,
21
+ "eos_token_id": 32000,
22
+ "freeze_backbone": false,
23
+ "freeze_mm_mlp_adapter": false,
24
+ "hidden_act": "silu",
25
+ "hidden_size": 3072,
26
+ "hybrid": false,
27
+ "image_aspect_ratio": "pad",
28
+ "init_weight": true,
29
+ "initializer_range": 0.02,
30
+ "intermediate_size": 8192,
31
+ "is_cosine": false,
32
+ "is_norm_weight": false,
33
+ "local_rank": 0,
34
+ "loss1": "balanceloss",
35
+ "loss2": "zloss",
36
+ "luna": false,
37
+ "max_compete_in_iter": 3,
38
+ "max_position_embeddings": 131072,
39
+ "mlp_smoe": true,
40
+ "mm_hidden_size": 1152,
41
+ "mm_patch_merge_type": "flat",
42
+ "mm_projector_lr": null,
43
+ "mm_projector_type": "moe",
44
+ "mm_use_im_patch_token": false,
45
+ "mm_use_im_start_end": false,
46
+ "mm_vision_select_feature": "patch",
47
+ "mm_vision_select_layer": -2,
48
+ "mm_vision_tower": "google/siglip-so400m-patch14-224",
49
+ "model_name_or_path": "/cm/archive/namnv78/checkpoints/phi35-siglip224/pft",
50
+ "model_type": "llava_phi",
51
+ "moe_name": "smoe",
52
+ "norm_softmax": false,
53
+ "normalization": true,
54
+ "num_attention_heads": 32,
55
+ "num_experts": 4,
56
+ "num_hidden_layers": 32,
57
+ "num_key_value_heads": 32,
58
+ "num_layers": 3,
59
+ "num_selected": 2,
60
+ "number_of_previous_tokens": 2,
61
+ "original_max_position_embeddings": 4096,
62
+ "pad_token_id": 32000,
63
+ "pretrain_mm_mlp_adapter": "/cm/archive/namnv78/checkpoints/phi35-siglip224/pft/mm_projector.bin",
64
+ "rate_compete": 0.2,
65
+ "rate_flip": 0.05,
66
+ "resid_pdrop": 0.0,
67
+ "rms_norm_eps": 1e-05,
68
+ "rope_scaling": {
69
+ "long_factor": [
70
+ 1.0800000429153442,
71
+ 1.1100000143051147,
72
+ 1.1399999856948853,
73
+ 1.340000033378601,
74
+ 1.5899999141693115,
75
+ 1.600000023841858,
76
+ 1.6200000047683716,
77
+ 2.620000123977661,
78
+ 3.2300000190734863,
79
+ 3.2300000190734863,
80
+ 4.789999961853027,
81
+ 7.400000095367432,
82
+ 7.700000286102295,
83
+ 9.09000015258789,
84
+ 12.199999809265137,
85
+ 17.670000076293945,
86
+ 24.46000099182129,
87
+ 28.57000160217285,
88
+ 30.420001983642578,
89
+ 30.840002059936523,
90
+ 32.590003967285156,
91
+ 32.93000411987305,
92
+ 42.320003509521484,
93
+ 44.96000289916992,
94
+ 50.340003967285156,
95
+ 50.45000457763672,
96
+ 57.55000305175781,
97
+ 57.93000411987305,
98
+ 58.21000289916992,
99
+ 60.1400032043457,
100
+ 62.61000442504883,
101
+ 62.62000274658203,
102
+ 62.71000289916992,
103
+ 63.1400032043457,
104
+ 63.1400032043457,
105
+ 63.77000427246094,
106
+ 63.93000411987305,
107
+ 63.96000289916992,
108
+ 63.970001220703125,
109
+ 64.02999877929688,
110
+ 64.06999969482422,
111
+ 64.08000183105469,
112
+ 64.12000274658203,
113
+ 64.41000366210938,
114
+ 64.4800033569336,
115
+ 64.51000213623047,
116
+ 64.52999877929688,
117
+ 64.83999633789062
118
+ ],
119
+ "short_factor": [
120
+ 1.0,
121
+ 1.0199999809265137,
122
+ 1.0299999713897705,
123
+ 1.0299999713897705,
124
+ 1.0499999523162842,
125
+ 1.0499999523162842,
126
+ 1.0499999523162842,
127
+ 1.0499999523162842,
128
+ 1.0499999523162842,
129
+ 1.0699999332427979,
130
+ 1.0999999046325684,
131
+ 1.1099998950958252,
132
+ 1.1599998474121094,
133
+ 1.1599998474121094,
134
+ 1.1699998378753662,
135
+ 1.2899998426437378,
136
+ 1.339999794960022,
137
+ 1.679999828338623,
138
+ 1.7899998426437378,
139
+ 1.8199998140335083,
140
+ 1.8499997854232788,
141
+ 1.8799997568130493,
142
+ 1.9099997282028198,
143
+ 1.9399996995925903,
144
+ 1.9899996519088745,
145
+ 2.0199997425079346,
146
+ 2.0199997425079346,
147
+ 2.0199997425079346,
148
+ 2.0199997425079346,
149
+ 2.0199997425079346,
150
+ 2.0199997425079346,
151
+ 2.0299997329711914,
152
+ 2.0299997329711914,
153
+ 2.0299997329711914,
154
+ 2.0299997329711914,
155
+ 2.0299997329711914,
156
+ 2.0299997329711914,
157
+ 2.0299997329711914,
158
+ 2.0299997329711914,
159
+ 2.0299997329711914,
160
+ 2.0799996852874756,
161
+ 2.0899996757507324,
162
+ 2.189999580383301,
163
+ 2.2199995517730713,
164
+ 2.5899994373321533,
165
+ 2.729999542236328,
166
+ 2.749999523162842,
167
+ 2.8399994373321533
168
+ ],
169
+ "type": "longrope"
170
+ },
171
+ "rope_theta": 10000.0,
172
+ "router_loss_coef": 0.01,
173
+ "router_theta": 0.1,
174
+ "router_z_loss_coef": 0.001,
175
+ "scales": [
176
+ 1,
177
+ 3
178
+ ],
179
+ "sliding_window": 262144,
180
+ "sparse_upcycling": true,
181
+ "strategy_train": "base",
182
+ "tie_word_embeddings": false,
183
+ "tokenizer_model_max_length": 2048,
184
+ "tokenizer_padding_side": "right",
185
+ "topk_max": 2,
186
+ "topk_min": 1,
187
+ "torch_dtype": "bfloat16",
188
+ "training": true,
189
+ "transformers_version": "4.43.0",
190
+ "tune_mm_mlp_adapter": false,
191
+ "unit_test": true,
192
+ "use_cache": false,
193
+ "use_mm_proj": true,
194
+ "use_old": false,
195
+ "version": "phi35",
196
+ "vision_tower": "google/siglip-so400m-patch14-224",
197
+ "vision_tower_dir": "/cm/archive/namnv78/checkpoints/phi35-siglip224/pft/clip.bin",
198
+ "vocab_size": 32064,
199
+ "warm_up": 0.05
200
+ }
sft/smoe_refine_665k_llava/checkpoint-13312/generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 32007,
7
+ 32001,
8
+ 32000
9
+ ],
10
+ "pad_token_id": 32000,
11
+ "transformers_version": "4.43.0"
12
+ }
sft/smoe_refine_665k_llava/checkpoint-13312/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step13312
sft/smoe_refine_665k_llava/checkpoint-13312/model-00001-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5abca96eb16c6989c0c7734f13f669c1ace67aaf26c8b5f7f79f8bc35c807e5
3
+ size 4972489328
sft/smoe_refine_665k_llava/checkpoint-13312/model-00002-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4bf02fd8fe7bf65973b24cb3b0c40d5c029daa7ff90ae40d843f76a9d25c425
3
+ size 4985529648
sft/smoe_refine_665k_llava/checkpoint-13312/model-00003-of-00003.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f561042c089e5738650dfeca61863b4d778ffccb00cd719b357cb24371b64d7d
3
+ size 248943552
sft/smoe_refine_665k_llava/checkpoint-13312/model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
sft/smoe_refine_665k_llava/checkpoint-13312/rng_state_0.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22271cc36f268c0b3e870b3930ac590fd40a4a3cd3a88aed74f78e5f8790aceb
3
+ size 15024
sft/smoe_refine_665k_llava/checkpoint-13312/rng_state_1.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19435e9be5d4b837d96fc2e9286e23e27344bb6ad3222ef1b9d207e6b2bb8c78
3
+ size 15024
sft/smoe_refine_665k_llava/checkpoint-13312/rng_state_2.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2902ec572b1b2f1a6a78f8979353bf31953eacdc78b129cc34a9f04c1de9b8d5
3
+ size 15024
sft/smoe_refine_665k_llava/checkpoint-13312/rng_state_3.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8a011e80ba323d1fcabf31eaea4d2bc397efadb23603b4248f0067ff8ca3987
3
+ size 15024
sft/smoe_refine_665k_llava/checkpoint-13312/special_tokens_map.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": "<unk>",
17
+ "unk_token": {
18
+ "content": "<unk>",
19
+ "lstrip": false,
20
+ "normalized": false,
21
+ "rstrip": false,
22
+ "single_word": false
23
+ }
24
+ }
sft/smoe_refine_665k_llava/checkpoint-13312/tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
sft/smoe_refine_665k_llava/checkpoint-13312/tokenizer_config.json ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": true,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": true,
27
+ "single_word": false,
28
+ "special": false
29
+ },
30
+ "32000": {
31
+ "content": "<|endoftext|>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": true
37
+ },
38
+ "32001": {
39
+ "content": "<|assistant|>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": true,
43
+ "single_word": false,
44
+ "special": true
45
+ },
46
+ "32002": {
47
+ "content": "<|placeholder1|>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": true,
51
+ "single_word": false,
52
+ "special": true
53
+ },
54
+ "32003": {
55
+ "content": "<|placeholder2|>",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": true,
59
+ "single_word": false,
60
+ "special": true
61
+ },
62
+ "32004": {
63
+ "content": "<|placeholder3|>",
64
+ "lstrip": false,
65
+ "normalized": false,
66
+ "rstrip": true,
67
+ "single_word": false,
68
+ "special": true
69
+ },
70
+ "32005": {
71
+ "content": "<|placeholder4|>",
72
+ "lstrip": false,
73
+ "normalized": false,
74
+ "rstrip": true,
75
+ "single_word": false,
76
+ "special": true
77
+ },
78
+ "32006": {
79
+ "content": "<|system|>",
80
+ "lstrip": false,
81
+ "normalized": false,
82
+ "rstrip": true,
83
+ "single_word": false,
84
+ "special": true
85
+ },
86
+ "32007": {
87
+ "content": "<|end|>",
88
+ "lstrip": false,
89
+ "normalized": false,
90
+ "rstrip": true,
91
+ "single_word": false,
92
+ "special": true
93
+ },
94
+ "32008": {
95
+ "content": "<|placeholder5|>",
96
+ "lstrip": false,
97
+ "normalized": false,
98
+ "rstrip": true,
99
+ "single_word": false,
100
+ "special": true
101
+ },
102
+ "32009": {
103
+ "content": "<|placeholder6|>",
104
+ "lstrip": false,
105
+ "normalized": false,
106
+ "rstrip": true,
107
+ "single_word": false,
108
+ "special": true
109
+ },
110
+ "32010": {
111
+ "content": "<|user|>",
112
+ "lstrip": false,
113
+ "normalized": false,
114
+ "rstrip": true,
115
+ "single_word": false,
116
+ "special": true
117
+ }
118
+ },
119
+ "bos_token": "<s>",
120
+ "chat_template": "{% for message in messages %}{% if message['role'] == 'system' and message['content'] %}{{'<|system|>\n' + message['content'] + '<|end|>\n'}}{% elif message['role'] == 'user' %}{{'<|user|>\n' + message['content'] + '<|end|>\n'}}{% elif message['role'] == 'assistant' %}{{'<|assistant|>\n' + message['content'] + '<|end|>\n'}}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>\n' }}{% else %}{{ eos_token }}{% endif %}",
121
+ "clean_up_tokenization_spaces": false,
122
+ "eos_token": "<|endoftext|>",
123
+ "legacy": false,
124
+ "model_max_length": 2048,
125
+ "pad_token": "<unk>",
126
+ "padding_side": "right",
127
+ "sp_model_kwargs": {},
128
+ "spaces_between_special_tokens": false,
129
+ "tokenizer_class": "LlamaTokenizer",
130
+ "unk_token": "<unk>",
131
+ "use_default_system_prompt": false
132
+ }
sft/smoe_refine_665k_llava/checkpoint-13312/trainer_state.json ADDED
The diff for this file is too large to render. See raw diff
 
sft/smoe_refine_665k_llava/checkpoint-13312/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e89343be69cf9344a0c92b8a9b8d2f2e376d7e19a1cc7fe1cba698b6a65fa0c
3
+ size 7928
sft/smoe_refine_665k_llava/checkpoint-13312/zero_to_fp32.py ADDED
@@ -0,0 +1,604 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # Copyright (c) Microsoft Corporation.
4
+ # SPDX-License-Identifier: Apache-2.0
5
+
6
+ # DeepSpeed Team
7
+
8
+ # This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
9
+ # copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
10
+ # the future. Once extracted, the weights don't require DeepSpeed and can be used in any
11
+ # application.
12
+ #
13
+ # example: python zero_to_fp32.py . pytorch_model.bin
14
+
15
+ import argparse
16
+ import torch
17
+ import glob
18
+ import math
19
+ import os
20
+ import re
21
+ from collections import OrderedDict
22
+ from dataclasses import dataclass
23
+
24
+ # while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
25
+ # DeepSpeed data structures it has to be available in the current python environment.
26
+ from deepspeed.utils import logger
27
+ from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
28
+ FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
29
+ FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS)
30
+
31
+
32
+ @dataclass
33
+ class zero_model_state:
34
+ buffers: dict()
35
+ param_shapes: dict()
36
+ shared_params: list
37
+ ds_version: int
38
+ frozen_param_shapes: dict()
39
+ frozen_param_fragments: dict()
40
+
41
+
42
+ debug = 0
43
+
44
+ # load to cpu
45
+ device = torch.device('cpu')
46
+
47
+
48
+ def atoi(text):
49
+ return int(text) if text.isdigit() else text
50
+
51
+
52
+ def natural_keys(text):
53
+ '''
54
+ alist.sort(key=natural_keys) sorts in human order
55
+ http://nedbatchelder.com/blog/200712/human_sorting.html
56
+ (See Toothy's implementation in the comments)
57
+ '''
58
+ return [atoi(c) for c in re.split(r'(\d+)', text)]
59
+
60
+
61
+ def get_model_state_file(checkpoint_dir, zero_stage):
62
+ if not os.path.isdir(checkpoint_dir):
63
+ raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
64
+
65
+ # there should be only one file
66
+ if zero_stage <= 2:
67
+ file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
68
+ elif zero_stage == 3:
69
+ file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
70
+
71
+ if not os.path.exists(file):
72
+ raise FileNotFoundError(f"can't find model states file at '{file}'")
73
+
74
+ return file
75
+
76
+
77
+ def get_checkpoint_files(checkpoint_dir, glob_pattern):
78
+ # XXX: need to test that this simple glob rule works for multi-node setup too
79
+ ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
80
+
81
+ if len(ckpt_files) == 0:
82
+ raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
83
+
84
+ return ckpt_files
85
+
86
+
87
+ def get_optim_files(checkpoint_dir):
88
+ return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
89
+
90
+
91
+ def get_model_state_files(checkpoint_dir):
92
+ return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
93
+
94
+
95
+ def parse_model_states(files):
96
+ zero_model_states = []
97
+ for file in files:
98
+ state_dict = torch.load(file, map_location=device)
99
+
100
+ if BUFFER_NAMES not in state_dict:
101
+ raise ValueError(f"{file} is not a model state checkpoint")
102
+ buffer_names = state_dict[BUFFER_NAMES]
103
+ if debug:
104
+ print("Found buffers:", buffer_names)
105
+
106
+ # recover just the buffers while restoring them to fp32 if they were saved in fp16
107
+ buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
108
+ param_shapes = state_dict[PARAM_SHAPES]
109
+
110
+ # collect parameters that are included in param_shapes
111
+ param_names = []
112
+ for s in param_shapes:
113
+ for name in s.keys():
114
+ param_names.append(name)
115
+
116
+ # update with frozen parameters
117
+ frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
118
+ if frozen_param_shapes is not None:
119
+ if debug:
120
+ print(f"Found frozen_param_shapes: {frozen_param_shapes}")
121
+ param_names += list(frozen_param_shapes.keys())
122
+
123
+ # handle shared params
124
+ shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
125
+
126
+ ds_version = state_dict.get(DS_VERSION, None)
127
+
128
+ frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
129
+
130
+ z_model_state = zero_model_state(buffers=buffers,
131
+ param_shapes=param_shapes,
132
+ shared_params=shared_params,
133
+ ds_version=ds_version,
134
+ frozen_param_shapes=frozen_param_shapes,
135
+ frozen_param_fragments=frozen_param_fragments)
136
+ zero_model_states.append(z_model_state)
137
+
138
+ return zero_model_states
139
+
140
+
141
+ def parse_optim_states(files, ds_checkpoint_dir):
142
+
143
+ total_files = len(files)
144
+ state_dicts = []
145
+ for f in files:
146
+ state_dict = torch.load(f, map_location=device)
147
+ # immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
148
+ # and also handle the case where it was already removed by another helper script
149
+ state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
150
+ state_dicts.append(state_dict)
151
+
152
+ if not ZERO_STAGE in state_dicts[0][OPTIMIZER_STATE_DICT]:
153
+ raise ValueError(f"{files[0]} is not a zero checkpoint")
154
+ zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
155
+ world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
156
+
157
+ # For ZeRO-2 each param group can have different partition_count as data parallelism for expert
158
+ # parameters can be different from data parallelism for non-expert parameters. So we can just
159
+ # use the max of the partition_count to get the dp world_size.
160
+
161
+ if type(world_size) is list:
162
+ world_size = max(world_size)
163
+
164
+ if world_size != total_files:
165
+ raise ValueError(
166
+ f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
167
+ "Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
168
+ )
169
+
170
+ # the groups are named differently in each stage
171
+ if zero_stage <= 2:
172
+ fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
173
+ elif zero_stage == 3:
174
+ fp32_groups_key = FP32_FLAT_GROUPS
175
+ else:
176
+ raise ValueError(f"unknown zero stage {zero_stage}")
177
+
178
+ if zero_stage <= 2:
179
+ fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
180
+ elif zero_stage == 3:
181
+ # if there is more than one param group, there will be multiple flattened tensors - one
182
+ # flattened tensor per group - for simplicity merge them into a single tensor
183
+ #
184
+ # XXX: could make the script more memory efficient for when there are multiple groups - it
185
+ # will require matching the sub-lists of param_shapes for each param group flattened tensor
186
+
187
+ fp32_flat_groups = [
188
+ torch.cat(state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key], 0) for i in range(len(state_dicts))
189
+ ]
190
+
191
+ return zero_stage, world_size, fp32_flat_groups
192
+
193
+
194
+ def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
195
+ """
196
+ Returns fp32 state_dict reconstructed from ds checkpoint
197
+
198
+ Args:
199
+ - ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
200
+
201
+ """
202
+ print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
203
+
204
+ optim_files = get_optim_files(ds_checkpoint_dir)
205
+ zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
206
+ print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
207
+
208
+ model_files = get_model_state_files(ds_checkpoint_dir)
209
+
210
+ zero_model_states = parse_model_states(model_files)
211
+ print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
212
+
213
+ if zero_stage <= 2:
214
+ return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
215
+ exclude_frozen_parameters)
216
+ elif zero_stage == 3:
217
+ return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
218
+ exclude_frozen_parameters)
219
+
220
+
221
+ def _zero2_merge_frozen_params(state_dict, zero_model_states):
222
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
223
+ return
224
+
225
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
226
+ frozen_param_fragments = zero_model_states[0].frozen_param_fragments
227
+
228
+ if debug:
229
+ num_elem = sum(s.numel() for s in frozen_param_shapes.values())
230
+ print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
231
+
232
+ wanted_params = len(frozen_param_shapes)
233
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
234
+ avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
235
+ print(f'Frozen params: Have {avail_numel} numels to process.')
236
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
237
+
238
+ total_params = 0
239
+ total_numel = 0
240
+ for name, shape in frozen_param_shapes.items():
241
+ total_params += 1
242
+ unpartitioned_numel = shape.numel()
243
+ total_numel += unpartitioned_numel
244
+
245
+ state_dict[name] = frozen_param_fragments[name]
246
+
247
+ if debug:
248
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
249
+
250
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
251
+
252
+
253
+ def _has_callable(obj, fn):
254
+ attr = getattr(obj, fn, None)
255
+ return callable(attr)
256
+
257
+
258
+ def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
259
+ param_shapes = zero_model_states[0].param_shapes
260
+
261
+ # Reconstruction protocol:
262
+ #
263
+ # XXX: document this
264
+
265
+ if debug:
266
+ for i in range(world_size):
267
+ for j in range(len(fp32_flat_groups[0])):
268
+ print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
269
+
270
+ # XXX: memory usage doubles here (zero2)
271
+ num_param_groups = len(fp32_flat_groups[0])
272
+ merged_single_partition_of_fp32_groups = []
273
+ for i in range(num_param_groups):
274
+ merged_partitions = [sd[i] for sd in fp32_flat_groups]
275
+ full_single_fp32_vector = torch.cat(merged_partitions, 0)
276
+ merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
277
+ avail_numel = sum(
278
+ [full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
279
+
280
+ if debug:
281
+ wanted_params = sum([len(shapes) for shapes in param_shapes])
282
+ wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
283
+ # not asserting if there is a mismatch due to possible padding
284
+ print(f"Have {avail_numel} numels to process.")
285
+ print(f"Need {wanted_numel} numels in {wanted_params} params.")
286
+
287
+ # params
288
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
289
+ # out-of-core computing solution
290
+ total_numel = 0
291
+ total_params = 0
292
+ for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
293
+ offset = 0
294
+ avail_numel = full_single_fp32_vector.numel()
295
+ for name, shape in shapes.items():
296
+
297
+ unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
298
+ total_numel += unpartitioned_numel
299
+ total_params += 1
300
+
301
+ if debug:
302
+ print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
303
+ state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
304
+ offset += unpartitioned_numel
305
+
306
+ # Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
307
+ # avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
308
+ # paddings performed in the code it's almost impossible to predict the exact numbers w/o the
309
+ # live optimizer object, so we are checking that the numbers are within the right range
310
+ align_to = 2 * world_size
311
+
312
+ def zero2_align(x):
313
+ return align_to * math.ceil(x / align_to)
314
+
315
+ if debug:
316
+ print(f"original offset={offset}, avail_numel={avail_numel}")
317
+
318
+ offset = zero2_align(offset)
319
+ avail_numel = zero2_align(avail_numel)
320
+
321
+ if debug:
322
+ print(f"aligned offset={offset}, avail_numel={avail_numel}")
323
+
324
+ # Sanity check
325
+ if offset != avail_numel:
326
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
327
+
328
+ print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
329
+
330
+
331
+ def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
332
+ exclude_frozen_parameters):
333
+ state_dict = OrderedDict()
334
+
335
+ # buffers
336
+ buffers = zero_model_states[0].buffers
337
+ state_dict.update(buffers)
338
+ if debug:
339
+ print(f"added {len(buffers)} buffers")
340
+
341
+ if not exclude_frozen_parameters:
342
+ _zero2_merge_frozen_params(state_dict, zero_model_states)
343
+
344
+ _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
345
+
346
+ # recover shared parameters
347
+ for pair in zero_model_states[0].shared_params:
348
+ if pair[1] in state_dict:
349
+ state_dict[pair[0]] = state_dict[pair[1]]
350
+
351
+ return state_dict
352
+
353
+
354
+ def zero3_partitioned_param_info(unpartitioned_numel, world_size):
355
+ remainder = unpartitioned_numel % world_size
356
+ padding_numel = (world_size - remainder) if remainder else 0
357
+ partitioned_numel = math.ceil(unpartitioned_numel / world_size)
358
+ return partitioned_numel, padding_numel
359
+
360
+
361
+ def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
362
+ if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
363
+ return
364
+
365
+ if debug:
366
+ for i in range(world_size):
367
+ num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
368
+ print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
369
+
370
+ frozen_param_shapes = zero_model_states[0].frozen_param_shapes
371
+ wanted_params = len(frozen_param_shapes)
372
+ wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
373
+ avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
374
+ print(f'Frozen params: Have {avail_numel} numels to process.')
375
+ print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
376
+
377
+ total_params = 0
378
+ total_numel = 0
379
+ for name, shape in zero_model_states[0].frozen_param_shapes.items():
380
+ total_params += 1
381
+ unpartitioned_numel = shape.numel()
382
+ total_numel += unpartitioned_numel
383
+
384
+ param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
385
+ state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
386
+
387
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
388
+
389
+ if debug:
390
+ print(
391
+ f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
392
+ )
393
+
394
+ print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
395
+
396
+
397
+ def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
398
+ param_shapes = zero_model_states[0].param_shapes
399
+ avail_numel = fp32_flat_groups[0].numel() * world_size
400
+ # Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
401
+ # param, re-consolidating each param, while dealing with padding if any
402
+
403
+ # merge list of dicts, preserving order
404
+ param_shapes = {k: v for d in param_shapes for k, v in d.items()}
405
+
406
+ if debug:
407
+ for i in range(world_size):
408
+ print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
409
+
410
+ wanted_params = len(param_shapes)
411
+ wanted_numel = sum(shape.numel() for shape in param_shapes.values())
412
+ # not asserting if there is a mismatch due to possible padding
413
+ avail_numel = fp32_flat_groups[0].numel() * world_size
414
+ print(f"Trainable params: Have {avail_numel} numels to process.")
415
+ print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
416
+
417
+ # params
418
+ # XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
419
+ # out-of-core computing solution
420
+ offset = 0
421
+ total_numel = 0
422
+ total_params = 0
423
+ for name, shape in param_shapes.items():
424
+
425
+ unpartitioned_numel = shape.numel()
426
+ total_numel += unpartitioned_numel
427
+ total_params += 1
428
+
429
+ partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
430
+
431
+ if debug:
432
+ print(
433
+ f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
434
+ )
435
+
436
+ # XXX: memory usage doubles here
437
+ state_dict[name] = torch.cat(
438
+ tuple(fp32_flat_groups[i].narrow(0, offset, partitioned_numel) for i in range(world_size)),
439
+ 0).narrow(0, 0, unpartitioned_numel).view(shape)
440
+ offset += partitioned_numel
441
+
442
+ offset *= world_size
443
+
444
+ # Sanity check
445
+ if offset != avail_numel:
446
+ raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
447
+
448
+ print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
449
+
450
+
451
+ def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
452
+ exclude_frozen_parameters):
453
+ state_dict = OrderedDict()
454
+
455
+ # buffers
456
+ buffers = zero_model_states[0].buffers
457
+ state_dict.update(buffers)
458
+ if debug:
459
+ print(f"added {len(buffers)} buffers")
460
+
461
+ if not exclude_frozen_parameters:
462
+ _zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
463
+
464
+ _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
465
+
466
+ # recover shared parameters
467
+ for pair in zero_model_states[0].shared_params:
468
+ if pair[1] in state_dict:
469
+ state_dict[pair[0]] = state_dict[pair[1]]
470
+
471
+ return state_dict
472
+
473
+
474
+ def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag=None, exclude_frozen_parameters=False):
475
+ """
476
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
477
+ ``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
478
+ via a model hub.
479
+
480
+ Args:
481
+ - ``checkpoint_dir``: path to the desired checkpoint folder
482
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
483
+ - ``exclude_frozen_parameters``: exclude frozen parameters
484
+
485
+ Returns:
486
+ - pytorch ``state_dict``
487
+
488
+ Note: this approach may not work if your application doesn't have sufficient free CPU memory and
489
+ you may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
490
+ the checkpoint.
491
+
492
+ A typical usage might be ::
493
+
494
+ from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
495
+ # do the training and checkpoint saving
496
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
497
+ model = model.cpu() # move to cpu
498
+ model.load_state_dict(state_dict)
499
+ # submit to model hub or save the model to share with others
500
+
501
+ In this example the ``model`` will no longer be usable in the deepspeed context of the same
502
+ application. i.e. you will need to re-initialize the deepspeed engine, since
503
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
504
+
505
+ If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
506
+
507
+ """
508
+ if tag is None:
509
+ latest_path = os.path.join(checkpoint_dir, 'latest')
510
+ if os.path.isfile(latest_path):
511
+ with open(latest_path, 'r') as fd:
512
+ tag = fd.read().strip()
513
+ else:
514
+ raise ValueError(f"Unable to find 'latest' file at {latest_path}")
515
+
516
+ ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
517
+
518
+ if not os.path.isdir(ds_checkpoint_dir):
519
+ raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
520
+
521
+ return _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
522
+
523
+
524
+ def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir, output_file, tag=None, exclude_frozen_parameters=False):
525
+ """
526
+ Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
527
+ loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
528
+
529
+ Args:
530
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
531
+ - ``output_file``: path to the pytorch fp32 state_dict output file (e.g. path/pytorch_model.bin)
532
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
533
+ - ``exclude_frozen_parameters``: exclude frozen parameters
534
+ """
535
+
536
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag, exclude_frozen_parameters)
537
+ print(f"Saving fp32 state dict to {output_file}")
538
+ torch.save(state_dict, output_file)
539
+
540
+
541
+ def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
542
+ """
543
+ 1. Put the provided model to cpu
544
+ 2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
545
+ 3. Load it into the provided model
546
+
547
+ Args:
548
+ - ``model``: the model object to update
549
+ - ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
550
+ - ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
551
+
552
+ Returns:
553
+ - ``model`: modified model
554
+
555
+ Make sure you have plenty of CPU memory available before you call this function. If you don't
556
+ have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
557
+ conveniently placed for you in the checkpoint folder.
558
+
559
+ A typical usage might be ::
560
+
561
+ from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
562
+ model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
563
+ # submit to model hub or save the model to share with others
564
+
565
+ Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
566
+ of the same application. i.e. you will need to re-initialize the deepspeed engine, since
567
+ ``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
568
+
569
+ """
570
+ logger.info(f"Extracting fp32 weights")
571
+ state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
572
+
573
+ logger.info(f"Overwriting model with fp32 weights")
574
+ model = model.cpu()
575
+ model.load_state_dict(state_dict, strict=False)
576
+
577
+ return model
578
+
579
+
580
+ if __name__ == "__main__":
581
+
582
+ parser = argparse.ArgumentParser()
583
+ parser.add_argument("checkpoint_dir",
584
+ type=str,
585
+ help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
586
+ parser.add_argument(
587
+ "output_file",
588
+ type=str,
589
+ help="path to the pytorch fp32 state_dict output file (e.g. path/checkpoint-12/pytorch_model.bin)")
590
+ parser.add_argument("-t",
591
+ "--tag",
592
+ type=str,
593
+ default=None,
594
+ help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
595
+ parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
596
+ parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
597
+ args = parser.parse_args()
598
+
599
+ debug = args.debug
600
+
601
+ convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
602
+ args.output_file,
603
+ tag=args.tag,
604
+ exclude_frozen_parameters=args.exclude_frozen_parameters)
sft/smoe_refine_665k_llava/checkpoint-16632/added_tokens.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "<|assistant|>": 32001,
3
+ "<|endoftext|>": 32000,
4
+ "<|end|>": 32007,
5
+ "<|placeholder1|>": 32002,
6
+ "<|placeholder2|>": 32003,
7
+ "<|placeholder3|>": 32004,
8
+ "<|placeholder4|>": 32005,
9
+ "<|placeholder5|>": 32008,
10
+ "<|placeholder6|>": 32009,
11
+ "<|system|>": 32006,
12
+ "<|user|>": 32010
13
+ }
sft/smoe_refine_665k_llava/checkpoint-16632/config.json ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "/cm/archive/namnv78/checkpoints/phi35-siglip224/pft",
3
+ "architectures": [
4
+ "LlavaPhiForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "auto_map": {
9
+ "AutoConfig": "configuration_phi3.Phi3Config",
10
+ "AutoModelForCausalLM": "modeling_phi3.Phi3ForCausalLM"
11
+ },
12
+ "bal_comp_loss_coef": 0.01,
13
+ "balance_loss_coef": 0.01,
14
+ "bos_token_id": 1,
15
+ "clip_smoe": true,
16
+ "diversity_loss_coef": 0.01,
17
+ "dropout": false,
18
+ "e_loss_coef": 0.001,
19
+ "embd_pdrop": 0.0,
20
+ "entropy_advance_loss": false,
21
+ "eos_token_id": 32000,
22
+ "freeze_backbone": false,
23
+ "freeze_mm_mlp_adapter": false,
24
+ "hidden_act": "silu",
25
+ "hidden_size": 3072,
26
+ "hybrid": false,
27
+ "image_aspect_ratio": "pad",
28
+ "init_weight": true,
29
+ "initializer_range": 0.02,
30
+ "intermediate_size": 8192,
31
+ "is_cosine": false,
32
+ "is_norm_weight": false,
33
+ "local_rank": 0,
34
+ "loss1": "balanceloss",
35
+ "loss2": "zloss",
36
+ "luna": false,
37
+ "max_compete_in_iter": 3,
38
+ "max_position_embeddings": 131072,
39
+ "mlp_smoe": true,
40
+ "mm_hidden_size": 1152,
41
+ "mm_patch_merge_type": "flat",
42
+ "mm_projector_lr": null,
43
+ "mm_projector_type": "moe",
44
+ "mm_use_im_patch_token": false,
45
+ "mm_use_im_start_end": false,
46
+ "mm_vision_select_feature": "patch",
47
+ "mm_vision_select_layer": -2,
48
+ "mm_vision_tower": "google/siglip-so400m-patch14-224",
49
+ "model_name_or_path": "/cm/archive/namnv78/checkpoints/phi35-siglip224/pft",
50
+ "model_type": "llava_phi",
51
+ "moe_name": "smoe",
52
+ "norm_softmax": false,
53
+ "normalization": true,
54
+ "num_attention_heads": 32,
55
+ "num_experts": 4,
56
+ "num_hidden_layers": 32,
57
+ "num_key_value_heads": 32,
58
+ "num_layers": 3,
59
+ "num_selected": 2,
60
+ "number_of_previous_tokens": 2,
61
+ "original_max_position_embeddings": 4096,
62
+ "pad_token_id": 32000,
63
+ "pretrain_mm_mlp_adapter": "/cm/archive/namnv78/checkpoints/phi35-siglip224/pft/mm_projector.bin",
64
+ "rate_compete": 0.2,
65
+ "rate_flip": 0.05,
66
+ "resid_pdrop": 0.0,
67
+ "rms_norm_eps": 1e-05,
68
+ "rope_scaling": {
69
+ "long_factor": [
70
+ 1.0800000429153442,
71
+ 1.1100000143051147,
72
+ 1.1399999856948853,
73
+ 1.340000033378601,
74
+ 1.5899999141693115,
75
+ 1.600000023841858,
76
+ 1.6200000047683716,
77
+ 2.620000123977661,
78
+ 3.2300000190734863,
79
+ 3.2300000190734863,
80
+ 4.789999961853027,
81
+ 7.400000095367432,
82
+ 7.700000286102295,
83
+ 9.09000015258789,
84
+ 12.199999809265137,
85
+ 17.670000076293945,
86
+ 24.46000099182129,
87
+ 28.57000160217285,
88
+ 30.420001983642578,
89
+ 30.840002059936523,
90
+ 32.590003967285156,
91
+ 32.93000411987305,
92
+ 42.320003509521484,
93
+ 44.96000289916992,
94
+ 50.340003967285156,
95
+ 50.45000457763672,
96
+ 57.55000305175781,
97
+ 57.93000411987305,
98
+ 58.21000289916992,
99
+ 60.1400032043457,
100
+ 62.61000442504883,
101
+ 62.62000274658203,
102
+ 62.71000289916992,
103
+ 63.1400032043457,
104
+ 63.1400032043457,
105
+ 63.77000427246094,
106
+ 63.93000411987305,
107
+ 63.96000289916992,
108
+ 63.970001220703125,
109
+ 64.02999877929688,
110
+ 64.06999969482422,
111
+ 64.08000183105469,
112
+ 64.12000274658203,
113
+ 64.41000366210938,
114
+ 64.4800033569336,
115
+ 64.51000213623047,
116
+ 64.52999877929688,
117
+ 64.83999633789062
118
+ ],
119
+ "short_factor": [
120
+ 1.0,
121
+ 1.0199999809265137,
122
+ 1.0299999713897705,
123
+ 1.0299999713897705,
124
+ 1.0499999523162842,
125
+ 1.0499999523162842,
126
+ 1.0499999523162842,
127
+ 1.0499999523162842,
128
+ 1.0499999523162842,
129
+ 1.0699999332427979,
130
+ 1.0999999046325684,
131
+ 1.1099998950958252,
132
+ 1.1599998474121094,
133
+ 1.1599998474121094,
134
+ 1.1699998378753662,
135
+ 1.2899998426437378,
136
+ 1.339999794960022,
137
+ 1.679999828338623,
138
+ 1.7899998426437378,
139
+ 1.8199998140335083,
140
+ 1.8499997854232788,
141
+ 1.8799997568130493,
142
+ 1.9099997282028198,
143
+ 1.9399996995925903,
144
+ 1.9899996519088745,
145
+ 2.0199997425079346,
146
+ 2.0199997425079346,
147
+ 2.0199997425079346,
148
+ 2.0199997425079346,
149
+ 2.0199997425079346,
150
+ 2.0199997425079346,
151
+ 2.0299997329711914,
152
+ 2.0299997329711914,
153
+ 2.0299997329711914,
154
+ 2.0299997329711914,
155
+ 2.0299997329711914,
156
+ 2.0299997329711914,
157
+ 2.0299997329711914,
158
+ 2.0299997329711914,
159
+ 2.0299997329711914,
160
+ 2.0799996852874756,
161
+ 2.0899996757507324,
162
+ 2.189999580383301,
163
+ 2.2199995517730713,
164
+ 2.5899994373321533,
165
+ 2.729999542236328,
166
+ 2.749999523162842,
167
+ 2.8399994373321533
168
+ ],
169
+ "type": "longrope"
170
+ },
171
+ "rope_theta": 10000.0,
172
+ "router_loss_coef": 0.01,
173
+ "router_theta": 0.1,
174
+ "router_z_loss_coef": 0.001,
175
+ "scales": [
176
+ 1,
177
+ 3
178
+ ],
179
+ "sliding_window": 262144,
180
+ "sparse_upcycling": true,
181
+ "strategy_train": "base",
182
+ "tie_word_embeddings": false,
183
+ "tokenizer_model_max_length": 2048,
184
+ "tokenizer_padding_side": "right",
185
+ "topk_max": 2,
186
+ "topk_min": 1,
187
+ "torch_dtype": "bfloat16",
188
+ "training": true,
189
+ "transformers_version": "4.43.0",
190
+ "tune_mm_mlp_adapter": false,
191
+ "unit_test": true,
192
+ "use_cache": false,
193
+ "use_mm_proj": true,
194
+ "use_old": false,
195
+ "version": "phi35",
196
+ "vision_tower": "google/siglip-so400m-patch14-224",
197
+ "vision_tower_dir": "/cm/archive/namnv78/checkpoints/phi35-siglip224/pft/clip.bin",
198
+ "vocab_size": 32064,
199
+ "warm_up": 0.05
200
+ }
sft/smoe_refine_665k_llava/checkpoint-16632/generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 32007,
7
+ 32001,
8
+ 32000
9
+ ],
10
+ "pad_token_id": 32000,
11
+ "transformers_version": "4.43.0"
12
+ }
sft/smoe_refine_665k_llava/checkpoint-16632/latest ADDED
@@ -0,0 +1 @@
 
 
1
+ global_step16632
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/mmerealworld_lite.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b26e5e78b76b521492611ba5cfdc56ad379e4dfc7c5a5930f496708bdc63556
3
+ size 1994104210
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/ocrbench.json ADDED
The diff for this file is too large to render. See raw diff
 
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/pope.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4daf799d1b7ec517a5af1073d1049ec7bee5b95cdd694cf06778b0d0efbbfa9f
3
+ size 17577558
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/rank0_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 0 eval done
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/rank1_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 1 eval done
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/rank2_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 2 eval done
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/rank3_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 3 eval done
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/results.json ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "results": {
3
+ "mmerealworld_lite": {
4
+ "mme_realworld_score,none": 0.3324648254299114,
5
+ "mme_realworld_score_stderr,none": "N/A",
6
+ "alias": "mmerealworld_lite"
7
+ },
8
+ "ocrbench": {
9
+ "ocrbench_accuracy,none": 0.319,
10
+ "ocrbench_accuracy_stderr,none": "N/A",
11
+ "alias": "ocrbench"
12
+ },
13
+ "pope": {
14
+ "pope_accuracy,none": 0.8682222222222222,
15
+ "pope_accuracy_stderr,none": "N/A",
16
+ "pope_precision,none": 0.9297199170124482,
17
+ "pope_precision_stderr,none": "N/A",
18
+ "pope_recall,none": 0.7966666666666666,
19
+ "pope_recall_stderr,none": "N/A",
20
+ "pope_f1_score,none": 0.8580660603159406,
21
+ "pope_f1_score_stderr,none": "N/A",
22
+ "pope_yes_ratio,none": 0.5,
23
+ "pope_yes_ratio_stderr,none": "N/A",
24
+ "alias": "pope"
25
+ },
26
+ "textvqa_val": {
27
+ "exact_match,none": 0.41270000022649767,
28
+ "exact_match_stderr,none": 0.006748425752359104,
29
+ "submission,none": null,
30
+ "submission_stderr,none": "N/A",
31
+ "alias": "textvqa_val"
32
+ }
33
+ },
34
+ "configs": {
35
+ "mmerealworld_lite": {
36
+ "task": "mmerealworld_lite",
37
+ "dataset_path": "yifanzhang114/MME-RealWorld-lite-lmms-eval",
38
+ "dataset_kwargs": {
39
+ "token": true
40
+ },
41
+ "test_split": "train",
42
+ "doc_to_visual": "<function mme_realworld_doc_to_visual at 0x7fe9371bc9d0>",
43
+ "doc_to_text": "<function mme_realworld_doc_to_text at 0x7fe9371b65e0>",
44
+ "doc_to_target": "answer",
45
+ "process_results": "<function mme_realworld_process_results at 0x7fe9371453a0>",
46
+ "description": "",
47
+ "target_delimiter": " ",
48
+ "fewshot_delimiter": "\n\n",
49
+ "metric_list": [
50
+ {
51
+ "metric": "mme_realworld_score",
52
+ "aggregation": "<function mme_realworld_aggregate_results at 0x7fe937146040>",
53
+ "higher_is_better": true
54
+ }
55
+ ],
56
+ "output_type": "generate_until",
57
+ "generation_kwargs": {
58
+ "max_new_tokens": 16,
59
+ "temperature": 0.0,
60
+ "top_p": 1.0,
61
+ "num_beams": 1,
62
+ "do_sample": false,
63
+ "until": [
64
+ "\n\n"
65
+ ]
66
+ },
67
+ "repeats": 1,
68
+ "should_decontaminate": false,
69
+ "metadata": [
70
+ {
71
+ "version": 0.0
72
+ }
73
+ ],
74
+ "model_specific_prompt_kwargs": {
75
+ "default": {
76
+ "pre_prompt": "",
77
+ "post_prompt": "\nSelect the best answer to the above multiple-choice question based on the image. Respond with only the letter (A, B, C, D, or E) of the correct option."
78
+ },
79
+ "gpt4v": {
80
+ "pre_prompt": "",
81
+ "post_prompt": "\nSelect the best answer to the above multiple-choice question based on the image. Respond with only the letter (A, B, C, D, or E) of the correct option."
82
+ },
83
+ "xcomposer2_4khd": {
84
+ "pre_prompt": "[UNUSED_TOKEN_146]user\n",
85
+ "post_prompt": " Answer this question with A, B, C, or D.[UNUSED_TOKEN_145]\n[UNUSED_TOKEN_146]assistant\n"
86
+ }
87
+ }
88
+ },
89
+ "ocrbench": {
90
+ "task": "ocrbench",
91
+ "dataset_path": "echo840/OCRBench",
92
+ "dataset_kwargs": {
93
+ "token": true
94
+ },
95
+ "test_split": "test",
96
+ "doc_to_visual": "<function ocrbench_doc_to_visual at 0x7fe95037f040>",
97
+ "doc_to_text": "<function ocrbench_doc_to_text at 0x7fe95f79f670>",
98
+ "doc_to_target": "answer",
99
+ "process_results": "<function ocrbench_process_results at 0x7fe95f79f9d0>",
100
+ "description": "",
101
+ "target_delimiter": " ",
102
+ "fewshot_delimiter": "\n\n",
103
+ "metric_list": [
104
+ {
105
+ "metric": "ocrbench_accuracy",
106
+ "aggregation": "<function ocrbench_aggregate_accuracy at 0x7fe95f79fd30>",
107
+ "higher_is_better": true
108
+ }
109
+ ],
110
+ "output_type": "generate_until",
111
+ "generation_kwargs": {
112
+ "max_new_tokens": 128,
113
+ "temperature": 0.0,
114
+ "top_p": 1.0,
115
+ "num_beams": 1,
116
+ "do_sample": false,
117
+ "until": [
118
+ "\n\n"
119
+ ]
120
+ },
121
+ "repeats": 1,
122
+ "should_decontaminate": false,
123
+ "metadata": [
124
+ {
125
+ "version": 0.0
126
+ }
127
+ ]
128
+ },
129
+ "pope": {
130
+ "task": "pope",
131
+ "dataset_path": "lmms-lab/POPE",
132
+ "dataset_kwargs": {
133
+ "token": true
134
+ },
135
+ "test_split": "test",
136
+ "doc_to_visual": "<function pope_doc_to_visual at 0x7fe9371cfd30>",
137
+ "doc_to_text": "<function pope_doc_to_text at 0x7fe9371d6280>",
138
+ "doc_to_target": "answer",
139
+ "process_results": "<function pope_process_results at 0x7fe9371d6790>",
140
+ "description": "",
141
+ "target_delimiter": " ",
142
+ "fewshot_delimiter": "\n\n",
143
+ "metric_list": [
144
+ {
145
+ "metric": "pope_accuracy",
146
+ "aggregation": "<function pope_aggregate_accuracy at 0x7fe9371d6ca0>",
147
+ "higher_is_better": true
148
+ },
149
+ {
150
+ "metric": "pope_precision",
151
+ "aggregation": "<function pope_aggregate_precision at 0x7fe9371db1f0>",
152
+ "higher_is_better": true
153
+ },
154
+ {
155
+ "metric": "pope_recall",
156
+ "aggregation": "<function pope_aggregate_recall at 0x7fe9371db700>",
157
+ "higher_is_better": true
158
+ },
159
+ {
160
+ "metric": "pope_f1_score",
161
+ "aggregation": "<function pope_aggregate_f1_score at 0x7fe9371dbc10>",
162
+ "higher_is_better": true
163
+ },
164
+ {
165
+ "metric": "pope_yes_ratio",
166
+ "aggregation": "<function pope_aggregate_yes_ratio at 0x7fe9371e0160>",
167
+ "higher_is_better": true
168
+ }
169
+ ],
170
+ "output_type": "generate_until",
171
+ "generation_kwargs": {
172
+ "max_new_tokens": 128,
173
+ "temperature": 0.0,
174
+ "top_p": 1.0,
175
+ "num_beams": 1,
176
+ "do_sample": false,
177
+ "until": [
178
+ "\n\n"
179
+ ]
180
+ },
181
+ "repeats": 1,
182
+ "should_decontaminate": false,
183
+ "metadata": [
184
+ {
185
+ "version": 0.0
186
+ }
187
+ ]
188
+ },
189
+ "textvqa_val": {
190
+ "task": "textvqa_val",
191
+ "dataset_path": "lmms-lab/textvqa",
192
+ "test_split": "validation",
193
+ "doc_to_visual": "<function textvqa_doc_to_visual at 0x7fe96b6a60d0>",
194
+ "doc_to_text": "<function textvqa_doc_to_text at 0x7fe96b6a6550>",
195
+ "doc_to_target": "answer",
196
+ "process_results": "<function textvqa_process_results at 0x7fe96b6a6820>",
197
+ "description": "",
198
+ "target_delimiter": " ",
199
+ "fewshot_delimiter": "\n\n",
200
+ "metric_list": [
201
+ {
202
+ "metric": "exact_match",
203
+ "aggregation": "mean",
204
+ "higher_is_better": true,
205
+ "ignore_case": true,
206
+ "ignore_punctuation": true
207
+ },
208
+ {
209
+ "metric": "submission",
210
+ "aggregation": "<function textvqa_aggregate_submissions at 0x7fe96b708ee0>",
211
+ "higher_is_better": true
212
+ }
213
+ ],
214
+ "output_type": "generate_until",
215
+ "generation_kwargs": {
216
+ "until": [
217
+ "ASSISTANT:"
218
+ ]
219
+ },
220
+ "repeats": 1,
221
+ "should_decontaminate": false,
222
+ "model_specific_prompt_kwargs": {
223
+ "default": {
224
+ "pre_prompt": "",
225
+ "post_prompt": "\nAnswer the question using a single word or phrase.",
226
+ "ocr": false
227
+ },
228
+ "qwen_vl": {
229
+ "pre_prompt": "",
230
+ "post_prompt": " Answer:"
231
+ }
232
+ }
233
+ }
234
+ },
235
+ "versions": {
236
+ "mmerealworld_lite": "Yaml",
237
+ "ocrbench": "Yaml",
238
+ "pope": "Yaml",
239
+ "textvqa_val": "Yaml"
240
+ },
241
+ "n-shot": {
242
+ "mmerealworld_lite": 0,
243
+ "ocrbench": 0,
244
+ "pope": 0,
245
+ "textvqa_val": 0
246
+ },
247
+ "model_configs": {
248
+ "model": "llava",
249
+ "model_args": "pretrained=/cm/archive/namnv78/checkpoints/Xphi35-siglip224/sft/SMOE/Full_smoe/checkpoint-16632,conv_template=phi35",
250
+ "batch_size": "1",
251
+ "device": null,
252
+ "limit": null,
253
+ "bootstrap_iters": 100000,
254
+ "gen_kwargs": ""
255
+ },
256
+ "git_hash": "bf33b90"
257
+ }
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/results/ocrbench_results.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ######################### OCRBench #############################
2
+ Text Recognition(Total 300): 182
3
+ ---------------- Details of Recognition Score ------------------
4
+ Regular Text Recognition(Total 50): 46
5
+ Irregular Text Recognition(Total 50): 42
6
+ Artistic Text Recognition(Total 50): 44
7
+ Handwriting Recognition(Total 50): 26
8
+ Digit String Recognition(Total 50): 11
9
+ Non-Semantic Text Recognition(Total 50): 13
10
+ ----------------------------------------------------------------
11
+ Scene Text-centric VQA(Total 200): 107
12
+ ----------------------------------------------------------------
13
+ Doc-oriented VQA(Total 200): 22
14
+ ----------------------------------------------------------------
15
+ Key Information Extraction(Total 200): 8
16
+ Handwritten Mathematical Expression Recognition(Total 100): 0
17
+ --------------------- Final Score ------------------------------
18
+ Final Score(Total 1000): 319
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/submissions/textvqa_submission_2025-04-09-17-19-18.json ADDED
The diff for this file is too large to render. See raw diff
 
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1803_llava..._pope_llava_model_args_7bd459/textvqa_val.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02035d62838017ab756a6df07b88060c358076cdf3927fca0f0048c65b88a09d
3
+ size 13150501
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/ai2d.json ADDED
The diff for this file is too large to render. See raw diff
 
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/mmbench_en_dev.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4dcfddcb36e62b42fba763210b96466f64630d467f8192bc4803317fc5f3db0
3
+ size 14568169
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/mmmu_val.json ADDED
The diff for this file is too large to render. See raw diff
 
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/mmstar.json ADDED
The diff for this file is too large to render. See raw diff
 
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/rank0_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 0 eval done
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/rank1_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 1 eval done
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/rank2_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 2 eval done
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/rank3_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 3 eval done
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/results.json ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "results": {
3
+ "ai2d": {
4
+ "exact_match,flexible-extract": 0.6492875647668394,
5
+ "exact_match_stderr,flexible-extract": 0.008588667905633653,
6
+ "alias": "ai2d"
7
+ },
8
+ "mmbench_en_dev": {
9
+ "gpt_eval_score,none": 71.99312714776632,
10
+ "gpt_eval_score_stderr,none": "N/A",
11
+ "submission,none": null,
12
+ "submission_stderr,none": "N/A",
13
+ "alias": "mmbench_en_dev"
14
+ },
15
+ "mmmu_val": {
16
+ "mmmu_acc,none": 0.42222,
17
+ "mmmu_acc_stderr,none": "N/A",
18
+ "alias": "mmmu_val"
19
+ },
20
+ "mmstar": {
21
+ "coarse perception,none": 0.7030779789873819,
22
+ "coarse perception_stderr,none": "N/A",
23
+ "fine-grained perception,none": 0.34155612871530333,
24
+ "fine-grained perception_stderr,none": "N/A",
25
+ "instance reasoning,none": 0.53201826163044,
26
+ "instance reasoning_stderr,none": "N/A",
27
+ "logical reasoning,none": 0.36875764499526875,
28
+ "logical reasoning_stderr,none": "N/A",
29
+ "math,none": 0.2920175086875167,
30
+ "math_stderr,none": "N/A",
31
+ "science & technology,none": 0.25190144653700547,
32
+ "science & technology_stderr,none": "N/A",
33
+ "alias": "mmstar"
34
+ }
35
+ },
36
+ "configs": {
37
+ "ai2d": {
38
+ "task": "ai2d",
39
+ "dataset_path": "lmms-lab/ai2d",
40
+ "dataset_kwargs": {
41
+ "token": true
42
+ },
43
+ "test_split": "test",
44
+ "doc_to_visual": "<function ai2d_doc_to_visual at 0x7ef90acbe8b0>",
45
+ "doc_to_text": "<function ai2d_doc_to_text at 0x7ef90acbeb80>",
46
+ "doc_to_target": "<function ai2d_doc_to_target at 0x7ef90ac48040>",
47
+ "description": "",
48
+ "target_delimiter": " ",
49
+ "fewshot_delimiter": "\n\n",
50
+ "metric_list": [
51
+ {
52
+ "metric": "exact_match",
53
+ "aggregation": "mean",
54
+ "higher_is_better": true,
55
+ "ignore_case": true,
56
+ "ignore_punctuation": true
57
+ }
58
+ ],
59
+ "output_type": "generate_until",
60
+ "generation_kwargs": {
61
+ "max_new_tokens": 512,
62
+ "temperature": 0.0,
63
+ "do_sample": false,
64
+ "until": [
65
+ "\n\n"
66
+ ]
67
+ },
68
+ "repeats": 1,
69
+ "filter_list": [
70
+ {
71
+ "name": "flexible-extract",
72
+ "filter": [
73
+ {
74
+ "function": "<class 'utils.MultiChoiceRegexFilter'>",
75
+ "group_select": 0,
76
+ "ignore_case": true,
77
+ "ignore_punctuation": true,
78
+ "regex_pattern": "([A-Z])\\."
79
+ }
80
+ ]
81
+ }
82
+ ],
83
+ "should_decontaminate": false,
84
+ "metadata": [
85
+ {
86
+ "version": 0.0
87
+ }
88
+ ],
89
+ "model_specific_prompt_kwargs": {
90
+ "default": {
91
+ "prompt_format": "mcq",
92
+ "pre_prompt": "",
93
+ "post_prompt": "\nAnswer with the option's letter from the given choices directly."
94
+ },
95
+ "gpt4v": {
96
+ "prompt_format": "mcq",
97
+ "pre_prompt": "",
98
+ "post_prompt": "\nAbove choices are given in {option}. {content} format.\nPlease answer with the option letter from the given choices directly."
99
+ },
100
+ "qwen_vl": {
101
+ "prompt_format": "qa",
102
+ "pre_prompt": "",
103
+ "post_prompt": " Answer:"
104
+ },
105
+ "xcomposer2_4khd": {
106
+ "prompt_format": "mcq_xcomposer",
107
+ "pre_prompt": "[UNUSED_TOKEN_146]user\nQuestion: ",
108
+ "post_prompt": "[UNUSED_TOKEN_145]\n[UNUSED_TOKEN_146]assistant\nThe answer is"
109
+ }
110
+ },
111
+ "model_specific_target_kwargs": {
112
+ "default": "mcq",
113
+ "qwen_vl": "qa"
114
+ }
115
+ },
116
+ "mmbench_en_dev": {
117
+ "task": "mmbench_en_dev",
118
+ "dataset_path": "lmms-lab/MMBench",
119
+ "dataset_name": "en",
120
+ "dataset_kwargs": {
121
+ "token": true
122
+ },
123
+ "test_split": "dev",
124
+ "doc_to_visual": "<function mmbench_doc_to_visual at 0x7ef969d64e50>",
125
+ "doc_to_text": "<function mmbench_doc_to_text at 0x7ef969d67430>",
126
+ "doc_to_target": "answer",
127
+ "process_results": "<function mmbench_process_results at 0x7ef969d679d0>",
128
+ "description": "",
129
+ "target_delimiter": " ",
130
+ "fewshot_delimiter": "\n\n",
131
+ "metric_list": [
132
+ {
133
+ "metric": "gpt_eval_score",
134
+ "aggregation": "<function mmbench_aggregate_dev_results_eval at 0x7ef969d645e0>",
135
+ "higher_is_better": true
136
+ },
137
+ {
138
+ "metric": "submission",
139
+ "aggregation": "<function mmbench_aggregate_dev_results_submission at 0x7ef969d64b80>",
140
+ "higher_is_better": true
141
+ }
142
+ ],
143
+ "output_type": "generate_until",
144
+ "generation_kwargs": {
145
+ "until": [
146
+ "ASSISTANT:"
147
+ ],
148
+ "max_new_tokens": 1024,
149
+ "temperature": 0.0,
150
+ "top_p": 1.0,
151
+ "num_beams": 1,
152
+ "do_sample": false,
153
+ "image_aspect_ratio": "original"
154
+ },
155
+ "repeats": 1,
156
+ "should_decontaminate": false,
157
+ "model_specific_prompt_kwargs": {
158
+ "default": {
159
+ "pre_prompt": "",
160
+ "post_prompt": "\nAnswer with the option's letter from the given choices directly."
161
+ }
162
+ },
163
+ "model_specific_generation_kwargs": {
164
+ "llava": {
165
+ "image_aspect_ratio": "original"
166
+ }
167
+ }
168
+ },
169
+ "mmmu_val": {
170
+ "task": "mmmu_val",
171
+ "dataset_path": "lmms-lab/MMMU",
172
+ "test_split": "validation",
173
+ "doc_to_visual": "<function mmmu_doc_to_visual at 0x7ef932f079d0>",
174
+ "doc_to_text": "<function mmmu_doc_to_text at 0x7ef932e1a670>",
175
+ "doc_to_target": "answer",
176
+ "process_results": "<function mmmu_process_results at 0x7ef932cf84c0>",
177
+ "description": "",
178
+ "target_delimiter": " ",
179
+ "fewshot_delimiter": "\n\n",
180
+ "metric_list": [
181
+ {
182
+ "metric": "mmmu_acc",
183
+ "aggregation": "<function mmmu_aggregate_results at 0x7ef932c263a0>",
184
+ "higher_is_better": true
185
+ }
186
+ ],
187
+ "output_type": "generate_until",
188
+ "generation_kwargs": {
189
+ "max_new_tokens": 128,
190
+ "until": [
191
+ "\n\n"
192
+ ],
193
+ "image_aspect_ratio": "original"
194
+ },
195
+ "repeats": 1,
196
+ "should_decontaminate": false,
197
+ "metadata": [
198
+ {
199
+ "version": 0.0
200
+ }
201
+ ],
202
+ "model_specific_generation_kwargs": {
203
+ "llava": {
204
+ "image_aspect_ratio": "original"
205
+ }
206
+ }
207
+ },
208
+ "mmstar": {
209
+ "task": "mmstar",
210
+ "dataset_path": "Lin-Chen/MMStar",
211
+ "dataset_kwargs": {
212
+ "token": true
213
+ },
214
+ "test_split": "val",
215
+ "doc_to_visual": "<function mmstar_doc_to_visual at 0x7ef90ab97a60>",
216
+ "doc_to_text": "<function mmstar_doc_to_text at 0x7ef90ab97e50>",
217
+ "doc_to_target": "answer",
218
+ "process_results": "<function mmstar_process_results at 0x7ef90aba1310>",
219
+ "description": "",
220
+ "target_delimiter": " ",
221
+ "fewshot_delimiter": "\n\n",
222
+ "metric_list": [
223
+ {
224
+ "metric": "coarse perception",
225
+ "aggregation": "<function mmstar_aggregate_results at 0x7ef90aba1700>",
226
+ "higher_is_better": true
227
+ },
228
+ {
229
+ "metric": "fine-grained perception",
230
+ "aggregation": "<function mmstar_aggregate_results at 0x7ef90aba1a60>",
231
+ "higher_is_better": true
232
+ },
233
+ {
234
+ "metric": "instance reasoning",
235
+ "aggregation": "<function mmstar_aggregate_results at 0x7ef90aba1dc0>",
236
+ "higher_is_better": true
237
+ },
238
+ {
239
+ "metric": "logical reasoning",
240
+ "aggregation": "<function mmstar_aggregate_results at 0x7ef90aba9160>",
241
+ "higher_is_better": true
242
+ },
243
+ {
244
+ "metric": "science & technology",
245
+ "aggregation": "<function mmstar_aggregate_results at 0x7ef90aba94c0>",
246
+ "higher_is_better": true
247
+ },
248
+ {
249
+ "metric": "math",
250
+ "aggregation": "<function mmstar_aggregate_results at 0x7ef90aba9820>",
251
+ "higher_is_better": true
252
+ }
253
+ ],
254
+ "output_type": "generate_until",
255
+ "generation_kwargs": {
256
+ "until": [
257
+ "\n\n"
258
+ ],
259
+ "do_sample": false
260
+ },
261
+ "repeats": 1,
262
+ "should_decontaminate": false,
263
+ "metadata": [
264
+ {
265
+ "version": 0.0
266
+ }
267
+ ],
268
+ "model_specific_prompt_kwargs": {
269
+ "default": {
270
+ "pre_prompt": "",
271
+ "post_prompt": "\nAnswer with the option's letter from the given choices directly"
272
+ }
273
+ }
274
+ }
275
+ },
276
+ "versions": {
277
+ "ai2d": "Yaml",
278
+ "mmbench_en_dev": "Yaml",
279
+ "mmmu_val": "Yaml",
280
+ "mmstar": "Yaml"
281
+ },
282
+ "n-shot": {
283
+ "ai2d": 0,
284
+ "mmbench_en_dev": 0,
285
+ "mmmu_val": 0,
286
+ "mmstar": 0
287
+ },
288
+ "model_configs": {
289
+ "model": "llava",
290
+ "model_args": "pretrained=/cm/archive/namnv78/checkpoints/Xphi35-siglip224/sft/SMOE/Full_smoe/checkpoint-16632,conv_template=phi35",
291
+ "batch_size": "1",
292
+ "device": null,
293
+ "limit": null,
294
+ "bootstrap_iters": 100000,
295
+ "gen_kwargs": ""
296
+ },
297
+ "git_hash": "bf33b90"
298
+ }
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/submissions/mmbench_en_dev_results.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"overall_acc": 0.7199312714776632, "category_acc": {"action_recognition": 0.9259259259259259, "attribute_comparison": 0.6818181818181818, "attribute_recognition": 0.8648648648648649, "celebrity_recognition": 0.8080808080808081, "function_reasoning": 0.8734177215189873, "future_prediction": 0.5, "identity_reasoning": 0.9777777777777777, "image_emotion": 0.84, "image_quality": 0.5849056603773585, "image_scene": 0.9423076923076923, "image_style": 0.7924528301886793, "image_topic": 0.8888888888888888, "nature_relation": 0.5208333333333334, "object_localization": 0.5432098765432098, "ocr": 0.6666666666666666, "physical_property_reasoning": 0.5866666666666667, "physical_relation": 0.4583333333333333, "social_relation": 0.8372093023255814, "spatial_relationship": 0.3111111111111111, "structuralized_imagetext_understanding": 0.46153846153846156}, "l2_category_acc": {"attribute_reasoning": 0.7889447236180904, "coarse_perception": 0.8277027027027027, "finegrained_perception (cross-instance)": 0.6573426573426573, "finegrained_perception (instance-level)": 0.7303754266211604, "logic_reasoning": 0.4745762711864407, "relation_reasoning": 0.6260869565217392}}
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1833_llava...mstar_llava_model_args_7bd459/submissions/mmbench_en_dev_results.xlsx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8e1bf82d81bdc3d83cc5a496f96c0d8c23b646e46eebc33d1afa187aa952791
3
+ size 865173
sft/smoe_refine_665k_llava/checkpoint-16632/logs/0409_1843_llava...image_llava_model_args_7bd459/rank1_metric_eval_done.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ rank 1 eval done