hbfreed commited on
Commit
54af084
·
verified ·
1 Parent(s): 4e816d8

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. healed/knee0924/keep20/args.json +17 -0
  2. healed/knee0924/keep20/heal_result.json +14 -0
  3. healed/knee0924/keep20/step0050/config.json +643 -0
  4. healed/knee0924/keep20/step0050/configuration_pruned_olmoe.py +27 -0
  5. healed/knee0924/keep20/step0050/generation_config.json +6 -0
  6. healed/knee0924/keep20/step0050/modeling_pruned_olmoe.py +66 -0
  7. healed/knee0924/keep20/step0050/special_tokens_map.json +16 -0
  8. healed/knee0924/keep20/step0050/tokenizer.json +0 -0
  9. healed/knee0924/keep20/step0050/tokenizer_config.json +239 -0
  10. healed/knee0924/keep20/train_log.jsonl +50 -0
  11. healed/knee0924/keep25/args.json +17 -0
  12. healed/knee0924/keep25/heal_result.json +14 -0
  13. healed/knee0924/keep25/step0050/modeling_pruned_olmoe.py +66 -0
  14. healed/knee0924/keep25/step0050/special_tokens_map.json +16 -0
  15. healed/knee0924/keep25/train_log.jsonl +50 -0
  16. healed/knee0924/keep30/args.json +17 -0
  17. healed/knee0924/keep30/heal_result.json +14 -0
  18. healed/knee0924/keep30/train_log.jsonl +50 -0
  19. healed/knee0924/keep40/args.json +17 -0
  20. healed/knee0924/keep40/heal_result.json +14 -0
  21. healed/knee0924/keep40/train_log.jsonl +50 -0
  22. healed/knee0924/keep50/args.json +17 -0
  23. healed/knee0924/keep50/heal_result.json +14 -0
  24. healed/knee0924/keep50/train_log.jsonl +50 -0
  25. healed/mixdistill_smoke/step0006/chat_template.jinja +9 -0
  26. healed/mixdistill_smoke/step0006/config.json +887 -0
  27. healed/mixdistill_smoke/step0006/configuration_pruned_olmoe.py +27 -0
  28. healed/mixdistill_smoke/step0006/generation_config.json +6 -0
  29. healed/mixdistill_smoke/step0006/model.safetensors.index.json +0 -0
  30. healed/mixdistill_smoke/step0006/modeling_pruned_olmoe.py +66 -0
  31. healed/mixdistill_smoke/step0006/special_tokens_map.json +23 -0
  32. healed/mixdistill_smoke/step0006/tokenizer.json +0 -0
  33. healed/mixdistill_smoke/step0006/tokenizer_config.json +247 -0
  34. healed/opd_warm_unleashed/step0300/chat_template.jinja +9 -0
  35. healed/opd_warm_unleashed/step0300/config.json +887 -0
  36. healed/opd_warm_unleashed/step0300/configuration_pruned_olmoe.py +27 -0
  37. healed/opd_warm_unleashed/step0300/generation_config.json +6 -0
  38. healed/opd_warm_unleashed/step0300/model.safetensors.index.json +0 -0
  39. healed/opd_warm_unleashed/step0300/modeling_pruned_olmoe.py +66 -0
  40. healed/opd_warm_unleashed/step0300/special_tokens_map.json +23 -0
  41. healed/opd_warm_unleashed/step0300/tokenizer.json +0 -0
  42. healed/opd_warm_unleashed/step0300/tokenizer_config.json +247 -0
  43. healed/opd_warm_unleashed/step0350/chat_template.jinja +9 -0
  44. healed/opd_warm_unleashed/step0350/config.json +887 -0
  45. healed/opd_warm_unleashed/step0350/configuration_pruned_olmoe.py +27 -0
  46. healed/opd_warm_unleashed/step0350/generation_config.json +6 -0
  47. healed/opd_warm_unleashed/step0350/model.safetensors.index.json +0 -0
  48. healed/opd_warm_unleashed/step0350/modeling_pruned_olmoe.py +66 -0
  49. healed/opd_warm_unleashed/step0350/special_tokens_map.json +23 -0
  50. healed/opd_warm_unleashed/step0350/tokenizer.json +0 -0
healed/knee0924/keep20/args.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep20",
3
+ "teacher": "allenai/OLMoE-1B-7B-0924",
4
+ "out_dir": "outputs/healed/knee0924/keep20",
5
+ "steps": 50,
6
+ "tokens_per_step": 120000,
7
+ "lr": 3e-05,
8
+ "weight_decay": 0.1,
9
+ "seq_len": 2048,
10
+ "micro_batch": 2,
11
+ "dataset": "c4",
12
+ "data_seed": 1224,
13
+ "eval_seed": 7,
14
+ "eval_seq": 32,
15
+ "teacher_device": "cuda:0",
16
+ "student_device": "cuda:1"
17
+ }
healed/knee0924/keep20/heal_result.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep20",
3
+ "pre_heal_ppl": 164.80226135253906,
4
+ "post_heal_ppl": 33.18513870239258,
5
+ "steps": 50,
6
+ "tokens": 6144000,
7
+ "lr": 3e-05,
8
+ "eval": {
9
+ "dataset": "c4",
10
+ "n_seq": 32,
11
+ "seq_len": 2048,
12
+ "seed": 7
13
+ }
14
+ }
healed/knee0924/keep20/step0050/config.json ADDED
@@ -0,0 +1,643 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "PrunedOlmoeForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_pruned_olmoe.PrunedOlmoeConfig",
9
+ "AutoModelForCausalLM": "modeling_pruned_olmoe.PrunedOlmoeForCausalLM"
10
+ },
11
+ "clip_qkv": null,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 50279,
14
+ "expert_widths": [
15
+ [
16
+ 256,
17
+ 384,
18
+ 640,
19
+ 384,
20
+ 768,
21
+ 1024,
22
+ 640,
23
+ 256,
24
+ 256,
25
+ 256,
26
+ 384,
27
+ 256,
28
+ 256,
29
+ 384,
30
+ 128,
31
+ 256,
32
+ 640,
33
+ 1024,
34
+ 256,
35
+ 256,
36
+ 384,
37
+ 640,
38
+ 768,
39
+ 384,
40
+ 1024,
41
+ 384,
42
+ 512,
43
+ 256
44
+ ],
45
+ [
46
+ 512,
47
+ 256,
48
+ 512,
49
+ 512,
50
+ 128,
51
+ 256,
52
+ 640,
53
+ 128,
54
+ 256,
55
+ 1024,
56
+ 128,
57
+ 384,
58
+ 256,
59
+ 256,
60
+ 1024,
61
+ 1024,
62
+ 640,
63
+ 1024,
64
+ 512,
65
+ 512,
66
+ 256,
67
+ 256,
68
+ 256,
69
+ 256,
70
+ 640,
71
+ 384,
72
+ 1024
73
+ ],
74
+ [
75
+ 256,
76
+ 768,
77
+ 512,
78
+ 256,
79
+ 896,
80
+ 256,
81
+ 768,
82
+ 256,
83
+ 896,
84
+ 768,
85
+ 640,
86
+ 256,
87
+ 384,
88
+ 256,
89
+ 512,
90
+ 256,
91
+ 384,
92
+ 256,
93
+ 512,
94
+ 256,
95
+ 256,
96
+ 256,
97
+ 512,
98
+ 384,
99
+ 256,
100
+ 256,
101
+ 1024,
102
+ 768
103
+ ],
104
+ [
105
+ 512,
106
+ 640,
107
+ 256,
108
+ 256,
109
+ 256,
110
+ 640,
111
+ 128,
112
+ 256,
113
+ 512,
114
+ 256,
115
+ 512,
116
+ 256,
117
+ 640,
118
+ 256,
119
+ 896,
120
+ 512,
121
+ 1024,
122
+ 640,
123
+ 384,
124
+ 256,
125
+ 256,
126
+ 384,
127
+ 512,
128
+ 384,
129
+ 256,
130
+ 256,
131
+ 256,
132
+ 512,
133
+ 256,
134
+ 896
135
+ ],
136
+ [
137
+ 256,
138
+ 256,
139
+ 256,
140
+ 256,
141
+ 256,
142
+ 384,
143
+ 640,
144
+ 384,
145
+ 512,
146
+ 384,
147
+ 128,
148
+ 384,
149
+ 256,
150
+ 384,
151
+ 256,
152
+ 384,
153
+ 384,
154
+ 384,
155
+ 256,
156
+ 640,
157
+ 256,
158
+ 256,
159
+ 768,
160
+ 384,
161
+ 512,
162
+ 128,
163
+ 256,
164
+ 128,
165
+ 128,
166
+ 640,
167
+ 256,
168
+ 384,
169
+ 256,
170
+ 640,
171
+ 1024
172
+ ],
173
+ [
174
+ 256,
175
+ 512,
176
+ 512,
177
+ 256,
178
+ 640,
179
+ 256,
180
+ 384,
181
+ 256,
182
+ 256,
183
+ 128,
184
+ 384,
185
+ 384,
186
+ 256,
187
+ 256,
188
+ 128,
189
+ 512,
190
+ 128,
191
+ 256,
192
+ 256,
193
+ 256,
194
+ 128,
195
+ 256,
196
+ 256,
197
+ 256,
198
+ 384,
199
+ 256,
200
+ 256,
201
+ 640,
202
+ 256,
203
+ 384,
204
+ 256,
205
+ 256,
206
+ 384,
207
+ 128,
208
+ 384,
209
+ 384,
210
+ 512,
211
+ 512,
212
+ 256,
213
+ 384,
214
+ 256
215
+ ],
216
+ [
217
+ 512,
218
+ 128,
219
+ 768,
220
+ 384,
221
+ 384,
222
+ 512,
223
+ 256,
224
+ 512,
225
+ 256,
226
+ 256,
227
+ 256,
228
+ 512,
229
+ 896,
230
+ 384,
231
+ 512,
232
+ 384,
233
+ 384,
234
+ 256,
235
+ 384,
236
+ 384,
237
+ 256,
238
+ 256,
239
+ 384,
240
+ 256,
241
+ 384,
242
+ 384,
243
+ 384,
244
+ 256,
245
+ 384,
246
+ 256,
247
+ 256,
248
+ 256,
249
+ 512,
250
+ 512
251
+ ],
252
+ [
253
+ 128,
254
+ 256,
255
+ 640,
256
+ 256,
257
+ 256,
258
+ 384,
259
+ 256,
260
+ 256,
261
+ 256,
262
+ 384,
263
+ 256,
264
+ 256,
265
+ 384,
266
+ 256,
267
+ 512,
268
+ 512,
269
+ 256,
270
+ 768,
271
+ 512,
272
+ 256,
273
+ 128,
274
+ 256,
275
+ 384,
276
+ 256,
277
+ 256,
278
+ 384,
279
+ 640,
280
+ 384,
281
+ 384,
282
+ 384,
283
+ 128,
284
+ 256,
285
+ 256,
286
+ 256,
287
+ 128,
288
+ 256,
289
+ 128,
290
+ 512,
291
+ 384,
292
+ 256
293
+ ],
294
+ [
295
+ 256,
296
+ 256,
297
+ 256,
298
+ 256,
299
+ 128,
300
+ 384,
301
+ 384,
302
+ 256,
303
+ 256,
304
+ 384,
305
+ 256,
306
+ 384,
307
+ 384,
308
+ 256,
309
+ 384,
310
+ 768,
311
+ 384,
312
+ 256,
313
+ 512,
314
+ 384,
315
+ 256,
316
+ 256,
317
+ 256,
318
+ 384,
319
+ 512,
320
+ 128,
321
+ 256,
322
+ 384,
323
+ 768,
324
+ 384,
325
+ 256,
326
+ 256,
327
+ 512,
328
+ 256,
329
+ 512,
330
+ 128,
331
+ 256,
332
+ 512
333
+ ],
334
+ [
335
+ 256,
336
+ 256,
337
+ 512,
338
+ 256,
339
+ 640,
340
+ 256,
341
+ 384,
342
+ 256,
343
+ 256,
344
+ 896,
345
+ 384,
346
+ 384,
347
+ 256,
348
+ 128,
349
+ 256,
350
+ 256,
351
+ 256,
352
+ 128,
353
+ 512,
354
+ 256,
355
+ 384,
356
+ 384,
357
+ 256,
358
+ 384,
359
+ 384,
360
+ 256,
361
+ 128,
362
+ 384,
363
+ 256,
364
+ 256,
365
+ 384,
366
+ 512,
367
+ 256,
368
+ 512,
369
+ 256,
370
+ 128,
371
+ 384,
372
+ 512,
373
+ 256
374
+ ],
375
+ [
376
+ 256,
377
+ 256,
378
+ 384,
379
+ 512,
380
+ 256,
381
+ 256,
382
+ 640,
383
+ 512,
384
+ 128,
385
+ 512,
386
+ 256,
387
+ 512,
388
+ 256,
389
+ 640,
390
+ 384,
391
+ 512,
392
+ 384,
393
+ 384,
394
+ 128,
395
+ 384,
396
+ 256,
397
+ 384,
398
+ 640,
399
+ 384,
400
+ 384,
401
+ 256,
402
+ 256,
403
+ 256,
404
+ 256,
405
+ 384,
406
+ 384,
407
+ 256,
408
+ 256,
409
+ 128,
410
+ 768,
411
+ 128,
412
+ 128
413
+ ],
414
+ [
415
+ 384,
416
+ 512,
417
+ 384,
418
+ 384,
419
+ 128,
420
+ 384,
421
+ 256,
422
+ 640,
423
+ 128,
424
+ 128,
425
+ 512,
426
+ 256,
427
+ 256,
428
+ 256,
429
+ 640,
430
+ 512,
431
+ 256,
432
+ 384,
433
+ 384,
434
+ 128,
435
+ 384,
436
+ 256,
437
+ 256,
438
+ 256,
439
+ 256,
440
+ 256,
441
+ 128,
442
+ 256,
443
+ 256,
444
+ 256,
445
+ 256,
446
+ 128,
447
+ 256,
448
+ 256,
449
+ 256,
450
+ 256,
451
+ 512,
452
+ 256,
453
+ 640,
454
+ 384,
455
+ 384
456
+ ],
457
+ [
458
+ 384,
459
+ 128,
460
+ 256,
461
+ 384,
462
+ 512,
463
+ 512,
464
+ 512,
465
+ 384,
466
+ 384,
467
+ 256,
468
+ 512,
469
+ 384,
470
+ 128,
471
+ 256,
472
+ 384,
473
+ 512,
474
+ 256,
475
+ 256,
476
+ 256,
477
+ 256,
478
+ 384,
479
+ 128,
480
+ 640,
481
+ 256,
482
+ 256,
483
+ 512,
484
+ 384,
485
+ 640,
486
+ 384,
487
+ 256,
488
+ 512,
489
+ 384,
490
+ 384,
491
+ 384,
492
+ 256,
493
+ 256,
494
+ 128
495
+ ],
496
+ [
497
+ 512,
498
+ 512,
499
+ 256,
500
+ 128,
501
+ 384,
502
+ 256,
503
+ 384,
504
+ 640,
505
+ 512,
506
+ 256,
507
+ 384,
508
+ 384,
509
+ 256,
510
+ 384,
511
+ 256,
512
+ 256,
513
+ 256,
514
+ 256,
515
+ 256,
516
+ 256,
517
+ 640,
518
+ 256,
519
+ 512,
520
+ 512,
521
+ 512,
522
+ 384,
523
+ 256,
524
+ 256,
525
+ 128,
526
+ 256,
527
+ 128,
528
+ 384,
529
+ 256,
530
+ 256,
531
+ 384,
532
+ 640,
533
+ 512
534
+ ],
535
+ [
536
+ 384,
537
+ 128,
538
+ 256,
539
+ 128,
540
+ 256,
541
+ 384,
542
+ 128,
543
+ 640,
544
+ 128,
545
+ 384,
546
+ 384,
547
+ 512,
548
+ 256,
549
+ 512,
550
+ 384,
551
+ 384,
552
+ 384,
553
+ 512,
554
+ 128,
555
+ 256,
556
+ 256,
557
+ 384,
558
+ 256,
559
+ 512,
560
+ 256,
561
+ 512,
562
+ 640,
563
+ 256,
564
+ 384,
565
+ 128,
566
+ 128,
567
+ 128,
568
+ 512,
569
+ 256,
570
+ 128,
571
+ 640,
572
+ 384,
573
+ 512,
574
+ 256
575
+ ],
576
+ [
577
+ 384,
578
+ 640,
579
+ 384,
580
+ 256,
581
+ 640,
582
+ 512,
583
+ 512,
584
+ 512,
585
+ 256,
586
+ 256,
587
+ 384,
588
+ 384,
589
+ 384,
590
+ 768,
591
+ 256,
592
+ 384,
593
+ 512,
594
+ 256,
595
+ 128,
596
+ 384,
597
+ 512,
598
+ 384,
599
+ 256,
600
+ 768,
601
+ 384,
602
+ 256,
603
+ 512,
604
+ 640,
605
+ 256,
606
+ 384,
607
+ 256,
608
+ 256
609
+ ]
610
+ ],
611
+ "glean_metadata": {
612
+ "base_model": "allenai/OLMoE-1B-7B-0924",
613
+ "block_size": 128,
614
+ "criterion": "reap",
615
+ "dead_experts": 461,
616
+ "keep_fraction": 0.2,
617
+ "min_width": 128,
618
+ "params": 1759223808,
619
+ "scores": "outputs/scores_0924_c4_2.1M/scores.pt"
620
+ },
621
+ "hidden_act": "silu",
622
+ "hidden_size": 2048,
623
+ "initializer_range": 0.02,
624
+ "intermediate_size": 1024,
625
+ "max_position_embeddings": 4096,
626
+ "model_type": "pruned_olmoe",
627
+ "norm_topk_prob": false,
628
+ "num_attention_heads": 16,
629
+ "num_experts": 64,
630
+ "num_experts_per_tok": 8,
631
+ "num_hidden_layers": 16,
632
+ "num_key_value_heads": 16,
633
+ "output_router_logits": false,
634
+ "pad_token_id": 1,
635
+ "rms_norm_eps": 1e-05,
636
+ "rope_scaling": null,
637
+ "rope_theta": 10000.0,
638
+ "router_aux_loss_coef": 0.01,
639
+ "tie_word_embeddings": false,
640
+ "transformers_version": "4.57.6",
641
+ "use_cache": true,
642
+ "vocab_size": 50304
643
+ }
healed/knee0924/keep20/step0050/configuration_pruned_olmoe.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Configuration for GLEAN-pruned OLMoE: variable-width, variable-count experts.
2
+ """
3
+
4
+ from transformers.models.olmoe.configuration_olmoe import OlmoeConfig
5
+
6
+
7
+ class PrunedOlmoeConfig(OlmoeConfig):
8
+ """OlmoeConfig plus a per-(layer, expert) width table.
9
+
10
+ ``expert_widths[l]`` lists the SwiGLU intermediate width of each surviving
11
+ expert in decoder layer ``l``, in expert order. Lists are ragged: layers
12
+ may keep different numbers of experts (deleted experts simply don't
13
+ appear — the router in layer ``l`` has ``len(expert_widths[l])`` rows),
14
+ and each width may differ (multiples of the GEMM block size, 128, for
15
+ variable-MegaBlocks execution). ``None`` means an unpruned model
16
+ (uniform ``num_experts`` × ``intermediate_size``).
17
+
18
+ The inherited ``num_experts`` / ``intermediate_size`` keep their ORIGINAL
19
+ (pre-pruning) values for provenance; the width table is authoritative for
20
+ the built architecture.
21
+ """
22
+
23
+ model_type = "pruned_olmoe"
24
+
25
+ def __init__(self, expert_widths: list[list[int]] | None = None, **kwargs):
26
+ super().__init__(**kwargs)
27
+ self.expert_widths = expert_widths
healed/knee0924/keep20/step0050/generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 50279,
4
+ "pad_token_id": 1,
5
+ "transformers_version": "4.57.6"
6
+ }
healed/knee0924/keep20/step0050/modeling_pruned_olmoe.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """GLEAN-pruned OLMoE: HF-loadable model with ragged (variable-width) experts.
2
+
3
+ Pattern follows hbfreed/variable-flex-olmo's PrunedFlexOlmoForCausalLM
4
+ (docs/recon/prior-work-hbfreed.md), generalized from one scalar width to a
5
+ per-(layer, expert) width table: ``super().__init__`` builds the uniform
6
+ architecture from the config, then every MoE block is rebuilt to its pruned
7
+ shape — surviving experts only, each at its own width, router sliced to
8
+ match — so the state dict aligns exactly with what
9
+ ``glean.prune.prune_channels_global`` leaves behind.
10
+
11
+ Caveat: ``output_router_logits=True`` (the load-balancing aux loss) assumes a
12
+ uniform ``config.num_experts`` and is unsupported on ragged models.
13
+ """
14
+
15
+ import torch.nn as nn
16
+ from transformers.activations import ACT2FN
17
+ from transformers.models.olmoe.modeling_olmoe import OlmoeForCausalLM
18
+
19
+ from .configuration_pruned_olmoe import PrunedOlmoeConfig
20
+
21
+
22
+ class RaggedOlmoeMLP(nn.Module):
23
+ """OlmoeMLP with an explicit intermediate width (SwiGLU, no biases)."""
24
+
25
+ def __init__(self, hidden_size: int, intermediate_size: int, hidden_act: str):
26
+ super().__init__()
27
+ self.hidden_size = hidden_size
28
+ self.intermediate_size = intermediate_size
29
+ self.gate_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
30
+ self.up_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
31
+ self.down_proj = nn.Linear(intermediate_size, hidden_size, bias=False)
32
+ self.act_fn = ACT2FN[hidden_act]
33
+
34
+ def forward(self, x):
35
+ return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
36
+
37
+
38
+ class PrunedOlmoeForCausalLM(OlmoeForCausalLM):
39
+ """OLMoE with per-layer surviving-expert lists at per-expert widths."""
40
+
41
+ config_class = PrunedOlmoeConfig
42
+
43
+ def __init__(self, config: PrunedOlmoeConfig):
44
+ super().__init__(config)
45
+ widths_table = getattr(config, "expert_widths", None)
46
+ if widths_table is None:
47
+ return # unpruned: plain OLMoE
48
+ if len(widths_table) != len(self.model.layers):
49
+ raise ValueError(
50
+ f"expert_widths has {len(widths_table)} rows but the model has "
51
+ f"{len(self.model.layers)} decoder layers"
52
+ )
53
+ for layer, widths in zip(self.model.layers, widths_table):
54
+ if any(w <= 0 for w in widths):
55
+ raise ValueError("expert_widths must list surviving experts only (>0)")
56
+ block = layer.mlp
57
+ if len(widths) < block.top_k:
58
+ raise ValueError(
59
+ f"a layer keeps {len(widths)} experts < top_k={block.top_k}"
60
+ )
61
+ block.num_experts = len(widths)
62
+ block.gate = nn.Linear(config.hidden_size, len(widths), bias=False)
63
+ block.experts = nn.ModuleList(
64
+ RaggedOlmoeMLP(config.hidden_size, w, config.hidden_act)
65
+ for w in widths
66
+ )
healed/knee0924/keep20/step0050/special_tokens_map.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "eos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "pad_token": {
10
+ "content": "<|padding|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ }
16
+ }
healed/knee0924/keep20/step0050/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
healed/knee0924/keep20/step0050/tokenizer_config.json ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": false,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "|||IP_ADDRESS|||",
8
+ "lstrip": false,
9
+ "normalized": true,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": false
13
+ },
14
+ "1": {
15
+ "content": "<|padding|>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "50254": {
23
+ "content": " ",
24
+ "lstrip": false,
25
+ "normalized": true,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": false
29
+ },
30
+ "50255": {
31
+ "content": " ",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": false
37
+ },
38
+ "50256": {
39
+ "content": " ",
40
+ "lstrip": false,
41
+ "normalized": true,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": false
45
+ },
46
+ "50257": {
47
+ "content": " ",
48
+ "lstrip": false,
49
+ "normalized": true,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": false
53
+ },
54
+ "50258": {
55
+ "content": " ",
56
+ "lstrip": false,
57
+ "normalized": true,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": false
61
+ },
62
+ "50259": {
63
+ "content": " ",
64
+ "lstrip": false,
65
+ "normalized": true,
66
+ "rstrip": false,
67
+ "single_word": false,
68
+ "special": false
69
+ },
70
+ "50260": {
71
+ "content": " ",
72
+ "lstrip": false,
73
+ "normalized": true,
74
+ "rstrip": false,
75
+ "single_word": false,
76
+ "special": false
77
+ },
78
+ "50261": {
79
+ "content": " ",
80
+ "lstrip": false,
81
+ "normalized": true,
82
+ "rstrip": false,
83
+ "single_word": false,
84
+ "special": false
85
+ },
86
+ "50262": {
87
+ "content": " ",
88
+ "lstrip": false,
89
+ "normalized": true,
90
+ "rstrip": false,
91
+ "single_word": false,
92
+ "special": false
93
+ },
94
+ "50263": {
95
+ "content": " ",
96
+ "lstrip": false,
97
+ "normalized": true,
98
+ "rstrip": false,
99
+ "single_word": false,
100
+ "special": false
101
+ },
102
+ "50264": {
103
+ "content": " ",
104
+ "lstrip": false,
105
+ "normalized": true,
106
+ "rstrip": false,
107
+ "single_word": false,
108
+ "special": false
109
+ },
110
+ "50265": {
111
+ "content": " ",
112
+ "lstrip": false,
113
+ "normalized": true,
114
+ "rstrip": false,
115
+ "single_word": false,
116
+ "special": false
117
+ },
118
+ "50266": {
119
+ "content": " ",
120
+ "lstrip": false,
121
+ "normalized": true,
122
+ "rstrip": false,
123
+ "single_word": false,
124
+ "special": false
125
+ },
126
+ "50267": {
127
+ "content": " ",
128
+ "lstrip": false,
129
+ "normalized": true,
130
+ "rstrip": false,
131
+ "single_word": false,
132
+ "special": false
133
+ },
134
+ "50268": {
135
+ "content": " ",
136
+ "lstrip": false,
137
+ "normalized": true,
138
+ "rstrip": false,
139
+ "single_word": false,
140
+ "special": false
141
+ },
142
+ "50269": {
143
+ "content": " ",
144
+ "lstrip": false,
145
+ "normalized": true,
146
+ "rstrip": false,
147
+ "single_word": false,
148
+ "special": false
149
+ },
150
+ "50270": {
151
+ "content": " ",
152
+ "lstrip": false,
153
+ "normalized": true,
154
+ "rstrip": false,
155
+ "single_word": false,
156
+ "special": false
157
+ },
158
+ "50271": {
159
+ "content": " ",
160
+ "lstrip": false,
161
+ "normalized": true,
162
+ "rstrip": false,
163
+ "single_word": false,
164
+ "special": false
165
+ },
166
+ "50272": {
167
+ "content": " ",
168
+ "lstrip": false,
169
+ "normalized": true,
170
+ "rstrip": false,
171
+ "single_word": false,
172
+ "special": false
173
+ },
174
+ "50273": {
175
+ "content": " ",
176
+ "lstrip": false,
177
+ "normalized": true,
178
+ "rstrip": false,
179
+ "single_word": false,
180
+ "special": false
181
+ },
182
+ "50274": {
183
+ "content": " ",
184
+ "lstrip": false,
185
+ "normalized": true,
186
+ "rstrip": false,
187
+ "single_word": false,
188
+ "special": false
189
+ },
190
+ "50275": {
191
+ "content": " ",
192
+ "lstrip": false,
193
+ "normalized": true,
194
+ "rstrip": false,
195
+ "single_word": false,
196
+ "special": false
197
+ },
198
+ "50276": {
199
+ "content": " ",
200
+ "lstrip": false,
201
+ "normalized": true,
202
+ "rstrip": false,
203
+ "single_word": false,
204
+ "special": false
205
+ },
206
+ "50277": {
207
+ "content": "|||EMAIL_ADDRESS|||",
208
+ "lstrip": false,
209
+ "normalized": true,
210
+ "rstrip": false,
211
+ "single_word": false,
212
+ "special": false
213
+ },
214
+ "50278": {
215
+ "content": "|||PHONE_NUMBER|||",
216
+ "lstrip": false,
217
+ "normalized": true,
218
+ "rstrip": false,
219
+ "single_word": false,
220
+ "special": false
221
+ },
222
+ "50279": {
223
+ "content": "<|endoftext|>",
224
+ "lstrip": false,
225
+ "normalized": false,
226
+ "rstrip": false,
227
+ "single_word": false,
228
+ "special": true
229
+ }
230
+ },
231
+ "bos_token": null,
232
+ "clean_up_tokenization_spaces": true,
233
+ "eos_token": "<|endoftext|>",
234
+ "extra_special_tokens": {},
235
+ "model_max_length": 1000000000000000019884624838656,
236
+ "pad_token": "<|padding|>",
237
+ "tokenizer_class": "GPTNeoXTokenizer",
238
+ "unk_token": null
239
+ }
healed/knee0924/keep20/train_log.jsonl ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"step": 1, "kl": 2.799445072809855, "tokens": 122880, "cumulative_loss_tokens": 122880, "secs": 45.8}
2
+ {"step": 2, "kl": 2.00822594165802, "tokens": 122880, "cumulative_loss_tokens": 245760, "secs": 36.7}
3
+ {"step": 3, "kl": 1.7884283105532328, "tokens": 122880, "cumulative_loss_tokens": 368640, "secs": 36.7}
4
+ {"step": 4, "kl": 1.7781060735384624, "tokens": 122880, "cumulative_loss_tokens": 491520, "secs": 36.7}
5
+ {"step": 5, "kl": 1.6532676378885904, "tokens": 122880, "cumulative_loss_tokens": 614400, "secs": 36.7}
6
+ {"step": 6, "kl": 1.4948806603749594, "tokens": 122880, "cumulative_loss_tokens": 737280, "secs": 36.7}
7
+ {"step": 7, "kl": 1.4933756669362386, "tokens": 122880, "cumulative_loss_tokens": 860160, "secs": 36.7}
8
+ {"step": 8, "kl": 1.5488511085510255, "tokens": 122880, "cumulative_loss_tokens": 983040, "secs": 36.7}
9
+ {"step": 9, "kl": 1.4010032296180726, "tokens": 122880, "cumulative_loss_tokens": 1105920, "secs": 36.7}
10
+ {"step": 10, "kl": 1.3937324325243632, "tokens": 122880, "cumulative_loss_tokens": 1228800, "secs": 36.7}
11
+ {"step": 11, "kl": 1.393221026659012, "tokens": 122880, "cumulative_loss_tokens": 1351680, "secs": 36.7}
12
+ {"step": 12, "kl": 1.2561392446358999, "tokens": 122880, "cumulative_loss_tokens": 1474560, "secs": 36.7}
13
+ {"step": 13, "kl": 1.3050465305646262, "tokens": 122880, "cumulative_loss_tokens": 1597440, "secs": 36.7}
14
+ {"step": 14, "kl": 1.244993543624878, "tokens": 122880, "cumulative_loss_tokens": 1720320, "secs": 36.7}
15
+ {"step": 15, "kl": 1.2129537065823872, "tokens": 122880, "cumulative_loss_tokens": 1843200, "secs": 36.7}
16
+ {"step": 16, "kl": 1.3954785863558452, "tokens": 122880, "cumulative_loss_tokens": 1966080, "secs": 36.8}
17
+ {"step": 17, "kl": 1.1894520342350006, "tokens": 122880, "cumulative_loss_tokens": 2088960, "secs": 36.7}
18
+ {"step": 18, "kl": 1.2797086536884308, "tokens": 122880, "cumulative_loss_tokens": 2211840, "secs": 36.7}
19
+ {"step": 19, "kl": 1.1934045394261679, "tokens": 122880, "cumulative_loss_tokens": 2334720, "secs": 36.6}
20
+ {"step": 20, "kl": 1.2127291063467662, "tokens": 122880, "cumulative_loss_tokens": 2457600, "secs": 36.7}
21
+ {"step": 21, "kl": 1.2141900857289631, "tokens": 122880, "cumulative_loss_tokens": 2580480, "secs": 36.6}
22
+ {"step": 22, "kl": 1.2126166780789693, "tokens": 122880, "cumulative_loss_tokens": 2703360, "secs": 36.7}
23
+ {"step": 23, "kl": 1.188023897012075, "tokens": 122880, "cumulative_loss_tokens": 2826240, "secs": 36.7}
24
+ {"step": 24, "kl": 1.220291304588318, "tokens": 122880, "cumulative_loss_tokens": 2949120, "secs": 36.7}
25
+ {"step": 25, "kl": 1.1050480604171753, "tokens": 122880, "cumulative_loss_tokens": 3072000, "secs": 36.7}
26
+ {"step": 26, "kl": 1.107023400068283, "tokens": 122880, "cumulative_loss_tokens": 3194880, "secs": 36.7}
27
+ {"step": 27, "kl": 1.1752450664838154, "tokens": 122880, "cumulative_loss_tokens": 3317760, "secs": 36.7}
28
+ {"step": 28, "kl": 1.1123643855253855, "tokens": 122880, "cumulative_loss_tokens": 3440640, "secs": 36.7}
29
+ {"step": 29, "kl": 1.1148907899856568, "tokens": 122880, "cumulative_loss_tokens": 3563520, "secs": 36.7}
30
+ {"step": 30, "kl": 1.1799089233080546, "tokens": 122880, "cumulative_loss_tokens": 3686400, "secs": 36.7}
31
+ {"step": 31, "kl": 1.1139978369077046, "tokens": 122880, "cumulative_loss_tokens": 3809280, "secs": 36.7}
32
+ {"step": 32, "kl": 1.1341905176639557, "tokens": 122880, "cumulative_loss_tokens": 3932160, "secs": 36.6}
33
+ {"step": 33, "kl": 1.0690260032812755, "tokens": 122880, "cumulative_loss_tokens": 4055040, "secs": 36.7}
34
+ {"step": 34, "kl": 0.9891984204451243, "tokens": 122880, "cumulative_loss_tokens": 4177920, "secs": 36.7}
35
+ {"step": 35, "kl": 1.0958283106486002, "tokens": 122880, "cumulative_loss_tokens": 4300800, "secs": 36.7}
36
+ {"step": 36, "kl": 1.0473421196142831, "tokens": 122880, "cumulative_loss_tokens": 4423680, "secs": 36.6}
37
+ {"step": 37, "kl": 1.1448211173216503, "tokens": 122880, "cumulative_loss_tokens": 4546560, "secs": 36.7}
38
+ {"step": 38, "kl": 1.0664462268352508, "tokens": 122880, "cumulative_loss_tokens": 4669440, "secs": 36.6}
39
+ {"step": 39, "kl": 1.0221477329730988, "tokens": 122880, "cumulative_loss_tokens": 4792320, "secs": 36.7}
40
+ {"step": 40, "kl": 1.082367899020513, "tokens": 122880, "cumulative_loss_tokens": 4915200, "secs": 36.7}
41
+ {"step": 41, "kl": 1.0801438073317209, "tokens": 122880, "cumulative_loss_tokens": 5038080, "secs": 36.6}
42
+ {"step": 42, "kl": 1.0414667387803396, "tokens": 122880, "cumulative_loss_tokens": 5160960, "secs": 36.6}
43
+ {"step": 43, "kl": 1.0454433143138886, "tokens": 122880, "cumulative_loss_tokens": 5283840, "secs": 36.6}
44
+ {"step": 44, "kl": 0.9927415390809377, "tokens": 122880, "cumulative_loss_tokens": 5406720, "secs": 36.6}
45
+ {"step": 45, "kl": 1.0122422436873117, "tokens": 122880, "cumulative_loss_tokens": 5529600, "secs": 36.7}
46
+ {"step": 46, "kl": 1.0627652982870737, "tokens": 122880, "cumulative_loss_tokens": 5652480, "secs": 36.6}
47
+ {"step": 47, "kl": 1.0868095854918163, "tokens": 122880, "cumulative_loss_tokens": 5775360, "secs": 36.6}
48
+ {"step": 48, "kl": 1.0355110168457031, "tokens": 122880, "cumulative_loss_tokens": 5898240, "secs": 36.7}
49
+ {"step": 49, "kl": 1.031413996219635, "tokens": 122880, "cumulative_loss_tokens": 6021120, "secs": 36.8}
50
+ {"step": 50, "kl": 1.0871112326780954, "tokens": 122880, "cumulative_loss_tokens": 6144000, "secs": 36.7}
healed/knee0924/keep25/args.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep25",
3
+ "teacher": "allenai/OLMoE-1B-7B-0924",
4
+ "out_dir": "outputs/healed/knee0924/keep25",
5
+ "steps": 50,
6
+ "tokens_per_step": 120000,
7
+ "lr": 3e-05,
8
+ "weight_decay": 0.1,
9
+ "seq_len": 2048,
10
+ "micro_batch": 2,
11
+ "dataset": "c4",
12
+ "data_seed": 1224,
13
+ "eval_seed": 7,
14
+ "eval_seq": 32,
15
+ "teacher_device": "cuda:0",
16
+ "student_device": "cuda:1"
17
+ }
healed/knee0924/keep25/heal_result.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep25",
3
+ "pre_heal_ppl": 105.4487533569336,
4
+ "post_heal_ppl": 28.708465576171875,
5
+ "steps": 50,
6
+ "tokens": 6144000,
7
+ "lr": 3e-05,
8
+ "eval": {
9
+ "dataset": "c4",
10
+ "n_seq": 32,
11
+ "seq_len": 2048,
12
+ "seed": 7
13
+ }
14
+ }
healed/knee0924/keep25/step0050/modeling_pruned_olmoe.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """GLEAN-pruned OLMoE: HF-loadable model with ragged (variable-width) experts.
2
+
3
+ Pattern follows hbfreed/variable-flex-olmo's PrunedFlexOlmoForCausalLM
4
+ (docs/recon/prior-work-hbfreed.md), generalized from one scalar width to a
5
+ per-(layer, expert) width table: ``super().__init__`` builds the uniform
6
+ architecture from the config, then every MoE block is rebuilt to its pruned
7
+ shape — surviving experts only, each at its own width, router sliced to
8
+ match — so the state dict aligns exactly with what
9
+ ``glean.prune.prune_channels_global`` leaves behind.
10
+
11
+ Caveat: ``output_router_logits=True`` (the load-balancing aux loss) assumes a
12
+ uniform ``config.num_experts`` and is unsupported on ragged models.
13
+ """
14
+
15
+ import torch.nn as nn
16
+ from transformers.activations import ACT2FN
17
+ from transformers.models.olmoe.modeling_olmoe import OlmoeForCausalLM
18
+
19
+ from .configuration_pruned_olmoe import PrunedOlmoeConfig
20
+
21
+
22
+ class RaggedOlmoeMLP(nn.Module):
23
+ """OlmoeMLP with an explicit intermediate width (SwiGLU, no biases)."""
24
+
25
+ def __init__(self, hidden_size: int, intermediate_size: int, hidden_act: str):
26
+ super().__init__()
27
+ self.hidden_size = hidden_size
28
+ self.intermediate_size = intermediate_size
29
+ self.gate_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
30
+ self.up_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
31
+ self.down_proj = nn.Linear(intermediate_size, hidden_size, bias=False)
32
+ self.act_fn = ACT2FN[hidden_act]
33
+
34
+ def forward(self, x):
35
+ return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
36
+
37
+
38
+ class PrunedOlmoeForCausalLM(OlmoeForCausalLM):
39
+ """OLMoE with per-layer surviving-expert lists at per-expert widths."""
40
+
41
+ config_class = PrunedOlmoeConfig
42
+
43
+ def __init__(self, config: PrunedOlmoeConfig):
44
+ super().__init__(config)
45
+ widths_table = getattr(config, "expert_widths", None)
46
+ if widths_table is None:
47
+ return # unpruned: plain OLMoE
48
+ if len(widths_table) != len(self.model.layers):
49
+ raise ValueError(
50
+ f"expert_widths has {len(widths_table)} rows but the model has "
51
+ f"{len(self.model.layers)} decoder layers"
52
+ )
53
+ for layer, widths in zip(self.model.layers, widths_table):
54
+ if any(w <= 0 for w in widths):
55
+ raise ValueError("expert_widths must list surviving experts only (>0)")
56
+ block = layer.mlp
57
+ if len(widths) < block.top_k:
58
+ raise ValueError(
59
+ f"a layer keeps {len(widths)} experts < top_k={block.top_k}"
60
+ )
61
+ block.num_experts = len(widths)
62
+ block.gate = nn.Linear(config.hidden_size, len(widths), bias=False)
63
+ block.experts = nn.ModuleList(
64
+ RaggedOlmoeMLP(config.hidden_size, w, config.hidden_act)
65
+ for w in widths
66
+ )
healed/knee0924/keep25/step0050/special_tokens_map.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "eos_token": {
3
+ "content": "<|endoftext|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "pad_token": {
10
+ "content": "<|padding|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ }
16
+ }
healed/knee0924/keep25/train_log.jsonl ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"step": 1, "kl": 2.313830228646596, "tokens": 122880, "cumulative_loss_tokens": 122880, "secs": 47.4}
2
+ {"step": 2, "kl": 1.6554232875506083, "tokens": 122880, "cumulative_loss_tokens": 245760, "secs": 37.5}
3
+ {"step": 3, "kl": 1.4781606793403625, "tokens": 122880, "cumulative_loss_tokens": 368640, "secs": 37.4}
4
+ {"step": 4, "kl": 1.4840904911359152, "tokens": 122880, "cumulative_loss_tokens": 491520, "secs": 37.4}
5
+ {"step": 5, "kl": 1.3798327247301738, "tokens": 122880, "cumulative_loss_tokens": 614400, "secs": 37.4}
6
+ {"step": 6, "kl": 1.2483799874782562, "tokens": 122880, "cumulative_loss_tokens": 737280, "secs": 37.4}
7
+ {"step": 7, "kl": 1.2335848788420358, "tokens": 122880, "cumulative_loss_tokens": 860160, "secs": 37.5}
8
+ {"step": 8, "kl": 1.2804628968238831, "tokens": 122880, "cumulative_loss_tokens": 983040, "secs": 37.4}
9
+ {"step": 9, "kl": 1.1768523673216502, "tokens": 122880, "cumulative_loss_tokens": 1105920, "secs": 37.4}
10
+ {"step": 10, "kl": 1.1638859351476034, "tokens": 122880, "cumulative_loss_tokens": 1228800, "secs": 37.4}
11
+ {"step": 11, "kl": 1.1788139998912812, "tokens": 122880, "cumulative_loss_tokens": 1351680, "secs": 37.4}
12
+ {"step": 12, "kl": 1.0587308764457704, "tokens": 122880, "cumulative_loss_tokens": 1474560, "secs": 37.4}
13
+ {"step": 13, "kl": 1.096179978052775, "tokens": 122880, "cumulative_loss_tokens": 1597440, "secs": 37.4}
14
+ {"step": 14, "kl": 1.0411964118480683, "tokens": 122880, "cumulative_loss_tokens": 1720320, "secs": 37.4}
15
+ {"step": 15, "kl": 1.0206178704897562, "tokens": 122880, "cumulative_loss_tokens": 1843200, "secs": 37.4}
16
+ {"step": 16, "kl": 1.197655294338862, "tokens": 122880, "cumulative_loss_tokens": 1966080, "secs": 37.5}
17
+ {"step": 17, "kl": 0.9969692786534627, "tokens": 122880, "cumulative_loss_tokens": 2088960, "secs": 37.4}
18
+ {"step": 18, "kl": 1.0813468813896179, "tokens": 122880, "cumulative_loss_tokens": 2211840, "secs": 37.4}
19
+ {"step": 19, "kl": 1.001629074414571, "tokens": 122880, "cumulative_loss_tokens": 2334720, "secs": 37.3}
20
+ {"step": 20, "kl": 1.0257816811402638, "tokens": 122880, "cumulative_loss_tokens": 2457600, "secs": 37.4}
21
+ {"step": 21, "kl": 1.0294838051001232, "tokens": 122880, "cumulative_loss_tokens": 2580480, "secs": 37.3}
22
+ {"step": 22, "kl": 1.0281385282675426, "tokens": 122880, "cumulative_loss_tokens": 2703360, "secs": 37.4}
23
+ {"step": 23, "kl": 1.0075202882289886, "tokens": 122880, "cumulative_loss_tokens": 2826240, "secs": 37.4}
24
+ {"step": 24, "kl": 1.0307145178318025, "tokens": 122880, "cumulative_loss_tokens": 2949120, "secs": 37.4}
25
+ {"step": 25, "kl": 0.9371936043103536, "tokens": 122880, "cumulative_loss_tokens": 3072000, "secs": 37.4}
26
+ {"step": 26, "kl": 0.9309814016024271, "tokens": 122880, "cumulative_loss_tokens": 3194880, "secs": 37.4}
27
+ {"step": 27, "kl": 1.0037646392981212, "tokens": 122880, "cumulative_loss_tokens": 3317760, "secs": 37.4}
28
+ {"step": 28, "kl": 0.9431975464026133, "tokens": 122880, "cumulative_loss_tokens": 3440640, "secs": 37.4}
29
+ {"step": 29, "kl": 0.9441798885663351, "tokens": 122880, "cumulative_loss_tokens": 3563520, "secs": 37.4}
30
+ {"step": 30, "kl": 1.0116740624109903, "tokens": 122880, "cumulative_loss_tokens": 3686400, "secs": 37.4}
31
+ {"step": 31, "kl": 0.9417168378829956, "tokens": 122880, "cumulative_loss_tokens": 3809280, "secs": 37.3}
32
+ {"step": 32, "kl": 0.969733864068985, "tokens": 122880, "cumulative_loss_tokens": 3932160, "secs": 37.3}
33
+ {"step": 33, "kl": 0.9051402866840362, "tokens": 122880, "cumulative_loss_tokens": 4055040, "secs": 37.4}
34
+ {"step": 34, "kl": 0.8359194397926331, "tokens": 122880, "cumulative_loss_tokens": 4177920, "secs": 37.4}
35
+ {"step": 35, "kl": 0.9334291179974874, "tokens": 122880, "cumulative_loss_tokens": 4300800, "secs": 37.4}
36
+ {"step": 36, "kl": 0.8888086318969727, "tokens": 122880, "cumulative_loss_tokens": 4423680, "secs": 37.3}
37
+ {"step": 37, "kl": 0.9763996124267578, "tokens": 122880, "cumulative_loss_tokens": 4546560, "secs": 37.4}
38
+ {"step": 38, "kl": 0.9056931614875794, "tokens": 122880, "cumulative_loss_tokens": 4669440, "secs": 37.4}
39
+ {"step": 39, "kl": 0.8712732523679734, "tokens": 122880, "cumulative_loss_tokens": 4792320, "secs": 37.4}
40
+ {"step": 40, "kl": 0.923673681418101, "tokens": 122880, "cumulative_loss_tokens": 4915200, "secs": 37.4}
41
+ {"step": 41, "kl": 0.9259252826372782, "tokens": 122880, "cumulative_loss_tokens": 5038080, "secs": 37.4}
42
+ {"step": 42, "kl": 0.8857697010040283, "tokens": 122880, "cumulative_loss_tokens": 5160960, "secs": 37.4}
43
+ {"step": 43, "kl": 0.8929120381673177, "tokens": 122880, "cumulative_loss_tokens": 5283840, "secs": 37.3}
44
+ {"step": 44, "kl": 0.8391634007294972, "tokens": 122880, "cumulative_loss_tokens": 5406720, "secs": 37.3}
45
+ {"step": 45, "kl": 0.8613568643728892, "tokens": 122880, "cumulative_loss_tokens": 5529600, "secs": 37.3}
46
+ {"step": 46, "kl": 0.9118083119392395, "tokens": 122880, "cumulative_loss_tokens": 5652480, "secs": 37.3}
47
+ {"step": 47, "kl": 0.9288128594557444, "tokens": 122880, "cumulative_loss_tokens": 5775360, "secs": 37.4}
48
+ {"step": 48, "kl": 0.8719660659631093, "tokens": 122880, "cumulative_loss_tokens": 5898240, "secs": 37.4}
49
+ {"step": 49, "kl": 0.8787553608417511, "tokens": 122880, "cumulative_loss_tokens": 6021120, "secs": 37.4}
50
+ {"step": 50, "kl": 0.9383302330970764, "tokens": 122880, "cumulative_loss_tokens": 6144000, "secs": 37.3}
healed/knee0924/keep30/args.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep30",
3
+ "teacher": "allenai/OLMoE-1B-7B-0924",
4
+ "out_dir": "outputs/healed/knee0924/keep30",
5
+ "steps": 50,
6
+ "tokens_per_step": 120000,
7
+ "lr": 3e-05,
8
+ "weight_decay": 0.1,
9
+ "seq_len": 2048,
10
+ "micro_batch": 2,
11
+ "dataset": "c4",
12
+ "data_seed": 1224,
13
+ "eval_seed": 7,
14
+ "eval_seq": 32,
15
+ "teacher_device": "cuda:0",
16
+ "student_device": "cuda:1"
17
+ }
healed/knee0924/keep30/heal_result.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep30",
3
+ "pre_heal_ppl": 69.09920501708984,
4
+ "post_heal_ppl": 25.705188751220703,
5
+ "steps": 50,
6
+ "tokens": 6144000,
7
+ "lr": 3e-05,
8
+ "eval": {
9
+ "dataset": "c4",
10
+ "n_seq": 32,
11
+ "seq_len": 2048,
12
+ "seed": 7
13
+ }
14
+ }
healed/knee0924/keep30/train_log.jsonl ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"step": 1, "kl": 1.9134400963783265, "tokens": 122880, "cumulative_loss_tokens": 122880, "secs": 48.5}
2
+ {"step": 2, "kl": 1.3438369194666544, "tokens": 122880, "cumulative_loss_tokens": 245760, "secs": 38.1}
3
+ {"step": 3, "kl": 1.1803164184093475, "tokens": 122880, "cumulative_loss_tokens": 368640, "secs": 38.1}
4
+ {"step": 4, "kl": 1.2290376603603363, "tokens": 122880, "cumulative_loss_tokens": 491520, "secs": 38.1}
5
+ {"step": 5, "kl": 1.1476012349128724, "tokens": 122880, "cumulative_loss_tokens": 614400, "secs": 38.1}
6
+ {"step": 6, "kl": 1.0419771254062653, "tokens": 122880, "cumulative_loss_tokens": 737280, "secs": 38.1}
7
+ {"step": 7, "kl": 1.0220232804616292, "tokens": 122880, "cumulative_loss_tokens": 860160, "secs": 38.1}
8
+ {"step": 8, "kl": 1.0815871198972067, "tokens": 122880, "cumulative_loss_tokens": 983040, "secs": 38.1}
9
+ {"step": 9, "kl": 0.9827445109685262, "tokens": 122880, "cumulative_loss_tokens": 1105920, "secs": 38.1}
10
+ {"step": 10, "kl": 0.9709443469842275, "tokens": 122880, "cumulative_loss_tokens": 1228800, "secs": 38.1}
11
+ {"step": 11, "kl": 0.991158950328827, "tokens": 122880, "cumulative_loss_tokens": 1351680, "secs": 38.1}
12
+ {"step": 12, "kl": 0.8874583780765534, "tokens": 122880, "cumulative_loss_tokens": 1474560, "secs": 38.1}
13
+ {"step": 13, "kl": 0.9268575588862101, "tokens": 122880, "cumulative_loss_tokens": 1597440, "secs": 38.1}
14
+ {"step": 14, "kl": 0.8714903970559438, "tokens": 122880, "cumulative_loss_tokens": 1720320, "secs": 38.1}
15
+ {"step": 15, "kl": 0.8550567487875621, "tokens": 122880, "cumulative_loss_tokens": 1843200, "secs": 38.1}
16
+ {"step": 16, "kl": 1.032442420721054, "tokens": 122880, "cumulative_loss_tokens": 1966080, "secs": 38.1}
17
+ {"step": 17, "kl": 0.8429429848988851, "tokens": 122880, "cumulative_loss_tokens": 2088960, "secs": 38.1}
18
+ {"step": 18, "kl": 0.9245830039183299, "tokens": 122880, "cumulative_loss_tokens": 2211840, "secs": 38.1}
19
+ {"step": 19, "kl": 0.8454516013463338, "tokens": 122880, "cumulative_loss_tokens": 2334720, "secs": 38.1}
20
+ {"step": 20, "kl": 0.8760805626710256, "tokens": 122880, "cumulative_loss_tokens": 2457600, "secs": 38.1}
21
+ {"step": 21, "kl": 0.8805038313070933, "tokens": 122880, "cumulative_loss_tokens": 2580480, "secs": 38.0}
22
+ {"step": 22, "kl": 0.8789269506931305, "tokens": 122880, "cumulative_loss_tokens": 2703360, "secs": 38.1}
23
+ {"step": 23, "kl": 0.861937924226125, "tokens": 122880, "cumulative_loss_tokens": 2826240, "secs": 38.1}
24
+ {"step": 24, "kl": 0.8894271711508434, "tokens": 122880, "cumulative_loss_tokens": 2949120, "secs": 38.1}
25
+ {"step": 25, "kl": 0.8030505537986755, "tokens": 122880, "cumulative_loss_tokens": 3072000, "secs": 38.1}
26
+ {"step": 26, "kl": 0.7937345544497172, "tokens": 122880, "cumulative_loss_tokens": 3194880, "secs": 38.1}
27
+ {"step": 27, "kl": 0.8633080859978993, "tokens": 122880, "cumulative_loss_tokens": 3317760, "secs": 38.1}
28
+ {"step": 28, "kl": 0.8080259402592976, "tokens": 122880, "cumulative_loss_tokens": 3440640, "secs": 38.1}
29
+ {"step": 29, "kl": 0.8120014548301697, "tokens": 122880, "cumulative_loss_tokens": 3563520, "secs": 38.1}
30
+ {"step": 30, "kl": 0.8738385081291199, "tokens": 122880, "cumulative_loss_tokens": 3686400, "secs": 38.1}
31
+ {"step": 31, "kl": 0.8093875706195831, "tokens": 122880, "cumulative_loss_tokens": 3809280, "secs": 38.1}
32
+ {"step": 32, "kl": 0.8427861034870148, "tokens": 122880, "cumulative_loss_tokens": 3932160, "secs": 38.0}
33
+ {"step": 33, "kl": 0.7789631843566894, "tokens": 122880, "cumulative_loss_tokens": 4055040, "secs": 38.1}
34
+ {"step": 34, "kl": 0.7124047259489695, "tokens": 122880, "cumulative_loss_tokens": 4177920, "secs": 38.1}
35
+ {"step": 35, "kl": 0.8032700498898824, "tokens": 122880, "cumulative_loss_tokens": 4300800, "secs": 38.1}
36
+ {"step": 36, "kl": 0.7631795922915141, "tokens": 122880, "cumulative_loss_tokens": 4423680, "secs": 38.1}
37
+ {"step": 37, "kl": 0.84235600233078, "tokens": 122880, "cumulative_loss_tokens": 4546560, "secs": 38.1}
38
+ {"step": 38, "kl": 0.7787195940812429, "tokens": 122880, "cumulative_loss_tokens": 4669440, "secs": 38.1}
39
+ {"step": 39, "kl": 0.7503240784009297, "tokens": 122880, "cumulative_loss_tokens": 4792320, "secs": 38.1}
40
+ {"step": 40, "kl": 0.8020394384860993, "tokens": 122880, "cumulative_loss_tokens": 4915200, "secs": 38.1}
41
+ {"step": 41, "kl": 0.8019351383050283, "tokens": 122880, "cumulative_loss_tokens": 5038080, "secs": 38.1}
42
+ {"step": 42, "kl": 0.7664479116598765, "tokens": 122880, "cumulative_loss_tokens": 5160960, "secs": 38.1}
43
+ {"step": 43, "kl": 0.7694141308466593, "tokens": 122880, "cumulative_loss_tokens": 5283840, "secs": 38.0}
44
+ {"step": 44, "kl": 0.7206377108891805, "tokens": 122880, "cumulative_loss_tokens": 5406720, "secs": 38.1}
45
+ {"step": 45, "kl": 0.7483313242594402, "tokens": 122880, "cumulative_loss_tokens": 5529600, "secs": 38.1}
46
+ {"step": 46, "kl": 0.7960013389587403, "tokens": 122880, "cumulative_loss_tokens": 5652480, "secs": 38.0}
47
+ {"step": 47, "kl": 0.8123511930306753, "tokens": 122880, "cumulative_loss_tokens": 5775360, "secs": 38.1}
48
+ {"step": 48, "kl": 0.7524132609367371, "tokens": 122880, "cumulative_loss_tokens": 5898240, "secs": 38.1}
49
+ {"step": 49, "kl": 0.760091096162796, "tokens": 122880, "cumulative_loss_tokens": 6021120, "secs": 38.1}
50
+ {"step": 50, "kl": 0.8231359044710795, "tokens": 122880, "cumulative_loss_tokens": 6144000, "secs": 38.0}
healed/knee0924/keep40/args.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep40",
3
+ "teacher": "allenai/OLMoE-1B-7B-0924",
4
+ "out_dir": "outputs/healed/knee0924/keep40",
5
+ "steps": 50,
6
+ "tokens_per_step": 120000,
7
+ "lr": 3e-05,
8
+ "weight_decay": 0.1,
9
+ "seq_len": 2048,
10
+ "micro_batch": 2,
11
+ "dataset": "c4",
12
+ "data_seed": 1224,
13
+ "eval_seed": 7,
14
+ "eval_seq": 32,
15
+ "teacher_device": "cuda:0",
16
+ "student_device": "cuda:1"
17
+ }
healed/knee0924/keep40/heal_result.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep40",
3
+ "pre_heal_ppl": 34.65605163574219,
4
+ "post_heal_ppl": 21.057231903076172,
5
+ "steps": 50,
6
+ "tokens": 6144000,
7
+ "lr": 3e-05,
8
+ "eval": {
9
+ "dataset": "c4",
10
+ "n_seq": 32,
11
+ "seq_len": 2048,
12
+ "seed": 7
13
+ }
14
+ }
healed/knee0924/keep40/train_log.jsonl ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"step": 1, "kl": 1.203008109331131, "tokens": 122880, "cumulative_loss_tokens": 122880, "secs": 49.6}
2
+ {"step": 2, "kl": 0.8977614363034566, "tokens": 122880, "cumulative_loss_tokens": 245760, "secs": 40.4}
3
+ {"step": 3, "kl": 0.7635675986607869, "tokens": 122880, "cumulative_loss_tokens": 368640, "secs": 40.4}
4
+ {"step": 4, "kl": 0.8397774795691172, "tokens": 122880, "cumulative_loss_tokens": 491520, "secs": 40.3}
5
+ {"step": 5, "kl": 0.7817749043305715, "tokens": 122880, "cumulative_loss_tokens": 614400, "secs": 40.4}
6
+ {"step": 6, "kl": 0.7146296739578247, "tokens": 122880, "cumulative_loss_tokens": 737280, "secs": 40.4}
7
+ {"step": 7, "kl": 0.7007134864727657, "tokens": 122880, "cumulative_loss_tokens": 860160, "secs": 40.4}
8
+ {"step": 8, "kl": 0.7662253022193909, "tokens": 122880, "cumulative_loss_tokens": 983040, "secs": 40.4}
9
+ {"step": 9, "kl": 0.6819654544194539, "tokens": 122880, "cumulative_loss_tokens": 1105920, "secs": 40.3}
10
+ {"step": 10, "kl": 0.6813271423180898, "tokens": 122880, "cumulative_loss_tokens": 1228800, "secs": 40.5}
11
+ {"step": 11, "kl": 0.7043846547603607, "tokens": 122880, "cumulative_loss_tokens": 1351680, "secs": 40.5}
12
+ {"step": 12, "kl": 0.6235980540513992, "tokens": 122880, "cumulative_loss_tokens": 1474560, "secs": 42.6}
13
+ {"step": 13, "kl": 0.6587181915839513, "tokens": 122880, "cumulative_loss_tokens": 1597440, "secs": 40.7}
14
+ {"step": 14, "kl": 0.608491646250089, "tokens": 122880, "cumulative_loss_tokens": 1720320, "secs": 40.2}
15
+ {"step": 15, "kl": 0.6108660946289698, "tokens": 122880, "cumulative_loss_tokens": 1843200, "secs": 40.4}
16
+ {"step": 16, "kl": 0.7790463368097941, "tokens": 122880, "cumulative_loss_tokens": 1966080, "secs": 40.4}
17
+ {"step": 17, "kl": 0.6061649690071742, "tokens": 122880, "cumulative_loss_tokens": 2088960, "secs": 40.6}
18
+ {"step": 18, "kl": 0.6803837349017461, "tokens": 122880, "cumulative_loss_tokens": 2211840, "secs": 40.4}
19
+ {"step": 19, "kl": 0.6089968343575796, "tokens": 122880, "cumulative_loss_tokens": 2334720, "secs": 40.2}
20
+ {"step": 20, "kl": 0.6348114997148514, "tokens": 122880, "cumulative_loss_tokens": 2457600, "secs": 40.4}
21
+ {"step": 21, "kl": 0.6464616119861603, "tokens": 122880, "cumulative_loss_tokens": 2580480, "secs": 40.3}
22
+ {"step": 22, "kl": 0.6489827265342076, "tokens": 122880, "cumulative_loss_tokens": 2703360, "secs": 40.3}
23
+ {"step": 23, "kl": 0.6233947813510895, "tokens": 122880, "cumulative_loss_tokens": 2826240, "secs": 40.3}
24
+ {"step": 24, "kl": 0.6494492749373119, "tokens": 122880, "cumulative_loss_tokens": 2949120, "secs": 40.3}
25
+ {"step": 25, "kl": 0.5768886228402456, "tokens": 122880, "cumulative_loss_tokens": 3072000, "secs": 40.3}
26
+ {"step": 26, "kl": 0.566129986445109, "tokens": 122880, "cumulative_loss_tokens": 3194880, "secs": 40.3}
27
+ {"step": 27, "kl": 0.6275245815515518, "tokens": 122880, "cumulative_loss_tokens": 3317760, "secs": 40.3}
28
+ {"step": 28, "kl": 0.5870765805244446, "tokens": 122880, "cumulative_loss_tokens": 3440640, "secs": 40.3}
29
+ {"step": 29, "kl": 0.5843763609727224, "tokens": 122880, "cumulative_loss_tokens": 3563520, "secs": 40.3}
30
+ {"step": 30, "kl": 0.639552503824234, "tokens": 122880, "cumulative_loss_tokens": 3686400, "secs": 40.2}
31
+ {"step": 31, "kl": 0.5818809111913045, "tokens": 122880, "cumulative_loss_tokens": 3809280, "secs": 40.3}
32
+ {"step": 32, "kl": 0.6239005188147227, "tokens": 122880, "cumulative_loss_tokens": 3932160, "secs": 40.3}
33
+ {"step": 33, "kl": 0.5610700309276581, "tokens": 122880, "cumulative_loss_tokens": 4055040, "secs": 40.3}
34
+ {"step": 34, "kl": 0.5062820067008337, "tokens": 122880, "cumulative_loss_tokens": 4177920, "secs": 40.3}
35
+ {"step": 35, "kl": 0.584183860818545, "tokens": 122880, "cumulative_loss_tokens": 4300800, "secs": 40.3}
36
+ {"step": 36, "kl": 0.550735863049825, "tokens": 122880, "cumulative_loss_tokens": 4423680, "secs": 40.3}
37
+ {"step": 37, "kl": 0.6168364971876145, "tokens": 122880, "cumulative_loss_tokens": 4546560, "secs": 40.3}
38
+ {"step": 38, "kl": 0.5639737645785013, "tokens": 122880, "cumulative_loss_tokens": 4669440, "secs": 40.2}
39
+ {"step": 39, "kl": 0.5465332046151161, "tokens": 122880, "cumulative_loss_tokens": 4792320, "secs": 40.3}
40
+ {"step": 40, "kl": 0.5914001047611237, "tokens": 122880, "cumulative_loss_tokens": 4915200, "secs": 40.3}
41
+ {"step": 41, "kl": 0.5894514630238216, "tokens": 122880, "cumulative_loss_tokens": 5038080, "secs": 40.3}
42
+ {"step": 42, "kl": 0.5617780417203904, "tokens": 122880, "cumulative_loss_tokens": 5160960, "secs": 40.2}
43
+ {"step": 43, "kl": 0.5585460325082143, "tokens": 122880, "cumulative_loss_tokens": 5283840, "secs": 40.2}
44
+ {"step": 44, "kl": 0.5199935048818588, "tokens": 122880, "cumulative_loss_tokens": 5406720, "secs": 40.2}
45
+ {"step": 45, "kl": 0.5476068059603373, "tokens": 122880, "cumulative_loss_tokens": 5529600, "secs": 40.3}
46
+ {"step": 46, "kl": 0.5946912695964177, "tokens": 122880, "cumulative_loss_tokens": 5652480, "secs": 40.2}
47
+ {"step": 47, "kl": 0.6040740340948105, "tokens": 122880, "cumulative_loss_tokens": 5775360, "secs": 40.2}
48
+ {"step": 48, "kl": 0.5480124910672506, "tokens": 122880, "cumulative_loss_tokens": 5898240, "secs": 40.3}
49
+ {"step": 49, "kl": 0.5551868160565694, "tokens": 122880, "cumulative_loss_tokens": 6021120, "secs": 40.3}
50
+ {"step": 50, "kl": 0.616097284356753, "tokens": 122880, "cumulative_loss_tokens": 6144000, "secs": 40.2}
healed/knee0924/keep50/args.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep50",
3
+ "teacher": "allenai/OLMoE-1B-7B-0924",
4
+ "out_dir": "outputs/healed/knee0924/keep50",
5
+ "steps": 50,
6
+ "tokens_per_step": 120000,
7
+ "lr": 3e-05,
8
+ "weight_decay": 0.1,
9
+ "seq_len": 2048,
10
+ "micro_batch": 2,
11
+ "dataset": "c4",
12
+ "data_seed": 1224,
13
+ "eval_seed": 7,
14
+ "eval_seq": 32,
15
+ "teacher_device": "cuda:0",
16
+ "student_device": "cuda:1"
17
+ }
healed/knee0924/keep50/heal_result.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "student": "outputs/pruned/knee0924/keep50",
3
+ "pre_heal_ppl": 25.590167999267578,
4
+ "post_heal_ppl": 18.254446029663086,
5
+ "steps": 50,
6
+ "tokens": 6144000,
7
+ "lr": 3e-05,
8
+ "eval": {
9
+ "dataset": "c4",
10
+ "n_seq": 32,
11
+ "seq_len": 2048,
12
+ "seed": 7
13
+ }
14
+ }
healed/knee0924/keep50/train_log.jsonl ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"step": 1, "kl": 0.8699087758858999, "tokens": 122880, "cumulative_loss_tokens": 122880, "secs": 52.5}
2
+ {"step": 2, "kl": 0.6575553546349208, "tokens": 122880, "cumulative_loss_tokens": 245760, "secs": 42.0}
3
+ {"step": 3, "kl": 0.5402249326308568, "tokens": 122880, "cumulative_loss_tokens": 368640, "secs": 42.1}
4
+ {"step": 4, "kl": 0.6123988221089045, "tokens": 122880, "cumulative_loss_tokens": 491520, "secs": 42.0}
5
+ {"step": 5, "kl": 0.5700773159662883, "tokens": 122880, "cumulative_loss_tokens": 614400, "secs": 42.0}
6
+ {"step": 6, "kl": 0.5183772613604863, "tokens": 122880, "cumulative_loss_tokens": 737280, "secs": 42.0}
7
+ {"step": 7, "kl": 0.5071838061014812, "tokens": 122880, "cumulative_loss_tokens": 860160, "secs": 42.0}
8
+ {"step": 8, "kl": 0.5582418620586396, "tokens": 122880, "cumulative_loss_tokens": 983040, "secs": 42.0}
9
+ {"step": 9, "kl": 0.4857077270746231, "tokens": 122880, "cumulative_loss_tokens": 1105920, "secs": 42.0}
10
+ {"step": 10, "kl": 0.4897372633218765, "tokens": 122880, "cumulative_loss_tokens": 1228800, "secs": 42.0}
11
+ {"step": 11, "kl": 0.5120153983434041, "tokens": 122880, "cumulative_loss_tokens": 1351680, "secs": 42.1}
12
+ {"step": 12, "kl": 0.4449257473150889, "tokens": 122880, "cumulative_loss_tokens": 1474560, "secs": 42.0}
13
+ {"step": 13, "kl": 0.4799923410018285, "tokens": 122880, "cumulative_loss_tokens": 1597440, "secs": 42.0}
14
+ {"step": 14, "kl": 0.42896502117315927, "tokens": 122880, "cumulative_loss_tokens": 1720320, "secs": 42.0}
15
+ {"step": 15, "kl": 0.4418807705243429, "tokens": 122880, "cumulative_loss_tokens": 1843200, "secs": 42.0}
16
+ {"step": 16, "kl": 0.601253342628479, "tokens": 122880, "cumulative_loss_tokens": 1966080, "secs": 42.1}
17
+ {"step": 17, "kl": 0.4330762306849162, "tokens": 122880, "cumulative_loss_tokens": 2088960, "secs": 42.1}
18
+ {"step": 18, "kl": 0.5030014336109161, "tokens": 122880, "cumulative_loss_tokens": 2211840, "secs": 42.0}
19
+ {"step": 19, "kl": 0.44243644972642265, "tokens": 122880, "cumulative_loss_tokens": 2334720, "secs": 42.0}
20
+ {"step": 20, "kl": 0.4637090047200521, "tokens": 122880, "cumulative_loss_tokens": 2457600, "secs": 42.0}
21
+ {"step": 21, "kl": 0.4785055696964264, "tokens": 122880, "cumulative_loss_tokens": 2580480, "secs": 42.0}
22
+ {"step": 22, "kl": 0.47858787775039674, "tokens": 122880, "cumulative_loss_tokens": 2703360, "secs": 42.0}
23
+ {"step": 23, "kl": 0.4540826499462128, "tokens": 122880, "cumulative_loss_tokens": 2826240, "secs": 42.0}
24
+ {"step": 24, "kl": 0.4782628983259201, "tokens": 122880, "cumulative_loss_tokens": 2949120, "secs": 42.0}
25
+ {"step": 25, "kl": 0.416959140698115, "tokens": 122880, "cumulative_loss_tokens": 3072000, "secs": 42.0}
26
+ {"step": 26, "kl": 0.40522719323635104, "tokens": 122880, "cumulative_loss_tokens": 3194880, "secs": 42.0}
27
+ {"step": 27, "kl": 0.4650170256694158, "tokens": 122880, "cumulative_loss_tokens": 3317760, "secs": 42.0}
28
+ {"step": 28, "kl": 0.43529969255129497, "tokens": 122880, "cumulative_loss_tokens": 3440640, "secs": 42.0}
29
+ {"step": 29, "kl": 0.4287110875050227, "tokens": 122880, "cumulative_loss_tokens": 3563520, "secs": 42.0}
30
+ {"step": 30, "kl": 0.4738962093989054, "tokens": 122880, "cumulative_loss_tokens": 3686400, "secs": 42.1}
31
+ {"step": 31, "kl": 0.4250258584817251, "tokens": 122880, "cumulative_loss_tokens": 3809280, "secs": 42.0}
32
+ {"step": 32, "kl": 0.47182846466700235, "tokens": 122880, "cumulative_loss_tokens": 3932160, "secs": 42.0}
33
+ {"step": 33, "kl": 0.4137675185998281, "tokens": 122880, "cumulative_loss_tokens": 4055040, "secs": 42.0}
34
+ {"step": 34, "kl": 0.3596928596496582, "tokens": 122880, "cumulative_loss_tokens": 4177920, "secs": 42.1}
35
+ {"step": 35, "kl": 0.4286925872166952, "tokens": 122880, "cumulative_loss_tokens": 4300800, "secs": 42.0}
36
+ {"step": 36, "kl": 0.4013708233833313, "tokens": 122880, "cumulative_loss_tokens": 4423680, "secs": 42.0}
37
+ {"step": 37, "kl": 0.456011638045311, "tokens": 122880, "cumulative_loss_tokens": 4546560, "secs": 42.1}
38
+ {"step": 38, "kl": 0.41011486351490023, "tokens": 122880, "cumulative_loss_tokens": 4669440, "secs": 42.0}
39
+ {"step": 39, "kl": 0.4057838886976242, "tokens": 122880, "cumulative_loss_tokens": 4792320, "secs": 42.1}
40
+ {"step": 40, "kl": 0.44491428236166636, "tokens": 122880, "cumulative_loss_tokens": 4915200, "secs": 42.1}
41
+ {"step": 41, "kl": 0.44118417501449586, "tokens": 122880, "cumulative_loss_tokens": 5038080, "secs": 42.1}
42
+ {"step": 42, "kl": 0.4141279463966688, "tokens": 122880, "cumulative_loss_tokens": 5160960, "secs": 42.1}
43
+ {"step": 43, "kl": 0.41535414357980094, "tokens": 122880, "cumulative_loss_tokens": 5283840, "secs": 42.0}
44
+ {"step": 44, "kl": 0.37733205656210583, "tokens": 122880, "cumulative_loss_tokens": 5406720, "secs": 42.1}
45
+ {"step": 45, "kl": 0.40215973754723866, "tokens": 122880, "cumulative_loss_tokens": 5529600, "secs": 42.1}
46
+ {"step": 46, "kl": 0.44426603813966115, "tokens": 122880, "cumulative_loss_tokens": 5652480, "secs": 41.9}
47
+ {"step": 47, "kl": 0.45498027503490446, "tokens": 122880, "cumulative_loss_tokens": 5775360, "secs": 42.1}
48
+ {"step": 48, "kl": 0.3959922303756078, "tokens": 122880, "cumulative_loss_tokens": 5898240, "secs": 42.1}
49
+ {"step": 49, "kl": 0.405680842200915, "tokens": 122880, "cumulative_loss_tokens": 6021120, "secs": 42.1}
50
+ {"step": 50, "kl": 0.46550515393416086, "tokens": 122880, "cumulative_loss_tokens": 6144000, "secs": 42.0}
healed/mixdistill_smoke/step0006/chat_template.jinja ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|system|>
2
+ ' + message['content'] + '
3
+ ' }}{% elif message['role'] == 'user' %}{{ '<|user|>
4
+ ' + message['content'] + '
5
+ ' }}{% elif message['role'] == 'assistant' %}{% if not loop.last %}{{ '<|assistant|>
6
+ ' + message['content'] + eos_token + '
7
+ ' }}{% else %}{{ '<|assistant|>
8
+ ' + message['content'] + eos_token }}{% endif %}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|assistant|>
9
+ ' }}{% endif %}{% endfor %}
healed/mixdistill_smoke/step0006/config.json ADDED
@@ -0,0 +1,887 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "PrunedOlmoeForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_pruned_olmoe.PrunedOlmoeConfig",
9
+ "AutoModelForCausalLM": "modeling_pruned_olmoe.PrunedOlmoeForCausalLM"
10
+ },
11
+ "clip_qkv": null,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 50279,
14
+ "expert_widths": [
15
+ [
16
+ 1024,
17
+ 384,
18
+ 256,
19
+ 256,
20
+ 768,
21
+ 1024,
22
+ 128,
23
+ 768,
24
+ 384,
25
+ 128,
26
+ 1024,
27
+ 384,
28
+ 384,
29
+ 128,
30
+ 640,
31
+ 896,
32
+ 896,
33
+ 256,
34
+ 768,
35
+ 128,
36
+ 768,
37
+ 768,
38
+ 768,
39
+ 768,
40
+ 640,
41
+ 896,
42
+ 256,
43
+ 128,
44
+ 384,
45
+ 896,
46
+ 256,
47
+ 768,
48
+ 512,
49
+ 640,
50
+ 768,
51
+ 896,
52
+ 1024,
53
+ 384,
54
+ 384,
55
+ 512,
56
+ 384,
57
+ 256,
58
+ 768,
59
+ 640,
60
+ 896,
61
+ 896,
62
+ 512,
63
+ 768,
64
+ 512,
65
+ 384,
66
+ 1024,
67
+ 896,
68
+ 896,
69
+ 768,
70
+ 128
71
+ ],
72
+ [
73
+ 768,
74
+ 896,
75
+ 896,
76
+ 256,
77
+ 896,
78
+ 384,
79
+ 768,
80
+ 768,
81
+ 1024,
82
+ 384,
83
+ 512,
84
+ 1024,
85
+ 768,
86
+ 768,
87
+ 1024,
88
+ 640,
89
+ 128,
90
+ 768,
91
+ 384,
92
+ 768,
93
+ 128,
94
+ 256,
95
+ 512,
96
+ 384,
97
+ 896,
98
+ 256,
99
+ 1024,
100
+ 1024,
101
+ 896,
102
+ 1024,
103
+ 896,
104
+ 768,
105
+ 256,
106
+ 768,
107
+ 128,
108
+ 1024,
109
+ 768,
110
+ 768,
111
+ 640,
112
+ 384,
113
+ 1024,
114
+ 384,
115
+ 640,
116
+ 896,
117
+ 1024,
118
+ 512,
119
+ 512,
120
+ 512,
121
+ 640
122
+ ],
123
+ [
124
+ 768,
125
+ 1024,
126
+ 512,
127
+ 384,
128
+ 384,
129
+ 768,
130
+ 256,
131
+ 384,
132
+ 1024,
133
+ 896,
134
+ 640,
135
+ 256,
136
+ 1024,
137
+ 1024,
138
+ 1024,
139
+ 640,
140
+ 1024,
141
+ 896,
142
+ 512,
143
+ 768,
144
+ 128,
145
+ 768,
146
+ 1024,
147
+ 768,
148
+ 256,
149
+ 1024,
150
+ 896,
151
+ 1024,
152
+ 896,
153
+ 512,
154
+ 640,
155
+ 384,
156
+ 896,
157
+ 384,
158
+ 512,
159
+ 640,
160
+ 256,
161
+ 768,
162
+ 256,
163
+ 768,
164
+ 768,
165
+ 640,
166
+ 1024,
167
+ 640,
168
+ 896,
169
+ 768,
170
+ 768,
171
+ 256
172
+ ],
173
+ [
174
+ 640,
175
+ 640,
176
+ 896,
177
+ 512,
178
+ 640,
179
+ 896,
180
+ 896,
181
+ 384,
182
+ 896,
183
+ 896,
184
+ 384,
185
+ 896,
186
+ 640,
187
+ 256,
188
+ 640,
189
+ 1024,
190
+ 1024,
191
+ 768,
192
+ 1024,
193
+ 896,
194
+ 1024,
195
+ 768,
196
+ 896,
197
+ 256,
198
+ 512,
199
+ 768,
200
+ 1024,
201
+ 256,
202
+ 768,
203
+ 512,
204
+ 256,
205
+ 640,
206
+ 1024,
207
+ 1024,
208
+ 512,
209
+ 1024,
210
+ 768,
211
+ 256,
212
+ 1024,
213
+ 384,
214
+ 896,
215
+ 1024,
216
+ 896,
217
+ 1024,
218
+ 384
219
+ ],
220
+ [
221
+ 256,
222
+ 640,
223
+ 640,
224
+ 896,
225
+ 768,
226
+ 896,
227
+ 768,
228
+ 768,
229
+ 896,
230
+ 896,
231
+ 1024,
232
+ 256,
233
+ 512,
234
+ 1024,
235
+ 640,
236
+ 896,
237
+ 512,
238
+ 512,
239
+ 384,
240
+ 384,
241
+ 256,
242
+ 384,
243
+ 384,
244
+ 896,
245
+ 896,
246
+ 768,
247
+ 640,
248
+ 896,
249
+ 768,
250
+ 1024,
251
+ 512,
252
+ 640,
253
+ 512,
254
+ 640,
255
+ 896,
256
+ 512,
257
+ 512,
258
+ 384,
259
+ 640,
260
+ 896,
261
+ 896,
262
+ 896,
263
+ 1024,
264
+ 640,
265
+ 1024,
266
+ 640,
267
+ 1024
268
+ ],
269
+ [
270
+ 1024,
271
+ 512,
272
+ 1024,
273
+ 1024,
274
+ 640,
275
+ 896,
276
+ 640,
277
+ 1024,
278
+ 896,
279
+ 384,
280
+ 1024,
281
+ 128,
282
+ 896,
283
+ 768,
284
+ 1024,
285
+ 768,
286
+ 640,
287
+ 896,
288
+ 768,
289
+ 640,
290
+ 512,
291
+ 896,
292
+ 512,
293
+ 640,
294
+ 256,
295
+ 768,
296
+ 640,
297
+ 768,
298
+ 384,
299
+ 896,
300
+ 512,
301
+ 512,
302
+ 256,
303
+ 512,
304
+ 896,
305
+ 256,
306
+ 384,
307
+ 640,
308
+ 512,
309
+ 640,
310
+ 896,
311
+ 512,
312
+ 1024,
313
+ 256,
314
+ 768,
315
+ 1024,
316
+ 768,
317
+ 256,
318
+ 256
319
+ ],
320
+ [
321
+ 640,
322
+ 896,
323
+ 1024,
324
+ 896,
325
+ 1024,
326
+ 1024,
327
+ 1024,
328
+ 512,
329
+ 256,
330
+ 256,
331
+ 1024,
332
+ 768,
333
+ 512,
334
+ 768,
335
+ 1024,
336
+ 1024,
337
+ 1024,
338
+ 384,
339
+ 512,
340
+ 1024,
341
+ 512,
342
+ 1024,
343
+ 128,
344
+ 640,
345
+ 640,
346
+ 896,
347
+ 768,
348
+ 128,
349
+ 256,
350
+ 256,
351
+ 256,
352
+ 256,
353
+ 896,
354
+ 1024,
355
+ 1024,
356
+ 384,
357
+ 896,
358
+ 256,
359
+ 896,
360
+ 640,
361
+ 1024,
362
+ 384,
363
+ 640,
364
+ 256,
365
+ 1024,
366
+ 1024,
367
+ 1024
368
+ ],
369
+ [
370
+ 1024,
371
+ 384,
372
+ 1024,
373
+ 1024,
374
+ 256,
375
+ 128,
376
+ 256,
377
+ 384,
378
+ 256,
379
+ 384,
380
+ 896,
381
+ 768,
382
+ 896,
383
+ 896,
384
+ 512,
385
+ 896,
386
+ 640,
387
+ 384,
388
+ 384,
389
+ 896,
390
+ 768,
391
+ 384,
392
+ 896,
393
+ 768,
394
+ 768,
395
+ 512,
396
+ 896,
397
+ 768,
398
+ 768,
399
+ 896,
400
+ 128,
401
+ 896,
402
+ 512,
403
+ 256,
404
+ 768,
405
+ 128,
406
+ 384,
407
+ 256,
408
+ 896,
409
+ 896,
410
+ 384,
411
+ 768,
412
+ 512,
413
+ 640,
414
+ 256,
415
+ 768,
416
+ 640,
417
+ 896,
418
+ 384,
419
+ 512,
420
+ 1024,
421
+ 768,
422
+ 384
423
+ ],
424
+ [
425
+ 512,
426
+ 768,
427
+ 512,
428
+ 256,
429
+ 128,
430
+ 640,
431
+ 384,
432
+ 640,
433
+ 768,
434
+ 896,
435
+ 640,
436
+ 768,
437
+ 256,
438
+ 384,
439
+ 1024,
440
+ 896,
441
+ 256,
442
+ 896,
443
+ 512,
444
+ 256,
445
+ 896,
446
+ 768,
447
+ 256,
448
+ 896,
449
+ 896,
450
+ 384,
451
+ 896,
452
+ 640,
453
+ 768,
454
+ 512,
455
+ 768,
456
+ 768,
457
+ 1024,
458
+ 768,
459
+ 640,
460
+ 768,
461
+ 384,
462
+ 256,
463
+ 512,
464
+ 896,
465
+ 128,
466
+ 384,
467
+ 256,
468
+ 768,
469
+ 384,
470
+ 256,
471
+ 1024,
472
+ 1024,
473
+ 896,
474
+ 256,
475
+ 1024,
476
+ 256,
477
+ 128,
478
+ 896
479
+ ],
480
+ [
481
+ 640,
482
+ 640,
483
+ 896,
484
+ 256,
485
+ 1024,
486
+ 512,
487
+ 1024,
488
+ 768,
489
+ 384,
490
+ 512,
491
+ 256,
492
+ 768,
493
+ 896,
494
+ 768,
495
+ 512,
496
+ 768,
497
+ 768,
498
+ 640,
499
+ 384,
500
+ 768,
501
+ 512,
502
+ 768,
503
+ 768,
504
+ 512,
505
+ 768,
506
+ 128,
507
+ 896,
508
+ 512,
509
+ 768,
510
+ 1024,
511
+ 128,
512
+ 384,
513
+ 768,
514
+ 768,
515
+ 768,
516
+ 384,
517
+ 512,
518
+ 640,
519
+ 768,
520
+ 512,
521
+ 768,
522
+ 1024,
523
+ 640,
524
+ 896,
525
+ 256,
526
+ 1024,
527
+ 384,
528
+ 768,
529
+ 768,
530
+ 768
531
+ ],
532
+ [
533
+ 896,
534
+ 512,
535
+ 896,
536
+ 768,
537
+ 384,
538
+ 384,
539
+ 768,
540
+ 512,
541
+ 768,
542
+ 512,
543
+ 1024,
544
+ 640,
545
+ 896,
546
+ 896,
547
+ 256,
548
+ 640,
549
+ 1024,
550
+ 256,
551
+ 896,
552
+ 128,
553
+ 128,
554
+ 128,
555
+ 768,
556
+ 896,
557
+ 384,
558
+ 896,
559
+ 512,
560
+ 896,
561
+ 384,
562
+ 256,
563
+ 640,
564
+ 640,
565
+ 896,
566
+ 768,
567
+ 640,
568
+ 256,
569
+ 896,
570
+ 896,
571
+ 512,
572
+ 128,
573
+ 896,
574
+ 256,
575
+ 256,
576
+ 640,
577
+ 896,
578
+ 896,
579
+ 128,
580
+ 1024,
581
+ 256,
582
+ 384,
583
+ 1024,
584
+ 640,
585
+ 896
586
+ ],
587
+ [
588
+ 768,
589
+ 384,
590
+ 640,
591
+ 896,
592
+ 256,
593
+ 128,
594
+ 384,
595
+ 896,
596
+ 128,
597
+ 128,
598
+ 896,
599
+ 256,
600
+ 384,
601
+ 896,
602
+ 512,
603
+ 768,
604
+ 768,
605
+ 512,
606
+ 512,
607
+ 768,
608
+ 896,
609
+ 640,
610
+ 768,
611
+ 896,
612
+ 896,
613
+ 896,
614
+ 640,
615
+ 896,
616
+ 640,
617
+ 512,
618
+ 896,
619
+ 256,
620
+ 512,
621
+ 128,
622
+ 512,
623
+ 384,
624
+ 768,
625
+ 768,
626
+ 1024,
627
+ 256,
628
+ 768,
629
+ 256,
630
+ 768,
631
+ 512,
632
+ 640,
633
+ 1024,
634
+ 128,
635
+ 896,
636
+ 896,
637
+ 896,
638
+ 896,
639
+ 1024
640
+ ],
641
+ [
642
+ 512,
643
+ 384,
644
+ 768,
645
+ 640,
646
+ 640,
647
+ 768,
648
+ 1024,
649
+ 896,
650
+ 512,
651
+ 256,
652
+ 640,
653
+ 768,
654
+ 640,
655
+ 896,
656
+ 128,
657
+ 256,
658
+ 896,
659
+ 1024,
660
+ 256,
661
+ 640,
662
+ 512,
663
+ 256,
664
+ 128,
665
+ 512,
666
+ 256,
667
+ 640,
668
+ 768,
669
+ 768,
670
+ 128,
671
+ 128,
672
+ 768,
673
+ 640,
674
+ 1024,
675
+ 1024,
676
+ 768,
677
+ 512,
678
+ 896,
679
+ 768,
680
+ 896,
681
+ 1024,
682
+ 896,
683
+ 896,
684
+ 512,
685
+ 640,
686
+ 1024,
687
+ 512,
688
+ 1024,
689
+ 512,
690
+ 512,
691
+ 512,
692
+ 768
693
+ ],
694
+ [
695
+ 896,
696
+ 896,
697
+ 1024,
698
+ 1024,
699
+ 896,
700
+ 128,
701
+ 768,
702
+ 256,
703
+ 1024,
704
+ 256,
705
+ 1024,
706
+ 640,
707
+ 384,
708
+ 256,
709
+ 256,
710
+ 512,
711
+ 768,
712
+ 896,
713
+ 512,
714
+ 768,
715
+ 384,
716
+ 1024,
717
+ 896,
718
+ 896,
719
+ 1024,
720
+ 896,
721
+ 768,
722
+ 896,
723
+ 640,
724
+ 1024,
725
+ 512,
726
+ 896,
727
+ 512,
728
+ 1024,
729
+ 512,
730
+ 512,
731
+ 256,
732
+ 256,
733
+ 256,
734
+ 512,
735
+ 768,
736
+ 128,
737
+ 384,
738
+ 512,
739
+ 896,
740
+ 896,
741
+ 1024,
742
+ 256,
743
+ 384,
744
+ 640
745
+ ],
746
+ [
747
+ 896,
748
+ 640,
749
+ 384,
750
+ 512,
751
+ 256,
752
+ 640,
753
+ 1024,
754
+ 384,
755
+ 1024,
756
+ 1024,
757
+ 768,
758
+ 256,
759
+ 1024,
760
+ 768,
761
+ 512,
762
+ 896,
763
+ 256,
764
+ 1024,
765
+ 768,
766
+ 768,
767
+ 768,
768
+ 384,
769
+ 384,
770
+ 256,
771
+ 1024,
772
+ 384,
773
+ 384,
774
+ 384,
775
+ 896,
776
+ 768,
777
+ 640,
778
+ 768,
779
+ 512,
780
+ 896,
781
+ 896,
782
+ 896,
783
+ 896,
784
+ 256,
785
+ 384,
786
+ 128,
787
+ 1024,
788
+ 896,
789
+ 256,
790
+ 256,
791
+ 768,
792
+ 640,
793
+ 896,
794
+ 384,
795
+ 768,
796
+ 512,
797
+ 640
798
+ ],
799
+ [
800
+ 896,
801
+ 1024,
802
+ 768,
803
+ 1024,
804
+ 896,
805
+ 256,
806
+ 768,
807
+ 128,
808
+ 128,
809
+ 768,
810
+ 512,
811
+ 896,
812
+ 384,
813
+ 768,
814
+ 1024,
815
+ 256,
816
+ 768,
817
+ 768,
818
+ 256,
819
+ 512,
820
+ 512,
821
+ 640,
822
+ 512,
823
+ 256,
824
+ 768,
825
+ 896,
826
+ 384,
827
+ 1024,
828
+ 640,
829
+ 1024,
830
+ 512,
831
+ 512,
832
+ 384,
833
+ 512,
834
+ 512,
835
+ 1024,
836
+ 384,
837
+ 896,
838
+ 768,
839
+ 384,
840
+ 384,
841
+ 128,
842
+ 384,
843
+ 1024,
844
+ 896,
845
+ 640,
846
+ 768,
847
+ 768,
848
+ 256,
849
+ 640,
850
+ 512,
851
+ 640,
852
+ 384
853
+ ]
854
+ ],
855
+ "glean_metadata": {
856
+ "base_model": "allenai/OLMoE-1B-7B-0125-Instruct",
857
+ "block_size": 128,
858
+ "criterion": "reap",
859
+ "dead_experts": 217,
860
+ "keep_fraction": 0.5,
861
+ "min_width": 128,
862
+ "params": 3697491968,
863
+ "scores": "outputs/scores_0125inst_dolmino-math/scores.pt"
864
+ },
865
+ "hidden_act": "silu",
866
+ "hidden_size": 2048,
867
+ "initializer_range": 0.02,
868
+ "intermediate_size": 1024,
869
+ "max_position_embeddings": 4096,
870
+ "model_type": "pruned_olmoe",
871
+ "norm_topk_prob": false,
872
+ "num_attention_heads": 16,
873
+ "num_experts": 64,
874
+ "num_experts_per_tok": 8,
875
+ "num_hidden_layers": 16,
876
+ "num_key_value_heads": 16,
877
+ "output_router_logits": false,
878
+ "pad_token_id": 1,
879
+ "rms_norm_eps": 1e-05,
880
+ "rope_scaling": null,
881
+ "rope_theta": 10000.0,
882
+ "router_aux_loss_coef": 0.01,
883
+ "tie_word_embeddings": false,
884
+ "transformers_version": "4.57.6",
885
+ "use_cache": false,
886
+ "vocab_size": 50304
887
+ }
healed/mixdistill_smoke/step0006/configuration_pruned_olmoe.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Configuration for GLEAN-pruned OLMoE: variable-width, variable-count experts.
2
+ """
3
+
4
+ from transformers.models.olmoe.configuration_olmoe import OlmoeConfig
5
+
6
+
7
+ class PrunedOlmoeConfig(OlmoeConfig):
8
+ """OlmoeConfig plus a per-(layer, expert) width table.
9
+
10
+ ``expert_widths[l]`` lists the SwiGLU intermediate width of each surviving
11
+ expert in decoder layer ``l``, in expert order. Lists are ragged: layers
12
+ may keep different numbers of experts (deleted experts simply don't
13
+ appear — the router in layer ``l`` has ``len(expert_widths[l])`` rows),
14
+ and each width may differ (multiples of the GEMM block size, 128, for
15
+ variable-MegaBlocks execution). ``None`` means an unpruned model
16
+ (uniform ``num_experts`` × ``intermediate_size``).
17
+
18
+ The inherited ``num_experts`` / ``intermediate_size`` keep their ORIGINAL
19
+ (pre-pruning) values for provenance; the width table is authoritative for
20
+ the built architecture.
21
+ """
22
+
23
+ model_type = "pruned_olmoe"
24
+
25
+ def __init__(self, expert_widths: list[list[int]] | None = None, **kwargs):
26
+ super().__init__(**kwargs)
27
+ self.expert_widths = expert_widths
healed/mixdistill_smoke/step0006/generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 50279,
4
+ "pad_token_id": 1,
5
+ "transformers_version": "4.57.6"
6
+ }
healed/mixdistill_smoke/step0006/model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
healed/mixdistill_smoke/step0006/modeling_pruned_olmoe.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """GLEAN-pruned OLMoE: HF-loadable model with ragged (variable-width) experts.
2
+
3
+ Pattern follows hbfreed/variable-flex-olmo's PrunedFlexOlmoForCausalLM
4
+ (docs/recon/prior-work-hbfreed.md), generalized from one scalar width to a
5
+ per-(layer, expert) width table: ``super().__init__`` builds the uniform
6
+ architecture from the config, then every MoE block is rebuilt to its pruned
7
+ shape — surviving experts only, each at its own width, router sliced to
8
+ match — so the state dict aligns exactly with what
9
+ ``glean.prune.prune_channels_global`` leaves behind.
10
+
11
+ Caveat: ``output_router_logits=True`` (the load-balancing aux loss) assumes a
12
+ uniform ``config.num_experts`` and is unsupported on ragged models.
13
+ """
14
+
15
+ import torch.nn as nn
16
+ from transformers.activations import ACT2FN
17
+ from transformers.models.olmoe.modeling_olmoe import OlmoeForCausalLM
18
+
19
+ from .configuration_pruned_olmoe import PrunedOlmoeConfig
20
+
21
+
22
+ class RaggedOlmoeMLP(nn.Module):
23
+ """OlmoeMLP with an explicit intermediate width (SwiGLU, no biases)."""
24
+
25
+ def __init__(self, hidden_size: int, intermediate_size: int, hidden_act: str):
26
+ super().__init__()
27
+ self.hidden_size = hidden_size
28
+ self.intermediate_size = intermediate_size
29
+ self.gate_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
30
+ self.up_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
31
+ self.down_proj = nn.Linear(intermediate_size, hidden_size, bias=False)
32
+ self.act_fn = ACT2FN[hidden_act]
33
+
34
+ def forward(self, x):
35
+ return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
36
+
37
+
38
+ class PrunedOlmoeForCausalLM(OlmoeForCausalLM):
39
+ """OLMoE with per-layer surviving-expert lists at per-expert widths."""
40
+
41
+ config_class = PrunedOlmoeConfig
42
+
43
+ def __init__(self, config: PrunedOlmoeConfig):
44
+ super().__init__(config)
45
+ widths_table = getattr(config, "expert_widths", None)
46
+ if widths_table is None:
47
+ return # unpruned: plain OLMoE
48
+ if len(widths_table) != len(self.model.layers):
49
+ raise ValueError(
50
+ f"expert_widths has {len(widths_table)} rows but the model has "
51
+ f"{len(self.model.layers)} decoder layers"
52
+ )
53
+ for layer, widths in zip(self.model.layers, widths_table):
54
+ if any(w <= 0 for w in widths):
55
+ raise ValueError("expert_widths must list surviving experts only (>0)")
56
+ block = layer.mlp
57
+ if len(widths) < block.top_k:
58
+ raise ValueError(
59
+ f"a layer keeps {len(widths)} experts < top_k={block.top_k}"
60
+ )
61
+ block.num_experts = len(widths)
62
+ block.gate = nn.Linear(config.hidden_size, len(widths), bias=False)
63
+ block.experts = nn.ModuleList(
64
+ RaggedOlmoeMLP(config.hidden_size, w, config.hidden_act)
65
+ for w in widths
66
+ )
healed/mixdistill_smoke/step0006/special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "|||IP_ADDRESS|||",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "|||IP_ADDRESS|||",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<pad>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
healed/mixdistill_smoke/step0006/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
healed/mixdistill_smoke/step0006/tokenizer_config.json ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": false,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<|endoftext|>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<|padding|>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "50254": {
23
+ "content": " ",
24
+ "lstrip": false,
25
+ "normalized": true,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": false
29
+ },
30
+ "50255": {
31
+ "content": " ",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": false
37
+ },
38
+ "50256": {
39
+ "content": " ",
40
+ "lstrip": false,
41
+ "normalized": true,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": false
45
+ },
46
+ "50257": {
47
+ "content": " ",
48
+ "lstrip": false,
49
+ "normalized": true,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": false
53
+ },
54
+ "50258": {
55
+ "content": " ",
56
+ "lstrip": false,
57
+ "normalized": true,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": false
61
+ },
62
+ "50259": {
63
+ "content": " ",
64
+ "lstrip": false,
65
+ "normalized": true,
66
+ "rstrip": false,
67
+ "single_word": false,
68
+ "special": false
69
+ },
70
+ "50260": {
71
+ "content": " ",
72
+ "lstrip": false,
73
+ "normalized": true,
74
+ "rstrip": false,
75
+ "single_word": false,
76
+ "special": false
77
+ },
78
+ "50261": {
79
+ "content": " ",
80
+ "lstrip": false,
81
+ "normalized": true,
82
+ "rstrip": false,
83
+ "single_word": false,
84
+ "special": false
85
+ },
86
+ "50262": {
87
+ "content": " ",
88
+ "lstrip": false,
89
+ "normalized": true,
90
+ "rstrip": false,
91
+ "single_word": false,
92
+ "special": false
93
+ },
94
+ "50263": {
95
+ "content": " ",
96
+ "lstrip": false,
97
+ "normalized": true,
98
+ "rstrip": false,
99
+ "single_word": false,
100
+ "special": false
101
+ },
102
+ "50264": {
103
+ "content": " ",
104
+ "lstrip": false,
105
+ "normalized": true,
106
+ "rstrip": false,
107
+ "single_word": false,
108
+ "special": false
109
+ },
110
+ "50265": {
111
+ "content": " ",
112
+ "lstrip": false,
113
+ "normalized": true,
114
+ "rstrip": false,
115
+ "single_word": false,
116
+ "special": false
117
+ },
118
+ "50266": {
119
+ "content": " ",
120
+ "lstrip": false,
121
+ "normalized": true,
122
+ "rstrip": false,
123
+ "single_word": false,
124
+ "special": false
125
+ },
126
+ "50267": {
127
+ "content": " ",
128
+ "lstrip": false,
129
+ "normalized": true,
130
+ "rstrip": false,
131
+ "single_word": false,
132
+ "special": false
133
+ },
134
+ "50268": {
135
+ "content": " ",
136
+ "lstrip": false,
137
+ "normalized": true,
138
+ "rstrip": false,
139
+ "single_word": false,
140
+ "special": false
141
+ },
142
+ "50269": {
143
+ "content": " ",
144
+ "lstrip": false,
145
+ "normalized": true,
146
+ "rstrip": false,
147
+ "single_word": false,
148
+ "special": false
149
+ },
150
+ "50270": {
151
+ "content": " ",
152
+ "lstrip": false,
153
+ "normalized": true,
154
+ "rstrip": false,
155
+ "single_word": false,
156
+ "special": false
157
+ },
158
+ "50271": {
159
+ "content": " ",
160
+ "lstrip": false,
161
+ "normalized": true,
162
+ "rstrip": false,
163
+ "single_word": false,
164
+ "special": false
165
+ },
166
+ "50272": {
167
+ "content": " ",
168
+ "lstrip": false,
169
+ "normalized": true,
170
+ "rstrip": false,
171
+ "single_word": false,
172
+ "special": false
173
+ },
174
+ "50273": {
175
+ "content": " ",
176
+ "lstrip": false,
177
+ "normalized": true,
178
+ "rstrip": false,
179
+ "single_word": false,
180
+ "special": false
181
+ },
182
+ "50274": {
183
+ "content": " ",
184
+ "lstrip": false,
185
+ "normalized": true,
186
+ "rstrip": false,
187
+ "single_word": false,
188
+ "special": false
189
+ },
190
+ "50275": {
191
+ "content": " ",
192
+ "lstrip": false,
193
+ "normalized": true,
194
+ "rstrip": false,
195
+ "single_word": false,
196
+ "special": false
197
+ },
198
+ "50276": {
199
+ "content": " ",
200
+ "lstrip": false,
201
+ "normalized": true,
202
+ "rstrip": false,
203
+ "single_word": false,
204
+ "special": false
205
+ },
206
+ "50277": {
207
+ "content": "|||EMAIL_ADDRESS|||",
208
+ "lstrip": false,
209
+ "normalized": true,
210
+ "rstrip": false,
211
+ "single_word": false,
212
+ "special": false
213
+ },
214
+ "50278": {
215
+ "content": "|||PHONE_NUMBER|||",
216
+ "lstrip": false,
217
+ "normalized": true,
218
+ "rstrip": false,
219
+ "single_word": false,
220
+ "special": false
221
+ },
222
+ "50279": {
223
+ "content": "|||IP_ADDRESS|||",
224
+ "lstrip": false,
225
+ "normalized": true,
226
+ "rstrip": false,
227
+ "single_word": false,
228
+ "special": true
229
+ },
230
+ "50280": {
231
+ "content": "<pad>",
232
+ "lstrip": false,
233
+ "normalized": false,
234
+ "rstrip": false,
235
+ "single_word": false,
236
+ "special": true
237
+ }
238
+ },
239
+ "bos_token": "|||IP_ADDRESS|||",
240
+ "clean_up_tokenization_spaces": false,
241
+ "eos_token": "|||IP_ADDRESS|||",
242
+ "extra_special_tokens": {},
243
+ "model_max_length": 1000000000000000019884624838656,
244
+ "pad_token": "<pad>",
245
+ "tokenizer_class": "GPTNeoXTokenizer",
246
+ "unk_token": null
247
+ }
healed/opd_warm_unleashed/step0300/chat_template.jinja ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|system|>
2
+ ' + message['content'] + '
3
+ ' }}{% elif message['role'] == 'user' %}{{ '<|user|>
4
+ ' + message['content'] + '
5
+ ' }}{% elif message['role'] == 'assistant' %}{% if not loop.last %}{{ '<|assistant|>
6
+ ' + message['content'] + eos_token + '
7
+ ' }}{% else %}{{ '<|assistant|>
8
+ ' + message['content'] + eos_token }}{% endif %}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|assistant|>
9
+ ' }}{% endif %}{% endfor %}
healed/opd_warm_unleashed/step0300/config.json ADDED
@@ -0,0 +1,887 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "PrunedOlmoeForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_pruned_olmoe.PrunedOlmoeConfig",
9
+ "AutoModelForCausalLM": "modeling_pruned_olmoe.PrunedOlmoeForCausalLM"
10
+ },
11
+ "clip_qkv": null,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 50279,
14
+ "expert_widths": [
15
+ [
16
+ 1024,
17
+ 384,
18
+ 256,
19
+ 256,
20
+ 768,
21
+ 1024,
22
+ 128,
23
+ 768,
24
+ 384,
25
+ 128,
26
+ 1024,
27
+ 384,
28
+ 384,
29
+ 128,
30
+ 640,
31
+ 896,
32
+ 896,
33
+ 256,
34
+ 768,
35
+ 128,
36
+ 768,
37
+ 768,
38
+ 768,
39
+ 768,
40
+ 640,
41
+ 896,
42
+ 256,
43
+ 128,
44
+ 384,
45
+ 896,
46
+ 256,
47
+ 768,
48
+ 512,
49
+ 640,
50
+ 768,
51
+ 896,
52
+ 1024,
53
+ 384,
54
+ 384,
55
+ 512,
56
+ 384,
57
+ 256,
58
+ 768,
59
+ 640,
60
+ 896,
61
+ 896,
62
+ 512,
63
+ 768,
64
+ 512,
65
+ 384,
66
+ 1024,
67
+ 896,
68
+ 896,
69
+ 768,
70
+ 128
71
+ ],
72
+ [
73
+ 768,
74
+ 896,
75
+ 896,
76
+ 256,
77
+ 896,
78
+ 384,
79
+ 768,
80
+ 768,
81
+ 1024,
82
+ 384,
83
+ 512,
84
+ 1024,
85
+ 768,
86
+ 768,
87
+ 1024,
88
+ 640,
89
+ 128,
90
+ 768,
91
+ 384,
92
+ 768,
93
+ 128,
94
+ 256,
95
+ 512,
96
+ 384,
97
+ 896,
98
+ 256,
99
+ 1024,
100
+ 1024,
101
+ 896,
102
+ 1024,
103
+ 896,
104
+ 768,
105
+ 256,
106
+ 768,
107
+ 128,
108
+ 1024,
109
+ 768,
110
+ 768,
111
+ 640,
112
+ 384,
113
+ 1024,
114
+ 384,
115
+ 640,
116
+ 896,
117
+ 1024,
118
+ 512,
119
+ 512,
120
+ 512,
121
+ 640
122
+ ],
123
+ [
124
+ 768,
125
+ 1024,
126
+ 512,
127
+ 384,
128
+ 384,
129
+ 768,
130
+ 256,
131
+ 384,
132
+ 1024,
133
+ 896,
134
+ 640,
135
+ 256,
136
+ 1024,
137
+ 1024,
138
+ 1024,
139
+ 640,
140
+ 1024,
141
+ 896,
142
+ 512,
143
+ 768,
144
+ 128,
145
+ 768,
146
+ 1024,
147
+ 768,
148
+ 256,
149
+ 1024,
150
+ 896,
151
+ 1024,
152
+ 896,
153
+ 512,
154
+ 640,
155
+ 384,
156
+ 896,
157
+ 384,
158
+ 512,
159
+ 640,
160
+ 256,
161
+ 768,
162
+ 256,
163
+ 768,
164
+ 768,
165
+ 640,
166
+ 1024,
167
+ 640,
168
+ 896,
169
+ 768,
170
+ 768,
171
+ 256
172
+ ],
173
+ [
174
+ 640,
175
+ 640,
176
+ 896,
177
+ 512,
178
+ 640,
179
+ 896,
180
+ 896,
181
+ 384,
182
+ 896,
183
+ 896,
184
+ 384,
185
+ 896,
186
+ 640,
187
+ 256,
188
+ 640,
189
+ 1024,
190
+ 1024,
191
+ 768,
192
+ 1024,
193
+ 896,
194
+ 1024,
195
+ 768,
196
+ 896,
197
+ 256,
198
+ 512,
199
+ 768,
200
+ 1024,
201
+ 256,
202
+ 768,
203
+ 512,
204
+ 256,
205
+ 640,
206
+ 1024,
207
+ 1024,
208
+ 512,
209
+ 1024,
210
+ 768,
211
+ 256,
212
+ 1024,
213
+ 384,
214
+ 896,
215
+ 1024,
216
+ 896,
217
+ 1024,
218
+ 384
219
+ ],
220
+ [
221
+ 256,
222
+ 640,
223
+ 640,
224
+ 896,
225
+ 768,
226
+ 896,
227
+ 768,
228
+ 768,
229
+ 896,
230
+ 896,
231
+ 1024,
232
+ 256,
233
+ 512,
234
+ 1024,
235
+ 640,
236
+ 896,
237
+ 512,
238
+ 512,
239
+ 384,
240
+ 384,
241
+ 256,
242
+ 384,
243
+ 384,
244
+ 896,
245
+ 896,
246
+ 768,
247
+ 640,
248
+ 896,
249
+ 768,
250
+ 1024,
251
+ 512,
252
+ 640,
253
+ 512,
254
+ 640,
255
+ 896,
256
+ 512,
257
+ 512,
258
+ 384,
259
+ 640,
260
+ 896,
261
+ 896,
262
+ 896,
263
+ 1024,
264
+ 640,
265
+ 1024,
266
+ 640,
267
+ 1024
268
+ ],
269
+ [
270
+ 1024,
271
+ 512,
272
+ 1024,
273
+ 1024,
274
+ 640,
275
+ 896,
276
+ 640,
277
+ 1024,
278
+ 896,
279
+ 384,
280
+ 1024,
281
+ 128,
282
+ 896,
283
+ 768,
284
+ 1024,
285
+ 768,
286
+ 640,
287
+ 896,
288
+ 768,
289
+ 640,
290
+ 512,
291
+ 896,
292
+ 512,
293
+ 640,
294
+ 256,
295
+ 768,
296
+ 640,
297
+ 768,
298
+ 384,
299
+ 896,
300
+ 512,
301
+ 512,
302
+ 256,
303
+ 512,
304
+ 896,
305
+ 256,
306
+ 384,
307
+ 640,
308
+ 512,
309
+ 640,
310
+ 896,
311
+ 512,
312
+ 1024,
313
+ 256,
314
+ 768,
315
+ 1024,
316
+ 768,
317
+ 256,
318
+ 256
319
+ ],
320
+ [
321
+ 640,
322
+ 896,
323
+ 1024,
324
+ 896,
325
+ 1024,
326
+ 1024,
327
+ 1024,
328
+ 512,
329
+ 256,
330
+ 256,
331
+ 1024,
332
+ 768,
333
+ 512,
334
+ 768,
335
+ 1024,
336
+ 1024,
337
+ 1024,
338
+ 384,
339
+ 512,
340
+ 1024,
341
+ 512,
342
+ 1024,
343
+ 128,
344
+ 640,
345
+ 640,
346
+ 896,
347
+ 768,
348
+ 128,
349
+ 256,
350
+ 256,
351
+ 256,
352
+ 256,
353
+ 896,
354
+ 1024,
355
+ 1024,
356
+ 384,
357
+ 896,
358
+ 256,
359
+ 896,
360
+ 640,
361
+ 1024,
362
+ 384,
363
+ 640,
364
+ 256,
365
+ 1024,
366
+ 1024,
367
+ 1024
368
+ ],
369
+ [
370
+ 1024,
371
+ 384,
372
+ 1024,
373
+ 1024,
374
+ 256,
375
+ 128,
376
+ 256,
377
+ 384,
378
+ 256,
379
+ 384,
380
+ 896,
381
+ 768,
382
+ 896,
383
+ 896,
384
+ 512,
385
+ 896,
386
+ 640,
387
+ 384,
388
+ 384,
389
+ 896,
390
+ 768,
391
+ 384,
392
+ 896,
393
+ 768,
394
+ 768,
395
+ 512,
396
+ 896,
397
+ 768,
398
+ 768,
399
+ 896,
400
+ 128,
401
+ 896,
402
+ 512,
403
+ 256,
404
+ 768,
405
+ 128,
406
+ 384,
407
+ 256,
408
+ 896,
409
+ 896,
410
+ 384,
411
+ 768,
412
+ 512,
413
+ 640,
414
+ 256,
415
+ 768,
416
+ 640,
417
+ 896,
418
+ 384,
419
+ 512,
420
+ 1024,
421
+ 768,
422
+ 384
423
+ ],
424
+ [
425
+ 512,
426
+ 768,
427
+ 512,
428
+ 256,
429
+ 128,
430
+ 640,
431
+ 384,
432
+ 640,
433
+ 768,
434
+ 896,
435
+ 640,
436
+ 768,
437
+ 256,
438
+ 384,
439
+ 1024,
440
+ 896,
441
+ 256,
442
+ 896,
443
+ 512,
444
+ 256,
445
+ 896,
446
+ 768,
447
+ 256,
448
+ 896,
449
+ 896,
450
+ 384,
451
+ 896,
452
+ 640,
453
+ 768,
454
+ 512,
455
+ 768,
456
+ 768,
457
+ 1024,
458
+ 768,
459
+ 640,
460
+ 768,
461
+ 384,
462
+ 256,
463
+ 512,
464
+ 896,
465
+ 128,
466
+ 384,
467
+ 256,
468
+ 768,
469
+ 384,
470
+ 256,
471
+ 1024,
472
+ 1024,
473
+ 896,
474
+ 256,
475
+ 1024,
476
+ 256,
477
+ 128,
478
+ 896
479
+ ],
480
+ [
481
+ 640,
482
+ 640,
483
+ 896,
484
+ 256,
485
+ 1024,
486
+ 512,
487
+ 1024,
488
+ 768,
489
+ 384,
490
+ 512,
491
+ 256,
492
+ 768,
493
+ 896,
494
+ 768,
495
+ 512,
496
+ 768,
497
+ 768,
498
+ 640,
499
+ 384,
500
+ 768,
501
+ 512,
502
+ 768,
503
+ 768,
504
+ 512,
505
+ 768,
506
+ 128,
507
+ 896,
508
+ 512,
509
+ 768,
510
+ 1024,
511
+ 128,
512
+ 384,
513
+ 768,
514
+ 768,
515
+ 768,
516
+ 384,
517
+ 512,
518
+ 640,
519
+ 768,
520
+ 512,
521
+ 768,
522
+ 1024,
523
+ 640,
524
+ 896,
525
+ 256,
526
+ 1024,
527
+ 384,
528
+ 768,
529
+ 768,
530
+ 768
531
+ ],
532
+ [
533
+ 896,
534
+ 512,
535
+ 896,
536
+ 768,
537
+ 384,
538
+ 384,
539
+ 768,
540
+ 512,
541
+ 768,
542
+ 512,
543
+ 1024,
544
+ 640,
545
+ 896,
546
+ 896,
547
+ 256,
548
+ 640,
549
+ 1024,
550
+ 256,
551
+ 896,
552
+ 128,
553
+ 128,
554
+ 128,
555
+ 768,
556
+ 896,
557
+ 384,
558
+ 896,
559
+ 512,
560
+ 896,
561
+ 384,
562
+ 256,
563
+ 640,
564
+ 640,
565
+ 896,
566
+ 768,
567
+ 640,
568
+ 256,
569
+ 896,
570
+ 896,
571
+ 512,
572
+ 128,
573
+ 896,
574
+ 256,
575
+ 256,
576
+ 640,
577
+ 896,
578
+ 896,
579
+ 128,
580
+ 1024,
581
+ 256,
582
+ 384,
583
+ 1024,
584
+ 640,
585
+ 896
586
+ ],
587
+ [
588
+ 768,
589
+ 384,
590
+ 640,
591
+ 896,
592
+ 256,
593
+ 128,
594
+ 384,
595
+ 896,
596
+ 128,
597
+ 128,
598
+ 896,
599
+ 256,
600
+ 384,
601
+ 896,
602
+ 512,
603
+ 768,
604
+ 768,
605
+ 512,
606
+ 512,
607
+ 768,
608
+ 896,
609
+ 640,
610
+ 768,
611
+ 896,
612
+ 896,
613
+ 896,
614
+ 640,
615
+ 896,
616
+ 640,
617
+ 512,
618
+ 896,
619
+ 256,
620
+ 512,
621
+ 128,
622
+ 512,
623
+ 384,
624
+ 768,
625
+ 768,
626
+ 1024,
627
+ 256,
628
+ 768,
629
+ 256,
630
+ 768,
631
+ 512,
632
+ 640,
633
+ 1024,
634
+ 128,
635
+ 896,
636
+ 896,
637
+ 896,
638
+ 896,
639
+ 1024
640
+ ],
641
+ [
642
+ 512,
643
+ 384,
644
+ 768,
645
+ 640,
646
+ 640,
647
+ 768,
648
+ 1024,
649
+ 896,
650
+ 512,
651
+ 256,
652
+ 640,
653
+ 768,
654
+ 640,
655
+ 896,
656
+ 128,
657
+ 256,
658
+ 896,
659
+ 1024,
660
+ 256,
661
+ 640,
662
+ 512,
663
+ 256,
664
+ 128,
665
+ 512,
666
+ 256,
667
+ 640,
668
+ 768,
669
+ 768,
670
+ 128,
671
+ 128,
672
+ 768,
673
+ 640,
674
+ 1024,
675
+ 1024,
676
+ 768,
677
+ 512,
678
+ 896,
679
+ 768,
680
+ 896,
681
+ 1024,
682
+ 896,
683
+ 896,
684
+ 512,
685
+ 640,
686
+ 1024,
687
+ 512,
688
+ 1024,
689
+ 512,
690
+ 512,
691
+ 512,
692
+ 768
693
+ ],
694
+ [
695
+ 896,
696
+ 896,
697
+ 1024,
698
+ 1024,
699
+ 896,
700
+ 128,
701
+ 768,
702
+ 256,
703
+ 1024,
704
+ 256,
705
+ 1024,
706
+ 640,
707
+ 384,
708
+ 256,
709
+ 256,
710
+ 512,
711
+ 768,
712
+ 896,
713
+ 512,
714
+ 768,
715
+ 384,
716
+ 1024,
717
+ 896,
718
+ 896,
719
+ 1024,
720
+ 896,
721
+ 768,
722
+ 896,
723
+ 640,
724
+ 1024,
725
+ 512,
726
+ 896,
727
+ 512,
728
+ 1024,
729
+ 512,
730
+ 512,
731
+ 256,
732
+ 256,
733
+ 256,
734
+ 512,
735
+ 768,
736
+ 128,
737
+ 384,
738
+ 512,
739
+ 896,
740
+ 896,
741
+ 1024,
742
+ 256,
743
+ 384,
744
+ 640
745
+ ],
746
+ [
747
+ 896,
748
+ 640,
749
+ 384,
750
+ 512,
751
+ 256,
752
+ 640,
753
+ 1024,
754
+ 384,
755
+ 1024,
756
+ 1024,
757
+ 768,
758
+ 256,
759
+ 1024,
760
+ 768,
761
+ 512,
762
+ 896,
763
+ 256,
764
+ 1024,
765
+ 768,
766
+ 768,
767
+ 768,
768
+ 384,
769
+ 384,
770
+ 256,
771
+ 1024,
772
+ 384,
773
+ 384,
774
+ 384,
775
+ 896,
776
+ 768,
777
+ 640,
778
+ 768,
779
+ 512,
780
+ 896,
781
+ 896,
782
+ 896,
783
+ 896,
784
+ 256,
785
+ 384,
786
+ 128,
787
+ 1024,
788
+ 896,
789
+ 256,
790
+ 256,
791
+ 768,
792
+ 640,
793
+ 896,
794
+ 384,
795
+ 768,
796
+ 512,
797
+ 640
798
+ ],
799
+ [
800
+ 896,
801
+ 1024,
802
+ 768,
803
+ 1024,
804
+ 896,
805
+ 256,
806
+ 768,
807
+ 128,
808
+ 128,
809
+ 768,
810
+ 512,
811
+ 896,
812
+ 384,
813
+ 768,
814
+ 1024,
815
+ 256,
816
+ 768,
817
+ 768,
818
+ 256,
819
+ 512,
820
+ 512,
821
+ 640,
822
+ 512,
823
+ 256,
824
+ 768,
825
+ 896,
826
+ 384,
827
+ 1024,
828
+ 640,
829
+ 1024,
830
+ 512,
831
+ 512,
832
+ 384,
833
+ 512,
834
+ 512,
835
+ 1024,
836
+ 384,
837
+ 896,
838
+ 768,
839
+ 384,
840
+ 384,
841
+ 128,
842
+ 384,
843
+ 1024,
844
+ 896,
845
+ 640,
846
+ 768,
847
+ 768,
848
+ 256,
849
+ 640,
850
+ 512,
851
+ 640,
852
+ 384
853
+ ]
854
+ ],
855
+ "glean_metadata": {
856
+ "base_model": "allenai/OLMoE-1B-7B-0125-Instruct",
857
+ "block_size": 128,
858
+ "criterion": "reap",
859
+ "dead_experts": 217,
860
+ "keep_fraction": 0.5,
861
+ "min_width": 128,
862
+ "params": 3697491968,
863
+ "scores": "outputs/scores_0125inst_dolmino-math/scores.pt"
864
+ },
865
+ "hidden_act": "silu",
866
+ "hidden_size": 2048,
867
+ "initializer_range": 0.02,
868
+ "intermediate_size": 1024,
869
+ "max_position_embeddings": 4096,
870
+ "model_type": "pruned_olmoe",
871
+ "norm_topk_prob": false,
872
+ "num_attention_heads": 16,
873
+ "num_experts": 64,
874
+ "num_experts_per_tok": 8,
875
+ "num_hidden_layers": 16,
876
+ "num_key_value_heads": 16,
877
+ "output_router_logits": false,
878
+ "pad_token_id": 1,
879
+ "rms_norm_eps": 1e-05,
880
+ "rope_scaling": null,
881
+ "rope_theta": 10000.0,
882
+ "router_aux_loss_coef": 0.01,
883
+ "tie_word_embeddings": false,
884
+ "transformers_version": "4.57.6",
885
+ "use_cache": false,
886
+ "vocab_size": 50304
887
+ }
healed/opd_warm_unleashed/step0300/configuration_pruned_olmoe.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Configuration for GLEAN-pruned OLMoE: variable-width, variable-count experts.
2
+ """
3
+
4
+ from transformers.models.olmoe.configuration_olmoe import OlmoeConfig
5
+
6
+
7
+ class PrunedOlmoeConfig(OlmoeConfig):
8
+ """OlmoeConfig plus a per-(layer, expert) width table.
9
+
10
+ ``expert_widths[l]`` lists the SwiGLU intermediate width of each surviving
11
+ expert in decoder layer ``l``, in expert order. Lists are ragged: layers
12
+ may keep different numbers of experts (deleted experts simply don't
13
+ appear — the router in layer ``l`` has ``len(expert_widths[l])`` rows),
14
+ and each width may differ (multiples of the GEMM block size, 128, for
15
+ variable-MegaBlocks execution). ``None`` means an unpruned model
16
+ (uniform ``num_experts`` × ``intermediate_size``).
17
+
18
+ The inherited ``num_experts`` / ``intermediate_size`` keep their ORIGINAL
19
+ (pre-pruning) values for provenance; the width table is authoritative for
20
+ the built architecture.
21
+ """
22
+
23
+ model_type = "pruned_olmoe"
24
+
25
+ def __init__(self, expert_widths: list[list[int]] | None = None, **kwargs):
26
+ super().__init__(**kwargs)
27
+ self.expert_widths = expert_widths
healed/opd_warm_unleashed/step0300/generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 50279,
4
+ "pad_token_id": 1,
5
+ "transformers_version": "4.57.6"
6
+ }
healed/opd_warm_unleashed/step0300/model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
healed/opd_warm_unleashed/step0300/modeling_pruned_olmoe.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """GLEAN-pruned OLMoE: HF-loadable model with ragged (variable-width) experts.
2
+
3
+ Pattern follows hbfreed/variable-flex-olmo's PrunedFlexOlmoForCausalLM
4
+ (docs/recon/prior-work-hbfreed.md), generalized from one scalar width to a
5
+ per-(layer, expert) width table: ``super().__init__`` builds the uniform
6
+ architecture from the config, then every MoE block is rebuilt to its pruned
7
+ shape — surviving experts only, each at its own width, router sliced to
8
+ match — so the state dict aligns exactly with what
9
+ ``glean.prune.prune_channels_global`` leaves behind.
10
+
11
+ Caveat: ``output_router_logits=True`` (the load-balancing aux loss) assumes a
12
+ uniform ``config.num_experts`` and is unsupported on ragged models.
13
+ """
14
+
15
+ import torch.nn as nn
16
+ from transformers.activations import ACT2FN
17
+ from transformers.models.olmoe.modeling_olmoe import OlmoeForCausalLM
18
+
19
+ from .configuration_pruned_olmoe import PrunedOlmoeConfig
20
+
21
+
22
+ class RaggedOlmoeMLP(nn.Module):
23
+ """OlmoeMLP with an explicit intermediate width (SwiGLU, no biases)."""
24
+
25
+ def __init__(self, hidden_size: int, intermediate_size: int, hidden_act: str):
26
+ super().__init__()
27
+ self.hidden_size = hidden_size
28
+ self.intermediate_size = intermediate_size
29
+ self.gate_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
30
+ self.up_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
31
+ self.down_proj = nn.Linear(intermediate_size, hidden_size, bias=False)
32
+ self.act_fn = ACT2FN[hidden_act]
33
+
34
+ def forward(self, x):
35
+ return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
36
+
37
+
38
+ class PrunedOlmoeForCausalLM(OlmoeForCausalLM):
39
+ """OLMoE with per-layer surviving-expert lists at per-expert widths."""
40
+
41
+ config_class = PrunedOlmoeConfig
42
+
43
+ def __init__(self, config: PrunedOlmoeConfig):
44
+ super().__init__(config)
45
+ widths_table = getattr(config, "expert_widths", None)
46
+ if widths_table is None:
47
+ return # unpruned: plain OLMoE
48
+ if len(widths_table) != len(self.model.layers):
49
+ raise ValueError(
50
+ f"expert_widths has {len(widths_table)} rows but the model has "
51
+ f"{len(self.model.layers)} decoder layers"
52
+ )
53
+ for layer, widths in zip(self.model.layers, widths_table):
54
+ if any(w <= 0 for w in widths):
55
+ raise ValueError("expert_widths must list surviving experts only (>0)")
56
+ block = layer.mlp
57
+ if len(widths) < block.top_k:
58
+ raise ValueError(
59
+ f"a layer keeps {len(widths)} experts < top_k={block.top_k}"
60
+ )
61
+ block.num_experts = len(widths)
62
+ block.gate = nn.Linear(config.hidden_size, len(widths), bias=False)
63
+ block.experts = nn.ModuleList(
64
+ RaggedOlmoeMLP(config.hidden_size, w, config.hidden_act)
65
+ for w in widths
66
+ )
healed/opd_warm_unleashed/step0300/special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "|||IP_ADDRESS|||",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "|||IP_ADDRESS|||",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<pad>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
healed/opd_warm_unleashed/step0300/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
healed/opd_warm_unleashed/step0300/tokenizer_config.json ADDED
@@ -0,0 +1,247 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": false,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<|endoftext|>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<|padding|>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "50254": {
23
+ "content": " ",
24
+ "lstrip": false,
25
+ "normalized": true,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": false
29
+ },
30
+ "50255": {
31
+ "content": " ",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": false
37
+ },
38
+ "50256": {
39
+ "content": " ",
40
+ "lstrip": false,
41
+ "normalized": true,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": false
45
+ },
46
+ "50257": {
47
+ "content": " ",
48
+ "lstrip": false,
49
+ "normalized": true,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": false
53
+ },
54
+ "50258": {
55
+ "content": " ",
56
+ "lstrip": false,
57
+ "normalized": true,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": false
61
+ },
62
+ "50259": {
63
+ "content": " ",
64
+ "lstrip": false,
65
+ "normalized": true,
66
+ "rstrip": false,
67
+ "single_word": false,
68
+ "special": false
69
+ },
70
+ "50260": {
71
+ "content": " ",
72
+ "lstrip": false,
73
+ "normalized": true,
74
+ "rstrip": false,
75
+ "single_word": false,
76
+ "special": false
77
+ },
78
+ "50261": {
79
+ "content": " ",
80
+ "lstrip": false,
81
+ "normalized": true,
82
+ "rstrip": false,
83
+ "single_word": false,
84
+ "special": false
85
+ },
86
+ "50262": {
87
+ "content": " ",
88
+ "lstrip": false,
89
+ "normalized": true,
90
+ "rstrip": false,
91
+ "single_word": false,
92
+ "special": false
93
+ },
94
+ "50263": {
95
+ "content": " ",
96
+ "lstrip": false,
97
+ "normalized": true,
98
+ "rstrip": false,
99
+ "single_word": false,
100
+ "special": false
101
+ },
102
+ "50264": {
103
+ "content": " ",
104
+ "lstrip": false,
105
+ "normalized": true,
106
+ "rstrip": false,
107
+ "single_word": false,
108
+ "special": false
109
+ },
110
+ "50265": {
111
+ "content": " ",
112
+ "lstrip": false,
113
+ "normalized": true,
114
+ "rstrip": false,
115
+ "single_word": false,
116
+ "special": false
117
+ },
118
+ "50266": {
119
+ "content": " ",
120
+ "lstrip": false,
121
+ "normalized": true,
122
+ "rstrip": false,
123
+ "single_word": false,
124
+ "special": false
125
+ },
126
+ "50267": {
127
+ "content": " ",
128
+ "lstrip": false,
129
+ "normalized": true,
130
+ "rstrip": false,
131
+ "single_word": false,
132
+ "special": false
133
+ },
134
+ "50268": {
135
+ "content": " ",
136
+ "lstrip": false,
137
+ "normalized": true,
138
+ "rstrip": false,
139
+ "single_word": false,
140
+ "special": false
141
+ },
142
+ "50269": {
143
+ "content": " ",
144
+ "lstrip": false,
145
+ "normalized": true,
146
+ "rstrip": false,
147
+ "single_word": false,
148
+ "special": false
149
+ },
150
+ "50270": {
151
+ "content": " ",
152
+ "lstrip": false,
153
+ "normalized": true,
154
+ "rstrip": false,
155
+ "single_word": false,
156
+ "special": false
157
+ },
158
+ "50271": {
159
+ "content": " ",
160
+ "lstrip": false,
161
+ "normalized": true,
162
+ "rstrip": false,
163
+ "single_word": false,
164
+ "special": false
165
+ },
166
+ "50272": {
167
+ "content": " ",
168
+ "lstrip": false,
169
+ "normalized": true,
170
+ "rstrip": false,
171
+ "single_word": false,
172
+ "special": false
173
+ },
174
+ "50273": {
175
+ "content": " ",
176
+ "lstrip": false,
177
+ "normalized": true,
178
+ "rstrip": false,
179
+ "single_word": false,
180
+ "special": false
181
+ },
182
+ "50274": {
183
+ "content": " ",
184
+ "lstrip": false,
185
+ "normalized": true,
186
+ "rstrip": false,
187
+ "single_word": false,
188
+ "special": false
189
+ },
190
+ "50275": {
191
+ "content": " ",
192
+ "lstrip": false,
193
+ "normalized": true,
194
+ "rstrip": false,
195
+ "single_word": false,
196
+ "special": false
197
+ },
198
+ "50276": {
199
+ "content": " ",
200
+ "lstrip": false,
201
+ "normalized": true,
202
+ "rstrip": false,
203
+ "single_word": false,
204
+ "special": false
205
+ },
206
+ "50277": {
207
+ "content": "|||EMAIL_ADDRESS|||",
208
+ "lstrip": false,
209
+ "normalized": true,
210
+ "rstrip": false,
211
+ "single_word": false,
212
+ "special": false
213
+ },
214
+ "50278": {
215
+ "content": "|||PHONE_NUMBER|||",
216
+ "lstrip": false,
217
+ "normalized": true,
218
+ "rstrip": false,
219
+ "single_word": false,
220
+ "special": false
221
+ },
222
+ "50279": {
223
+ "content": "|||IP_ADDRESS|||",
224
+ "lstrip": false,
225
+ "normalized": true,
226
+ "rstrip": false,
227
+ "single_word": false,
228
+ "special": true
229
+ },
230
+ "50280": {
231
+ "content": "<pad>",
232
+ "lstrip": false,
233
+ "normalized": false,
234
+ "rstrip": false,
235
+ "single_word": false,
236
+ "special": true
237
+ }
238
+ },
239
+ "bos_token": "|||IP_ADDRESS|||",
240
+ "clean_up_tokenization_spaces": false,
241
+ "eos_token": "|||IP_ADDRESS|||",
242
+ "extra_special_tokens": {},
243
+ "model_max_length": 1000000000000000019884624838656,
244
+ "pad_token": "<pad>",
245
+ "tokenizer_class": "GPTNeoXTokenizer",
246
+ "unk_token": null
247
+ }
healed/opd_warm_unleashed/step0350/chat_template.jinja ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|system|>
2
+ ' + message['content'] + '
3
+ ' }}{% elif message['role'] == 'user' %}{{ '<|user|>
4
+ ' + message['content'] + '
5
+ ' }}{% elif message['role'] == 'assistant' %}{% if not loop.last %}{{ '<|assistant|>
6
+ ' + message['content'] + eos_token + '
7
+ ' }}{% else %}{{ '<|assistant|>
8
+ ' + message['content'] + eos_token }}{% endif %}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|assistant|>
9
+ ' }}{% endif %}{% endfor %}
healed/opd_warm_unleashed/step0350/config.json ADDED
@@ -0,0 +1,887 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "PrunedOlmoeForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_pruned_olmoe.PrunedOlmoeConfig",
9
+ "AutoModelForCausalLM": "modeling_pruned_olmoe.PrunedOlmoeForCausalLM"
10
+ },
11
+ "clip_qkv": null,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 50279,
14
+ "expert_widths": [
15
+ [
16
+ 1024,
17
+ 384,
18
+ 256,
19
+ 256,
20
+ 768,
21
+ 1024,
22
+ 128,
23
+ 768,
24
+ 384,
25
+ 128,
26
+ 1024,
27
+ 384,
28
+ 384,
29
+ 128,
30
+ 640,
31
+ 896,
32
+ 896,
33
+ 256,
34
+ 768,
35
+ 128,
36
+ 768,
37
+ 768,
38
+ 768,
39
+ 768,
40
+ 640,
41
+ 896,
42
+ 256,
43
+ 128,
44
+ 384,
45
+ 896,
46
+ 256,
47
+ 768,
48
+ 512,
49
+ 640,
50
+ 768,
51
+ 896,
52
+ 1024,
53
+ 384,
54
+ 384,
55
+ 512,
56
+ 384,
57
+ 256,
58
+ 768,
59
+ 640,
60
+ 896,
61
+ 896,
62
+ 512,
63
+ 768,
64
+ 512,
65
+ 384,
66
+ 1024,
67
+ 896,
68
+ 896,
69
+ 768,
70
+ 128
71
+ ],
72
+ [
73
+ 768,
74
+ 896,
75
+ 896,
76
+ 256,
77
+ 896,
78
+ 384,
79
+ 768,
80
+ 768,
81
+ 1024,
82
+ 384,
83
+ 512,
84
+ 1024,
85
+ 768,
86
+ 768,
87
+ 1024,
88
+ 640,
89
+ 128,
90
+ 768,
91
+ 384,
92
+ 768,
93
+ 128,
94
+ 256,
95
+ 512,
96
+ 384,
97
+ 896,
98
+ 256,
99
+ 1024,
100
+ 1024,
101
+ 896,
102
+ 1024,
103
+ 896,
104
+ 768,
105
+ 256,
106
+ 768,
107
+ 128,
108
+ 1024,
109
+ 768,
110
+ 768,
111
+ 640,
112
+ 384,
113
+ 1024,
114
+ 384,
115
+ 640,
116
+ 896,
117
+ 1024,
118
+ 512,
119
+ 512,
120
+ 512,
121
+ 640
122
+ ],
123
+ [
124
+ 768,
125
+ 1024,
126
+ 512,
127
+ 384,
128
+ 384,
129
+ 768,
130
+ 256,
131
+ 384,
132
+ 1024,
133
+ 896,
134
+ 640,
135
+ 256,
136
+ 1024,
137
+ 1024,
138
+ 1024,
139
+ 640,
140
+ 1024,
141
+ 896,
142
+ 512,
143
+ 768,
144
+ 128,
145
+ 768,
146
+ 1024,
147
+ 768,
148
+ 256,
149
+ 1024,
150
+ 896,
151
+ 1024,
152
+ 896,
153
+ 512,
154
+ 640,
155
+ 384,
156
+ 896,
157
+ 384,
158
+ 512,
159
+ 640,
160
+ 256,
161
+ 768,
162
+ 256,
163
+ 768,
164
+ 768,
165
+ 640,
166
+ 1024,
167
+ 640,
168
+ 896,
169
+ 768,
170
+ 768,
171
+ 256
172
+ ],
173
+ [
174
+ 640,
175
+ 640,
176
+ 896,
177
+ 512,
178
+ 640,
179
+ 896,
180
+ 896,
181
+ 384,
182
+ 896,
183
+ 896,
184
+ 384,
185
+ 896,
186
+ 640,
187
+ 256,
188
+ 640,
189
+ 1024,
190
+ 1024,
191
+ 768,
192
+ 1024,
193
+ 896,
194
+ 1024,
195
+ 768,
196
+ 896,
197
+ 256,
198
+ 512,
199
+ 768,
200
+ 1024,
201
+ 256,
202
+ 768,
203
+ 512,
204
+ 256,
205
+ 640,
206
+ 1024,
207
+ 1024,
208
+ 512,
209
+ 1024,
210
+ 768,
211
+ 256,
212
+ 1024,
213
+ 384,
214
+ 896,
215
+ 1024,
216
+ 896,
217
+ 1024,
218
+ 384
219
+ ],
220
+ [
221
+ 256,
222
+ 640,
223
+ 640,
224
+ 896,
225
+ 768,
226
+ 896,
227
+ 768,
228
+ 768,
229
+ 896,
230
+ 896,
231
+ 1024,
232
+ 256,
233
+ 512,
234
+ 1024,
235
+ 640,
236
+ 896,
237
+ 512,
238
+ 512,
239
+ 384,
240
+ 384,
241
+ 256,
242
+ 384,
243
+ 384,
244
+ 896,
245
+ 896,
246
+ 768,
247
+ 640,
248
+ 896,
249
+ 768,
250
+ 1024,
251
+ 512,
252
+ 640,
253
+ 512,
254
+ 640,
255
+ 896,
256
+ 512,
257
+ 512,
258
+ 384,
259
+ 640,
260
+ 896,
261
+ 896,
262
+ 896,
263
+ 1024,
264
+ 640,
265
+ 1024,
266
+ 640,
267
+ 1024
268
+ ],
269
+ [
270
+ 1024,
271
+ 512,
272
+ 1024,
273
+ 1024,
274
+ 640,
275
+ 896,
276
+ 640,
277
+ 1024,
278
+ 896,
279
+ 384,
280
+ 1024,
281
+ 128,
282
+ 896,
283
+ 768,
284
+ 1024,
285
+ 768,
286
+ 640,
287
+ 896,
288
+ 768,
289
+ 640,
290
+ 512,
291
+ 896,
292
+ 512,
293
+ 640,
294
+ 256,
295
+ 768,
296
+ 640,
297
+ 768,
298
+ 384,
299
+ 896,
300
+ 512,
301
+ 512,
302
+ 256,
303
+ 512,
304
+ 896,
305
+ 256,
306
+ 384,
307
+ 640,
308
+ 512,
309
+ 640,
310
+ 896,
311
+ 512,
312
+ 1024,
313
+ 256,
314
+ 768,
315
+ 1024,
316
+ 768,
317
+ 256,
318
+ 256
319
+ ],
320
+ [
321
+ 640,
322
+ 896,
323
+ 1024,
324
+ 896,
325
+ 1024,
326
+ 1024,
327
+ 1024,
328
+ 512,
329
+ 256,
330
+ 256,
331
+ 1024,
332
+ 768,
333
+ 512,
334
+ 768,
335
+ 1024,
336
+ 1024,
337
+ 1024,
338
+ 384,
339
+ 512,
340
+ 1024,
341
+ 512,
342
+ 1024,
343
+ 128,
344
+ 640,
345
+ 640,
346
+ 896,
347
+ 768,
348
+ 128,
349
+ 256,
350
+ 256,
351
+ 256,
352
+ 256,
353
+ 896,
354
+ 1024,
355
+ 1024,
356
+ 384,
357
+ 896,
358
+ 256,
359
+ 896,
360
+ 640,
361
+ 1024,
362
+ 384,
363
+ 640,
364
+ 256,
365
+ 1024,
366
+ 1024,
367
+ 1024
368
+ ],
369
+ [
370
+ 1024,
371
+ 384,
372
+ 1024,
373
+ 1024,
374
+ 256,
375
+ 128,
376
+ 256,
377
+ 384,
378
+ 256,
379
+ 384,
380
+ 896,
381
+ 768,
382
+ 896,
383
+ 896,
384
+ 512,
385
+ 896,
386
+ 640,
387
+ 384,
388
+ 384,
389
+ 896,
390
+ 768,
391
+ 384,
392
+ 896,
393
+ 768,
394
+ 768,
395
+ 512,
396
+ 896,
397
+ 768,
398
+ 768,
399
+ 896,
400
+ 128,
401
+ 896,
402
+ 512,
403
+ 256,
404
+ 768,
405
+ 128,
406
+ 384,
407
+ 256,
408
+ 896,
409
+ 896,
410
+ 384,
411
+ 768,
412
+ 512,
413
+ 640,
414
+ 256,
415
+ 768,
416
+ 640,
417
+ 896,
418
+ 384,
419
+ 512,
420
+ 1024,
421
+ 768,
422
+ 384
423
+ ],
424
+ [
425
+ 512,
426
+ 768,
427
+ 512,
428
+ 256,
429
+ 128,
430
+ 640,
431
+ 384,
432
+ 640,
433
+ 768,
434
+ 896,
435
+ 640,
436
+ 768,
437
+ 256,
438
+ 384,
439
+ 1024,
440
+ 896,
441
+ 256,
442
+ 896,
443
+ 512,
444
+ 256,
445
+ 896,
446
+ 768,
447
+ 256,
448
+ 896,
449
+ 896,
450
+ 384,
451
+ 896,
452
+ 640,
453
+ 768,
454
+ 512,
455
+ 768,
456
+ 768,
457
+ 1024,
458
+ 768,
459
+ 640,
460
+ 768,
461
+ 384,
462
+ 256,
463
+ 512,
464
+ 896,
465
+ 128,
466
+ 384,
467
+ 256,
468
+ 768,
469
+ 384,
470
+ 256,
471
+ 1024,
472
+ 1024,
473
+ 896,
474
+ 256,
475
+ 1024,
476
+ 256,
477
+ 128,
478
+ 896
479
+ ],
480
+ [
481
+ 640,
482
+ 640,
483
+ 896,
484
+ 256,
485
+ 1024,
486
+ 512,
487
+ 1024,
488
+ 768,
489
+ 384,
490
+ 512,
491
+ 256,
492
+ 768,
493
+ 896,
494
+ 768,
495
+ 512,
496
+ 768,
497
+ 768,
498
+ 640,
499
+ 384,
500
+ 768,
501
+ 512,
502
+ 768,
503
+ 768,
504
+ 512,
505
+ 768,
506
+ 128,
507
+ 896,
508
+ 512,
509
+ 768,
510
+ 1024,
511
+ 128,
512
+ 384,
513
+ 768,
514
+ 768,
515
+ 768,
516
+ 384,
517
+ 512,
518
+ 640,
519
+ 768,
520
+ 512,
521
+ 768,
522
+ 1024,
523
+ 640,
524
+ 896,
525
+ 256,
526
+ 1024,
527
+ 384,
528
+ 768,
529
+ 768,
530
+ 768
531
+ ],
532
+ [
533
+ 896,
534
+ 512,
535
+ 896,
536
+ 768,
537
+ 384,
538
+ 384,
539
+ 768,
540
+ 512,
541
+ 768,
542
+ 512,
543
+ 1024,
544
+ 640,
545
+ 896,
546
+ 896,
547
+ 256,
548
+ 640,
549
+ 1024,
550
+ 256,
551
+ 896,
552
+ 128,
553
+ 128,
554
+ 128,
555
+ 768,
556
+ 896,
557
+ 384,
558
+ 896,
559
+ 512,
560
+ 896,
561
+ 384,
562
+ 256,
563
+ 640,
564
+ 640,
565
+ 896,
566
+ 768,
567
+ 640,
568
+ 256,
569
+ 896,
570
+ 896,
571
+ 512,
572
+ 128,
573
+ 896,
574
+ 256,
575
+ 256,
576
+ 640,
577
+ 896,
578
+ 896,
579
+ 128,
580
+ 1024,
581
+ 256,
582
+ 384,
583
+ 1024,
584
+ 640,
585
+ 896
586
+ ],
587
+ [
588
+ 768,
589
+ 384,
590
+ 640,
591
+ 896,
592
+ 256,
593
+ 128,
594
+ 384,
595
+ 896,
596
+ 128,
597
+ 128,
598
+ 896,
599
+ 256,
600
+ 384,
601
+ 896,
602
+ 512,
603
+ 768,
604
+ 768,
605
+ 512,
606
+ 512,
607
+ 768,
608
+ 896,
609
+ 640,
610
+ 768,
611
+ 896,
612
+ 896,
613
+ 896,
614
+ 640,
615
+ 896,
616
+ 640,
617
+ 512,
618
+ 896,
619
+ 256,
620
+ 512,
621
+ 128,
622
+ 512,
623
+ 384,
624
+ 768,
625
+ 768,
626
+ 1024,
627
+ 256,
628
+ 768,
629
+ 256,
630
+ 768,
631
+ 512,
632
+ 640,
633
+ 1024,
634
+ 128,
635
+ 896,
636
+ 896,
637
+ 896,
638
+ 896,
639
+ 1024
640
+ ],
641
+ [
642
+ 512,
643
+ 384,
644
+ 768,
645
+ 640,
646
+ 640,
647
+ 768,
648
+ 1024,
649
+ 896,
650
+ 512,
651
+ 256,
652
+ 640,
653
+ 768,
654
+ 640,
655
+ 896,
656
+ 128,
657
+ 256,
658
+ 896,
659
+ 1024,
660
+ 256,
661
+ 640,
662
+ 512,
663
+ 256,
664
+ 128,
665
+ 512,
666
+ 256,
667
+ 640,
668
+ 768,
669
+ 768,
670
+ 128,
671
+ 128,
672
+ 768,
673
+ 640,
674
+ 1024,
675
+ 1024,
676
+ 768,
677
+ 512,
678
+ 896,
679
+ 768,
680
+ 896,
681
+ 1024,
682
+ 896,
683
+ 896,
684
+ 512,
685
+ 640,
686
+ 1024,
687
+ 512,
688
+ 1024,
689
+ 512,
690
+ 512,
691
+ 512,
692
+ 768
693
+ ],
694
+ [
695
+ 896,
696
+ 896,
697
+ 1024,
698
+ 1024,
699
+ 896,
700
+ 128,
701
+ 768,
702
+ 256,
703
+ 1024,
704
+ 256,
705
+ 1024,
706
+ 640,
707
+ 384,
708
+ 256,
709
+ 256,
710
+ 512,
711
+ 768,
712
+ 896,
713
+ 512,
714
+ 768,
715
+ 384,
716
+ 1024,
717
+ 896,
718
+ 896,
719
+ 1024,
720
+ 896,
721
+ 768,
722
+ 896,
723
+ 640,
724
+ 1024,
725
+ 512,
726
+ 896,
727
+ 512,
728
+ 1024,
729
+ 512,
730
+ 512,
731
+ 256,
732
+ 256,
733
+ 256,
734
+ 512,
735
+ 768,
736
+ 128,
737
+ 384,
738
+ 512,
739
+ 896,
740
+ 896,
741
+ 1024,
742
+ 256,
743
+ 384,
744
+ 640
745
+ ],
746
+ [
747
+ 896,
748
+ 640,
749
+ 384,
750
+ 512,
751
+ 256,
752
+ 640,
753
+ 1024,
754
+ 384,
755
+ 1024,
756
+ 1024,
757
+ 768,
758
+ 256,
759
+ 1024,
760
+ 768,
761
+ 512,
762
+ 896,
763
+ 256,
764
+ 1024,
765
+ 768,
766
+ 768,
767
+ 768,
768
+ 384,
769
+ 384,
770
+ 256,
771
+ 1024,
772
+ 384,
773
+ 384,
774
+ 384,
775
+ 896,
776
+ 768,
777
+ 640,
778
+ 768,
779
+ 512,
780
+ 896,
781
+ 896,
782
+ 896,
783
+ 896,
784
+ 256,
785
+ 384,
786
+ 128,
787
+ 1024,
788
+ 896,
789
+ 256,
790
+ 256,
791
+ 768,
792
+ 640,
793
+ 896,
794
+ 384,
795
+ 768,
796
+ 512,
797
+ 640
798
+ ],
799
+ [
800
+ 896,
801
+ 1024,
802
+ 768,
803
+ 1024,
804
+ 896,
805
+ 256,
806
+ 768,
807
+ 128,
808
+ 128,
809
+ 768,
810
+ 512,
811
+ 896,
812
+ 384,
813
+ 768,
814
+ 1024,
815
+ 256,
816
+ 768,
817
+ 768,
818
+ 256,
819
+ 512,
820
+ 512,
821
+ 640,
822
+ 512,
823
+ 256,
824
+ 768,
825
+ 896,
826
+ 384,
827
+ 1024,
828
+ 640,
829
+ 1024,
830
+ 512,
831
+ 512,
832
+ 384,
833
+ 512,
834
+ 512,
835
+ 1024,
836
+ 384,
837
+ 896,
838
+ 768,
839
+ 384,
840
+ 384,
841
+ 128,
842
+ 384,
843
+ 1024,
844
+ 896,
845
+ 640,
846
+ 768,
847
+ 768,
848
+ 256,
849
+ 640,
850
+ 512,
851
+ 640,
852
+ 384
853
+ ]
854
+ ],
855
+ "glean_metadata": {
856
+ "base_model": "allenai/OLMoE-1B-7B-0125-Instruct",
857
+ "block_size": 128,
858
+ "criterion": "reap",
859
+ "dead_experts": 217,
860
+ "keep_fraction": 0.5,
861
+ "min_width": 128,
862
+ "params": 3697491968,
863
+ "scores": "outputs/scores_0125inst_dolmino-math/scores.pt"
864
+ },
865
+ "hidden_act": "silu",
866
+ "hidden_size": 2048,
867
+ "initializer_range": 0.02,
868
+ "intermediate_size": 1024,
869
+ "max_position_embeddings": 4096,
870
+ "model_type": "pruned_olmoe",
871
+ "norm_topk_prob": false,
872
+ "num_attention_heads": 16,
873
+ "num_experts": 64,
874
+ "num_experts_per_tok": 8,
875
+ "num_hidden_layers": 16,
876
+ "num_key_value_heads": 16,
877
+ "output_router_logits": false,
878
+ "pad_token_id": 1,
879
+ "rms_norm_eps": 1e-05,
880
+ "rope_scaling": null,
881
+ "rope_theta": 10000.0,
882
+ "router_aux_loss_coef": 0.01,
883
+ "tie_word_embeddings": false,
884
+ "transformers_version": "4.57.6",
885
+ "use_cache": false,
886
+ "vocab_size": 50304
887
+ }
healed/opd_warm_unleashed/step0350/configuration_pruned_olmoe.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Configuration for GLEAN-pruned OLMoE: variable-width, variable-count experts.
2
+ """
3
+
4
+ from transformers.models.olmoe.configuration_olmoe import OlmoeConfig
5
+
6
+
7
+ class PrunedOlmoeConfig(OlmoeConfig):
8
+ """OlmoeConfig plus a per-(layer, expert) width table.
9
+
10
+ ``expert_widths[l]`` lists the SwiGLU intermediate width of each surviving
11
+ expert in decoder layer ``l``, in expert order. Lists are ragged: layers
12
+ may keep different numbers of experts (deleted experts simply don't
13
+ appear — the router in layer ``l`` has ``len(expert_widths[l])`` rows),
14
+ and each width may differ (multiples of the GEMM block size, 128, for
15
+ variable-MegaBlocks execution). ``None`` means an unpruned model
16
+ (uniform ``num_experts`` × ``intermediate_size``).
17
+
18
+ The inherited ``num_experts`` / ``intermediate_size`` keep their ORIGINAL
19
+ (pre-pruning) values for provenance; the width table is authoritative for
20
+ the built architecture.
21
+ """
22
+
23
+ model_type = "pruned_olmoe"
24
+
25
+ def __init__(self, expert_widths: list[list[int]] | None = None, **kwargs):
26
+ super().__init__(**kwargs)
27
+ self.expert_widths = expert_widths
healed/opd_warm_unleashed/step0350/generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "eos_token_id": 50279,
4
+ "pad_token_id": 1,
5
+ "transformers_version": "4.57.6"
6
+ }
healed/opd_warm_unleashed/step0350/model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
healed/opd_warm_unleashed/step0350/modeling_pruned_olmoe.py ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """GLEAN-pruned OLMoE: HF-loadable model with ragged (variable-width) experts.
2
+
3
+ Pattern follows hbfreed/variable-flex-olmo's PrunedFlexOlmoForCausalLM
4
+ (docs/recon/prior-work-hbfreed.md), generalized from one scalar width to a
5
+ per-(layer, expert) width table: ``super().__init__`` builds the uniform
6
+ architecture from the config, then every MoE block is rebuilt to its pruned
7
+ shape — surviving experts only, each at its own width, router sliced to
8
+ match — so the state dict aligns exactly with what
9
+ ``glean.prune.prune_channels_global`` leaves behind.
10
+
11
+ Caveat: ``output_router_logits=True`` (the load-balancing aux loss) assumes a
12
+ uniform ``config.num_experts`` and is unsupported on ragged models.
13
+ """
14
+
15
+ import torch.nn as nn
16
+ from transformers.activations import ACT2FN
17
+ from transformers.models.olmoe.modeling_olmoe import OlmoeForCausalLM
18
+
19
+ from .configuration_pruned_olmoe import PrunedOlmoeConfig
20
+
21
+
22
+ class RaggedOlmoeMLP(nn.Module):
23
+ """OlmoeMLP with an explicit intermediate width (SwiGLU, no biases)."""
24
+
25
+ def __init__(self, hidden_size: int, intermediate_size: int, hidden_act: str):
26
+ super().__init__()
27
+ self.hidden_size = hidden_size
28
+ self.intermediate_size = intermediate_size
29
+ self.gate_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
30
+ self.up_proj = nn.Linear(hidden_size, intermediate_size, bias=False)
31
+ self.down_proj = nn.Linear(intermediate_size, hidden_size, bias=False)
32
+ self.act_fn = ACT2FN[hidden_act]
33
+
34
+ def forward(self, x):
35
+ return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
36
+
37
+
38
+ class PrunedOlmoeForCausalLM(OlmoeForCausalLM):
39
+ """OLMoE with per-layer surviving-expert lists at per-expert widths."""
40
+
41
+ config_class = PrunedOlmoeConfig
42
+
43
+ def __init__(self, config: PrunedOlmoeConfig):
44
+ super().__init__(config)
45
+ widths_table = getattr(config, "expert_widths", None)
46
+ if widths_table is None:
47
+ return # unpruned: plain OLMoE
48
+ if len(widths_table) != len(self.model.layers):
49
+ raise ValueError(
50
+ f"expert_widths has {len(widths_table)} rows but the model has "
51
+ f"{len(self.model.layers)} decoder layers"
52
+ )
53
+ for layer, widths in zip(self.model.layers, widths_table):
54
+ if any(w <= 0 for w in widths):
55
+ raise ValueError("expert_widths must list surviving experts only (>0)")
56
+ block = layer.mlp
57
+ if len(widths) < block.top_k:
58
+ raise ValueError(
59
+ f"a layer keeps {len(widths)} experts < top_k={block.top_k}"
60
+ )
61
+ block.num_experts = len(widths)
62
+ block.gate = nn.Linear(config.hidden_size, len(widths), bias=False)
63
+ block.experts = nn.ModuleList(
64
+ RaggedOlmoeMLP(config.hidden_size, w, config.hidden_act)
65
+ for w in widths
66
+ )
healed/opd_warm_unleashed/step0350/special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "|||IP_ADDRESS|||",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "|||IP_ADDRESS|||",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<pad>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
healed/opd_warm_unleashed/step0350/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff