Ouzhang commited on
Commit
0fe93d6
·
verified ·
1 Parent(s): 851b203

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. datasets/mmlu/.gitattributes +55 -0
  2. datasets/mmlu/README.md +2299 -0
  3. models/dmax-16b/.gitattributes +41 -0
  4. models/dmax-16b/README.md +109 -0
  5. models/dmax-16b/chat_template.jinja +86 -0
  6. models/dmax-16b/config.json +57 -0
  7. models/dmax-16b/configuration_llada2_moe.py +89 -0
  8. models/dmax-16b/model.safetensors.index.json +0 -0
  9. models/dmax-16b/modeling_llada2_moe.py +1937 -0
  10. models/dmax-16b/special_tokens_map.json +37 -0
  11. models/dmax-16b/tokenizer_config.json +2116 -0
  12. models/dreamreasoner-8b/.gitattributes +36 -0
  13. models/dreamreasoner-8b/README.md +3 -0
  14. models/dreamreasoner-8b/added_tokens.json +29 -0
  15. models/dreamreasoner-8b/chat_template.jinja +87 -0
  16. models/dreamreasoner-8b/config.json +38 -0
  17. models/dreamreasoner-8b/configuration_dream.py +223 -0
  18. models/dreamreasoner-8b/generation_config.json +7 -0
  19. models/dreamreasoner-8b/generation_utils.py +469 -0
  20. models/dreamreasoner-8b/merges.txt +0 -0
  21. models/dreamreasoner-8b/model.safetensors.index.json +406 -0
  22. models/dreamreasoner-8b/modeling_dream.py +574 -0
  23. models/dreamreasoner-8b/special_tokens_map.json +39 -0
  24. models/dreamreasoner-8b/tokenization_dream.py +342 -0
  25. models/dreamreasoner-8b/tokenizer_config.json +256 -0
  26. models/dreamreasoner-8b/vocab.json +0 -0
  27. runs/basecode/bd-base-sweep_678190.err +0 -0
  28. runs/basecode/bd-base-sweep_678190.out +5 -0
  29. runs/basecode/latest_sweep.jsonl +12 -0
  30. runs/basecode/sweep_678190.jsonl +12 -0
  31. runs/elf_timestep_alignment/elf-a40_679746.err +46 -0
  32. runs/elf_timestep_alignment/elf-a40_679746.out +34 -0
  33. runs/elf_timestep_alignment/elf-a80_679745.err +51 -0
  34. runs/elf_timestep_alignment/elf-a80_679745.out +23 -0
  35. runs/elf_timestep_alignment/elf-align_679699.err +3 -0
  36. runs/elf_timestep_alignment/elf-align_679716.err +19 -0
  37. runs/elf_timestep_alignment/elf-align_679741.err +23 -0
  38. runs/elf_timestep_alignment/elf-h47_679742.err +46 -0
  39. runs/elf_timestep_alignment/elf-h47_679742.out +34 -0
  40. runs/elf_timestep_alignment/elf-h96_679743.out +37 -0
  41. runs/elf_timestep_alignment/elfa-deep-s41_680360.err +10 -0
  42. runs/elf_timestep_alignment/elfa-deep-s41_680360.out +359 -0
  43. runs/elf_timestep_alignment/elfa-deep-s42_680361.out +359 -0
  44. runs/elf_timestep_alignment/elfa-deep-s45_680362.err +10 -0
  45. runs/elf_timestep_alignment/elfa-final-s42_680358.err +10 -0
  46. runs/elf_timestep_alignment/elfa-final-s43_680359.out +359 -0
  47. runs/elf_timestep_alignment/elfb-deep-s43_680027.err +10 -0
  48. runs/elf_timestep_alignment/elfb-deep-s44_680028.err +10 -0
  49. runs/elf_timestep_alignment/elfb-deep-s44_680028.out +370 -0
  50. runs/elf_timestep_alignment/elfb-final-s41_680020.out +370 -0
datasets/mmlu/.gitattributes ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
13
+ *.model filter=lfs diff=lfs merge=lfs -text
14
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
15
+ *.npy filter=lfs diff=lfs merge=lfs -text
16
+ *.npz filter=lfs diff=lfs merge=lfs -text
17
+ *.onnx filter=lfs diff=lfs merge=lfs -text
18
+ *.ot filter=lfs diff=lfs merge=lfs -text
19
+ *.parquet filter=lfs diff=lfs merge=lfs -text
20
+ *.pb filter=lfs diff=lfs merge=lfs -text
21
+ *.pickle filter=lfs diff=lfs merge=lfs -text
22
+ *.pkl filter=lfs diff=lfs merge=lfs -text
23
+ *.pt filter=lfs diff=lfs merge=lfs -text
24
+ *.pth filter=lfs diff=lfs merge=lfs -text
25
+ *.rar filter=lfs diff=lfs merge=lfs -text
26
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
27
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
30
+ *.tflite filter=lfs diff=lfs merge=lfs -text
31
+ *.tgz filter=lfs diff=lfs merge=lfs -text
32
+ *.wasm filter=lfs diff=lfs merge=lfs -text
33
+ *.xz filter=lfs diff=lfs merge=lfs -text
34
+ *.zip filter=lfs diff=lfs merge=lfs -text
35
+ *.zst filter=lfs diff=lfs merge=lfs -text
36
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
37
+ # Audio files - uncompressed
38
+ *.pcm filter=lfs diff=lfs merge=lfs -text
39
+ *.sam filter=lfs diff=lfs merge=lfs -text
40
+ *.raw filter=lfs diff=lfs merge=lfs -text
41
+ # Audio files - compressed
42
+ *.aac filter=lfs diff=lfs merge=lfs -text
43
+ *.flac filter=lfs diff=lfs merge=lfs -text
44
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
45
+ *.ogg filter=lfs diff=lfs merge=lfs -text
46
+ *.wav filter=lfs diff=lfs merge=lfs -text
47
+ # Image files - uncompressed
48
+ *.bmp filter=lfs diff=lfs merge=lfs -text
49
+ *.gif filter=lfs diff=lfs merge=lfs -text
50
+ *.png filter=lfs diff=lfs merge=lfs -text
51
+ *.tiff filter=lfs diff=lfs merge=lfs -text
52
+ # Image files - compressed
53
+ *.jpg filter=lfs diff=lfs merge=lfs -text
54
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
55
+ *.webp filter=lfs diff=lfs merge=lfs -text
datasets/mmlu/README.md ADDED
@@ -0,0 +1,2299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - no-annotation
4
+ language_creators:
5
+ - expert-generated
6
+ language:
7
+ - en
8
+ license:
9
+ - mit
10
+ multilinguality:
11
+ - monolingual
12
+ size_categories:
13
+ - 10K<n<100K
14
+ source_datasets:
15
+ - original
16
+ task_categories:
17
+ - question-answering
18
+ task_ids:
19
+ - multiple-choice-qa
20
+ paperswithcode_id: mmlu
21
+ pretty_name: Measuring Massive Multitask Language Understanding
22
+ language_bcp47:
23
+ - en-US
24
+ dataset_info:
25
+ - config_name: abstract_algebra
26
+ features:
27
+ - name: question
28
+ dtype: string
29
+ - name: subject
30
+ dtype: string
31
+ - name: choices
32
+ sequence: string
33
+ - name: answer
34
+ dtype:
35
+ class_label:
36
+ names:
37
+ '0': A
38
+ '1': B
39
+ '2': C
40
+ '3': D
41
+ splits:
42
+ - name: test
43
+ num_bytes: 49618.6654322746
44
+ num_examples: 100
45
+ - name: validation
46
+ num_bytes: 5485.515349444808
47
+ num_examples: 11
48
+ - name: dev
49
+ num_bytes: 2199.1754385964914
50
+ num_examples: 5
51
+ download_size: 17143
52
+ dataset_size: 57303.3562203159
53
+ - config_name: all
54
+ features:
55
+ - name: question
56
+ dtype: string
57
+ - name: subject
58
+ dtype: string
59
+ - name: choices
60
+ sequence: string
61
+ - name: answer
62
+ dtype:
63
+ class_label:
64
+ names:
65
+ '0': A
66
+ '1': B
67
+ '2': C
68
+ '3': D
69
+ splits:
70
+ - name: test
71
+ num_bytes: 6967453
72
+ num_examples: 14042
73
+ - name: validation
74
+ num_bytes: 763484
75
+ num_examples: 1531
76
+ - name: dev
77
+ num_bytes: 125353
78
+ num_examples: 285
79
+ - name: auxiliary_train
80
+ num_bytes: 161000625
81
+ num_examples: 99842
82
+ download_size: 51503402
83
+ dataset_size: 168856915
84
+ - config_name: anatomy
85
+ features:
86
+ - name: question
87
+ dtype: string
88
+ - name: subject
89
+ dtype: string
90
+ - name: choices
91
+ sequence: string
92
+ - name: answer
93
+ dtype:
94
+ class_label:
95
+ names:
96
+ '0': A
97
+ '1': B
98
+ '2': C
99
+ '3': D
100
+ splits:
101
+ - name: test
102
+ num_bytes: 66985.19833357072
103
+ num_examples: 135
104
+ - name: validation
105
+ num_bytes: 6981.5649902024825
106
+ num_examples: 14
107
+ - name: dev
108
+ num_bytes: 2199.1754385964914
109
+ num_examples: 5
110
+ download_size: 28864
111
+ dataset_size: 76165.9387623697
112
+ - config_name: astronomy
113
+ features:
114
+ - name: question
115
+ dtype: string
116
+ - name: subject
117
+ dtype: string
118
+ - name: choices
119
+ sequence: string
120
+ - name: answer
121
+ dtype:
122
+ class_label:
123
+ names:
124
+ '0': A
125
+ '1': B
126
+ '2': C
127
+ '3': D
128
+ splits:
129
+ - name: test
130
+ num_bytes: 75420.3714570574
131
+ num_examples: 152
132
+ - name: validation
133
+ num_bytes: 7978.931417374265
134
+ num_examples: 16
135
+ - name: dev
136
+ num_bytes: 2199.1754385964914
137
+ num_examples: 5
138
+ download_size: 39316
139
+ dataset_size: 85598.47831302814
140
+ - config_name: auxiliary_train
141
+ features:
142
+ - name: train
143
+ struct:
144
+ - name: answer
145
+ dtype: int64
146
+ - name: choices
147
+ sequence: string
148
+ - name: question
149
+ dtype: string
150
+ - name: subject
151
+ dtype: string
152
+ splits:
153
+ - name: train
154
+ num_bytes: 161000625
155
+ num_examples: 99842
156
+ download_size: 47518592
157
+ dataset_size: 161000625
158
+ - config_name: business_ethics
159
+ features:
160
+ - name: question
161
+ dtype: string
162
+ - name: subject
163
+ dtype: string
164
+ - name: choices
165
+ sequence: string
166
+ - name: answer
167
+ dtype:
168
+ class_label:
169
+ names:
170
+ '0': A
171
+ '1': B
172
+ '2': C
173
+ '3': D
174
+ splits:
175
+ - name: test
176
+ num_bytes: 49618.6654322746
177
+ num_examples: 100
178
+ - name: validation
179
+ num_bytes: 5485.515349444808
180
+ num_examples: 11
181
+ - name: dev
182
+ num_bytes: 2199.1754385964914
183
+ num_examples: 5
184
+ download_size: 31619
185
+ dataset_size: 57303.3562203159
186
+ - config_name: clinical_knowledge
187
+ features:
188
+ - name: question
189
+ dtype: string
190
+ - name: subject
191
+ dtype: string
192
+ - name: choices
193
+ sequence: string
194
+ - name: answer
195
+ dtype:
196
+ class_label:
197
+ names:
198
+ '0': A
199
+ '1': B
200
+ '2': C
201
+ '3': D
202
+ splits:
203
+ - name: test
204
+ num_bytes: 131489.4633955277
205
+ num_examples: 265
206
+ - name: validation
207
+ num_bytes: 14461.813193990856
208
+ num_examples: 29
209
+ - name: dev
210
+ num_bytes: 2199.1754385964914
211
+ num_examples: 5
212
+ download_size: 51655
213
+ dataset_size: 148150.45202811505
214
+ - config_name: college_biology
215
+ features:
216
+ - name: question
217
+ dtype: string
218
+ - name: subject
219
+ dtype: string
220
+ - name: choices
221
+ sequence: string
222
+ - name: answer
223
+ dtype:
224
+ class_label:
225
+ names:
226
+ '0': A
227
+ '1': B
228
+ '2': C
229
+ '3': D
230
+ splits:
231
+ - name: test
232
+ num_bytes: 71450.87822247542
233
+ num_examples: 144
234
+ - name: validation
235
+ num_bytes: 7978.931417374265
236
+ num_examples: 16
237
+ - name: dev
238
+ num_bytes: 2199.1754385964914
239
+ num_examples: 5
240
+ download_size: 43017
241
+ dataset_size: 81628.98507844617
242
+ - config_name: college_chemistry
243
+ features:
244
+ - name: question
245
+ dtype: string
246
+ - name: subject
247
+ dtype: string
248
+ - name: choices
249
+ sequence: string
250
+ - name: answer
251
+ dtype:
252
+ class_label:
253
+ names:
254
+ '0': A
255
+ '1': B
256
+ '2': C
257
+ '3': D
258
+ splits:
259
+ - name: test
260
+ num_bytes: 49618.6654322746
261
+ num_examples: 100
262
+ - name: validation
263
+ num_bytes: 3989.4657086871325
264
+ num_examples: 8
265
+ - name: dev
266
+ num_bytes: 2199.1754385964914
267
+ num_examples: 5
268
+ download_size: 26781
269
+ dataset_size: 55807.30657955822
270
+ - config_name: college_computer_science
271
+ features:
272
+ - name: question
273
+ dtype: string
274
+ - name: subject
275
+ dtype: string
276
+ - name: choices
277
+ sequence: string
278
+ - name: answer
279
+ dtype:
280
+ class_label:
281
+ names:
282
+ '0': A
283
+ '1': B
284
+ '2': C
285
+ '3': D
286
+ splits:
287
+ - name: test
288
+ num_bytes: 49618.6654322746
289
+ num_examples: 100
290
+ - name: validation
291
+ num_bytes: 5485.515349444808
292
+ num_examples: 11
293
+ - name: dev
294
+ num_bytes: 2199.1754385964914
295
+ num_examples: 5
296
+ download_size: 41132
297
+ dataset_size: 57303.3562203159
298
+ - config_name: college_mathematics
299
+ features:
300
+ - name: question
301
+ dtype: string
302
+ - name: subject
303
+ dtype: string
304
+ - name: choices
305
+ sequence: string
306
+ - name: answer
307
+ dtype:
308
+ class_label:
309
+ names:
310
+ '0': A
311
+ '1': B
312
+ '2': C
313
+ '3': D
314
+ splits:
315
+ - name: test
316
+ num_bytes: 49618.6654322746
317
+ num_examples: 100
318
+ - name: validation
319
+ num_bytes: 5485.515349444808
320
+ num_examples: 11
321
+ - name: dev
322
+ num_bytes: 2199.1754385964914
323
+ num_examples: 5
324
+ download_size: 26779
325
+ dataset_size: 57303.3562203159
326
+ - config_name: college_medicine
327
+ features:
328
+ - name: question
329
+ dtype: string
330
+ - name: subject
331
+ dtype: string
332
+ - name: choices
333
+ sequence: string
334
+ - name: answer
335
+ dtype:
336
+ class_label:
337
+ names:
338
+ '0': A
339
+ '1': B
340
+ '2': C
341
+ '3': D
342
+ splits:
343
+ - name: test
344
+ num_bytes: 85840.29119783506
345
+ num_examples: 173
346
+ - name: validation
347
+ num_bytes: 10971.030698889615
348
+ num_examples: 22
349
+ - name: dev
350
+ num_bytes: 2199.1754385964914
351
+ num_examples: 5
352
+ download_size: 56303
353
+ dataset_size: 99010.49733532117
354
+ - config_name: college_physics
355
+ features:
356
+ - name: question
357
+ dtype: string
358
+ - name: subject
359
+ dtype: string
360
+ - name: choices
361
+ sequence: string
362
+ - name: answer
363
+ dtype:
364
+ class_label:
365
+ names:
366
+ '0': A
367
+ '1': B
368
+ '2': C
369
+ '3': D
370
+ splits:
371
+ - name: test
372
+ num_bytes: 50611.0387409201
373
+ num_examples: 102
374
+ - name: validation
375
+ num_bytes: 5485.515349444808
376
+ num_examples: 11
377
+ - name: dev
378
+ num_bytes: 2199.1754385964914
379
+ num_examples: 5
380
+ download_size: 29539
381
+ dataset_size: 58295.7295289614
382
+ - config_name: computer_security
383
+ features:
384
+ - name: question
385
+ dtype: string
386
+ - name: subject
387
+ dtype: string
388
+ - name: choices
389
+ sequence: string
390
+ - name: answer
391
+ dtype:
392
+ class_label:
393
+ names:
394
+ '0': A
395
+ '1': B
396
+ '2': C
397
+ '3': D
398
+ splits:
399
+ - name: test
400
+ num_bytes: 49618.6654322746
401
+ num_examples: 100
402
+ - name: validation
403
+ num_bytes: 5485.515349444808
404
+ num_examples: 11
405
+ - name: dev
406
+ num_bytes: 2199.1754385964914
407
+ num_examples: 5
408
+ download_size: 30150
409
+ dataset_size: 57303.3562203159
410
+ - config_name: conceptual_physics
411
+ features:
412
+ - name: question
413
+ dtype: string
414
+ - name: subject
415
+ dtype: string
416
+ - name: choices
417
+ sequence: string
418
+ - name: answer
419
+ dtype:
420
+ class_label:
421
+ names:
422
+ '0': A
423
+ '1': B
424
+ '2': C
425
+ '3': D
426
+ splits:
427
+ - name: test
428
+ num_bytes: 116603.86376584532
429
+ num_examples: 235
430
+ - name: validation
431
+ num_bytes: 12965.76355323318
432
+ num_examples: 26
433
+ - name: dev
434
+ num_bytes: 2199.1754385964914
435
+ num_examples: 5
436
+ download_size: 34968
437
+ dataset_size: 131768.802757675
438
+ - config_name: econometrics
439
+ features:
440
+ - name: question
441
+ dtype: string
442
+ - name: subject
443
+ dtype: string
444
+ - name: choices
445
+ sequence: string
446
+ - name: answer
447
+ dtype:
448
+ class_label:
449
+ names:
450
+ '0': A
451
+ '1': B
452
+ '2': C
453
+ '3': D
454
+ splits:
455
+ - name: test
456
+ num_bytes: 56565.27859279305
457
+ num_examples: 114
458
+ - name: validation
459
+ num_bytes: 5984.198563030699
460
+ num_examples: 12
461
+ - name: dev
462
+ num_bytes: 2199.1754385964914
463
+ num_examples: 5
464
+ download_size: 36040
465
+ dataset_size: 64748.652594420244
466
+ - config_name: electrical_engineering
467
+ features:
468
+ - name: question
469
+ dtype: string
470
+ - name: subject
471
+ dtype: string
472
+ - name: choices
473
+ sequence: string
474
+ - name: answer
475
+ dtype:
476
+ class_label:
477
+ names:
478
+ '0': A
479
+ '1': B
480
+ '2': C
481
+ '3': D
482
+ splits:
483
+ - name: test
484
+ num_bytes: 71947.06487679818
485
+ num_examples: 145
486
+ - name: validation
487
+ num_bytes: 7978.931417374265
488
+ num_examples: 16
489
+ - name: dev
490
+ num_bytes: 2199.1754385964914
491
+ num_examples: 5
492
+ download_size: 26746
493
+ dataset_size: 82125.17173276893
494
+ - config_name: elementary_mathematics
495
+ features:
496
+ - name: question
497
+ dtype: string
498
+ - name: subject
499
+ dtype: string
500
+ - name: choices
501
+ sequence: string
502
+ - name: answer
503
+ dtype:
504
+ class_label:
505
+ names:
506
+ '0': A
507
+ '1': B
508
+ '2': C
509
+ '3': D
510
+ splits:
511
+ - name: test
512
+ num_bytes: 187558.555333998
513
+ num_examples: 378
514
+ - name: validation
515
+ num_bytes: 20446.011757021555
516
+ num_examples: 41
517
+ - name: dev
518
+ num_bytes: 2199.1754385964914
519
+ num_examples: 5
520
+ download_size: 54987
521
+ dataset_size: 210203.74252961605
522
+ - config_name: formal_logic
523
+ features:
524
+ - name: question
525
+ dtype: string
526
+ - name: subject
527
+ dtype: string
528
+ - name: choices
529
+ sequence: string
530
+ - name: answer
531
+ dtype:
532
+ class_label:
533
+ names:
534
+ '0': A
535
+ '1': B
536
+ '2': C
537
+ '3': D
538
+ splits:
539
+ - name: test
540
+ num_bytes: 62519.518444666
541
+ num_examples: 126
542
+ - name: validation
543
+ num_bytes: 6981.5649902024825
544
+ num_examples: 14
545
+ - name: dev
546
+ num_bytes: 2199.1754385964914
547
+ num_examples: 5
548
+ download_size: 32884
549
+ dataset_size: 71700.25887346498
550
+ - config_name: global_facts
551
+ features:
552
+ - name: question
553
+ dtype: string
554
+ - name: subject
555
+ dtype: string
556
+ - name: choices
557
+ sequence: string
558
+ - name: answer
559
+ dtype:
560
+ class_label:
561
+ names:
562
+ '0': A
563
+ '1': B
564
+ '2': C
565
+ '3': D
566
+ splits:
567
+ - name: test
568
+ num_bytes: 49618.6654322746
569
+ num_examples: 100
570
+ - name: validation
571
+ num_bytes: 4986.8321358589155
572
+ num_examples: 10
573
+ - name: dev
574
+ num_bytes: 2199.1754385964914
575
+ num_examples: 5
576
+ download_size: 19258
577
+ dataset_size: 56804.67300673001
578
+ - config_name: high_school_biology
579
+ features:
580
+ - name: question
581
+ dtype: string
582
+ - name: subject
583
+ dtype: string
584
+ - name: choices
585
+ sequence: string
586
+ - name: answer
587
+ dtype:
588
+ class_label:
589
+ names:
590
+ '0': A
591
+ '1': B
592
+ '2': C
593
+ '3': D
594
+ splits:
595
+ - name: test
596
+ num_bytes: 153817.86284005127
597
+ num_examples: 310
598
+ - name: validation
599
+ num_bytes: 15957.86283474853
600
+ num_examples: 32
601
+ - name: dev
602
+ num_bytes: 2199.1754385964914
603
+ num_examples: 5
604
+ download_size: 78216
605
+ dataset_size: 171974.90111339628
606
+ - config_name: high_school_chemistry
607
+ features:
608
+ - name: question
609
+ dtype: string
610
+ - name: subject
611
+ dtype: string
612
+ - name: choices
613
+ sequence: string
614
+ - name: answer
615
+ dtype:
616
+ class_label:
617
+ names:
618
+ '0': A
619
+ '1': B
620
+ '2': C
621
+ '3': D
622
+ splits:
623
+ - name: test
624
+ num_bytes: 100725.89082751745
625
+ num_examples: 203
626
+ - name: validation
627
+ num_bytes: 10971.030698889615
628
+ num_examples: 22
629
+ - name: dev
630
+ num_bytes: 2199.1754385964914
631
+ num_examples: 5
632
+ download_size: 45799
633
+ dataset_size: 113896.09696500355
634
+ - config_name: high_school_computer_science
635
+ features:
636
+ - name: question
637
+ dtype: string
638
+ - name: subject
639
+ dtype: string
640
+ - name: choices
641
+ sequence: string
642
+ - name: answer
643
+ dtype:
644
+ class_label:
645
+ names:
646
+ '0': A
647
+ '1': B
648
+ '2': C
649
+ '3': D
650
+ splits:
651
+ - name: test
652
+ num_bytes: 49618.6654322746
653
+ num_examples: 100
654
+ - name: validation
655
+ num_bytes: 4488.148922273024
656
+ num_examples: 9
657
+ - name: dev
658
+ num_bytes: 2199.1754385964914
659
+ num_examples: 5
660
+ download_size: 39072
661
+ dataset_size: 56305.989793144116
662
+ - config_name: high_school_european_history
663
+ features:
664
+ - name: question
665
+ dtype: string
666
+ - name: subject
667
+ dtype: string
668
+ - name: choices
669
+ sequence: string
670
+ - name: answer
671
+ dtype:
672
+ class_label:
673
+ names:
674
+ '0': A
675
+ '1': B
676
+ '2': C
677
+ '3': D
678
+ splits:
679
+ - name: test
680
+ num_bytes: 81870.79796325309
681
+ num_examples: 165
682
+ - name: validation
683
+ num_bytes: 8976.297844546049
684
+ num_examples: 18
685
+ - name: dev
686
+ num_bytes: 2199.1754385964914
687
+ num_examples: 5
688
+ download_size: 196270
689
+ dataset_size: 93046.27124639563
690
+ - config_name: high_school_geography
691
+ features:
692
+ - name: question
693
+ dtype: string
694
+ - name: subject
695
+ dtype: string
696
+ - name: choices
697
+ sequence: string
698
+ - name: answer
699
+ dtype:
700
+ class_label:
701
+ names:
702
+ '0': A
703
+ '1': B
704
+ '2': C
705
+ '3': D
706
+ splits:
707
+ - name: test
708
+ num_bytes: 98244.95755590372
709
+ num_examples: 198
710
+ - name: validation
711
+ num_bytes: 10971.030698889615
712
+ num_examples: 22
713
+ - name: dev
714
+ num_bytes: 2199.1754385964914
715
+ num_examples: 5
716
+ download_size: 38255
717
+ dataset_size: 111415.16369338983
718
+ - config_name: high_school_government_and_politics
719
+ features:
720
+ - name: question
721
+ dtype: string
722
+ - name: subject
723
+ dtype: string
724
+ - name: choices
725
+ sequence: string
726
+ - name: answer
727
+ dtype:
728
+ class_label:
729
+ names:
730
+ '0': A
731
+ '1': B
732
+ '2': C
733
+ '3': D
734
+ splits:
735
+ - name: test
736
+ num_bytes: 95764.02428428999
737
+ num_examples: 193
738
+ - name: validation
739
+ num_bytes: 10472.347485303722
740
+ num_examples: 21
741
+ - name: dev
742
+ num_bytes: 2199.1754385964914
743
+ num_examples: 5
744
+ download_size: 52963
745
+ dataset_size: 108435.5472081902
746
+ - config_name: high_school_macroeconomics
747
+ features:
748
+ - name: question
749
+ dtype: string
750
+ - name: subject
751
+ dtype: string
752
+ - name: choices
753
+ sequence: string
754
+ - name: answer
755
+ dtype:
756
+ class_label:
757
+ names:
758
+ '0': A
759
+ '1': B
760
+ '2': C
761
+ '3': D
762
+ splits:
763
+ - name: test
764
+ num_bytes: 193512.79518587096
765
+ num_examples: 390
766
+ - name: validation
767
+ num_bytes: 21443.378184193338
768
+ num_examples: 43
769
+ - name: dev
770
+ num_bytes: 2199.1754385964914
771
+ num_examples: 5
772
+ download_size: 68758
773
+ dataset_size: 217155.34880866078
774
+ - config_name: high_school_mathematics
775
+ features:
776
+ - name: question
777
+ dtype: string
778
+ - name: subject
779
+ dtype: string
780
+ - name: choices
781
+ sequence: string
782
+ - name: answer
783
+ dtype:
784
+ class_label:
785
+ names:
786
+ '0': A
787
+ '1': B
788
+ '2': C
789
+ '3': D
790
+ splits:
791
+ - name: test
792
+ num_bytes: 133970.39666714144
793
+ num_examples: 270
794
+ - name: validation
795
+ num_bytes: 14461.813193990856
796
+ num_examples: 29
797
+ - name: dev
798
+ num_bytes: 2199.1754385964914
799
+ num_examples: 5
800
+ download_size: 45210
801
+ dataset_size: 150631.38529972878
802
+ - config_name: high_school_microeconomics
803
+ features:
804
+ - name: question
805
+ dtype: string
806
+ - name: subject
807
+ dtype: string
808
+ - name: choices
809
+ sequence: string
810
+ - name: answer
811
+ dtype:
812
+ class_label:
813
+ names:
814
+ '0': A
815
+ '1': B
816
+ '2': C
817
+ '3': D
818
+ splits:
819
+ - name: test
820
+ num_bytes: 118092.42372881356
821
+ num_examples: 238
822
+ - name: validation
823
+ num_bytes: 12965.76355323318
824
+ num_examples: 26
825
+ - name: dev
826
+ num_bytes: 2199.1754385964914
827
+ num_examples: 5
828
+ download_size: 49885
829
+ dataset_size: 133257.36272064323
830
+ - config_name: high_school_physics
831
+ features:
832
+ - name: question
833
+ dtype: string
834
+ - name: subject
835
+ dtype: string
836
+ - name: choices
837
+ sequence: string
838
+ - name: answer
839
+ dtype:
840
+ class_label:
841
+ names:
842
+ '0': A
843
+ '1': B
844
+ '2': C
845
+ '3': D
846
+ splits:
847
+ - name: test
848
+ num_bytes: 74924.18480273466
849
+ num_examples: 151
850
+ - name: validation
851
+ num_bytes: 8477.614630960157
852
+ num_examples: 17
853
+ - name: dev
854
+ num_bytes: 2199.1754385964914
855
+ num_examples: 5
856
+ download_size: 45483
857
+ dataset_size: 85600.9748722913
858
+ - config_name: high_school_psychology
859
+ features:
860
+ - name: question
861
+ dtype: string
862
+ - name: subject
863
+ dtype: string
864
+ - name: choices
865
+ sequence: string
866
+ - name: answer
867
+ dtype:
868
+ class_label:
869
+ names:
870
+ '0': A
871
+ '1': B
872
+ '2': C
873
+ '3': D
874
+ splits:
875
+ - name: test
876
+ num_bytes: 270421.7266058966
877
+ num_examples: 545
878
+ - name: validation
879
+ num_bytes: 29920.992815153495
880
+ num_examples: 60
881
+ - name: dev
882
+ num_bytes: 2199.1754385964914
883
+ num_examples: 5
884
+ download_size: 113158
885
+ dataset_size: 302541.8948596466
886
+ - config_name: high_school_statistics
887
+ features:
888
+ - name: question
889
+ dtype: string
890
+ - name: subject
891
+ dtype: string
892
+ - name: choices
893
+ sequence: string
894
+ - name: answer
895
+ dtype:
896
+ class_label:
897
+ names:
898
+ '0': A
899
+ '1': B
900
+ '2': C
901
+ '3': D
902
+ splits:
903
+ - name: test
904
+ num_bytes: 107176.31733371314
905
+ num_examples: 216
906
+ - name: validation
907
+ num_bytes: 11469.713912475507
908
+ num_examples: 23
909
+ - name: dev
910
+ num_bytes: 2199.1754385964914
911
+ num_examples: 5
912
+ download_size: 74924
913
+ dataset_size: 120845.20668478514
914
+ - config_name: high_school_us_history
915
+ features:
916
+ - name: question
917
+ dtype: string
918
+ - name: subject
919
+ dtype: string
920
+ - name: choices
921
+ sequence: string
922
+ - name: answer
923
+ dtype:
924
+ class_label:
925
+ names:
926
+ '0': A
927
+ '1': B
928
+ '2': C
929
+ '3': D
930
+ splits:
931
+ - name: test
932
+ num_bytes: 101222.0774818402
933
+ num_examples: 204
934
+ - name: validation
935
+ num_bytes: 10971.030698889615
936
+ num_examples: 22
937
+ - name: dev
938
+ num_bytes: 2199.1754385964914
939
+ num_examples: 5
940
+ download_size: 200043
941
+ dataset_size: 114392.2836193263
942
+ - config_name: high_school_world_history
943
+ features:
944
+ - name: question
945
+ dtype: string
946
+ - name: subject
947
+ dtype: string
948
+ - name: choices
949
+ sequence: string
950
+ - name: answer
951
+ dtype:
952
+ class_label:
953
+ names:
954
+ '0': A
955
+ '1': B
956
+ '2': C
957
+ '3': D
958
+ splits:
959
+ - name: test
960
+ num_bytes: 117596.23707449081
961
+ num_examples: 237
962
+ - name: validation
963
+ num_bytes: 12965.76355323318
964
+ num_examples: 26
965
+ - name: dev
966
+ num_bytes: 2199.1754385964914
967
+ num_examples: 5
968
+ download_size: 250302
969
+ dataset_size: 132761.17606632048
970
+ - config_name: human_aging
971
+ features:
972
+ - name: question
973
+ dtype: string
974
+ - name: subject
975
+ dtype: string
976
+ - name: choices
977
+ sequence: string
978
+ - name: answer
979
+ dtype:
980
+ class_label:
981
+ names:
982
+ '0': A
983
+ '1': B
984
+ '2': C
985
+ '3': D
986
+ splits:
987
+ - name: test
988
+ num_bytes: 110649.62391397236
989
+ num_examples: 223
990
+ - name: validation
991
+ num_bytes: 11469.713912475507
992
+ num_examples: 23
993
+ - name: dev
994
+ num_bytes: 2199.1754385964914
995
+ num_examples: 5
996
+ download_size: 41196
997
+ dataset_size: 124318.51326504436
998
+ - config_name: human_sexuality
999
+ features:
1000
+ - name: question
1001
+ dtype: string
1002
+ - name: subject
1003
+ dtype: string
1004
+ - name: choices
1005
+ sequence: string
1006
+ - name: answer
1007
+ dtype:
1008
+ class_label:
1009
+ names:
1010
+ '0': A
1011
+ '1': B
1012
+ '2': C
1013
+ '3': D
1014
+ splits:
1015
+ - name: test
1016
+ num_bytes: 65000.451716279735
1017
+ num_examples: 131
1018
+ - name: validation
1019
+ num_bytes: 5984.198563030699
1020
+ num_examples: 12
1021
+ - name: dev
1022
+ num_bytes: 2199.1754385964914
1023
+ num_examples: 5
1024
+ download_size: 32533
1025
+ dataset_size: 73183.82571790692
1026
+ - config_name: international_law
1027
+ features:
1028
+ - name: question
1029
+ dtype: string
1030
+ - name: subject
1031
+ dtype: string
1032
+ - name: choices
1033
+ sequence: string
1034
+ - name: answer
1035
+ dtype:
1036
+ class_label:
1037
+ names:
1038
+ '0': A
1039
+ '1': B
1040
+ '2': C
1041
+ '3': D
1042
+ splits:
1043
+ - name: test
1044
+ num_bytes: 60038.58517305227
1045
+ num_examples: 121
1046
+ - name: validation
1047
+ num_bytes: 6482.88177661659
1048
+ num_examples: 13
1049
+ - name: dev
1050
+ num_bytes: 2199.1754385964914
1051
+ num_examples: 5
1052
+ download_size: 41592
1053
+ dataset_size: 68720.64238826535
1054
+ - config_name: jurisprudence
1055
+ features:
1056
+ - name: question
1057
+ dtype: string
1058
+ - name: subject
1059
+ dtype: string
1060
+ - name: choices
1061
+ sequence: string
1062
+ - name: answer
1063
+ dtype:
1064
+ class_label:
1065
+ names:
1066
+ '0': A
1067
+ '1': B
1068
+ '2': C
1069
+ '3': D
1070
+ splits:
1071
+ - name: test
1072
+ num_bytes: 53588.15866685657
1073
+ num_examples: 108
1074
+ - name: validation
1075
+ num_bytes: 5485.515349444808
1076
+ num_examples: 11
1077
+ - name: dev
1078
+ num_bytes: 2199.1754385964914
1079
+ num_examples: 5
1080
+ download_size: 33578
1081
+ dataset_size: 61272.84945489787
1082
+ - config_name: logical_fallacies
1083
+ features:
1084
+ - name: question
1085
+ dtype: string
1086
+ - name: subject
1087
+ dtype: string
1088
+ - name: choices
1089
+ sequence: string
1090
+ - name: answer
1091
+ dtype:
1092
+ class_label:
1093
+ names:
1094
+ '0': A
1095
+ '1': B
1096
+ '2': C
1097
+ '3': D
1098
+ splits:
1099
+ - name: test
1100
+ num_bytes: 80878.4246546076
1101
+ num_examples: 163
1102
+ - name: validation
1103
+ num_bytes: 8976.297844546049
1104
+ num_examples: 18
1105
+ - name: dev
1106
+ num_bytes: 2199.1754385964914
1107
+ num_examples: 5
1108
+ download_size: 33669
1109
+ dataset_size: 92053.89793775014
1110
+ - config_name: machine_learning
1111
+ features:
1112
+ - name: question
1113
+ dtype: string
1114
+ - name: subject
1115
+ dtype: string
1116
+ - name: choices
1117
+ sequence: string
1118
+ - name: answer
1119
+ dtype:
1120
+ class_label:
1121
+ names:
1122
+ '0': A
1123
+ '1': B
1124
+ '2': C
1125
+ '3': D
1126
+ splits:
1127
+ - name: test
1128
+ num_bytes: 55572.90528414756
1129
+ num_examples: 112
1130
+ - name: validation
1131
+ num_bytes: 5485.515349444808
1132
+ num_examples: 11
1133
+ - name: dev
1134
+ num_bytes: 2199.1754385964914
1135
+ num_examples: 5
1136
+ download_size: 31121
1137
+ dataset_size: 63257.596072188855
1138
+ - config_name: management
1139
+ features:
1140
+ - name: question
1141
+ dtype: string
1142
+ - name: subject
1143
+ dtype: string
1144
+ - name: choices
1145
+ sequence: string
1146
+ - name: answer
1147
+ dtype:
1148
+ class_label:
1149
+ names:
1150
+ '0': A
1151
+ '1': B
1152
+ '2': C
1153
+ '3': D
1154
+ splits:
1155
+ - name: test
1156
+ num_bytes: 51107.225395242844
1157
+ num_examples: 103
1158
+ - name: validation
1159
+ num_bytes: 5485.515349444808
1160
+ num_examples: 11
1161
+ - name: dev
1162
+ num_bytes: 2199.1754385964914
1163
+ num_examples: 5
1164
+ download_size: 22828
1165
+ dataset_size: 58791.91618328414
1166
+ - config_name: marketing
1167
+ features:
1168
+ - name: question
1169
+ dtype: string
1170
+ - name: subject
1171
+ dtype: string
1172
+ - name: choices
1173
+ sequence: string
1174
+ - name: answer
1175
+ dtype:
1176
+ class_label:
1177
+ names:
1178
+ '0': A
1179
+ '1': B
1180
+ '2': C
1181
+ '3': D
1182
+ splits:
1183
+ - name: test
1184
+ num_bytes: 116107.67711152257
1185
+ num_examples: 234
1186
+ - name: validation
1187
+ num_bytes: 12467.08033964729
1188
+ num_examples: 25
1189
+ - name: dev
1190
+ num_bytes: 2199.1754385964914
1191
+ num_examples: 5
1192
+ download_size: 49747
1193
+ dataset_size: 130773.93288976635
1194
+ - config_name: medical_genetics
1195
+ features:
1196
+ - name: question
1197
+ dtype: string
1198
+ - name: subject
1199
+ dtype: string
1200
+ - name: choices
1201
+ sequence: string
1202
+ - name: answer
1203
+ dtype:
1204
+ class_label:
1205
+ names:
1206
+ '0': A
1207
+ '1': B
1208
+ '2': C
1209
+ '3': D
1210
+ splits:
1211
+ - name: test
1212
+ num_bytes: 49618.6654322746
1213
+ num_examples: 100
1214
+ - name: validation
1215
+ num_bytes: 5485.515349444808
1216
+ num_examples: 11
1217
+ - name: dev
1218
+ num_bytes: 2199.1754385964914
1219
+ num_examples: 5
1220
+ download_size: 25775
1221
+ dataset_size: 57303.3562203159
1222
+ - config_name: miscellaneous
1223
+ features:
1224
+ - name: question
1225
+ dtype: string
1226
+ - name: subject
1227
+ dtype: string
1228
+ - name: choices
1229
+ sequence: string
1230
+ - name: answer
1231
+ dtype:
1232
+ class_label:
1233
+ names:
1234
+ '0': A
1235
+ '1': B
1236
+ '2': C
1237
+ '3': D
1238
+ splits:
1239
+ - name: test
1240
+ num_bytes: 388514.15033471014
1241
+ num_examples: 783
1242
+ - name: validation
1243
+ num_bytes: 42886.756368386676
1244
+ num_examples: 86
1245
+ - name: dev
1246
+ num_bytes: 2199.1754385964914
1247
+ num_examples: 5
1248
+ download_size: 115097
1249
+ dataset_size: 433600.08214169333
1250
+ - config_name: moral_disputes
1251
+ features:
1252
+ - name: question
1253
+ dtype: string
1254
+ - name: subject
1255
+ dtype: string
1256
+ - name: choices
1257
+ sequence: string
1258
+ - name: answer
1259
+ dtype:
1260
+ class_label:
1261
+ names:
1262
+ '0': A
1263
+ '1': B
1264
+ '2': C
1265
+ '3': D
1266
+ splits:
1267
+ - name: test
1268
+ num_bytes: 171680.58239567012
1269
+ num_examples: 346
1270
+ - name: validation
1271
+ num_bytes: 18949.96211626388
1272
+ num_examples: 38
1273
+ - name: dev
1274
+ num_bytes: 2199.1754385964914
1275
+ num_examples: 5
1276
+ download_size: 76043
1277
+ dataset_size: 192829.71995053047
1278
+ - config_name: moral_scenarios
1279
+ features:
1280
+ - name: question
1281
+ dtype: string
1282
+ - name: subject
1283
+ dtype: string
1284
+ - name: choices
1285
+ sequence: string
1286
+ - name: answer
1287
+ dtype:
1288
+ class_label:
1289
+ names:
1290
+ '0': A
1291
+ '1': B
1292
+ '2': C
1293
+ '3': D
1294
+ splits:
1295
+ - name: test
1296
+ num_bytes: 444087.05561885773
1297
+ num_examples: 895
1298
+ - name: validation
1299
+ num_bytes: 49868.32135858916
1300
+ num_examples: 100
1301
+ - name: dev
1302
+ num_bytes: 2199.1754385964914
1303
+ num_examples: 5
1304
+ download_size: 109869
1305
+ dataset_size: 496154.5524160434
1306
+ - config_name: nutrition
1307
+ features:
1308
+ - name: question
1309
+ dtype: string
1310
+ - name: subject
1311
+ dtype: string
1312
+ - name: choices
1313
+ sequence: string
1314
+ - name: answer
1315
+ dtype:
1316
+ class_label:
1317
+ names:
1318
+ '0': A
1319
+ '1': B
1320
+ '2': C
1321
+ '3': D
1322
+ splits:
1323
+ - name: test
1324
+ num_bytes: 151833.1162227603
1325
+ num_examples: 306
1326
+ - name: validation
1327
+ num_bytes: 16456.54604833442
1328
+ num_examples: 33
1329
+ - name: dev
1330
+ num_bytes: 2199.1754385964914
1331
+ num_examples: 5
1332
+ download_size: 69050
1333
+ dataset_size: 170488.8377096912
1334
+ - config_name: philosophy
1335
+ features:
1336
+ - name: question
1337
+ dtype: string
1338
+ - name: subject
1339
+ dtype: string
1340
+ - name: choices
1341
+ sequence: string
1342
+ - name: answer
1343
+ dtype:
1344
+ class_label:
1345
+ names:
1346
+ '0': A
1347
+ '1': B
1348
+ '2': C
1349
+ '3': D
1350
+ splits:
1351
+ - name: test
1352
+ num_bytes: 154314.04949437402
1353
+ num_examples: 311
1354
+ - name: validation
1355
+ num_bytes: 16955.229261920314
1356
+ num_examples: 34
1357
+ - name: dev
1358
+ num_bytes: 2199.1754385964914
1359
+ num_examples: 5
1360
+ download_size: 61912
1361
+ dataset_size: 173468.45419489083
1362
+ - config_name: prehistory
1363
+ features:
1364
+ - name: question
1365
+ dtype: string
1366
+ - name: subject
1367
+ dtype: string
1368
+ - name: choices
1369
+ sequence: string
1370
+ - name: answer
1371
+ dtype:
1372
+ class_label:
1373
+ names:
1374
+ '0': A
1375
+ '1': B
1376
+ '2': C
1377
+ '3': D
1378
+ splits:
1379
+ - name: test
1380
+ num_bytes: 160764.47600056973
1381
+ num_examples: 324
1382
+ - name: validation
1383
+ num_bytes: 17453.912475506204
1384
+ num_examples: 35
1385
+ - name: dev
1386
+ num_bytes: 2199.1754385964914
1387
+ num_examples: 5
1388
+ download_size: 68826
1389
+ dataset_size: 180417.5639146724
1390
+ - config_name: professional_accounting
1391
+ features:
1392
+ - name: question
1393
+ dtype: string
1394
+ - name: subject
1395
+ dtype: string
1396
+ - name: choices
1397
+ sequence: string
1398
+ - name: answer
1399
+ dtype:
1400
+ class_label:
1401
+ names:
1402
+ '0': A
1403
+ '1': B
1404
+ '2': C
1405
+ '3': D
1406
+ splits:
1407
+ - name: test
1408
+ num_bytes: 139924.6365190144
1409
+ num_examples: 282
1410
+ - name: validation
1411
+ num_bytes: 15459.179621162639
1412
+ num_examples: 31
1413
+ - name: dev
1414
+ num_bytes: 2199.1754385964914
1415
+ num_examples: 5
1416
+ download_size: 87297
1417
+ dataset_size: 157582.99157877354
1418
+ - config_name: professional_law
1419
+ features:
1420
+ - name: question
1421
+ dtype: string
1422
+ - name: subject
1423
+ dtype: string
1424
+ - name: choices
1425
+ sequence: string
1426
+ - name: answer
1427
+ dtype:
1428
+ class_label:
1429
+ names:
1430
+ '0': A
1431
+ '1': B
1432
+ '2': C
1433
+ '3': D
1434
+ splits:
1435
+ - name: test
1436
+ num_bytes: 761150.3277310925
1437
+ num_examples: 1534
1438
+ - name: validation
1439
+ num_bytes: 84776.14630960157
1440
+ num_examples: 170
1441
+ - name: dev
1442
+ num_bytes: 2199.1754385964914
1443
+ num_examples: 5
1444
+ download_size: 1167828
1445
+ dataset_size: 848125.6494792906
1446
+ - config_name: professional_medicine
1447
+ features:
1448
+ - name: question
1449
+ dtype: string
1450
+ - name: subject
1451
+ dtype: string
1452
+ - name: choices
1453
+ sequence: string
1454
+ - name: answer
1455
+ dtype:
1456
+ class_label:
1457
+ names:
1458
+ '0': A
1459
+ '1': B
1460
+ '2': C
1461
+ '3': D
1462
+ splits:
1463
+ - name: test
1464
+ num_bytes: 134962.7699757869
1465
+ num_examples: 272
1466
+ - name: validation
1467
+ num_bytes: 15459.179621162639
1468
+ num_examples: 31
1469
+ - name: dev
1470
+ num_bytes: 2199.1754385964914
1471
+ num_examples: 5
1472
+ download_size: 153242
1473
+ dataset_size: 152621.12503554605
1474
+ - config_name: professional_psychology
1475
+ features:
1476
+ - name: question
1477
+ dtype: string
1478
+ - name: subject
1479
+ dtype: string
1480
+ - name: choices
1481
+ sequence: string
1482
+ - name: answer
1483
+ dtype:
1484
+ class_label:
1485
+ names:
1486
+ '0': A
1487
+ '1': B
1488
+ '2': C
1489
+ '3': D
1490
+ splits:
1491
+ - name: test
1492
+ num_bytes: 303666.2324455206
1493
+ num_examples: 612
1494
+ - name: validation
1495
+ num_bytes: 34409.14173742652
1496
+ num_examples: 69
1497
+ - name: dev
1498
+ num_bytes: 2199.1754385964914
1499
+ num_examples: 5
1500
+ download_size: 159357
1501
+ dataset_size: 340274.5496215436
1502
+ - config_name: public_relations
1503
+ features:
1504
+ - name: question
1505
+ dtype: string
1506
+ - name: subject
1507
+ dtype: string
1508
+ - name: choices
1509
+ sequence: string
1510
+ - name: answer
1511
+ dtype:
1512
+ class_label:
1513
+ names:
1514
+ '0': A
1515
+ '1': B
1516
+ '2': C
1517
+ '3': D
1518
+ splits:
1519
+ - name: test
1520
+ num_bytes: 54580.53197550207
1521
+ num_examples: 110
1522
+ - name: validation
1523
+ num_bytes: 5984.198563030699
1524
+ num_examples: 12
1525
+ - name: dev
1526
+ num_bytes: 2199.1754385964914
1527
+ num_examples: 5
1528
+ download_size: 31500
1529
+ dataset_size: 62763.90597712925
1530
+ - config_name: security_studies
1531
+ features:
1532
+ - name: question
1533
+ dtype: string
1534
+ - name: subject
1535
+ dtype: string
1536
+ - name: choices
1537
+ sequence: string
1538
+ - name: answer
1539
+ dtype:
1540
+ class_label:
1541
+ names:
1542
+ '0': A
1543
+ '1': B
1544
+ '2': C
1545
+ '3': D
1546
+ splits:
1547
+ - name: test
1548
+ num_bytes: 121565.73030907278
1549
+ num_examples: 245
1550
+ - name: validation
1551
+ num_bytes: 13464.446766819072
1552
+ num_examples: 27
1553
+ - name: dev
1554
+ num_bytes: 2199.1754385964914
1555
+ num_examples: 5
1556
+ download_size: 140258
1557
+ dataset_size: 137229.35251448833
1558
+ - config_name: sociology
1559
+ features:
1560
+ - name: question
1561
+ dtype: string
1562
+ - name: subject
1563
+ dtype: string
1564
+ - name: choices
1565
+ sequence: string
1566
+ - name: answer
1567
+ dtype:
1568
+ class_label:
1569
+ names:
1570
+ '0': A
1571
+ '1': B
1572
+ '2': C
1573
+ '3': D
1574
+ splits:
1575
+ - name: test
1576
+ num_bytes: 99733.51751887196
1577
+ num_examples: 201
1578
+ - name: validation
1579
+ num_bytes: 10971.030698889615
1580
+ num_examples: 22
1581
+ - name: dev
1582
+ num_bytes: 2199.1754385964914
1583
+ num_examples: 5
1584
+ download_size: 56480
1585
+ dataset_size: 112903.72365635807
1586
+ - config_name: us_foreign_policy
1587
+ features:
1588
+ - name: question
1589
+ dtype: string
1590
+ - name: subject
1591
+ dtype: string
1592
+ - name: choices
1593
+ sequence: string
1594
+ - name: answer
1595
+ dtype:
1596
+ class_label:
1597
+ names:
1598
+ '0': A
1599
+ '1': B
1600
+ '2': C
1601
+ '3': D
1602
+ splits:
1603
+ - name: test
1604
+ num_bytes: 49618.6654322746
1605
+ num_examples: 100
1606
+ - name: validation
1607
+ num_bytes: 5485.515349444808
1608
+ num_examples: 11
1609
+ - name: dev
1610
+ num_bytes: 2199.1754385964914
1611
+ num_examples: 5
1612
+ download_size: 29027
1613
+ dataset_size: 57303.3562203159
1614
+ - config_name: virology
1615
+ features:
1616
+ - name: question
1617
+ dtype: string
1618
+ - name: subject
1619
+ dtype: string
1620
+ - name: choices
1621
+ sequence: string
1622
+ - name: answer
1623
+ dtype:
1624
+ class_label:
1625
+ names:
1626
+ '0': A
1627
+ '1': B
1628
+ '2': C
1629
+ '3': D
1630
+ splits:
1631
+ - name: test
1632
+ num_bytes: 82366.98461757584
1633
+ num_examples: 166
1634
+ - name: validation
1635
+ num_bytes: 8976.297844546049
1636
+ num_examples: 18
1637
+ - name: dev
1638
+ num_bytes: 2199.1754385964914
1639
+ num_examples: 5
1640
+ download_size: 38229
1641
+ dataset_size: 93542.45790071838
1642
+ - config_name: world_religions
1643
+ features:
1644
+ - name: question
1645
+ dtype: string
1646
+ - name: subject
1647
+ dtype: string
1648
+ - name: choices
1649
+ sequence: string
1650
+ - name: answer
1651
+ dtype:
1652
+ class_label:
1653
+ names:
1654
+ '0': A
1655
+ '1': B
1656
+ '2': C
1657
+ '3': D
1658
+ splits:
1659
+ - name: test
1660
+ num_bytes: 84847.91788918957
1661
+ num_examples: 171
1662
+ - name: validation
1663
+ num_bytes: 9474.98105813194
1664
+ num_examples: 19
1665
+ - name: dev
1666
+ num_bytes: 2199.1754385964914
1667
+ num_examples: 5
1668
+ download_size: 27165
1669
+ dataset_size: 96522.07438591801
1670
+ configs:
1671
+ - config_name: abstract_algebra
1672
+ data_files:
1673
+ - split: test
1674
+ path: abstract_algebra/test-*
1675
+ - split: validation
1676
+ path: abstract_algebra/validation-*
1677
+ - split: dev
1678
+ path: abstract_algebra/dev-*
1679
+ - config_name: all
1680
+ data_files:
1681
+ - split: test
1682
+ path: all/test-*
1683
+ - split: validation
1684
+ path: all/validation-*
1685
+ - split: dev
1686
+ path: all/dev-*
1687
+ - split: auxiliary_train
1688
+ path: all/auxiliary_train-*
1689
+ - config_name: anatomy
1690
+ data_files:
1691
+ - split: test
1692
+ path: anatomy/test-*
1693
+ - split: validation
1694
+ path: anatomy/validation-*
1695
+ - split: dev
1696
+ path: anatomy/dev-*
1697
+ - config_name: astronomy
1698
+ data_files:
1699
+ - split: test
1700
+ path: astronomy/test-*
1701
+ - split: validation
1702
+ path: astronomy/validation-*
1703
+ - split: dev
1704
+ path: astronomy/dev-*
1705
+ - config_name: auxiliary_train
1706
+ data_files:
1707
+ - split: train
1708
+ path: auxiliary_train/train-*
1709
+ - config_name: business_ethics
1710
+ data_files:
1711
+ - split: test
1712
+ path: business_ethics/test-*
1713
+ - split: validation
1714
+ path: business_ethics/validation-*
1715
+ - split: dev
1716
+ path: business_ethics/dev-*
1717
+ - config_name: clinical_knowledge
1718
+ data_files:
1719
+ - split: test
1720
+ path: clinical_knowledge/test-*
1721
+ - split: validation
1722
+ path: clinical_knowledge/validation-*
1723
+ - split: dev
1724
+ path: clinical_knowledge/dev-*
1725
+ - config_name: college_biology
1726
+ data_files:
1727
+ - split: test
1728
+ path: college_biology/test-*
1729
+ - split: validation
1730
+ path: college_biology/validation-*
1731
+ - split: dev
1732
+ path: college_biology/dev-*
1733
+ - config_name: college_chemistry
1734
+ data_files:
1735
+ - split: test
1736
+ path: college_chemistry/test-*
1737
+ - split: validation
1738
+ path: college_chemistry/validation-*
1739
+ - split: dev
1740
+ path: college_chemistry/dev-*
1741
+ - config_name: college_computer_science
1742
+ data_files:
1743
+ - split: test
1744
+ path: college_computer_science/test-*
1745
+ - split: validation
1746
+ path: college_computer_science/validation-*
1747
+ - split: dev
1748
+ path: college_computer_science/dev-*
1749
+ - config_name: college_mathematics
1750
+ data_files:
1751
+ - split: test
1752
+ path: college_mathematics/test-*
1753
+ - split: validation
1754
+ path: college_mathematics/validation-*
1755
+ - split: dev
1756
+ path: college_mathematics/dev-*
1757
+ - config_name: college_medicine
1758
+ data_files:
1759
+ - split: test
1760
+ path: college_medicine/test-*
1761
+ - split: validation
1762
+ path: college_medicine/validation-*
1763
+ - split: dev
1764
+ path: college_medicine/dev-*
1765
+ - config_name: college_physics
1766
+ data_files:
1767
+ - split: test
1768
+ path: college_physics/test-*
1769
+ - split: validation
1770
+ path: college_physics/validation-*
1771
+ - split: dev
1772
+ path: college_physics/dev-*
1773
+ - config_name: computer_security
1774
+ data_files:
1775
+ - split: test
1776
+ path: computer_security/test-*
1777
+ - split: validation
1778
+ path: computer_security/validation-*
1779
+ - split: dev
1780
+ path: computer_security/dev-*
1781
+ - config_name: conceptual_physics
1782
+ data_files:
1783
+ - split: test
1784
+ path: conceptual_physics/test-*
1785
+ - split: validation
1786
+ path: conceptual_physics/validation-*
1787
+ - split: dev
1788
+ path: conceptual_physics/dev-*
1789
+ - config_name: econometrics
1790
+ data_files:
1791
+ - split: test
1792
+ path: econometrics/test-*
1793
+ - split: validation
1794
+ path: econometrics/validation-*
1795
+ - split: dev
1796
+ path: econometrics/dev-*
1797
+ - config_name: electrical_engineering
1798
+ data_files:
1799
+ - split: test
1800
+ path: electrical_engineering/test-*
1801
+ - split: validation
1802
+ path: electrical_engineering/validation-*
1803
+ - split: dev
1804
+ path: electrical_engineering/dev-*
1805
+ - config_name: elementary_mathematics
1806
+ data_files:
1807
+ - split: test
1808
+ path: elementary_mathematics/test-*
1809
+ - split: validation
1810
+ path: elementary_mathematics/validation-*
1811
+ - split: dev
1812
+ path: elementary_mathematics/dev-*
1813
+ - config_name: formal_logic
1814
+ data_files:
1815
+ - split: test
1816
+ path: formal_logic/test-*
1817
+ - split: validation
1818
+ path: formal_logic/validation-*
1819
+ - split: dev
1820
+ path: formal_logic/dev-*
1821
+ - config_name: global_facts
1822
+ data_files:
1823
+ - split: test
1824
+ path: global_facts/test-*
1825
+ - split: validation
1826
+ path: global_facts/validation-*
1827
+ - split: dev
1828
+ path: global_facts/dev-*
1829
+ - config_name: high_school_biology
1830
+ data_files:
1831
+ - split: test
1832
+ path: high_school_biology/test-*
1833
+ - split: validation
1834
+ path: high_school_biology/validation-*
1835
+ - split: dev
1836
+ path: high_school_biology/dev-*
1837
+ - config_name: high_school_chemistry
1838
+ data_files:
1839
+ - split: test
1840
+ path: high_school_chemistry/test-*
1841
+ - split: validation
1842
+ path: high_school_chemistry/validation-*
1843
+ - split: dev
1844
+ path: high_school_chemistry/dev-*
1845
+ - config_name: high_school_computer_science
1846
+ data_files:
1847
+ - split: test
1848
+ path: high_school_computer_science/test-*
1849
+ - split: validation
1850
+ path: high_school_computer_science/validation-*
1851
+ - split: dev
1852
+ path: high_school_computer_science/dev-*
1853
+ - config_name: high_school_european_history
1854
+ data_files:
1855
+ - split: test
1856
+ path: high_school_european_history/test-*
1857
+ - split: validation
1858
+ path: high_school_european_history/validation-*
1859
+ - split: dev
1860
+ path: high_school_european_history/dev-*
1861
+ - config_name: high_school_geography
1862
+ data_files:
1863
+ - split: test
1864
+ path: high_school_geography/test-*
1865
+ - split: validation
1866
+ path: high_school_geography/validation-*
1867
+ - split: dev
1868
+ path: high_school_geography/dev-*
1869
+ - config_name: high_school_government_and_politics
1870
+ data_files:
1871
+ - split: test
1872
+ path: high_school_government_and_politics/test-*
1873
+ - split: validation
1874
+ path: high_school_government_and_politics/validation-*
1875
+ - split: dev
1876
+ path: high_school_government_and_politics/dev-*
1877
+ - config_name: high_school_macroeconomics
1878
+ data_files:
1879
+ - split: test
1880
+ path: high_school_macroeconomics/test-*
1881
+ - split: validation
1882
+ path: high_school_macroeconomics/validation-*
1883
+ - split: dev
1884
+ path: high_school_macroeconomics/dev-*
1885
+ - config_name: high_school_mathematics
1886
+ data_files:
1887
+ - split: test
1888
+ path: high_school_mathematics/test-*
1889
+ - split: validation
1890
+ path: high_school_mathematics/validation-*
1891
+ - split: dev
1892
+ path: high_school_mathematics/dev-*
1893
+ - config_name: high_school_microeconomics
1894
+ data_files:
1895
+ - split: test
1896
+ path: high_school_microeconomics/test-*
1897
+ - split: validation
1898
+ path: high_school_microeconomics/validation-*
1899
+ - split: dev
1900
+ path: high_school_microeconomics/dev-*
1901
+ - config_name: high_school_physics
1902
+ data_files:
1903
+ - split: test
1904
+ path: high_school_physics/test-*
1905
+ - split: validation
1906
+ path: high_school_physics/validation-*
1907
+ - split: dev
1908
+ path: high_school_physics/dev-*
1909
+ - config_name: high_school_psychology
1910
+ data_files:
1911
+ - split: test
1912
+ path: high_school_psychology/test-*
1913
+ - split: validation
1914
+ path: high_school_psychology/validation-*
1915
+ - split: dev
1916
+ path: high_school_psychology/dev-*
1917
+ - config_name: high_school_statistics
1918
+ data_files:
1919
+ - split: test
1920
+ path: high_school_statistics/test-*
1921
+ - split: validation
1922
+ path: high_school_statistics/validation-*
1923
+ - split: dev
1924
+ path: high_school_statistics/dev-*
1925
+ - config_name: high_school_us_history
1926
+ data_files:
1927
+ - split: test
1928
+ path: high_school_us_history/test-*
1929
+ - split: validation
1930
+ path: high_school_us_history/validation-*
1931
+ - split: dev
1932
+ path: high_school_us_history/dev-*
1933
+ - config_name: high_school_world_history
1934
+ data_files:
1935
+ - split: test
1936
+ path: high_school_world_history/test-*
1937
+ - split: validation
1938
+ path: high_school_world_history/validation-*
1939
+ - split: dev
1940
+ path: high_school_world_history/dev-*
1941
+ - config_name: human_aging
1942
+ data_files:
1943
+ - split: test
1944
+ path: human_aging/test-*
1945
+ - split: validation
1946
+ path: human_aging/validation-*
1947
+ - split: dev
1948
+ path: human_aging/dev-*
1949
+ - config_name: human_sexuality
1950
+ data_files:
1951
+ - split: test
1952
+ path: human_sexuality/test-*
1953
+ - split: validation
1954
+ path: human_sexuality/validation-*
1955
+ - split: dev
1956
+ path: human_sexuality/dev-*
1957
+ - config_name: international_law
1958
+ data_files:
1959
+ - split: test
1960
+ path: international_law/test-*
1961
+ - split: validation
1962
+ path: international_law/validation-*
1963
+ - split: dev
1964
+ path: international_law/dev-*
1965
+ - config_name: jurisprudence
1966
+ data_files:
1967
+ - split: test
1968
+ path: jurisprudence/test-*
1969
+ - split: validation
1970
+ path: jurisprudence/validation-*
1971
+ - split: dev
1972
+ path: jurisprudence/dev-*
1973
+ - config_name: logical_fallacies
1974
+ data_files:
1975
+ - split: test
1976
+ path: logical_fallacies/test-*
1977
+ - split: validation
1978
+ path: logical_fallacies/validation-*
1979
+ - split: dev
1980
+ path: logical_fallacies/dev-*
1981
+ - config_name: machine_learning
1982
+ data_files:
1983
+ - split: test
1984
+ path: machine_learning/test-*
1985
+ - split: validation
1986
+ path: machine_learning/validation-*
1987
+ - split: dev
1988
+ path: machine_learning/dev-*
1989
+ - config_name: management
1990
+ data_files:
1991
+ - split: test
1992
+ path: management/test-*
1993
+ - split: validation
1994
+ path: management/validation-*
1995
+ - split: dev
1996
+ path: management/dev-*
1997
+ - config_name: marketing
1998
+ data_files:
1999
+ - split: test
2000
+ path: marketing/test-*
2001
+ - split: validation
2002
+ path: marketing/validation-*
2003
+ - split: dev
2004
+ path: marketing/dev-*
2005
+ - config_name: medical_genetics
2006
+ data_files:
2007
+ - split: test
2008
+ path: medical_genetics/test-*
2009
+ - split: validation
2010
+ path: medical_genetics/validation-*
2011
+ - split: dev
2012
+ path: medical_genetics/dev-*
2013
+ - config_name: miscellaneous
2014
+ data_files:
2015
+ - split: test
2016
+ path: miscellaneous/test-*
2017
+ - split: validation
2018
+ path: miscellaneous/validation-*
2019
+ - split: dev
2020
+ path: miscellaneous/dev-*
2021
+ - config_name: moral_disputes
2022
+ data_files:
2023
+ - split: test
2024
+ path: moral_disputes/test-*
2025
+ - split: validation
2026
+ path: moral_disputes/validation-*
2027
+ - split: dev
2028
+ path: moral_disputes/dev-*
2029
+ - config_name: moral_scenarios
2030
+ data_files:
2031
+ - split: test
2032
+ path: moral_scenarios/test-*
2033
+ - split: validation
2034
+ path: moral_scenarios/validation-*
2035
+ - split: dev
2036
+ path: moral_scenarios/dev-*
2037
+ - config_name: nutrition
2038
+ data_files:
2039
+ - split: test
2040
+ path: nutrition/test-*
2041
+ - split: validation
2042
+ path: nutrition/validation-*
2043
+ - split: dev
2044
+ path: nutrition/dev-*
2045
+ - config_name: philosophy
2046
+ data_files:
2047
+ - split: test
2048
+ path: philosophy/test-*
2049
+ - split: validation
2050
+ path: philosophy/validation-*
2051
+ - split: dev
2052
+ path: philosophy/dev-*
2053
+ - config_name: prehistory
2054
+ data_files:
2055
+ - split: test
2056
+ path: prehistory/test-*
2057
+ - split: validation
2058
+ path: prehistory/validation-*
2059
+ - split: dev
2060
+ path: prehistory/dev-*
2061
+ - config_name: professional_accounting
2062
+ data_files:
2063
+ - split: test
2064
+ path: professional_accounting/test-*
2065
+ - split: validation
2066
+ path: professional_accounting/validation-*
2067
+ - split: dev
2068
+ path: professional_accounting/dev-*
2069
+ - config_name: professional_law
2070
+ data_files:
2071
+ - split: test
2072
+ path: professional_law/test-*
2073
+ - split: validation
2074
+ path: professional_law/validation-*
2075
+ - split: dev
2076
+ path: professional_law/dev-*
2077
+ - config_name: professional_medicine
2078
+ data_files:
2079
+ - split: test
2080
+ path: professional_medicine/test-*
2081
+ - split: validation
2082
+ path: professional_medicine/validation-*
2083
+ - split: dev
2084
+ path: professional_medicine/dev-*
2085
+ - config_name: professional_psychology
2086
+ data_files:
2087
+ - split: test
2088
+ path: professional_psychology/test-*
2089
+ - split: validation
2090
+ path: professional_psychology/validation-*
2091
+ - split: dev
2092
+ path: professional_psychology/dev-*
2093
+ - config_name: public_relations
2094
+ data_files:
2095
+ - split: test
2096
+ path: public_relations/test-*
2097
+ - split: validation
2098
+ path: public_relations/validation-*
2099
+ - split: dev
2100
+ path: public_relations/dev-*
2101
+ - config_name: security_studies
2102
+ data_files:
2103
+ - split: test
2104
+ path: security_studies/test-*
2105
+ - split: validation
2106
+ path: security_studies/validation-*
2107
+ - split: dev
2108
+ path: security_studies/dev-*
2109
+ - config_name: sociology
2110
+ data_files:
2111
+ - split: test
2112
+ path: sociology/test-*
2113
+ - split: validation
2114
+ path: sociology/validation-*
2115
+ - split: dev
2116
+ path: sociology/dev-*
2117
+ - config_name: us_foreign_policy
2118
+ data_files:
2119
+ - split: test
2120
+ path: us_foreign_policy/test-*
2121
+ - split: validation
2122
+ path: us_foreign_policy/validation-*
2123
+ - split: dev
2124
+ path: us_foreign_policy/dev-*
2125
+ - config_name: virology
2126
+ data_files:
2127
+ - split: test
2128
+ path: virology/test-*
2129
+ - split: validation
2130
+ path: virology/validation-*
2131
+ - split: dev
2132
+ path: virology/dev-*
2133
+ - config_name: world_religions
2134
+ data_files:
2135
+ - split: test
2136
+ path: world_religions/test-*
2137
+ - split: validation
2138
+ path: world_religions/validation-*
2139
+ - split: dev
2140
+ path: world_religions/dev-*
2141
+ ---
2142
+
2143
+ # Dataset Card for MMLU
2144
+
2145
+ ## Table of Contents
2146
+ - [Table of Contents](#table-of-contents)
2147
+ - [Dataset Description](#dataset-description)
2148
+ - [Dataset Summary](#dataset-summary)
2149
+ - [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
2150
+ - [Languages](#languages)
2151
+ - [Dataset Structure](#dataset-structure)
2152
+ - [Data Instances](#data-instances)
2153
+ - [Data Fields](#data-fields)
2154
+ - [Data Splits](#data-splits)
2155
+ - [Dataset Creation](#dataset-creation)
2156
+ - [Curation Rationale](#curation-rationale)
2157
+ - [Source Data](#source-data)
2158
+ - [Annotations](#annotations)
2159
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
2160
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
2161
+ - [Social Impact of Dataset](#social-impact-of-dataset)
2162
+ - [Discussion of Biases](#discussion-of-biases)
2163
+ - [Other Known Limitations](#other-known-limitations)
2164
+ - [Additional Information](#additional-information)
2165
+ - [Dataset Curators](#dataset-curators)
2166
+ - [Licensing Information](#licensing-information)
2167
+ - [Citation Information](#citation-information)
2168
+ - [Contributions](#contributions)
2169
+
2170
+ ## Dataset Description
2171
+
2172
+ - **Repository**: https://github.com/hendrycks/test
2173
+ - **Paper**: https://arxiv.org/abs/2009.03300
2174
+
2175
+ ### Dataset Summary
2176
+
2177
+ [Measuring Massive Multitask Language Understanding](https://arxiv.org/pdf/2009.03300) by [Dan Hendrycks](https://people.eecs.berkeley.edu/~hendrycks/), [Collin Burns](http://collinpburns.com), [Steven Basart](https://stevenbas.art), Andy Zou, Mantas Mazeika, [Dawn Song](https://people.eecs.berkeley.edu/~dawnsong/), and [Jacob Steinhardt](https://www.stat.berkeley.edu/~jsteinhardt/) (ICLR 2021).
2178
+
2179
+ This is a massive multitask test consisting of multiple-choice questions from various branches of knowledge. The test spans subjects in the humanities, social sciences, hard sciences, and other areas that are important for some people to learn. This covers 57 tasks including elementary mathematics, US history, computer science, law, and more. To attain high accuracy on this test, models must possess extensive world knowledge and problem solving ability.
2180
+
2181
+ A complete list of tasks: ['abstract_algebra', 'anatomy', 'astronomy', 'business_ethics', 'clinical_knowledge', 'college_biology', 'college_chemistry', 'college_computer_science', 'college_mathematics', 'college_medicine', 'college_physics', 'computer_security', 'conceptual_physics', 'econometrics', 'electrical_engineering', 'elementary_mathematics', 'formal_logic', 'global_facts', 'high_school_biology', 'high_school_chemistry', 'high_school_computer_science', 'high_school_european_history', 'high_school_geography', 'high_school_government_and_politics', 'high_school_macroeconomics', 'high_school_mathematics', 'high_school_microeconomics', 'high_school_physics', 'high_school_psychology', 'high_school_statistics', 'high_school_us_history', 'high_school_world_history', 'human_aging', 'human_sexuality', 'international_law', 'jurisprudence', 'logical_fallacies', 'machine_learning', 'management', 'marketing', 'medical_genetics', 'miscellaneous', 'moral_disputes', 'moral_scenarios', 'nutrition', 'philosophy', 'prehistory', 'professional_accounting', 'professional_law', 'professional_medicine', 'professional_psychology', 'public_relations', 'security_studies', 'sociology', 'us_foreign_policy', 'virology', 'world_religions']
2182
+
2183
+ ### Supported Tasks and Leaderboards
2184
+
2185
+ | Model | Authors | Humanities | Social Science | STEM | Other | Average |
2186
+ |------------------------------------|----------|:-------:|:-------:|:-------:|:-------:|:-------:|
2187
+ | [UnifiedQA](https://arxiv.org/abs/2005.00700) | Khashabi et al., 2020 | 45.6 | 56.6 | 40.2 | 54.6 | 48.9
2188
+ | [GPT-3](https://arxiv.org/abs/2005.14165) (few-shot) | Brown et al., 2020 | 40.8 | 50.4 | 36.7 | 48.8 | 43.9
2189
+ | [GPT-2](https://arxiv.org/abs/2005.14165) | Radford et al., 2019 | 32.8 | 33.3 | 30.2 | 33.1 | 32.4
2190
+ | Random Baseline | N/A | 25.0 | 25.0 | 25.0 | 25.0 | 25.0 | 25.0
2191
+
2192
+ ### Languages
2193
+
2194
+ English
2195
+
2196
+ ## Dataset Structure
2197
+
2198
+ ### Data Instances
2199
+
2200
+ An example from anatomy subtask looks as follows:
2201
+ ```
2202
+ {
2203
+ "question": "What is the embryological origin of the hyoid bone?",
2204
+ "choices": ["The first pharyngeal arch", "The first and second pharyngeal arches", "The second pharyngeal arch", "The second and third pharyngeal arches"],
2205
+ "answer": "D"
2206
+ }
2207
+ ```
2208
+
2209
+ ### Data Fields
2210
+
2211
+ - `question`: a string feature
2212
+ - `choices`: a list of 4 string features
2213
+ - `answer`: a ClassLabel feature
2214
+
2215
+ ### Data Splits
2216
+
2217
+ - `auxiliary_train`: auxiliary multiple-choice training questions from ARC, MC_TEST, OBQA, RACE, etc.
2218
+ - `dev`: 5 examples per subtask, meant for few-shot setting
2219
+ - `test`: there are at least 100 examples per subtask
2220
+
2221
+ | | auxiliary_train | dev | val | test |
2222
+ | ----- | :------: | :-----: | :-----: | :-----: |
2223
+ | TOTAL | 99842 | 285 | 1531 | 14042
2224
+
2225
+ ## Dataset Creation
2226
+
2227
+ ### Curation Rationale
2228
+
2229
+ Transformer models have driven this recent progress by pretraining on massive text corpora, including all of Wikipedia, thousands of books, and numerous websites. These models consequently see extensive information about specialized topics, most of which is not assessed by existing NLP benchmarks. To bridge the gap between the wide-ranging knowledge that models see during pretraining and the existing measures of success, we introduce a new benchmark for assessing models across a diverse set of subjects that humans learn.
2230
+
2231
+ ### Source Data
2232
+
2233
+ #### Initial Data Collection and Normalization
2234
+
2235
+ [More Information Needed]
2236
+
2237
+ #### Who are the source language producers?
2238
+
2239
+ [More Information Needed]
2240
+
2241
+ ### Annotations
2242
+
2243
+ #### Annotation process
2244
+
2245
+ [More Information Needed]
2246
+
2247
+ #### Who are the annotators?
2248
+
2249
+ [More Information Needed]
2250
+
2251
+ ### Personal and Sensitive Information
2252
+
2253
+ [More Information Needed]
2254
+
2255
+ ## Considerations for Using the Data
2256
+
2257
+ ### Social Impact of Dataset
2258
+
2259
+ [More Information Needed]
2260
+
2261
+ ### Discussion of Biases
2262
+
2263
+ [More Information Needed]
2264
+
2265
+ ### Other Known Limitations
2266
+
2267
+ [More Information Needed]
2268
+
2269
+ ## Additional Information
2270
+
2271
+ ### Dataset Curators
2272
+
2273
+ [More Information Needed]
2274
+
2275
+ ### Licensing Information
2276
+
2277
+ [MIT License](https://github.com/hendrycks/test/blob/master/LICENSE)
2278
+
2279
+ ### Citation Information
2280
+
2281
+ If you find this useful in your research, please consider citing the test and also the [ETHICS](https://arxiv.org/abs/2008.02275) dataset it draws from:
2282
+ ```
2283
+ @article{hendryckstest2021,
2284
+ title={Measuring Massive Multitask Language Understanding},
2285
+ author={Dan Hendrycks and Collin Burns and Steven Basart and Andy Zou and Mantas Mazeika and Dawn Song and Jacob Steinhardt},
2286
+ journal={Proceedings of the International Conference on Learning Representations (ICLR)},
2287
+ year={2021}
2288
+ }
2289
+
2290
+ @article{hendrycks2021ethics,
2291
+ title={Aligning AI With Shared Human Values},
2292
+ author={Dan Hendrycks and Collin Burns and Steven Basart and Andrew Critch and Jerry Li and Dawn Song and Jacob Steinhardt},
2293
+ journal={Proceedings of the International Conference on Learning Representations (ICLR)},
2294
+ year={2021}
2295
+ }
2296
+ ```
2297
+ ### Contributions
2298
+
2299
+ Thanks to [@andyzoujm](https://github.com/andyzoujm) for adding this dataset.
models/dmax-16b/.gitattributes ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/decode.png filter=lfs diff=lfs merge=lfs -text
37
+ assets/demo.png filter=lfs diff=lfs merge=lfs -text
38
+ assets/exp.png filter=lfs diff=lfs merge=lfs -text
39
+ assets/tradeoff.png filter=lfs diff=lfs merge=lfs -text
40
+ assets/train.png filter=lfs diff=lfs merge=lfs -text
41
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
models/dmax-16b/README.md ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - inclusionAI/LLaDA2.0-mini
4
+ license: apache-2.0
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ ---
8
+
9
+ <div align="center">
10
+ <h1>🚀 DMax: Aggressive Parallel Decoding for dLLMs</h1>
11
+ <div align="center">
12
+ <a href="https://github.com/czg1225/DMax/blob/main/LICENSE">
13
+ <img alt="Apache" src="https://img.shields.io/badge/License-Apache-4E94CE.svg">
14
+ </a>
15
+ <a href="https://arxiv.org/abs/2604.08302">
16
+ <img src="https://img.shields.io/badge/Paper-Arxiv-darkred.svg" alt="Paper">
17
+ </a>
18
+ <a href="https://github.com/czg1225/DMax">
19
+ <img src="https://img.shields.io/badge/GitHub-Code-blue.svg?logo=github&" alt="GitHub">
20
+ </a>
21
+ </div>
22
+ </div>
23
+
24
+ DMax is a new paradigm for efficient diffusion language models (dLLMs) that enables aggressive decoding parallelism while preserving generation quality. This repository hosts **DMax-16B**, a highly parallel general-purpose diffusion language model (dLLM) capable of handling code generation, mathematical reasoning, and daily conversation.
25
+
26
+
27
+ ## 💪 Highlights
28
+
29
+ - **Aggressive Decoding Parallelism**: Achieves 6.0 TPF on math and reasoning tasks and 6.6 TPF on code tasks while preserving accuracy.
30
+ - **Self-Revising dLLM**: Extends a pretrained MDLM into a UDLM with an intrinsic ability to revise its own erroneous predictions during decoding.
31
+ - **Soft Parallel Decoding**: Uses interpolation between mask and token embeddings to propagate confidence priors from previous steps.
32
+
33
+ <div align="center">
34
+ <img src="assets/tradeoff.png" width="100%" />
35
+ <br>
36
+ <em>Superior Parallelism-Accuracy Trade-off, Increased TPF with Maintained Accuracy.</em>
37
+ </div>
38
+
39
+
40
+ ## 💻 Model and Datasets
41
+
42
+ | Model | Description | Source Model | Link |
43
+ | --- | --- | --- | --- |
44
+ | 🤖 DMax-16B | Highly parallel general-purpose dLLM. | LLaDA-2.0-mini | [HF](https://huggingface.co/Zigeng/DMax-16B) |
45
+ | 🤖 DMax-Math-16B | Highly parallel dLLM for math and reasoning. | LLaDA-2.0-mini | [HF](https://huggingface.co/Zigeng/DMax-Math-16B) |
46
+ | 🤖 DMax-Coder-16B | Highly parallel dLLM for code generation. | LLaDA-2.0-mini | [HF](https://huggingface.co/Zigeng/DMax-Coder-16B) |
47
+
48
+ | Dataset | Description | Link |
49
+ | --- | --- | --- |
50
+ | 📊 DMax-Math-Training-Data | math trajectories generated by LLaDA-2.0-mini | [HF](https://huggingface.co/datasets/Zigeng/DMax-LLaDA-2.0-Mini-Math-Trajectories) |
51
+ | 📊 DMax-Code-Training-Data | code trajectories generated by LLaDA-2.0-mini | [HF](https://huggingface.co/datasets/Zigeng/DMax-LLaDA-2.0-Mini-Code-Trajectories) |
52
+
53
+
54
+
55
+ ## 🚀 Quick Start
56
+
57
+ ```python
58
+ import torch
59
+ from transformers import AutoModelForCausalLM
60
+ from transformers import AutoTokenizer
61
+
62
+ model = AutoModelForCausalLM.from_pretrained(
63
+ "Zigeng/DMax-16B", trust_remote_code=True, device_map="cuda:0"
64
+ )
65
+ model = model.to(torch.bfloat16)
66
+ model.eval()
67
+ tokenizer = AutoTokenizer.from_pretrained("Zigeng/DMax-16B", trust_remote_code=True)
68
+
69
+ prompt = "A robe takes 2 bolts of blue fiber and half that much white fiber. How many bolts in total does it take?" + "
70
+ Let's think step by step
71
+ "
72
+
73
+ input_ids = tokenizer.apply_chat_template(
74
+ [{"role": "user", "content": prompt}],
75
+ add_generation_prompt=True,
76
+ tokenize=True,
77
+ return_tensors="pt",
78
+ )
79
+
80
+ nfe, generated_tokens = model.generate_spd(
81
+ inputs=input_ids,
82
+ gen_length=2048,
83
+ block_length=32,
84
+ threshold=0.5,
85
+ )
86
+
87
+ generated_answer = tokenizer.decode(
88
+ generated_tokens[0],
89
+ skip_special_tokens=True,
90
+ )
91
+
92
+ print(generated_answer)
93
+ print("nfe:",nfe,"token length",len(generated_tokens[0]))
94
+ ```
95
+
96
+ ## 📖 Experimental Results
97
+
98
+ ![trade-off](assets/exp.png)
99
+
100
+ ## 📚 Citation
101
+
102
+ ```bibtex
103
+ @article{chen2026dmax,
104
+ title={DMax: Aggressive Parallel Decoding for dLLMs},
105
+ author={Chen, Zigeng and Fang, Gongfan and Ma, Xinyin and Yu, Ruonan and Wang, Xinchao},
106
+ journal={arXiv preprint arXiv:2604.08302},
107
+ year={2026}
108
+ }
109
+
models/dmax-16b/chat_template.jinja ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% set thinking_option = 'off' %}
2
+ {{- '<role>SYSTEM</role>' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n' }}
5
+ {%- endif %}
6
+ {%- if tools %}
7
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
8
+ {%- for tool in tools %}
9
+ {{- "\n" }}
10
+ {{- tool | tojson }}
11
+ {%- endfor %}
12
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call>\n" }}
13
+ {%- endif %}
14
+ {{- 'detailed thinking ' + thinking_option + '<|role_end|>' }}
15
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
16
+ {%- for message in messages[::-1] %}
17
+ {%- set index = (messages|length - 1) - loop.index0 %}
18
+ {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
19
+ {%- set ns.multi_step_tool = false %}
20
+ {%- set ns.last_query_index = index %}
21
+ {%- endif %}
22
+ {%- endfor %}
23
+ {%- for message in messages %}
24
+ {%- if message.content is string %}
25
+ {%- set content = message.content %}
26
+ {%- else %}
27
+ {%- set content = '' %}
28
+ {%- endif %}
29
+ {%- if message.role == "user" %}
30
+ {{- '<role>HUMAN</role>' + message.content + '<|role_end|>' }}
31
+ {%- elif message.role == "system" and not loop.first %}
32
+ {{- '<role>SYSTEM</role>' + message.content + '<|role_end|>' }}
33
+ {%- elif message.role == "assistant" %}
34
+ {%- set reasoning_content = '' %}
35
+ {%- if message.reasoning_content is string %}
36
+ {%- set reasoning_content = message.reasoning_content %}
37
+ {%- else %}
38
+ {%- if '</think>' in content %}
39
+ {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
40
+ {%- set content = content.split('</think>')[-1].lstrip('\n') %}
41
+ {%- endif %}
42
+ {%- endif %}
43
+ {%- if loop.index0 > ns.last_query_index %}
44
+ {%- if reasoning_content %}
45
+ {{- '<role>ASSISTANT</role>' + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
46
+ {%- else %}
47
+ {{- '<role>ASSISTANT</role>' + content }}
48
+ {%- endif %}
49
+ {%- else %}
50
+ {{- '<role>ASSISTANT</role>' + content }}
51
+ {%- endif %}
52
+ {%- if message.tool_calls %}
53
+ {%- for tool_call in message.tool_calls %}
54
+ {%- if (loop.first and content) or (not loop.first) %}
55
+ {{- '\n' }}
56
+ {%- endif %}
57
+ {%- if tool_call.function %}
58
+ {%- set tool_call = tool_call.function %}
59
+ {%- endif %}
60
+ {{- '<tool_call>\n{"name": "' }}
61
+ {{- tool_call.name }}
62
+ {{- '", "arguments": ' }}
63
+ {%- if tool_call.arguments is string %}
64
+ {{- tool_call.arguments }}
65
+ {%- else %}
66
+ {{- tool_call.arguments | tojson }}
67
+ {%- endif %}
68
+ {{- '}\n</tool_call>' }}
69
+ {%- endfor %}
70
+ {%- endif %}
71
+ {{- '<|role_end|>' }}
72
+ {%- elif message.role == "tool" %}
73
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
74
+ {{- '<role>OBSERVATION</role>' }}
75
+ {%- endif %}
76
+ {{- '\n<tool_response>\n' }}
77
+ {{- content }}
78
+ {{- '\n</tool_response>' }}
79
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
80
+ {{- '<|role_end|>' }}
81
+ {%- endif %}
82
+ {%- endif %}
83
+ {%- endfor %}
84
+ {%- if add_generation_prompt %}
85
+ {{- '<role>ASSISTANT</role>' }}
86
+ {%- endif %}
models/dmax-16b/config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_moe_implementation": "fused",
3
+ "architectures": [
4
+ "LLaDA2MoeModelLM"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_llada2_moe.LLaDA2MoeConfig",
9
+ "AutoModel": "modeling_llada2_moe.LLaDA2MoeModel",
10
+ "AutoModelForCausalLM": "modeling_llada2_moe.LLaDA2MoeModelLM"
11
+ },
12
+ "dtype": "bfloat16",
13
+ "embedding_dropout": 0.0,
14
+ "first_k_dense_replace": 1,
15
+ "head_dim": 128,
16
+ "hidden_act": "silu",
17
+ "hidden_size": 2048,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 5120,
20
+ "max_position_embeddings": 16384,
21
+ "max_window_layers": 28,
22
+ "model_type": "llada2_moe",
23
+ "moe_intermediate_size": 512,
24
+ "moe_router_enable_expert_bias": true,
25
+ "n_group": 8,
26
+ "norm_head": false,
27
+ "norm_softmax": false,
28
+ "norm_topk_prob": true,
29
+ "num_attention_heads": 16,
30
+ "num_experts": 256,
31
+ "num_experts_per_tok": 8,
32
+ "num_hidden_layers": 20,
33
+ "num_key_value_heads": 4,
34
+ "num_shared_experts": 1,
35
+ "output_dropout": 0.0,
36
+ "output_router_logits": false,
37
+ "pad_token_id": 156892,
38
+ "partial_rotary_factor": 0.5,
39
+ "rms_norm_eps": 1e-06,
40
+ "rope_scaling": null,
41
+ "rope_theta": 600000,
42
+ "rotary_dim": 64,
43
+ "routed_scaling_factor": 2.5,
44
+ "router_dtype": "fp32",
45
+ "score_function": "sigmoid",
46
+ "sliding_window": 4096,
47
+ "tie_word_embeddings": false,
48
+ "topk_group": 4,
49
+ "transformers_version": "4.56.0",
50
+ "use_bias": false,
51
+ "use_cache": false,
52
+ "use_qkv_bias": false,
53
+ "use_rmsnorm": true,
54
+ "use_sliding_window": false,
55
+ "using_split_qkv_in_self_attention": false,
56
+ "vocab_size": 157184
57
+ }
models/dmax-16b/configuration_llada2_moe.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """LLaDA2 MoE model configuration"""
2
+
3
+ from transformers.configuration_utils import PretrainedConfig
4
+
5
+
6
+ class LLaDA2MoeConfig(PretrainedConfig):
7
+ model_type = "llada2_moe"
8
+
9
+ def __init__(
10
+ self,
11
+ vocab_size=30592,
12
+ hidden_size=1024,
13
+ intermediate_size=None,
14
+ num_hidden_layers=24,
15
+ num_attention_heads=16,
16
+ num_key_value_heads=0,
17
+ hidden_act="silu",
18
+ use_qkv_bias=False, # llada2 only
19
+ use_qk_norm=True,
20
+ use_bias=True, # llada2 only
21
+ rms_norm_eps=1e-05,
22
+ norm_head=False, # llada2 only
23
+ tie_word_embeddings=False, # PretrainedConfig key, here change default value.
24
+ embedding_dropout=0.1,
25
+ attention_dropout=0.1,
26
+ output_dropout=0.1,
27
+ initializer_range=0.02,
28
+ max_position_embeddings=16384,
29
+ rope_theta=10000.0,
30
+ use_cache=True,
31
+ use_sliding_window=False,
32
+ sliding_window=4096,
33
+ max_window_layers=28,
34
+ rope_scaling=None,
35
+ pad_token_id=126081,
36
+ num_experts=16,
37
+ num_shared_experts=0,
38
+ num_experts_per_tok=2,
39
+ n_group=8,
40
+ topk_group=4,
41
+ routed_scaling_factor=2.5,
42
+ moe_intermediate_size=None,
43
+ first_k_dense_replace=0,
44
+ head_dim=None,
45
+ output_router_logits=False,
46
+ partial_rotary_factor=0.5,
47
+ **kwargs,
48
+ ):
49
+ self.num_hidden_layers = num_hidden_layers
50
+ self.vocab_size = vocab_size
51
+ self.hidden_size = hidden_size
52
+ self.intermediate_size = intermediate_size
53
+ self.num_attention_heads = num_attention_heads
54
+ self.num_key_value_heads = num_key_value_heads
55
+ self.hidden_act = hidden_act
56
+ self.use_qkv_bias = use_qkv_bias
57
+ self.use_qk_norm = use_qk_norm
58
+ self.use_bias = use_bias
59
+ self.norm_head = norm_head
60
+ self.rms_norm_eps = rms_norm_eps
61
+ self.embedding_dropout = embedding_dropout
62
+ self.attention_dropout = attention_dropout
63
+ self.output_dropout = output_dropout
64
+ self.initializer_range = initializer_range
65
+ self.max_position_embeddings = max_position_embeddings
66
+ self.rope_theta = rope_theta
67
+ self.use_cache = use_cache
68
+ self.use_sliding_window = use_sliding_window
69
+ self.sliding_window = sliding_window
70
+ self.max_window_layers = max_window_layers
71
+ self.head_dim = head_dim or self.hidden_size // self.num_attention_heads
72
+ self.rope_scaling = rope_scaling
73
+
74
+ # MoE configs
75
+ self.num_experts = num_experts
76
+ self.num_shared_experts = num_shared_experts
77
+ self.num_experts_per_tok = num_experts_per_tok
78
+ self.n_group = n_group
79
+ self.topk_group = topk_group
80
+ self.moe_intermediate_size = moe_intermediate_size
81
+ self.first_k_dense_replace = first_k_dense_replace
82
+ self.output_router_logits = output_router_logits
83
+ self.routed_scaling_factor = routed_scaling_factor
84
+ self.partial_rotary_factor = partial_rotary_factor
85
+
86
+ super().__init__(
87
+ pad_token_id=pad_token_id, tie_word_embeddings=tie_word_embeddings, **kwargs
88
+ )
89
+
models/dmax-16b/model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
models/dmax-16b/modeling_llada2_moe.py ADDED
@@ -0,0 +1,1937 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2025 Antgroup and The HuggingFace Inc. team. All rights reserved.
2
+ #
3
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
4
+ # and OPT implementations in this library. It has been modified from its
5
+ # original forms to accommodate minor architectural differences compared
6
+ # to GPT-NeoX and OPT used by the Meta AI team that trained the model.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ """PyTorch LLaDA2MoE model."""
20
+
21
+ import math
22
+ from typing import List, Callable, Optional, Tuple, Union
23
+
24
+ import torch
25
+ import torch.nn.functional as F
26
+ from torch import nn
27
+ from torch.nn import CrossEntropyLoss
28
+
29
+ from transformers.activations import ACT2FN
30
+ from transformers.cache_utils import Cache, DynamicCache
31
+ from transformers.modeling_attn_mask_utils import (
32
+ _prepare_4d_causal_attention_mask,
33
+ _prepare_4d_causal_attention_mask_for_sdpa,
34
+ )
35
+ from transformers.modeling_outputs import (
36
+ MoeModelOutputWithPast,
37
+ MoeCausalLMOutputWithPast,
38
+ )
39
+ from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
40
+ from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
41
+ from transformers.processing_utils import Unpack
42
+ from transformers.pytorch_utils import (
43
+ ALL_LAYERNORM_LAYERS,
44
+ is_torch_greater_or_equal_than_1_13,
45
+ )
46
+ from transformers.utils import (
47
+ TransformersKwargs,
48
+ add_start_docstrings,
49
+ add_start_docstrings_to_model_forward,
50
+ logging,
51
+ replace_return_docstrings,
52
+ )
53
+ from transformers.utils.import_utils import is_torch_fx_available
54
+ from .configuration_llada2_moe import LLaDA2MoeConfig
55
+ from transformers.generation.utils import GenerationMixin
56
+
57
+ import numpy as np
58
+ # This makes `_prepare_4d_causal_attention_mask` a leaf function in the FX graph.
59
+ # It means that the function will not be traced through and simply appear as a node in the graph.
60
+ if is_torch_fx_available():
61
+ if not is_torch_greater_or_equal_than_1_13:
62
+ import torch.fx
63
+
64
+ _prepare_4d_causal_attention_mask = torch.fx.wrap(_prepare_4d_causal_attention_mask)
65
+
66
+
67
+ logger = logging.get_logger(__name__)
68
+
69
+ _CONFIG_FOR_DOC = "LLaDA2MoeConfig"
70
+
71
+
72
+ def _get_unpad_data(attention_mask):
73
+ seqlens_in_batch = attention_mask.sum(dim=-1, dtype=torch.int32)
74
+ indices = torch.nonzero(attention_mask.flatten(), as_tuple=False).flatten()
75
+ max_seqlen_in_batch = seqlens_in_batch.max().item()
76
+ cu_seqlens = F.pad(
77
+ torch.cumsum(seqlens_in_batch, dim=0, dtype=torch.torch.int32), (1, 0)
78
+ )
79
+ return (
80
+ indices,
81
+ cu_seqlens,
82
+ max_seqlen_in_batch,
83
+ )
84
+
85
+
86
+ class LLaDA2MoeRMSNorm(nn.Module):
87
+ def __init__(self, hidden_size, eps=1e-6):
88
+ """
89
+ LLaDA2MoeRMSNorm is equivalent to T5LayerNorm
90
+ """
91
+ super().__init__()
92
+ self.weight = nn.Parameter(torch.ones(hidden_size))
93
+ self.variance_epsilon = eps
94
+
95
+ def forward(self, hidden_states):
96
+ input_dtype = hidden_states.dtype
97
+ hidden_states = hidden_states.to(torch.float32)
98
+ variance = hidden_states.pow(2).mean(-1, keepdim=True)
99
+ hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
100
+ return self.weight * hidden_states.to(input_dtype)
101
+
102
+
103
+ ALL_LAYERNORM_LAYERS.append(LLaDA2MoeRMSNorm)
104
+
105
+
106
+ class LLaDA2MoeRotaryEmbedding(nn.Module):
107
+ def __init__(self, config: LLaDA2MoeConfig, device=None):
108
+ super().__init__()
109
+ # BC: "rope_type" was originally "type"
110
+ if hasattr(config, "rope_scaling") and config.rope_scaling is not None:
111
+ self.rope_type = config.rope_scaling.get(
112
+ "rope_type", config.rope_scaling.get("type")
113
+ )
114
+ else:
115
+ self.rope_type = "default"
116
+ self.max_seq_len_cached = config.max_position_embeddings
117
+ self.original_max_seq_len = config.max_position_embeddings
118
+
119
+ self.config = config
120
+ self.rope_init_fn = ROPE_INIT_FUNCTIONS[self.rope_type]
121
+
122
+ inv_freq, self.attention_scaling = self.rope_init_fn(self.config, device)
123
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
124
+ self.original_inv_freq = self.inv_freq
125
+
126
+ @torch.no_grad()
127
+ @dynamic_rope_update # power user: used with advanced RoPE types (e.g. dynamic rope)
128
+ def forward(self, x, position_ids):
129
+ inv_freq_expanded = (
130
+ self.inv_freq[None, :, None]
131
+ .float()
132
+ .expand(position_ids.shape[0], -1, 1)
133
+ .to(x.device)
134
+ )
135
+ position_ids_expanded = position_ids[:, None, :].float()
136
+
137
+ device_type = (
138
+ x.device.type
139
+ if isinstance(x.device.type, str) and x.device.type != "mps"
140
+ else "cpu"
141
+ )
142
+ with torch.autocast(device_type=device_type, enabled=False): # Force float32
143
+ freqs = (
144
+ inv_freq_expanded.float() @ position_ids_expanded.float()
145
+ ).transpose(1, 2)
146
+ emb = torch.cat((freqs, freqs), dim=-1)
147
+ cos = emb.cos() * self.attention_scaling
148
+ sin = emb.sin() * self.attention_scaling
149
+
150
+ return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
151
+
152
+
153
+ # Copied from transformers.models.llama.modeling_llama.rotate_half
154
+ def rotate_half(x):
155
+ """Rotates half the hidden dims of the input."""
156
+ x1 = x[..., : x.shape[-1] // 2]
157
+ x2 = x[..., x.shape[-1] // 2 :]
158
+ return torch.cat((-x2, x1), dim=-1)
159
+
160
+
161
+ # Copied from transformers.models.llama.modeling_llama.apply_rotary_pos_emb
162
+ def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
163
+ """Applies Rotary Position Embedding to the query and key tensors.
164
+
165
+ Args:
166
+ q (`torch.Tensor`): The query tensor.
167
+ k (`torch.Tensor`): The key tensor.
168
+ cos (`torch.Tensor`): The cosine part of the rotary embedding.
169
+ sin (`torch.Tensor`): The sine part of the rotary embedding.
170
+ position_ids (`torch.Tensor`):
171
+ The position indices of the tokens corresponding to the query and key tensors. For example, this can be
172
+ used to pass offsetted position ids when working with a KV-cache.
173
+ unsqueeze_dim (`int`, *optional*, defaults to 1):
174
+ The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
175
+ sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
176
+ that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
177
+ k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
178
+ cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
179
+ the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
180
+ Returns:
181
+ `tuple(torch.Tensor)` comprising the query and key tensors rotated using the Rotary Position Embedding.
182
+ """
183
+ cos = cos.unsqueeze(unsqueeze_dim)
184
+ sin = sin.unsqueeze(unsqueeze_dim)
185
+
186
+ # Keep half or full tensor for later concatenation
187
+ rotary_dim = cos.shape[-1]
188
+ q_rot, q_pass = q[..., :rotary_dim], q[..., rotary_dim:]
189
+ k_rot, k_pass = k[..., :rotary_dim], k[..., rotary_dim:]
190
+
191
+ # Apply rotary embeddings on the first half or full tensor
192
+ q_embed = (q_rot * cos) + (rotate_half(q_rot) * sin)
193
+ k_embed = (k_rot * cos) + (rotate_half(k_rot) * sin)
194
+
195
+ # Concatenate back to full shape
196
+ q_embed = torch.cat([q_embed, q_pass], dim=-1)
197
+ k_embed = torch.cat([k_embed, k_pass], dim=-1)
198
+ return q_embed, k_embed
199
+
200
+
201
+ class LLaDA2MoeMLP(nn.Module):
202
+ def __init__(self, config: LLaDA2MoeConfig, intermediate_size: int):
203
+ super().__init__()
204
+ self.config = config
205
+ self.hidden_size = config.hidden_size
206
+ self.intermediate_size = intermediate_size
207
+
208
+ self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
209
+ self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
210
+ self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
211
+ self.act_fn = ACT2FN[config.hidden_act]
212
+
213
+ def forward(self, x):
214
+ return self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
215
+
216
+
217
+ class LLaDA2MoeGate(nn.Module):
218
+ def __init__(self, config):
219
+ super().__init__()
220
+ self.config = config
221
+ self.top_k = config.num_experts_per_tok
222
+ self.num_experts = config.num_experts
223
+
224
+ self.n_group = config.n_group
225
+ self.topk_group = config.topk_group
226
+
227
+ # topk selection algorithm
228
+ self.gating_dim = config.hidden_size
229
+ self.weight = nn.Parameter(torch.empty((self.num_experts, self.gating_dim)))
230
+ self.routed_scaling_factor = config.routed_scaling_factor
231
+
232
+ self.register_buffer("expert_bias", torch.zeros(self.num_experts))
233
+ self.reset_parameters()
234
+
235
+ def reset_parameters(self) -> None:
236
+ import torch.nn.init as init
237
+
238
+ init.kaiming_uniform_(self.weight, a=math.sqrt(5))
239
+
240
+ def group_limited_topk(
241
+ self,
242
+ scores: torch.Tensor,
243
+ ):
244
+ num_tokens, _ = scores.size()
245
+ # Organize the experts into groups
246
+ group_scores = (
247
+ scores.view(num_tokens, self.n_group, -1).topk(2, dim=-1)[0].sum(dim=-1)
248
+ )
249
+ group_idx = torch.topk(group_scores, k=self.topk_group, dim=-1, sorted=False)[1]
250
+ group_mask = torch.zeros_like(group_scores)
251
+ group_mask.scatter_(1, group_idx, 1)
252
+
253
+ # Mask the experts based on selection groups
254
+ score_mask = (
255
+ group_mask.unsqueeze(-1)
256
+ .expand(num_tokens, self.n_group, self.num_experts // self.n_group)
257
+ .reshape(num_tokens, -1)
258
+ )
259
+
260
+ masked_scores = scores.masked_fill(~score_mask.bool(), float("-inf"))
261
+ probs, top_indices = torch.topk(masked_scores, k=self.top_k, dim=-1)
262
+
263
+ return probs, top_indices
264
+
265
+ def forward(self, hidden_states):
266
+ # compute gating score
267
+ hidden_states = hidden_states.view(-1, hidden_states.shape[-1])
268
+ logits = F.linear(
269
+ hidden_states.type(torch.float32), self.weight.type(torch.float32)
270
+ )
271
+
272
+ scores = torch.sigmoid(logits.float()).type_as(logits)
273
+
274
+ scores_for_routing = scores + self.expert_bias
275
+ _, topk_idx = self.group_limited_topk(scores_for_routing)
276
+
277
+ scores = torch.gather(scores, dim=1, index=topk_idx).type_as(logits)
278
+
279
+ topk_weight = (
280
+ scores / (scores.sum(dim=-1, keepdim=True) + 1e-20)
281
+ if self.top_k > 1
282
+ else scores
283
+ )
284
+ topk_weight = topk_weight * self.routed_scaling_factor
285
+
286
+ return topk_idx, topk_weight, logits
287
+
288
+
289
+ class LLaDA2MoeSparseMoeBlock(nn.Module):
290
+ """
291
+ A mixed expert module containing shared experts.
292
+ """
293
+
294
+ def __init__(self, config: LLaDA2MoeConfig):
295
+ super().__init__()
296
+ self.config = config
297
+ self.num_experts_per_tok = config.num_experts_per_tok
298
+ self._setup_experts()
299
+ self.gate = LLaDA2MoeGate(config)
300
+ if config.num_shared_experts is not None:
301
+ self.shared_experts = LLaDA2MoeMLP(
302
+ config=config,
303
+ intermediate_size=config.moe_intermediate_size
304
+ * config.num_shared_experts,
305
+ )
306
+
307
+ def _setup_experts(self):
308
+ self.experts = nn.ModuleList(
309
+ [
310
+ LLaDA2MoeMLP(
311
+ config=self.config,
312
+ intermediate_size=self.config.moe_intermediate_size,
313
+ )
314
+ for _ in range(self.config.num_experts)
315
+ ]
316
+ )
317
+
318
+ def forward(self, hidden_states):
319
+ identity = hidden_states
320
+ bsz, seq_len, h = hidden_states.shape
321
+ topk_idx, topk_weight, router_logits = self.gate(hidden_states)
322
+ hidden_states = hidden_states.view(-1, hidden_states.shape[-1])
323
+ flat_topk_idx = topk_idx.view(-1)
324
+ if self.training:
325
+ hidden_states = hidden_states.repeat_interleave(
326
+ self.num_experts_per_tok, dim=0
327
+ )
328
+ y = torch.empty_like(hidden_states)
329
+ for i, expert in enumerate(self.experts):
330
+ y[flat_topk_idx == i] = expert(hidden_states[flat_topk_idx == i])
331
+ y = (y.view(*topk_weight.shape, -1) * topk_weight.unsqueeze(-1)).sum(dim=1)
332
+ y = y.to(hidden_states.dtype).view(bsz, seq_len, h)
333
+ else:
334
+ y = self.moe_infer(hidden_states, topk_idx, topk_weight).view(
335
+ bsz, seq_len, h
336
+ )
337
+ if self.config.num_shared_experts is not None:
338
+ y = y + self.shared_experts(identity)
339
+ return y, (
340
+ router_logits.view(bsz, seq_len, -1),
341
+ topk_idx.view(bsz, seq_len, -1),
342
+ )
343
+
344
+ @torch.no_grad()
345
+ def moe_infer(self, x, topk_ids, topk_weight):
346
+ cnts = topk_ids.new_zeros((topk_ids.shape[0], len(self.experts)))
347
+ cnts.scatter_(1, topk_ids, 1)
348
+ tokens_per_expert = cnts.sum(dim=0)
349
+ idxs = topk_ids.view(-1).argsort()
350
+ sorted_tokens = x[idxs // topk_ids.shape[1]]
351
+ tokens_per_expert = tokens_per_expert.cpu().numpy()
352
+ outputs = []
353
+ start_idx = 0
354
+ for i, num_tokens_tensor in enumerate(tokens_per_expert):
355
+ num_tokens = num_tokens_tensor.item()
356
+ if num_tokens == 0:
357
+ continue
358
+ end_idx = start_idx + num_tokens
359
+ expert = self.experts[i]
360
+ tokens_for_this_expert = sorted_tokens[start_idx:end_idx]
361
+ expert_out = expert(tokens_for_this_expert)
362
+ outputs.append(expert_out.to(x.device))
363
+ start_idx = end_idx
364
+
365
+ outs = torch.cat(outputs, dim=0) if len(outputs) else sorted_tokens.new_empty(0)
366
+ new_x = torch.empty_like(outs)
367
+ new_x[idxs] = outs
368
+ final_out = (
369
+ new_x.view(*topk_ids.shape, -1)
370
+ .type(topk_weight.dtype)
371
+ .mul_(topk_weight.unsqueeze(dim=-1))
372
+ .sum(dim=1)
373
+ .type(new_x.dtype)
374
+ )
375
+ return final_out
376
+
377
+
378
+ # Copied from transformers.models.llama.modeling_llama.repeat_kv
379
+ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
380
+ """
381
+ This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
382
+ num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
383
+ """
384
+ batch, num_key_value_heads, slen, head_dim = hidden_states.shape
385
+ if n_rep == 1:
386
+ return hidden_states
387
+ hidden_states = hidden_states[:, :, None, :, :].expand(
388
+ batch, num_key_value_heads, n_rep, slen, head_dim
389
+ )
390
+ return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
391
+
392
+
393
+ def eager_attention_forward(
394
+ module: nn.Module,
395
+ query: torch.Tensor,
396
+ key: torch.Tensor,
397
+ value: torch.Tensor,
398
+ attention_mask: Optional[torch.Tensor],
399
+ scaling: float,
400
+ dropout: float = 0.0,
401
+ **kwargs: Unpack[TransformersKwargs],
402
+ ):
403
+ key_states = repeat_kv(key, module.num_key_value_groups)
404
+ value_states = repeat_kv(value, module.num_key_value_groups)
405
+
406
+ attn_weights = (
407
+ torch.matmul(query, key_states.transpose(2, 3)) * scaling
408
+ )
409
+ if attention_mask is not None:
410
+ attn_weights = attn_weights + attention_mask[:, :, :, : key_states.shape[-2]]
411
+
412
+ # upcast attention to fp32
413
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(
414
+ query.dtype
415
+ )
416
+ attn_weights = nn.functional.dropout(
417
+ attn_weights, p=dropout, training=module.training
418
+ )
419
+ attn_output = torch.matmul(attn_weights, value_states)
420
+ attn_output = attn_output.transpose(1, 2).contiguous()
421
+
422
+ return attn_output, attn_weights
423
+
424
+
425
+ # Copied from transformers.models.llama.modeling_llama.LlamaAttention with Llama->LLaDA2Moe
426
+ class LLaDA2MoeAttention(nn.Module):
427
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
428
+
429
+ def __init__(self, config: LLaDA2MoeConfig, layer_idx: Optional[int] = None):
430
+ super().__init__()
431
+ self.config = config
432
+ self.layer_idx = layer_idx
433
+ if layer_idx is None:
434
+ logger.warning_once(
435
+ f"Instantiating {self.__class__.__name__} without passing `layer_idx` is not recommended and will "
436
+ "to errors during the forward call, if caching is used. Please make sure to provide a `layer_idx` "
437
+ "when creating this class."
438
+ )
439
+ self.attention_dropout = config.attention_dropout
440
+ self.hidden_size = config.hidden_size
441
+ self.num_heads = config.num_attention_heads
442
+ self.head_dim = config.head_dim or self.hidden_size // self.num_heads
443
+ partial_rotary_factor = (
444
+ config.partial_rotary_factor
445
+ if hasattr(config, "partial_rotary_factor")
446
+ else 1.0
447
+ )
448
+ self.rope_dim = int(self.head_dim * partial_rotary_factor)
449
+ self.num_key_value_heads = config.num_key_value_heads
450
+ self.num_key_value_groups = self.num_heads // self.num_key_value_heads
451
+ self.max_position_embeddings = config.max_position_embeddings
452
+ self.rope_theta = config.rope_theta
453
+ self.scaling = self.head_dim**-0.5
454
+ self.is_causal = False
455
+
456
+ self.query_key_value = nn.Linear(
457
+ self.hidden_size,
458
+ (self.num_heads + 2 * self.num_key_value_heads) * self.head_dim,
459
+ bias=config.use_qkv_bias,
460
+ )
461
+
462
+ if self.config.use_qk_norm:
463
+ self.query_layernorm = LLaDA2MoeRMSNorm(
464
+ self.head_dim, eps=config.rms_norm_eps
465
+ )
466
+ self.key_layernorm = LLaDA2MoeRMSNorm(
467
+ self.head_dim, eps=config.rms_norm_eps
468
+ )
469
+ self.dense = nn.Linear(
470
+ self.num_heads * self.head_dim, self.hidden_size, bias=config.use_bias
471
+ )
472
+ self.sliding_window = getattr(config, "sliding_window", None)
473
+
474
+ def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
475
+ return (
476
+ tensor.view(bsz, seq_len, self.num_heads, self.head_dim)
477
+ .transpose(1, 2)
478
+ .contiguous()
479
+ )
480
+
481
+ def forward(
482
+ self,
483
+ hidden_states: torch.Tensor,
484
+ attention_mask: Optional[torch.Tensor] = None,
485
+ position_ids: Optional[torch.LongTensor] = None,
486
+ past_key_value: Optional[Cache] = None,
487
+ output_attentions: bool = False,
488
+ use_cache: bool = False,
489
+ position_embeddings: Optional[
490
+ Tuple[torch.Tensor, torch.Tensor]
491
+ ] = None, # necessary, but kept here for BC
492
+ **kwargs,
493
+ ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
494
+ input_shape = hidden_states.shape[:-1]
495
+
496
+ bsz, q_len, _ = hidden_states.size()
497
+
498
+ qkv = self.query_key_value(hidden_states)
499
+ qkv = qkv.view(
500
+ bsz, q_len, self.num_heads + 2 * self.num_key_value_heads, self.head_dim
501
+ )
502
+
503
+ query_states, key_states, value_states = qkv.split(
504
+ [self.num_heads, self.num_key_value_heads, self.num_key_value_heads], dim=-2
505
+ )
506
+ query_states = query_states.transpose(1, 2)
507
+ key_states = key_states.transpose(1, 2)
508
+ value_states = value_states.transpose(1, 2)
509
+
510
+ if self.config.use_qk_norm:
511
+ query_states = self.query_layernorm(query_states)
512
+ key_states = self.key_layernorm(key_states)
513
+
514
+ cos, sin = position_embeddings
515
+ query_states, key_states = apply_rotary_pos_emb(
516
+ query_states, key_states, cos, sin
517
+ )
518
+
519
+ if past_key_value is not None:
520
+ if self.layer_idx is None:
521
+ raise ValueError(
522
+ f"The cache structure has changed since version v4.36. If you are using {self.__class__.__name__} "
523
+ "for auto-regressive decoding with k/v caching, please make sure to initialize the attention class "
524
+ "with a layer index."
525
+ )
526
+ cache_kwargs = {"sin": sin, "cos": cos}
527
+ key_states, value_states = past_key_value.update(
528
+ key_states, value_states, self.layer_idx, cache_kwargs
529
+ )
530
+
531
+ attention_interface: Callable = eager_attention_forward
532
+ if self.config._attn_implementation != "eager":
533
+ attention_interface = ALL_ATTENTION_FUNCTIONS[
534
+ self.config._attn_implementation
535
+ ]
536
+
537
+ attn_output, attn_weights = attention_interface(
538
+ self,
539
+ query_states,
540
+ key_states,
541
+ value_states,
542
+ attention_mask,
543
+ dropout=0.0 if not self.training else self.attention_dropout,
544
+ scaling=self.scaling,
545
+ sliding_window=self.sliding_window, # diff with Llama
546
+ **kwargs,
547
+ )
548
+
549
+ attn_output = attn_output.reshape(*input_shape, -1).contiguous()
550
+ attn_output = self.dense(attn_output)
551
+
552
+ return attn_output, attn_weights, past_key_value
553
+
554
+
555
+ class LLaDA2MoeDecoderLayer(nn.Module):
556
+ def __init__(self, config: LLaDA2MoeConfig, layer_idx: int):
557
+ super().__init__()
558
+ self.hidden_size = config.hidden_size
559
+
560
+ self.attention = LLaDA2MoeAttention(config=config, layer_idx=layer_idx)
561
+
562
+ self.mlp = (
563
+ LLaDA2MoeSparseMoeBlock(config)
564
+ if (
565
+ config.num_experts is not None
566
+ and layer_idx >= config.first_k_dense_replace
567
+ )
568
+ else LLaDA2MoeMLP(config=config, intermediate_size=config.intermediate_size)
569
+ )
570
+ self.input_layernorm = LLaDA2MoeRMSNorm(
571
+ config.hidden_size, eps=config.rms_norm_eps
572
+ )
573
+ self.post_attention_layernorm = LLaDA2MoeRMSNorm(
574
+ config.hidden_size, eps=config.rms_norm_eps
575
+ )
576
+
577
+ def forward(
578
+ self,
579
+ hidden_states: torch.Tensor,
580
+ attention_mask: Optional[torch.Tensor] = None,
581
+ position_ids: Optional[torch.LongTensor] = None,
582
+ past_key_value: Optional[Tuple[torch.Tensor]] = None,
583
+ output_attentions: Optional[bool] = False,
584
+ output_router_logits: Optional[bool] = False,
585
+ use_cache: Optional[bool] = False,
586
+ position_embeddings: Optional[
587
+ Tuple[torch.Tensor, torch.Tensor]
588
+ ] = None, # necessary, but kept here for BC
589
+ **kwargs,
590
+ ) -> Tuple[
591
+ torch.FloatTensor, Optional[Tuple[torch.FloatTensor, torch.FloatTensor]]
592
+ ]:
593
+ """
594
+ Args:
595
+ hidden_states (`torch.FloatTensor`): input to the layer of shape `(batch, seq_len, embed_dim)`
596
+ attention_mask (`torch.FloatTensor`, *optional*):
597
+ attention mask of size `(batch_size, sequence_length)` if flash attention is used or `(batch_size, 1,
598
+ query_sequence_length, key_sequence_length)` if default attention is used.
599
+ position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
600
+ Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
601
+ config.n_positions - 1]`.
602
+ past_key_value (`Tuple(torch.FloatTensor)`, *optional*):
603
+ cached past key and value projection states
604
+ output_attentions (`bool`, *optional*):
605
+ Whether to return the attentions tensors of all attention layers. See `attentions` under
606
+ returned tensors for more detail.
607
+ output_router_logits (`bool`, *optional*):
608
+ Whether or not to return the logits of all the routers. They are useful for computing the router loss,
609
+ and should not be returned during inference.
610
+ use_cache (`bool`, *optional*):
611
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding
612
+ (see `past_key_values`).
613
+ """
614
+ residual = hidden_states
615
+
616
+ hidden_states = self.input_layernorm(hidden_states)
617
+
618
+ # Self Attention
619
+ hidden_states, self_attn_weights, present_key_value = self.attention(
620
+ hidden_states=hidden_states,
621
+ attention_mask=attention_mask,
622
+ position_ids=position_ids,
623
+ past_key_value=past_key_value,
624
+ output_attentions=output_attentions,
625
+ position_embeddings=position_embeddings,
626
+ use_cache=use_cache,
627
+ )
628
+ hidden_states = residual + hidden_states
629
+
630
+ # Fully Connected
631
+ residual = hidden_states
632
+ hidden_states = self.post_attention_layernorm(hidden_states)
633
+ hidden_states = self.mlp(hidden_states)
634
+ if isinstance(hidden_states, tuple):
635
+ hidden_states, router_logits = hidden_states
636
+ else:
637
+ router_logits = None
638
+ hidden_states = residual + hidden_states.to(residual.device)
639
+
640
+ outputs = (hidden_states,)
641
+
642
+ if output_attentions:
643
+ outputs += (self_attn_weights,)
644
+
645
+ if use_cache:
646
+ outputs += (present_key_value,)
647
+
648
+ if output_router_logits:
649
+ outputs += (router_logits,)
650
+
651
+ return outputs
652
+
653
+
654
+ LLADA2MOE_START_DOCSTRING = r"""
655
+ This model inherits from [`PreTrainedModel`]. Check the superclass documentation for the generic methods the
656
+ library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
657
+ etc.)
658
+
659
+ This model is also a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) subclass.
660
+ Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
661
+ and behavior.
662
+
663
+ Parameters:
664
+ config ([`LLaDA2MoeConfig`]):
665
+ Model configuration class with all the parameters of the model. Initializing with a config file does not
666
+ load the weights associated with the model, only the configuration. Check out the
667
+ [`~PreTrainedModel.from_pretrained`] method to load the model weights.
668
+ """
669
+
670
+
671
+ @add_start_docstrings(
672
+ "The bare LLaDA2Moe Model outputting raw hidden-states without any specific head on top.",
673
+ LLADA2MOE_START_DOCSTRING,
674
+ )
675
+ class LLaDA2MoePreTrainedModel(PreTrainedModel):
676
+ config_class = LLaDA2MoeConfig
677
+ base_model_prefix = "model"
678
+ supports_gradient_checkpointing = True
679
+ _no_split_modules = ["LLaDA2MoeDecoderLayer"]
680
+ _skip_keys_device_placement = ["past_key_values"]
681
+ _supports_flash_attn_2 = False
682
+ _supports_sdpa = True
683
+ _supports_flex_attn = True
684
+ _supports_cache_class = True
685
+
686
+ def _init_weights(self, module):
687
+ std = self.config.initializer_range
688
+ if isinstance(module, nn.Linear):
689
+ module.weight.data.normal_(mean=0.0, std=std)
690
+ if module.bias is not None:
691
+ module.bias.data.zero_()
692
+ elif isinstance(module, nn.Embedding):
693
+ module.weight.data.normal_(mean=0.0, std=std)
694
+ if module.padding_idx is not None:
695
+ module.weight.data[module.padding_idx].zero_()
696
+
697
+
698
+ LLADA2MOE_INPUTS_DOCSTRING = r"""
699
+ Args:
700
+ input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
701
+ Indices of input sequence tokens in the vocabulary. Padding will be ignored by default should you provide
702
+ it.
703
+
704
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
705
+ [`PreTrainedTokenizer.__call__`] for details.
706
+
707
+ [What are input IDs?](../glossary#input-ids)
708
+ attention_mask (`torch.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
709
+ Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:
710
+
711
+ - 1 for tokens that are **not masked**,
712
+ - 0 for tokens that are **masked**.
713
+
714
+ [What are attention masks?](../glossary#attention-mask)
715
+
716
+ Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
717
+ [`PreTrainedTokenizer.__call__`] for details.
718
+
719
+ If `past_key_values` is used, optionally only the last `input_ids` have to be input (see
720
+ `past_key_values`).
721
+
722
+ If you want to change padding behavior, you should read [`modeling_opt._prepare_decoder_attention_mask`]
723
+ and modify to your needs. See diagram 1 in [the paper](https://arxiv.org/abs/1910.13461) for more
724
+ information on the default strategy.
725
+
726
+ - 1 indicates the head is **not masked**,
727
+ - 0 indicates the head is **masked**.
728
+ position_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
729
+ Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
730
+ config.n_positions - 1]`.
731
+
732
+ [What are position IDs?](../glossary#position-ids)
733
+ past_key_values (`Cache` or `tuple(tuple(torch.FloatTensor))`, *optional*):
734
+ Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
735
+ blocks) that can be used to speed up sequential decoding. This typically consists in the `past_key_values`
736
+ returned by the model at a previous stage of decoding, when `use_cache=True` or `config.use_cache=True`.
737
+
738
+ Two formats are allowed:
739
+ - a [`~cache_utils.Cache`] instance;
740
+ - Tuple of `tuple(torch.FloatTensor)` of length `config.n_layers`, with each tuple having 2 tensors of
741
+ shape `(batch_size, num_heads, sequence_length, embed_size_per_head)`). This is also known as the legacy
742
+ cache format.
743
+
744
+ The model will output the same cache format that is fed as input. If no `past_key_values` are passed, the
745
+ legacy cache format will be returned.
746
+
747
+ If `past_key_values` are used, the user can optionally input only the last `input_ids` (those that don't
748
+ have their past key value states given to this model) of shape `(batch_size, 1)` instead of all `input_ids`
749
+ of shape `(batch_size, sequence_length)`.
750
+ inputs_embeds (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
751
+ Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
752
+ is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
753
+ model's internal embedding lookup matrix.
754
+ use_cache (`bool`, *optional*):
755
+ If set to `True`, `past_key_values` key value states are returned and can be used to speed up decoding (see
756
+ `past_key_values`).
757
+ output_attentions (`bool`, *optional*):
758
+ Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
759
+ tensors for more detail.
760
+ output_hidden_states (`bool`, *optional*):
761
+ Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
762
+ more detail.
763
+ return_dict (`bool`, *optional*):
764
+ Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
765
+ """
766
+
767
+
768
+ @add_start_docstrings(
769
+ "The bare LLaDA2Moe Model outputting raw hidden-states without any specific head on top.",
770
+ LLADA2MOE_START_DOCSTRING,
771
+ )
772
+ class LLaDA2MoeModel(LLaDA2MoePreTrainedModel):
773
+ """
774
+ Transformer decoder consisting of *config.num_hidden_layers* layers. Each layer is a [`LLaDA2MoeDecoderLayer`]
775
+
776
+ Args:
777
+ config: LLaDA2MoeConfig
778
+ """
779
+
780
+ def __init__(self, config: LLaDA2MoeConfig):
781
+ super().__init__(config)
782
+ self.padding_idx = config.pad_token_id
783
+ self.vocab_size = config.vocab_size
784
+
785
+ self.word_embeddings = nn.Embedding(
786
+ config.vocab_size, config.hidden_size, self.padding_idx
787
+ )
788
+ self.layers = nn.ModuleList(
789
+ [
790
+ LLaDA2MoeDecoderLayer(config, layer_idx)
791
+ for layer_idx in range(config.num_hidden_layers)
792
+ ]
793
+ )
794
+ self._use_sdpa = config._attn_implementation == "sdpa"
795
+ self._use_flex_attention = config._attn_implementation == "flex_attention"
796
+ self.norm = LLaDA2MoeRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
797
+ self.rotary_emb = LLaDA2MoeRotaryEmbedding(config=config)
798
+ self.gradient_checkpointing = False
799
+ # Initialize weights and apply final processing
800
+ self.post_init()
801
+
802
+ def get_input_embeddings(self):
803
+ return self.word_embeddings
804
+
805
+ def set_input_embeddings(self, value):
806
+ self.word_embeddings = value
807
+
808
+ @add_start_docstrings_to_model_forward(LLADA2MOE_INPUTS_DOCSTRING)
809
+ def forward(
810
+ self,
811
+ input_ids: torch.LongTensor = None,
812
+ attention_mask: Optional[torch.Tensor] = None,
813
+ position_ids: Optional[torch.LongTensor] = None,
814
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
815
+ inputs_embeds: Optional[torch.FloatTensor] = None,
816
+ use_cache: Optional[bool] = None,
817
+ output_attentions: Optional[bool] = None,
818
+ output_hidden_states: Optional[bool] = None,
819
+ output_router_logits: Optional[bool] = None,
820
+ return_dict: Optional[bool] = None,
821
+ **kwargs,
822
+ ) -> Union[Tuple, MoeModelOutputWithPast]:
823
+ output_attentions = (
824
+ output_attentions
825
+ if output_attentions is not None
826
+ else self.config.output_attentions
827
+ )
828
+ output_hidden_states = (
829
+ output_hidden_states
830
+ if output_hidden_states is not None
831
+ else self.config.output_hidden_states
832
+ )
833
+ output_router_logits = (
834
+ output_router_logits
835
+ if output_router_logits is not None
836
+ else self.config.output_router_logits
837
+ )
838
+ use_cache = use_cache if use_cache is not None else self.config.use_cache
839
+
840
+ return_dict = (
841
+ return_dict if return_dict is not None else self.config.use_return_dict
842
+ )
843
+
844
+ # retrieve input_ids and inputs_embeds
845
+ if input_ids is not None and inputs_embeds is not None:
846
+ raise ValueError(
847
+ "You cannot specify both input_ids and inputs_embeds at the same time"
848
+ )
849
+ elif input_ids is not None:
850
+ batch_size, seq_length = input_ids.shape[:2]
851
+ elif inputs_embeds is not None:
852
+ batch_size, seq_length = inputs_embeds.shape[:2]
853
+ else:
854
+ raise ValueError("You have to specify either input_ids or inputs_embeds")
855
+
856
+ if self.gradient_checkpointing and self.training:
857
+ if use_cache:
858
+ logger.warning_once(
859
+ "`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`transformers."
860
+ )
861
+ use_cache = False
862
+
863
+ if use_cache and past_key_values is None:
864
+ past_key_values = DynamicCache()
865
+
866
+ if inputs_embeds is None:
867
+ inputs_embeds = self.word_embeddings(input_ids)
868
+
869
+ past_seen_tokens = (
870
+ past_key_values.get_seq_length() if past_key_values is not None else 0
871
+ )
872
+
873
+ if position_ids is None:
874
+ position_ids = torch.arange(
875
+ past_seen_tokens,
876
+ past_seen_tokens + inputs_embeds.shape[1],
877
+ device=inputs_embeds.device,
878
+ )
879
+ position_ids = position_ids.unsqueeze(0)
880
+
881
+ if self._use_flex_attention:
882
+ if attention_mask is not None and isinstance(attention_mask, torch.Tensor):
883
+ attention_mask = _prepare_4d_causal_attention_mask_for_sdpa(
884
+ attention_mask,
885
+ (batch_size, seq_length),
886
+ inputs_embeds,
887
+ past_seen_tokens,
888
+ )
889
+ elif self._use_sdpa and not output_attentions:
890
+ # output_attentions=True can not be supported when using SDPA, and we fall back on
891
+ # the manual implementation that requires a 4D causal mask in all cases.
892
+ attention_mask = _prepare_4d_causal_attention_mask_for_sdpa(
893
+ attention_mask,
894
+ (batch_size, seq_length),
895
+ inputs_embeds,
896
+ past_seen_tokens,
897
+ )
898
+ else:
899
+ # 4d mask is passed through the layers
900
+ attention_mask = _prepare_4d_causal_attention_mask(
901
+ attention_mask,
902
+ (batch_size, seq_length),
903
+ inputs_embeds,
904
+ past_seen_tokens,
905
+ )
906
+
907
+ # embed positions
908
+ hidden_states = inputs_embeds
909
+
910
+ # create position embeddings to be shared across the decoder layers
911
+ position_embeddings = self.rotary_emb(hidden_states, position_ids)
912
+
913
+ # decoder layers
914
+ all_hidden_states = () if output_hidden_states else None
915
+ all_self_attns = () if output_attentions else None
916
+ all_router_logits = () if output_router_logits else None
917
+ next_decoder_cache = None
918
+
919
+ for decoder_layer in self.layers:
920
+ if output_hidden_states:
921
+ all_hidden_states += (hidden_states,)
922
+
923
+ if self.gradient_checkpointing and self.training:
924
+ layer_outputs = self._gradient_checkpointing_func(
925
+ decoder_layer.__call__,
926
+ hidden_states,
927
+ attention_mask,
928
+ position_ids,
929
+ past_key_values,
930
+ output_attentions,
931
+ output_router_logits,
932
+ use_cache,
933
+ position_embeddings,
934
+ )
935
+ else:
936
+ layer_outputs = decoder_layer(
937
+ hidden_states,
938
+ attention_mask=attention_mask,
939
+ position_ids=position_ids,
940
+ past_key_value=past_key_values,
941
+ output_attentions=output_attentions,
942
+ output_router_logits=output_router_logits,
943
+ use_cache=use_cache,
944
+ position_embeddings=position_embeddings,
945
+ )
946
+ hidden_states = layer_outputs[0]
947
+
948
+ if use_cache:
949
+ next_decoder_cache = layer_outputs[2 if output_attentions else 1]
950
+
951
+ if output_attentions:
952
+ all_self_attns += (layer_outputs[1],)
953
+
954
+ if output_router_logits and layer_outputs[-1] is not None:
955
+ all_router_logits += (layer_outputs[-1],)
956
+
957
+ hidden_states = self.norm(hidden_states)
958
+
959
+ # add hidden states from the last decoder layer
960
+ if output_hidden_states:
961
+ all_hidden_states += (hidden_states,)
962
+
963
+ next_cache = None
964
+ if use_cache:
965
+ next_cache = next_decoder_cache
966
+ if not return_dict:
967
+ return tuple(
968
+ v
969
+ for v in [
970
+ hidden_states,
971
+ next_cache,
972
+ all_hidden_states,
973
+ all_self_attns,
974
+ all_router_logits,
975
+ ]
976
+ if v is not None
977
+ )
978
+ return MoeModelOutputWithPast(
979
+ last_hidden_state=hidden_states,
980
+ past_key_values=next_cache,
981
+ hidden_states=all_hidden_states,
982
+ attentions=all_self_attns,
983
+ router_logits=all_router_logits,
984
+ )
985
+
986
+
987
+ class LLaDA2MoeModelLM(LLaDA2MoePreTrainedModel, GenerationMixin):
988
+ _tied_weights_keys = ["lm_head.weight"]
989
+
990
+ def __init__(self, config: LLaDA2MoeConfig):
991
+ super().__init__(config)
992
+ self.model = LLaDA2MoeModel(config)
993
+ self.vocab_size = config.vocab_size
994
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
995
+
996
+ # Initialize weights and apply final processing
997
+ self.post_init()
998
+
999
+ def get_input_embeddings(self):
1000
+ return self.model.word_embeddings
1001
+
1002
+ def set_input_embeddings(self, value):
1003
+ self.model.word_embeddings = value
1004
+
1005
+ def get_output_embeddings(self):
1006
+ return self.lm_head
1007
+
1008
+ def set_output_embeddings(self, new_embeddings):
1009
+ self.lm_head = new_embeddings
1010
+
1011
+ def set_decoder(self, decoder):
1012
+ self.model = decoder
1013
+
1014
+ def get_decoder(self):
1015
+ return self.model
1016
+
1017
+ @add_start_docstrings_to_model_forward(LLADA2MOE_INPUTS_DOCSTRING)
1018
+ @replace_return_docstrings(
1019
+ output_type=MoeCausalLMOutputWithPast, config_class=_CONFIG_FOR_DOC
1020
+ )
1021
+ def forward(
1022
+ self,
1023
+ input_ids: torch.LongTensor = None,
1024
+ attention_mask: Optional[torch.Tensor] = None,
1025
+ position_ids: Optional[torch.LongTensor] = None,
1026
+ past_key_values: Optional[List[torch.FloatTensor]] = None,
1027
+ inputs_embeds: Optional[torch.FloatTensor] = None,
1028
+ labels: Optional[torch.LongTensor] = None,
1029
+ use_cache: Optional[bool] = None,
1030
+ output_attentions: Optional[bool] = None,
1031
+ output_hidden_states: Optional[bool] = None,
1032
+ output_router_logits: Optional[bool] = None,
1033
+ return_dict: Optional[bool] = None,
1034
+ **kwargs,
1035
+ ) -> Union[Tuple, MoeCausalLMOutputWithPast]:
1036
+ r"""
1037
+ Args:
1038
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
1039
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
1040
+ config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
1041
+ (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
1042
+
1043
+ Returns:
1044
+
1045
+ Example:
1046
+
1047
+ ```python
1048
+ >>> from transformers import AutoTokenizer
1049
+
1050
+ >>> model = LLaDA2MoeForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
1051
+ >>> tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
1052
+
1053
+ >>> prompt = "Hey, are you conscious? Can you talk to me?"
1054
+ >>> inputs = tokenizer(prompt, return_tensors="pt")
1055
+
1056
+ >>> # Generate
1057
+ >>> generate_ids = model.generate(inputs.input_ids, max_length=30)
1058
+ >>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
1059
+ "Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
1060
+ ```"""
1061
+ output_attentions = (
1062
+ output_attentions
1063
+ if output_attentions is not None
1064
+ else self.config.output_attentions
1065
+ )
1066
+ output_hidden_states = (
1067
+ output_hidden_states
1068
+ if output_hidden_states is not None
1069
+ else self.config.output_hidden_states
1070
+ )
1071
+ output_router_logits = (
1072
+ output_router_logits
1073
+ if output_router_logits is not None
1074
+ else self.config.output_router_logits
1075
+ )
1076
+ return_dict = (
1077
+ return_dict if return_dict is not None else self.config.use_return_dict
1078
+ )
1079
+ # decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
1080
+ outputs = self.model(
1081
+ input_ids=input_ids,
1082
+ attention_mask=attention_mask,
1083
+ position_ids=position_ids,
1084
+ past_key_values=past_key_values,
1085
+ inputs_embeds=inputs_embeds,
1086
+ use_cache=use_cache,
1087
+ output_attentions=output_attentions,
1088
+ output_hidden_states=output_hidden_states,
1089
+ output_router_logits=output_router_logits,
1090
+ return_dict=return_dict,
1091
+ **kwargs,
1092
+ )
1093
+
1094
+ loss = None
1095
+ aux_loss = None
1096
+ hidden_states = outputs[0]
1097
+
1098
+ logits = self.lm_head(hidden_states)
1099
+ logits = logits.float()
1100
+
1101
+ if labels is not None:
1102
+ # LLaDA2.0 will use same label position logits
1103
+ shift_logits = logits
1104
+ shift_labels = labels
1105
+ # Flatten the tokens
1106
+ loss_fct = CrossEntropyLoss()
1107
+ shift_logits = shift_logits.view(-1, self.config.vocab_size)
1108
+ shift_labels = shift_labels.view(-1)
1109
+ # Enable model parallelism
1110
+ shift_labels = shift_labels.to(shift_logits.device)
1111
+ loss = loss_fct(shift_logits, shift_labels)
1112
+
1113
+ if not return_dict:
1114
+ output = (logits,) + outputs[1:]
1115
+ if output_router_logits:
1116
+ output = (aux_loss,) + output
1117
+ return (loss,) + output if loss is not None else output
1118
+
1119
+ return MoeCausalLMOutputWithPast(
1120
+ loss=loss,
1121
+ aux_loss=aux_loss,
1122
+ logits=logits,
1123
+ past_key_values=outputs.past_key_values,
1124
+ hidden_states=outputs.hidden_states,
1125
+ attentions=outputs.attentions,
1126
+ router_logits=outputs.router_logits,
1127
+ )
1128
+
1129
+ def prepare_inputs_for_generation(
1130
+ self,
1131
+ input_ids,
1132
+ past_key_values=None,
1133
+ attention_mask=None,
1134
+ inputs_embeds=None,
1135
+ token_type_ids=None,
1136
+ **kwargs,
1137
+ ):
1138
+ if past_key_values is not None:
1139
+ if isinstance(past_key_values, Cache):
1140
+ cache_length = past_key_values.get_seq_length()
1141
+ past_length = past_key_values.seen_tokens
1142
+ max_cache_length = (
1143
+ past_key_values.get_max_length()
1144
+ if hasattr(past_key_values, "get_max_length")
1145
+ else past_key_values.get_max_cache_shape()
1146
+ )
1147
+ else:
1148
+ cache_length = past_length = past_key_values[0][0].shape[2]
1149
+ max_cache_length = None
1150
+
1151
+ # Keep only the unprocessed tokens:
1152
+ # 1 - If the length of the attention_mask exceeds the length of input_ids, then we are in a setting where
1153
+ # some of the inputs are exclusivelly passed as part of the cache (e.g. when passing input_embeds as input)
1154
+ if (
1155
+ attention_mask is not None
1156
+ and attention_mask.shape[1] > input_ids.shape[1]
1157
+ ):
1158
+ input_ids = input_ids[:, -(attention_mask.shape[1] - past_length) :]
1159
+ # 2 - If the past_length is smaller than input_ids', then input_ids holds all input tokens. We can discard
1160
+ # input_ids based on the past_length.
1161
+ elif past_length < input_ids.shape[1]:
1162
+ input_ids = input_ids[:, past_length:]
1163
+ # 3 - Otherwise (past_length >= input_ids.shape[1]), let's assume input_ids only has unprocessed tokens.
1164
+
1165
+ # If we are about to go beyond the maximum cache length, we need to crop the input attention mask.
1166
+ if (
1167
+ max_cache_length is not None
1168
+ and attention_mask is not None
1169
+ and cache_length + input_ids.shape[1] > max_cache_length
1170
+ ):
1171
+ attention_mask = attention_mask[:, -max_cache_length:]
1172
+
1173
+ position_ids = kwargs.get("position_ids", None)
1174
+ if attention_mask is not None and position_ids is None:
1175
+ # create position_ids on the fly for batch generation
1176
+ position_ids = attention_mask.long().cumsum(-1) - 1
1177
+ position_ids.masked_fill_(attention_mask == 0, 1)
1178
+ if past_key_values:
1179
+ position_ids = position_ids[:, -input_ids.shape[1] :]
1180
+
1181
+ # if `inputs_embeds` are passed, we only want to use them in the 1st generation step
1182
+ if inputs_embeds is not None and past_key_values is None:
1183
+ model_inputs = {"inputs_embeds": inputs_embeds}
1184
+ else:
1185
+ model_inputs = {"input_ids": input_ids}
1186
+
1187
+ model_inputs.update(
1188
+ {
1189
+ "position_ids": position_ids,
1190
+ "past_key_values": past_key_values,
1191
+ "use_cache": kwargs.get("use_cache"),
1192
+ "attention_mask": attention_mask,
1193
+ }
1194
+ )
1195
+ return model_inputs
1196
+
1197
+ @staticmethod
1198
+ def _reorder_cache(past_key_values, beam_idx):
1199
+ reordered_past = ()
1200
+ for layer_past in past_key_values:
1201
+ reordered_past += (
1202
+ tuple(
1203
+ past_state.index_select(0, beam_idx.to(past_state.device))
1204
+ for past_state in layer_past
1205
+ ),
1206
+ )
1207
+ return reordered_past
1208
+
1209
+ @staticmethod
1210
+ def _top_k_logits(logits, k):
1211
+ if k is None or k <= 0:
1212
+ return logits
1213
+ else:
1214
+ values, _ = torch.topk(logits, k)
1215
+ min_values = values[..., -1, None]
1216
+ return torch.where(
1217
+ logits < min_values, torch.full_like(logits, float("-inf")), logits
1218
+ )
1219
+
1220
+ @staticmethod
1221
+ def _top_p_logits(logits, p):
1222
+ if p is None or p >= 1.0:
1223
+ return logits
1224
+ sorted_logits, sorted_indices = torch.sort(logits, descending=True)
1225
+ cumulative_probs = torch.cumsum(F.softmax(sorted_logits, dim=-1), dim=-1)
1226
+ sorted_mask = cumulative_probs > p
1227
+ sorted_mask[..., 1:] = sorted_mask[..., :-1].clone()
1228
+ sorted_mask[..., 0] = False
1229
+ mask_indices = torch.scatter(
1230
+ torch.full_like(logits, False, dtype=torch.bool),
1231
+ -1,
1232
+ sorted_indices,
1233
+ sorted_mask,
1234
+ )
1235
+ return logits.masked_fill(mask_indices, float("-inf"))
1236
+
1237
+ def _sample_with_temperature_topk_topp(
1238
+ self, logits, temperature=1.0, top_k=0, top_p=1.0
1239
+ ):
1240
+ orig_shape = logits.shape[:-1]
1241
+ vocab_size = logits.shape[-1]
1242
+ logits = logits.reshape(-1, vocab_size)
1243
+
1244
+ # Greedy mode: temperature = 0, no top-k/p
1245
+ if temperature == 0.0:
1246
+ probs = F.softmax(logits, dim=-1)
1247
+ token = logits.argmax(dim=-1, keepdim=True)
1248
+ token_prob = probs.gather(-1, token)
1249
+ return token.view(*orig_shape), token_prob.view(*orig_shape)
1250
+
1251
+ if temperature > 0 and temperature != 1.0:
1252
+ logits = logits / temperature
1253
+ logits = self._top_k_logits(logits, top_k)
1254
+ logits = self._top_p_logits(logits, top_p)
1255
+ probs = F.softmax(logits, dim=-1)
1256
+ token = torch.multinomial(probs, num_samples=1)
1257
+ token_prob = torch.gather(probs, -1, token)
1258
+ # token = logits.argmax(dim=-1, keepdim=True)
1259
+ return token.view(*orig_shape), token_prob.view(*orig_shape)
1260
+
1261
+ @staticmethod
1262
+ def _get_num_transfer_tokens(block_length, steps):
1263
+ if steps == 0:
1264
+ return torch.tensor([], dtype=torch.int64)
1265
+ base = block_length // steps
1266
+ remainder = block_length % steps
1267
+ num_transfer_tokens = torch.full((steps,), base, dtype=torch.int64)
1268
+ num_transfer_tokens[:remainder] += 1
1269
+ return num_transfer_tokens
1270
+
1271
+ @torch.no_grad()
1272
+ def generate(
1273
+ self,
1274
+ inputs: Optional[torch.Tensor] = None,
1275
+ temperature: int = 0.0,
1276
+ block_length: int = 32,
1277
+ steps: int = 32,
1278
+ gen_length: int = 2048,
1279
+ top_p: Optional[int] = None,
1280
+ top_k: Optional[int] = None,
1281
+ eos_early_stop: bool = False,
1282
+ minimal_topk: int = 1,
1283
+ threshold: float = 0.95,
1284
+ eos_id: int = 156892,
1285
+ mask_id: int = 156895,
1286
+ ):
1287
+ r"""
1288
+ Generates tokens using a block-wise, iterative refinement strategy.
1289
+
1290
+ This method operates differently from standard autoregressive generation. It first creates a template of the
1291
+ full desired length, filled with a special `mask_id`. It then processes this template in segments (`blocks`)
1292
+ and iteratively "denoises" or "refines" the `mask_id` tokens into actual tokens over a series of `steps` for
1293
+ each block. A custom block-diagonal causal attention mask ensures that generation within a block can attend to
1294
+ all previous blocks but not future ones.
1295
+
1296
+ <Tip warning={true}>
1297
+
1298
+ This is a specialized generation method. The quality and speed of the output are highly dependent on the interplay
1299
+ between `block_length`, `steps`, and `threshold`. It aims to achieve faster generation through parallel
1300
+ decoding within blocks, which is a departure from the token-by-token generation of standard `.generate()` methods.
1301
+
1302
+ </Tip>
1303
+
1304
+ Parameters:
1305
+ inputs (`torch.Tensor`):
1306
+ The token sequence used as a prompt for the generation.
1307
+ temperature (`float`, *optional*, defaults to 0.0):
1308
+ The value used to module the next token probabilities. A value of 0.0 corresponds to greedy decoding.
1309
+ block_length (`int`, *optional*, defaults to 32):
1310
+ The size of each generation block. The model generates text in parallel within these blocks. This is a
1311
+ key parameter for controlling the granularity of the generation process.
1312
+ steps (`int`, *optional*, defaults to 32):
1313
+ The number of iterative refinement (or "denoising") steps to perform for each block. Within each block,
1314
+ the model will try to replace `mask_id` tokens with real tokens for this many iterations.
1315
+ gen_length (`int`, *optional*, defaults to 2048):
1316
+ The maximum number of tokens to generate, excluding the prompt.
1317
+ top_p (`float`, *optional*):
1318
+ If set to a float value between 0 and 1, only the most probable tokens with probabilities that add up to
1319
+ `top_p` or higher are kept for generation (nucleus sampling).
1320
+ top_k (`int`, *optional*):
1321
+ The number of highest probability vocabulary tokens to keep for top-k-filtering.
1322
+ eos_early_stop (`bool`, *optional*, defaults to `False`):
1323
+ If `True`, generation will stop as soon as a valid End-Of-Sequence token is generated and confirmed,
1324
+ even if `gen_length` has not been reached.
1325
+ minimal_topk (`int`, *optional*, defaults to 1):
1326
+ A parameter used to dynamically adjust the number of refinement `steps`. The effective number of steps
1327
+ is capped at `gen_length // minimal_topk`.
1328
+ threshold (`float`, *optional*, defaults to 0.95):
1329
+ The confidence probability threshold for accepting a sampled token. During each refinement step, a
1330
+ sampled token is only kept if its probability is above this threshold. If not enough tokens meet the
1331
+ threshold, the ones with the highest confidence are chosen.
1332
+ eos_id (`int`, *optional*, defaults to 156892):
1333
+ The token ID for the end-of-sequence token. Used for `eos_early_stop`.
1334
+ mask_id (`int`, *optional*, defaults to 156895):
1335
+ The token ID used as a placeholder for tokens that are yet to be generated. This is central to the
1336
+ iterative refinement algorithm.
1337
+
1338
+ Return:
1339
+ `torch.Tensor`: A string containing the generated token IDs, starting
1340
+ after the prompt and stopping at the first `eos_id` or `gen_length`.
1341
+ """
1342
+ steps = min(steps, gen_length // minimal_topk)
1343
+ input_ids = inputs.to(self.device)
1344
+
1345
+ prompt_length = input_ids.shape[1]
1346
+ num_blocks = (prompt_length + gen_length + block_length - 1) // block_length
1347
+ total_length = num_blocks * block_length
1348
+
1349
+ block_mask = torch.tril(torch.ones(num_blocks, num_blocks, device=self.device))
1350
+ block_diffusion_attention_mask = (
1351
+ (
1352
+ block_mask.repeat_interleave(block_length, dim=0)
1353
+ .repeat_interleave(block_length, dim=1)
1354
+ .unsqueeze(0)
1355
+ .unsqueeze(0)
1356
+ )
1357
+ .log()
1358
+ .to(torch.bfloat16)
1359
+ )
1360
+
1361
+ position_ids = torch.arange(total_length, device=self.device).unsqueeze(0)
1362
+ x = torch.full((1, total_length), mask_id, dtype=torch.long, device=self.device)
1363
+ x[:, :prompt_length] = input_ids.clone()
1364
+
1365
+ prompt_index_full = torch.zeros_like(x, dtype=torch.bool)
1366
+ prompt_index_full[:, :prompt_length] = True
1367
+
1368
+ prefill_blocks = prompt_length // block_length
1369
+
1370
+ denoising_steps_per_block = steps
1371
+ num_transfer_tokens_schedule = self._get_num_transfer_tokens(
1372
+ block_length, denoising_steps_per_block
1373
+ )
1374
+
1375
+ nfe = 0
1376
+
1377
+ for num_block in range(prefill_blocks, num_blocks):
1378
+ current_window_end = (num_block + 1) * block_length
1379
+ cur_x = x[:, :current_window_end]
1380
+ cur_attn_mask = block_diffusion_attention_mask[
1381
+ :, :, :current_window_end, :current_window_end
1382
+ ]
1383
+ cur_position_ids = position_ids[:, :current_window_end]
1384
+
1385
+ for _ in range(denoising_steps_per_block):
1386
+ active_block_mask = cur_x[:, -block_length:] == mask_id
1387
+ if active_block_mask.sum() == 0:
1388
+ break
1389
+
1390
+ logits = self.forward(
1391
+ cur_x,
1392
+ attention_mask=cur_attn_mask,
1393
+ position_ids=cur_position_ids,
1394
+ ).logits
1395
+
1396
+ active_logits = logits[:, -block_length:, :]
1397
+ # active_logits = logits[:, -block_length-1:-1, :]
1398
+ x0, x0_p = self._sample_with_temperature_topk_topp(
1399
+ active_logits, temperature=temperature, top_k=top_k, top_p=top_p
1400
+ )
1401
+ nfe += 1
1402
+
1403
+ num_to_transfer = num_transfer_tokens_schedule[step].item()
1404
+ transfer_index = torch.zeros_like(x0, dtype=torch.bool)
1405
+
1406
+ confidence = torch.where(active_block_mask, x0_p, -torch.inf)
1407
+ high_conf_mask = confidence[0] > threshold
1408
+ num_high_confidence = high_conf_mask.sum().item()
1409
+
1410
+ if num_high_confidence >= num_to_transfer:
1411
+ transfer_index[0] = high_conf_mask
1412
+ else:
1413
+ _, idx = torch.topk(
1414
+ confidence[0],
1415
+ k=min(num_to_transfer, active_block_mask.sum().item()),
1416
+ )
1417
+ transfer_index[0, idx] = True
1418
+
1419
+ if transfer_index.any():
1420
+ cur_x[:, -block_length:][transfer_index] = x0[transfer_index]
1421
+ if eos_early_stop and (x0[transfer_index] == eos_id).any():
1422
+ eos_pos_in_x = (cur_x[0] == eos_id).nonzero(as_tuple=True)
1423
+ if len(eos_pos_in_x[0]) > 0:
1424
+ eos_pos = eos_pos_in_x[0][0].item()
1425
+ if (cur_x[0, prompt_length:eos_pos] != mask_id).all():
1426
+ final_x = x[:, :total_length][:, : eos_pos + 1]
1427
+ return nfe, final_x
1428
+
1429
+ x[:, :current_window_end] = cur_x
1430
+ if (
1431
+ eos_id is not None
1432
+ and (x[0, prompt_length:current_window_end] == eos_id).any()
1433
+ ):
1434
+ break
1435
+
1436
+
1437
+ generated_answer = x[:, : prompt_length + gen_length]
1438
+
1439
+ mask_positions = (generated_answer[0][input_ids.shape[1] :] == eos_id).nonzero(
1440
+ as_tuple=True
1441
+ )[0]
1442
+ if len(mask_positions) > 0:
1443
+ first_mask_position = mask_positions[0].item()
1444
+ else:
1445
+ first_mask_position = gen_length
1446
+ return nfe, generated_answer[
1447
+ :, input_ids.shape[1] : input_ids.shape[1] + first_mask_position + 1
1448
+ ]
1449
+
1450
+
1451
+
1452
+
1453
+ @torch.no_grad()
1454
+ def generate_spd(
1455
+ self,
1456
+ inputs: Optional[torch.Tensor] = None,
1457
+ block_length: int = 32,
1458
+ steps: int = 32,
1459
+ gen_length: int = 2048,
1460
+ minimal_topk: int = 1,
1461
+ threshold: float = 0.95,
1462
+ eos_id: int = 156892,
1463
+ mask_id: int = 156895,
1464
+ ):
1465
+ r"""
1466
+ Generates tokens using a block-wise, iterative refinement strategy.
1467
+
1468
+ This method operates differently from standard autoregressive generation. It first creates a template of the
1469
+ full desired length, filled with a special `mask_id`. It then processes this template in segments (`blocks`)
1470
+ and iteratively "denoises" or "refines" the `mask_id` tokens into actual tokens over a series of `steps` for
1471
+ each block. A custom block-diagonal causal attention mask ensures that generation within a block can attend to
1472
+ all previous blocks but not future ones.
1473
+
1474
+ <Tip warning={true}>
1475
+
1476
+ This is a specialized generation method. The quality and speed of the output are highly dependent on the interplay
1477
+ between `block_length`, `steps`, and `threshold`. It aims to achieve faster generation through parallel
1478
+ decoding within blocks, which is a departure from the token-by-token generation of standard `.generate()` methods.
1479
+
1480
+ </Tip>
1481
+
1482
+ Parameters:
1483
+ inputs (`torch.Tensor`):
1484
+ The token sequence used as a prompt for the generation.
1485
+ block_length (`int`, *optional*, defaults to 32):
1486
+ The size of each generation block. The model generates text in parallel within these blocks. This is a
1487
+ key parameter for controlling the granularity of the generation process.
1488
+ steps (`int`, *optional*, defaults to 32):
1489
+ The number of iterative refinement (or "denoising") steps to perform for each block. Within each block,
1490
+ the model will try to replace `mask_id` tokens with real tokens for this many iterations.
1491
+ gen_length (`int`, *optional*, defaults to 2048):
1492
+ The maximum number of tokens to generate, excluding the prompt.
1493
+ minimal_topk (`int`, *optional*, defaults to 1):
1494
+ A parameter used to dynamically adjust the number of refinement `steps`. The effective number of steps
1495
+ is capped at `gen_length // minimal_topk`.
1496
+ threshold (`float`, *optional*, defaults to 0.95):
1497
+ The confidence probability threshold for accepting a sampled token. During each refinement step, a
1498
+ sampled token is only kept if its probability is above this threshold. If not enough tokens meet the
1499
+ threshold, the ones with the highest confidence are chosen.
1500
+ eos_id (`int`, *optional*, defaults to 156892):
1501
+ The token ID for the end-of-sequence token. Used for `eos_early_stop`.
1502
+ mask_id (`int`, *optional*, defaults to 156895):
1503
+ The token ID used as a placeholder for tokens that are yet to be generated. This is central to the
1504
+ iterative refinement algorithm.
1505
+
1506
+ Return:
1507
+ `torch.Tensor`: A string containing the generated token IDs, starting
1508
+ after the prompt and stopping at the first `eos_id` or `gen_length`.
1509
+ """
1510
+ steps = min(steps, gen_length // minimal_topk)
1511
+ input_ids = inputs.to(self.device)
1512
+
1513
+ prompt_length = input_ids.shape[1]
1514
+ num_blocks = (prompt_length + gen_length + block_length - 1) // block_length
1515
+ total_length = num_blocks * block_length
1516
+
1517
+ block_mask = torch.tril(torch.ones(num_blocks, num_blocks, device=self.device))
1518
+ block_diffusion_attention_mask = (
1519
+ (
1520
+ block_mask.repeat_interleave(block_length, dim=0)
1521
+ .repeat_interleave(block_length, dim=1)
1522
+ .unsqueeze(0)
1523
+ .unsqueeze(0)
1524
+ )
1525
+ .log()
1526
+ .to(torch.bfloat16)
1527
+ )
1528
+
1529
+ position_ids = torch.arange(total_length, device=self.device).unsqueeze(0)
1530
+ x = torch.full((1, total_length), mask_id, dtype=torch.long, device=self.device)
1531
+ x[:, :prompt_length] = input_ids.clone()
1532
+ input_embeddings = self.get_input_embeddings()
1533
+ mask_embedding = input_embeddings.weight[mask_id].to(self.device).view(1, 1, -1)
1534
+
1535
+ prefill_blocks = prompt_length // block_length
1536
+
1537
+ denoising_steps_per_block = min(steps, block_length)
1538
+ nfe = 0
1539
+
1540
+ for num_block in range(prefill_blocks, num_blocks):
1541
+ current_window_end = (num_block + 1) * block_length
1542
+ cur_x = x[:, :current_window_end]
1543
+ # Cache token embeddings for the visible prefix and only refresh the active block.
1544
+ cur_token_embeds = input_embeddings(cur_x)
1545
+ cur_inputs_embeds = cur_token_embeds.clone()
1546
+ cur_attn_mask = block_diffusion_attention_mask[
1547
+ :, :, :current_window_end, :current_window_end
1548
+ ]
1549
+ cur_position_ids = position_ids[:, :current_window_end]
1550
+
1551
+ # Only non-prompt positions in the current block participate in iterative decoding.
1552
+ active_block_mask = torch.arange(
1553
+ current_window_end - block_length,
1554
+ current_window_end,
1555
+ device=cur_x.device,
1556
+ ).unsqueeze(0)
1557
+ active_block_mask = active_block_mask >= prompt_length
1558
+ block_slice = slice(-block_length, None)
1559
+ expanded_mask_embedding = mask_embedding.expand(1, block_length, -1)
1560
+ expanded_mask_norm = torch.linalg.vector_norm(
1561
+ expanded_mask_embedding.float(), dim=-1, keepdim=True
1562
+ ).to(cur_token_embeds.dtype)
1563
+ block_confidence = torch.zeros(
1564
+ (1, block_length), device=cur_x.device, dtype=torch.float32
1565
+ )
1566
+
1567
+ for _ in range(denoising_steps_per_block):
1568
+ current_block = cur_x[:, block_slice]
1569
+ prev_block = current_block.clone()
1570
+ mask_index = current_block == mask_id
1571
+ token_index = active_block_mask & (~mask_index)
1572
+ block_token_embeds = cur_token_embeds[:, block_slice, :]
1573
+ block_inputs_embeds = block_token_embeds.clone()
1574
+ token_weight = block_confidence.to(block_inputs_embeds.dtype).unsqueeze(-1)
1575
+
1576
+ # Token positions use a confidence-weighted token/mask blend before the forward pass.
1577
+ mixed_embeds = (
1578
+ token_weight * block_token_embeds
1579
+ + (1.0 - token_weight) * expanded_mask_embedding
1580
+ )
1581
+ token_norm = torch.linalg.vector_norm(
1582
+ block_token_embeds.float(), dim=-1, keepdim=True
1583
+ ).to(block_inputs_embeds.dtype)
1584
+ target_norm = (
1585
+ token_weight * token_norm
1586
+ + (1.0 - token_weight) * expanded_mask_norm
1587
+ )
1588
+ mixed_norm = torch.linalg.vector_norm(
1589
+ mixed_embeds.float(), dim=-1, keepdim=True
1590
+ ).clamp_min(1e-12).to(block_inputs_embeds.dtype)
1591
+ # Renormalize the blended embedding to the weighted target norm.
1592
+ mixed_embeds = mixed_embeds * (target_norm / mixed_norm)
1593
+
1594
+ # Mask positions stay on the mask embedding; token positions receive the blended embedding.
1595
+ block_inputs_embeds = torch.where(
1596
+ mask_index.unsqueeze(-1),
1597
+ expanded_mask_embedding,
1598
+ block_inputs_embeds,
1599
+ )
1600
+ block_inputs_embeds = torch.where(
1601
+ token_index.unsqueeze(-1),
1602
+ mixed_embeds,
1603
+ block_inputs_embeds,
1604
+ )
1605
+ cur_inputs_embeds[:, block_slice, :] = block_inputs_embeds
1606
+
1607
+ logits = self.forward(
1608
+ inputs_embeds=cur_inputs_embeds,
1609
+ attention_mask=cur_attn_mask,
1610
+ position_ids=cur_position_ids,
1611
+ ).logits
1612
+ nfe += 1
1613
+
1614
+ active_logits = logits[:, -block_length:, :]
1615
+ active_probs = F.softmax(active_logits.float(), dim=-1)
1616
+ top1_confidence, top1_tokens = torch.max(active_probs, dim=-1)
1617
+
1618
+ target_slice = current_block.clone()
1619
+ # Every active token index is refreshed by the current step's top-1 prediction.
1620
+ target_slice = torch.where(token_index, top1_tokens, target_slice)
1621
+
1622
+ mask_positions = torch.nonzero(mask_index[0], as_tuple=False).flatten()
1623
+ if mask_positions.numel() > 0:
1624
+ mask_confidence = top1_confidence[0, mask_positions]
1625
+ below_threshold = torch.nonzero(
1626
+ mask_confidence < threshold, as_tuple=False
1627
+ ).flatten()
1628
+
1629
+ if below_threshold.numel() == 0:
1630
+ decode_upto = mask_positions.numel()
1631
+ elif below_threshold[0].item() == 0:
1632
+ decode_upto = 1
1633
+ else:
1634
+ decode_upto = below_threshold[0].item()
1635
+
1636
+ # Decode the leftmost mask prefix above threshold, or force one token if needed.
1637
+ decode_positions = mask_positions[:decode_upto]
1638
+ target_slice[0, decode_positions] = top1_tokens[0, decode_positions]
1639
+
1640
+ cur_x[:, block_slice] = torch.where(
1641
+ active_block_mask, target_slice, cur_x[:, block_slice]
1642
+ )
1643
+ current_block = cur_x[:, block_slice]
1644
+ same_as_previous = torch.equal(current_block, prev_block)
1645
+ active_confidence = torch.where(
1646
+ active_block_mask,
1647
+ top1_confidence,
1648
+ torch.ones_like(top1_confidence),
1649
+ )
1650
+ all_confident = bool((active_confidence >= 0.9).all().item())
1651
+
1652
+ # A block is committed once it stops changing or every active position is confident enough.
1653
+ if same_as_previous or all_confident:
1654
+ break
1655
+
1656
+ cur_token_embeds[:, block_slice, :] = input_embeddings(current_block)
1657
+ block_confidence = torch.where(
1658
+ active_block_mask & (current_block != mask_id),
1659
+ top1_confidence,
1660
+ torch.zeros_like(top1_confidence),
1661
+ )
1662
+
1663
+ x[:, :current_window_end] = cur_x
1664
+
1665
+ if (
1666
+ eos_id is not None
1667
+ and (x[0, prompt_length:current_window_end] == eos_id).any()
1668
+ ):
1669
+ break
1670
+
1671
+ generated_answer = x[:, : prompt_length + gen_length]
1672
+
1673
+ mask_positions = (generated_answer[0][input_ids.shape[1] :] == eos_id).nonzero(
1674
+ as_tuple=True
1675
+ )[0]
1676
+ if len(mask_positions) > 0:
1677
+ first_mask_position = mask_positions[0].item()
1678
+ else:
1679
+ first_mask_position = gen_length
1680
+ return nfe, generated_answer[
1681
+ :, input_ids.shape[1] : input_ids.shape[1] + first_mask_position + 1
1682
+ ]
1683
+
1684
+ @torch.no_grad()
1685
+ def generate_uniform_demo(
1686
+ self,
1687
+ inputs: Optional[torch.Tensor] = None,
1688
+ block_length: int = 32,
1689
+ steps: int = 32,
1690
+ gen_length: int = 2048,
1691
+ minimal_topk: int = 1,
1692
+ threshold: float = 0.95,
1693
+ eos_id: int = 156892,
1694
+ mask_id: int = 156895,
1695
+ ):
1696
+ r"""
1697
+ Runs the same decoding logic as `generate_uniform` while storing
1698
+ step-by-step metadata for visualization.
1699
+ """
1700
+ steps = min(steps, gen_length // minimal_topk)
1701
+ input_ids = inputs.to(self.device)
1702
+
1703
+ prompt_length = input_ids.shape[1]
1704
+ num_blocks = (prompt_length + gen_length + block_length - 1) // block_length
1705
+ total_length = num_blocks * block_length
1706
+
1707
+ block_mask = torch.tril(torch.ones(num_blocks, num_blocks, device=self.device))
1708
+ block_diffusion_attention_mask = (
1709
+ (
1710
+ block_mask.repeat_interleave(block_length, dim=0)
1711
+ .repeat_interleave(block_length, dim=1)
1712
+ .unsqueeze(0)
1713
+ .unsqueeze(0)
1714
+ )
1715
+ .log()
1716
+ .to(torch.bfloat16)
1717
+ )
1718
+
1719
+ position_ids = torch.arange(total_length, device=self.device).unsqueeze(0)
1720
+ x = torch.full((1, total_length), mask_id, dtype=torch.long, device=self.device)
1721
+ x[:, :prompt_length] = input_ids.clone()
1722
+ input_embeddings = self.get_input_embeddings()
1723
+ mask_embedding = input_embeddings.weight[mask_id].to(self.device).view(1, 1, -1)
1724
+
1725
+ prefill_blocks = prompt_length // block_length
1726
+
1727
+ denoising_steps_per_block = min(steps, block_length)
1728
+ nfe = 0
1729
+ frames = []
1730
+ block_summaries = []
1731
+
1732
+ for num_block in range(prefill_blocks, num_blocks):
1733
+ current_window_end = (num_block + 1) * block_length
1734
+ cur_x = x[:, :current_window_end]
1735
+ cur_token_embeds = input_embeddings(cur_x)
1736
+ cur_inputs_embeds = cur_token_embeds.clone()
1737
+ cur_attn_mask = block_diffusion_attention_mask[
1738
+ :, :, :current_window_end, :current_window_end
1739
+ ]
1740
+ cur_position_ids = position_ids[:, :current_window_end]
1741
+
1742
+ active_block_mask = torch.arange(
1743
+ current_window_end - block_length,
1744
+ current_window_end,
1745
+ device=cur_x.device,
1746
+ ).unsqueeze(0)
1747
+ active_block_mask = active_block_mask >= prompt_length
1748
+ block_slice = slice(-block_length, None)
1749
+ expanded_mask_embedding = mask_embedding.expand(1, block_length, -1)
1750
+ expanded_mask_norm = torch.linalg.vector_norm(
1751
+ expanded_mask_embedding.float(), dim=-1, keepdim=True
1752
+ ).to(cur_token_embeds.dtype)
1753
+ block_confidence = torch.zeros(
1754
+ (1, block_length), device=cur_x.device, dtype=torch.float32
1755
+ )
1756
+
1757
+ block_summary = {
1758
+ "block_id": int(num_block - prefill_blocks),
1759
+ "absolute_block_id": int(num_block),
1760
+ "block_start": int(current_window_end - block_length),
1761
+ "block_end": int(current_window_end),
1762
+ "window_end": int(current_window_end),
1763
+ "num_steps": 0,
1764
+ "converged": False,
1765
+ "convergence_reason": "max_steps",
1766
+ }
1767
+
1768
+ for step_idx in range(denoising_steps_per_block):
1769
+ current_block = cur_x[:, block_slice]
1770
+ prev_block = current_block.clone()
1771
+ pre_visible_ids = cur_x[0, :current_window_end].detach().cpu().tolist()
1772
+ mask_index = current_block == mask_id
1773
+ token_index = active_block_mask & (~mask_index)
1774
+ input_confidence = block_confidence[0].detach().cpu().tolist()
1775
+ block_token_embeds = cur_token_embeds[:, block_slice, :]
1776
+ block_inputs_embeds = block_token_embeds.clone()
1777
+ token_weight = block_confidence.to(block_inputs_embeds.dtype).unsqueeze(-1)
1778
+
1779
+ mixed_embeds = (
1780
+ token_weight * block_token_embeds
1781
+ + (1.0 - token_weight) * expanded_mask_embedding
1782
+ )
1783
+ token_norm = torch.linalg.vector_norm(
1784
+ block_token_embeds.float(), dim=-1, keepdim=True
1785
+ ).to(block_inputs_embeds.dtype)
1786
+ target_norm = (
1787
+ token_weight * token_norm
1788
+ + (1.0 - token_weight) * expanded_mask_norm
1789
+ )
1790
+ mixed_norm = torch.linalg.vector_norm(
1791
+ mixed_embeds.float(), dim=-1, keepdim=True
1792
+ ).clamp_min(1e-12).to(block_inputs_embeds.dtype)
1793
+ mixed_embeds = mixed_embeds * (target_norm / mixed_norm)
1794
+
1795
+ block_inputs_embeds = torch.where(
1796
+ mask_index.unsqueeze(-1),
1797
+ expanded_mask_embedding,
1798
+ block_inputs_embeds,
1799
+ )
1800
+ block_inputs_embeds = torch.where(
1801
+ token_index.unsqueeze(-1),
1802
+ mixed_embeds,
1803
+ block_inputs_embeds,
1804
+ )
1805
+ cur_inputs_embeds[:, block_slice, :] = block_inputs_embeds
1806
+
1807
+ logits = self.forward(
1808
+ inputs_embeds=cur_inputs_embeds,
1809
+ attention_mask=cur_attn_mask,
1810
+ position_ids=cur_position_ids,
1811
+ ).logits
1812
+ nfe += 1
1813
+
1814
+ active_logits = logits[:, -block_length:, :]
1815
+ active_probs = F.softmax(active_logits.float(), dim=-1)
1816
+ top1_confidence, top1_tokens = torch.max(active_probs, dim=-1)
1817
+
1818
+ target_slice = current_block.clone()
1819
+ target_slice = torch.where(token_index, top1_tokens, target_slice)
1820
+
1821
+ decode_positions = torch.tensor(
1822
+ [], device=cur_x.device, dtype=torch.long
1823
+ )
1824
+ mask_positions = torch.nonzero(mask_index[0], as_tuple=False).flatten()
1825
+ if mask_positions.numel() > 0:
1826
+ mask_confidence = top1_confidence[0, mask_positions]
1827
+ below_threshold = torch.nonzero(
1828
+ mask_confidence < threshold, as_tuple=False
1829
+ ).flatten()
1830
+
1831
+ if below_threshold.numel() == 0:
1832
+ decode_upto = mask_positions.numel()
1833
+ elif below_threshold[0].item() == 0:
1834
+ decode_upto = 1
1835
+ else:
1836
+ decode_upto = below_threshold[0].item()
1837
+
1838
+ decode_positions = mask_positions[:decode_upto]
1839
+ target_slice[0, decode_positions] = top1_tokens[0, decode_positions]
1840
+
1841
+ cur_x[:, block_slice] = torch.where(
1842
+ active_block_mask, target_slice, cur_x[:, block_slice]
1843
+ )
1844
+ current_block = cur_x[:, block_slice]
1845
+ same_as_previous = torch.equal(current_block, prev_block)
1846
+ active_confidence = torch.where(
1847
+ active_block_mask,
1848
+ top1_confidence,
1849
+ torch.ones_like(top1_confidence),
1850
+ )
1851
+ all_confident = bool((active_confidence >= 0.9).all().item())
1852
+ converged = same_as_previous or all_confident
1853
+ convergence_reason = None
1854
+ if same_as_previous:
1855
+ convergence_reason = "stable_tokens"
1856
+ elif all_confident:
1857
+ convergence_reason = "high_confidence"
1858
+
1859
+ post_visible_ids = cur_x[0, :current_window_end].detach().cpu().tolist()
1860
+ frames.append(
1861
+ {
1862
+ "frame_id": len(frames),
1863
+ "block_id": int(num_block - prefill_blocks),
1864
+ "absolute_block_id": int(num_block),
1865
+ "step_id": int(step_idx),
1866
+ "window_end": int(current_window_end),
1867
+ "block_start": int(current_window_end - block_length),
1868
+ "block_end": int(current_window_end),
1869
+ "nfe": int(nfe),
1870
+ "pre_visible_ids": pre_visible_ids,
1871
+ "post_visible_ids": post_visible_ids,
1872
+ "active_block_mask": active_block_mask[0].detach().cpu().tolist(),
1873
+ "mask_index_before": mask_index[0].detach().cpu().tolist(),
1874
+ "token_index_before": token_index[0].detach().cpu().tolist(),
1875
+ "input_confidence": input_confidence,
1876
+ "top1_confidence": top1_confidence[0].detach().cpu().tolist(),
1877
+ "top1_token_ids": top1_tokens[0].detach().cpu().tolist(),
1878
+ "decoded_positions": decode_positions.detach().cpu().tolist(),
1879
+ "same_as_previous": bool(same_as_previous),
1880
+ "all_confident": bool(all_confident),
1881
+ "converged": bool(converged),
1882
+ "convergence_reason": convergence_reason,
1883
+ }
1884
+ )
1885
+
1886
+ block_summary["num_steps"] = step_idx + 1
1887
+ if converged:
1888
+ block_summary["converged"] = True
1889
+ block_summary["convergence_reason"] = convergence_reason
1890
+ break
1891
+
1892
+ cur_token_embeds[:, block_slice, :] = input_embeddings(current_block)
1893
+ block_confidence = torch.where(
1894
+ active_block_mask & (current_block != mask_id),
1895
+ top1_confidence,
1896
+ torch.zeros_like(top1_confidence),
1897
+ )
1898
+
1899
+ x[:, :current_window_end] = cur_x
1900
+ block_summaries.append(block_summary)
1901
+
1902
+ if (
1903
+ eos_id is not None
1904
+ and (x[0, prompt_length:current_window_end] == eos_id).any()
1905
+ ):
1906
+ break
1907
+
1908
+ generated_answer = x[:, : prompt_length + gen_length]
1909
+
1910
+ mask_positions = (generated_answer[0][input_ids.shape[1] :] == eos_id).nonzero(
1911
+ as_tuple=True
1912
+ )[0]
1913
+ if len(mask_positions) > 0:
1914
+ first_mask_position = mask_positions[0].item()
1915
+ else:
1916
+ first_mask_position = gen_length
1917
+
1918
+ generated_tokens = generated_answer[
1919
+ :, input_ids.shape[1] : input_ids.shape[1] + first_mask_position + 1
1920
+ ]
1921
+ demo_trace = {
1922
+ "prompt_length": int(prompt_length),
1923
+ "block_length": int(block_length),
1924
+ "steps": int(denoising_steps_per_block),
1925
+ "gen_length": int(gen_length),
1926
+ "threshold": float(threshold),
1927
+ "eos_id": int(eos_id) if eos_id is not None else None,
1928
+ "mask_id": int(mask_id),
1929
+ "nfe": int(nfe),
1930
+ "prompt_token_ids": input_ids[0].detach().cpu().tolist(),
1931
+ "generated_token_ids": generated_tokens[0].detach().cpu().tolist(),
1932
+ "final_token_ids": generated_answer[0].detach().cpu().tolist(),
1933
+ "frames": frames,
1934
+ "blocks": block_summaries,
1935
+ }
1936
+
1937
+ return demo_trace, nfe, generated_tokens
models/dmax-16b/special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|startoftext|>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "[CLS]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "<|endoftext|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<|mask|>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<|endoftext|>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
models/dmax-16b/tokenizer_config.json ADDED
@@ -0,0 +1,2116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "156891": {
6
+ "content": "<|startoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "156892": {
14
+ "content": "<|endoftext|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "156893": {
22
+ "content": "[CLS]",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "156894": {
30
+ "content": "[gMASK]",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "156895": {
38
+ "content": "<|mask|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "156896": {
46
+ "content": "<tool_call>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "156897": {
54
+ "content": "</tool_call>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "156898": {
62
+ "content": "<tool_response>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "156899": {
70
+ "content": "</tool_response>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "156900": {
78
+ "content": "<|role_end|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "156901": {
86
+ "content": "<|reserved_token_6|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "156902": {
94
+ "content": "<|reserved_token_7|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "156903": {
102
+ "content": "<|reserved_token_8|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "156904": {
110
+ "content": "<|reserved_token_9|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "156905": {
118
+ "content": "<|reserved_token_10|>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": true
124
+ },
125
+ "156906": {
126
+ "content": "<|reserved_token_11|>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": true
132
+ },
133
+ "156907": {
134
+ "content": "<|reserved_token_12|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": true
140
+ },
141
+ "156908": {
142
+ "content": "<|reserved_token_13|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": true
148
+ },
149
+ "156909": {
150
+ "content": "<|reserved_token_14|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": true
156
+ },
157
+ "156910": {
158
+ "content": "<|reserved_token_15|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": true
164
+ },
165
+ "156911": {
166
+ "content": "<|reserved_token_16|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": true
172
+ },
173
+ "156912": {
174
+ "content": "<|reserved_token_17|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": true
180
+ },
181
+ "156913": {
182
+ "content": "<|reserved_token_18|>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": true
188
+ },
189
+ "156914": {
190
+ "content": "<|reserved_token_19|>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": true
196
+ },
197
+ "156915": {
198
+ "content": "<|reserved_token_20|>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": true
204
+ },
205
+ "156916": {
206
+ "content": "<|reserved_token_21|>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": true
212
+ },
213
+ "156917": {
214
+ "content": "<|reserved_token_22|>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ },
221
+ "156918": {
222
+ "content": "<|reserved_token_23|>",
223
+ "lstrip": false,
224
+ "normalized": false,
225
+ "rstrip": false,
226
+ "single_word": false,
227
+ "special": true
228
+ },
229
+ "156919": {
230
+ "content": "<|reserved_token_24|>",
231
+ "lstrip": false,
232
+ "normalized": false,
233
+ "rstrip": false,
234
+ "single_word": false,
235
+ "special": true
236
+ },
237
+ "156920": {
238
+ "content": "<|reserved_token_25|>",
239
+ "lstrip": false,
240
+ "normalized": false,
241
+ "rstrip": false,
242
+ "single_word": false,
243
+ "special": true
244
+ },
245
+ "156921": {
246
+ "content": "<|reserved_token_26|>",
247
+ "lstrip": false,
248
+ "normalized": false,
249
+ "rstrip": false,
250
+ "single_word": false,
251
+ "special": true
252
+ },
253
+ "156922": {
254
+ "content": "<|reserved_token_27|>",
255
+ "lstrip": false,
256
+ "normalized": false,
257
+ "rstrip": false,
258
+ "single_word": false,
259
+ "special": true
260
+ },
261
+ "156923": {
262
+ "content": "<|reserved_token_28|>",
263
+ "lstrip": false,
264
+ "normalized": false,
265
+ "rstrip": false,
266
+ "single_word": false,
267
+ "special": true
268
+ },
269
+ "156924": {
270
+ "content": "<|reserved_token_29|>",
271
+ "lstrip": false,
272
+ "normalized": false,
273
+ "rstrip": false,
274
+ "single_word": false,
275
+ "special": true
276
+ },
277
+ "156925": {
278
+ "content": "<|reserved_token_30|>",
279
+ "lstrip": false,
280
+ "normalized": false,
281
+ "rstrip": false,
282
+ "single_word": false,
283
+ "special": true
284
+ },
285
+ "156926": {
286
+ "content": "<|reserved_token_31|>",
287
+ "lstrip": false,
288
+ "normalized": false,
289
+ "rstrip": false,
290
+ "single_word": false,
291
+ "special": true
292
+ },
293
+ "156927": {
294
+ "content": "<|reserved_token_32|>",
295
+ "lstrip": false,
296
+ "normalized": false,
297
+ "rstrip": false,
298
+ "single_word": false,
299
+ "special": true
300
+ },
301
+ "156928": {
302
+ "content": "<|reserved_token_33|>",
303
+ "lstrip": false,
304
+ "normalized": false,
305
+ "rstrip": false,
306
+ "single_word": false,
307
+ "special": true
308
+ },
309
+ "156929": {
310
+ "content": "<|reserved_token_34|>",
311
+ "lstrip": false,
312
+ "normalized": false,
313
+ "rstrip": false,
314
+ "single_word": false,
315
+ "special": true
316
+ },
317
+ "156930": {
318
+ "content": "<|reserved_token_35|>",
319
+ "lstrip": false,
320
+ "normalized": false,
321
+ "rstrip": false,
322
+ "single_word": false,
323
+ "special": true
324
+ },
325
+ "156931": {
326
+ "content": "<|reserved_token_36|>",
327
+ "lstrip": false,
328
+ "normalized": false,
329
+ "rstrip": false,
330
+ "single_word": false,
331
+ "special": true
332
+ },
333
+ "156932": {
334
+ "content": "<|reserved_token_37|>",
335
+ "lstrip": false,
336
+ "normalized": false,
337
+ "rstrip": false,
338
+ "single_word": false,
339
+ "special": true
340
+ },
341
+ "156933": {
342
+ "content": "<|reserved_token_38|>",
343
+ "lstrip": false,
344
+ "normalized": false,
345
+ "rstrip": false,
346
+ "single_word": false,
347
+ "special": true
348
+ },
349
+ "156934": {
350
+ "content": "<|reserved_token_39|>",
351
+ "lstrip": false,
352
+ "normalized": false,
353
+ "rstrip": false,
354
+ "single_word": false,
355
+ "special": true
356
+ },
357
+ "156935": {
358
+ "content": "<|reserved_token_40|>",
359
+ "lstrip": false,
360
+ "normalized": false,
361
+ "rstrip": false,
362
+ "single_word": false,
363
+ "special": true
364
+ },
365
+ "156936": {
366
+ "content": "<|reserved_token_41|>",
367
+ "lstrip": false,
368
+ "normalized": false,
369
+ "rstrip": false,
370
+ "single_word": false,
371
+ "special": true
372
+ },
373
+ "156937": {
374
+ "content": "<|reserved_token_42|>",
375
+ "lstrip": false,
376
+ "normalized": false,
377
+ "rstrip": false,
378
+ "single_word": false,
379
+ "special": true
380
+ },
381
+ "156938": {
382
+ "content": "<|reserved_token_43|>",
383
+ "lstrip": false,
384
+ "normalized": false,
385
+ "rstrip": false,
386
+ "single_word": false,
387
+ "special": true
388
+ },
389
+ "156939": {
390
+ "content": "<|reserved_token_44|>",
391
+ "lstrip": false,
392
+ "normalized": false,
393
+ "rstrip": false,
394
+ "single_word": false,
395
+ "special": true
396
+ },
397
+ "156940": {
398
+ "content": "<|reserved_token_45|>",
399
+ "lstrip": false,
400
+ "normalized": false,
401
+ "rstrip": false,
402
+ "single_word": false,
403
+ "special": true
404
+ },
405
+ "156941": {
406
+ "content": "<|reserved_token_46|>",
407
+ "lstrip": false,
408
+ "normalized": false,
409
+ "rstrip": false,
410
+ "single_word": false,
411
+ "special": true
412
+ },
413
+ "156942": {
414
+ "content": "<|reserved_token_47|>",
415
+ "lstrip": false,
416
+ "normalized": false,
417
+ "rstrip": false,
418
+ "single_word": false,
419
+ "special": true
420
+ },
421
+ "156943": {
422
+ "content": "<|reserved_token_48|>",
423
+ "lstrip": false,
424
+ "normalized": false,
425
+ "rstrip": false,
426
+ "single_word": false,
427
+ "special": true
428
+ },
429
+ "156944": {
430
+ "content": "<|reserved_token_49|>",
431
+ "lstrip": false,
432
+ "normalized": false,
433
+ "rstrip": false,
434
+ "single_word": false,
435
+ "special": true
436
+ },
437
+ "156945": {
438
+ "content": "<|reserved_token_50|>",
439
+ "lstrip": false,
440
+ "normalized": false,
441
+ "rstrip": false,
442
+ "single_word": false,
443
+ "special": true
444
+ },
445
+ "156946": {
446
+ "content": "<|reserved_token_51|>",
447
+ "lstrip": false,
448
+ "normalized": false,
449
+ "rstrip": false,
450
+ "single_word": false,
451
+ "special": true
452
+ },
453
+ "156947": {
454
+ "content": "<|reserved_token_52|>",
455
+ "lstrip": false,
456
+ "normalized": false,
457
+ "rstrip": false,
458
+ "single_word": false,
459
+ "special": true
460
+ },
461
+ "156948": {
462
+ "content": "<|reserved_token_53|>",
463
+ "lstrip": false,
464
+ "normalized": false,
465
+ "rstrip": false,
466
+ "single_word": false,
467
+ "special": true
468
+ },
469
+ "156949": {
470
+ "content": "<|reserved_token_54|>",
471
+ "lstrip": false,
472
+ "normalized": false,
473
+ "rstrip": false,
474
+ "single_word": false,
475
+ "special": true
476
+ },
477
+ "156950": {
478
+ "content": "<|reserved_token_55|>",
479
+ "lstrip": false,
480
+ "normalized": false,
481
+ "rstrip": false,
482
+ "single_word": false,
483
+ "special": true
484
+ },
485
+ "156951": {
486
+ "content": "<|reserved_token_56|>",
487
+ "lstrip": false,
488
+ "normalized": false,
489
+ "rstrip": false,
490
+ "single_word": false,
491
+ "special": true
492
+ },
493
+ "156952": {
494
+ "content": "<|reserved_token_57|>",
495
+ "lstrip": false,
496
+ "normalized": false,
497
+ "rstrip": false,
498
+ "single_word": false,
499
+ "special": true
500
+ },
501
+ "156953": {
502
+ "content": "<|reserved_token_58|>",
503
+ "lstrip": false,
504
+ "normalized": false,
505
+ "rstrip": false,
506
+ "single_word": false,
507
+ "special": true
508
+ },
509
+ "156954": {
510
+ "content": "<|reserved_token_59|>",
511
+ "lstrip": false,
512
+ "normalized": false,
513
+ "rstrip": false,
514
+ "single_word": false,
515
+ "special": true
516
+ },
517
+ "156955": {
518
+ "content": "<|reserved_token_60|>",
519
+ "lstrip": false,
520
+ "normalized": false,
521
+ "rstrip": false,
522
+ "single_word": false,
523
+ "special": true
524
+ },
525
+ "156956": {
526
+ "content": "<|reserved_token_61|>",
527
+ "lstrip": false,
528
+ "normalized": false,
529
+ "rstrip": false,
530
+ "single_word": false,
531
+ "special": true
532
+ },
533
+ "156957": {
534
+ "content": "<|reserved_token_62|>",
535
+ "lstrip": false,
536
+ "normalized": false,
537
+ "rstrip": false,
538
+ "single_word": false,
539
+ "special": true
540
+ },
541
+ "156958": {
542
+ "content": "<|reserved_token_63|>",
543
+ "lstrip": false,
544
+ "normalized": false,
545
+ "rstrip": false,
546
+ "single_word": false,
547
+ "special": true
548
+ },
549
+ "156959": {
550
+ "content": "<|reserved_token_64|>",
551
+ "lstrip": false,
552
+ "normalized": false,
553
+ "rstrip": false,
554
+ "single_word": false,
555
+ "special": true
556
+ },
557
+ "156960": {
558
+ "content": "<|reserved_token_65|>",
559
+ "lstrip": false,
560
+ "normalized": false,
561
+ "rstrip": false,
562
+ "single_word": false,
563
+ "special": true
564
+ },
565
+ "156961": {
566
+ "content": "<|reserved_token_66|>",
567
+ "lstrip": false,
568
+ "normalized": false,
569
+ "rstrip": false,
570
+ "single_word": false,
571
+ "special": true
572
+ },
573
+ "156962": {
574
+ "content": "<|reserved_token_67|>",
575
+ "lstrip": false,
576
+ "normalized": false,
577
+ "rstrip": false,
578
+ "single_word": false,
579
+ "special": true
580
+ },
581
+ "156963": {
582
+ "content": "<|reserved_token_68|>",
583
+ "lstrip": false,
584
+ "normalized": false,
585
+ "rstrip": false,
586
+ "single_word": false,
587
+ "special": true
588
+ },
589
+ "156964": {
590
+ "content": "<|reserved_token_69|>",
591
+ "lstrip": false,
592
+ "normalized": false,
593
+ "rstrip": false,
594
+ "single_word": false,
595
+ "special": true
596
+ },
597
+ "156965": {
598
+ "content": "<|reserved_token_70|>",
599
+ "lstrip": false,
600
+ "normalized": false,
601
+ "rstrip": false,
602
+ "single_word": false,
603
+ "special": true
604
+ },
605
+ "156966": {
606
+ "content": "<|reserved_token_71|>",
607
+ "lstrip": false,
608
+ "normalized": false,
609
+ "rstrip": false,
610
+ "single_word": false,
611
+ "special": true
612
+ },
613
+ "156967": {
614
+ "content": "<|reserved_token_72|>",
615
+ "lstrip": false,
616
+ "normalized": false,
617
+ "rstrip": false,
618
+ "single_word": false,
619
+ "special": true
620
+ },
621
+ "156968": {
622
+ "content": "<|reserved_token_73|>",
623
+ "lstrip": false,
624
+ "normalized": false,
625
+ "rstrip": false,
626
+ "single_word": false,
627
+ "special": true
628
+ },
629
+ "156969": {
630
+ "content": "<|reserved_token_74|>",
631
+ "lstrip": false,
632
+ "normalized": false,
633
+ "rstrip": false,
634
+ "single_word": false,
635
+ "special": true
636
+ },
637
+ "156970": {
638
+ "content": "<|reserved_token_75|>",
639
+ "lstrip": false,
640
+ "normalized": false,
641
+ "rstrip": false,
642
+ "single_word": false,
643
+ "special": true
644
+ },
645
+ "156971": {
646
+ "content": "<|reserved_token_76|>",
647
+ "lstrip": false,
648
+ "normalized": false,
649
+ "rstrip": false,
650
+ "single_word": false,
651
+ "special": true
652
+ },
653
+ "156972": {
654
+ "content": "<|reserved_token_77|>",
655
+ "lstrip": false,
656
+ "normalized": false,
657
+ "rstrip": false,
658
+ "single_word": false,
659
+ "special": true
660
+ },
661
+ "156973": {
662
+ "content": "<|reserved_token_78|>",
663
+ "lstrip": false,
664
+ "normalized": false,
665
+ "rstrip": false,
666
+ "single_word": false,
667
+ "special": true
668
+ },
669
+ "156974": {
670
+ "content": "<|reserved_token_79|>",
671
+ "lstrip": false,
672
+ "normalized": false,
673
+ "rstrip": false,
674
+ "single_word": false,
675
+ "special": true
676
+ },
677
+ "156975": {
678
+ "content": "<|reserved_token_80|>",
679
+ "lstrip": false,
680
+ "normalized": false,
681
+ "rstrip": false,
682
+ "single_word": false,
683
+ "special": true
684
+ },
685
+ "156976": {
686
+ "content": "<|reserved_token_81|>",
687
+ "lstrip": false,
688
+ "normalized": false,
689
+ "rstrip": false,
690
+ "single_word": false,
691
+ "special": true
692
+ },
693
+ "156977": {
694
+ "content": "<|reserved_token_82|>",
695
+ "lstrip": false,
696
+ "normalized": false,
697
+ "rstrip": false,
698
+ "single_word": false,
699
+ "special": true
700
+ },
701
+ "156978": {
702
+ "content": "<|reserved_token_83|>",
703
+ "lstrip": false,
704
+ "normalized": false,
705
+ "rstrip": false,
706
+ "single_word": false,
707
+ "special": true
708
+ },
709
+ "156979": {
710
+ "content": "<|reserved_token_84|>",
711
+ "lstrip": false,
712
+ "normalized": false,
713
+ "rstrip": false,
714
+ "single_word": false,
715
+ "special": true
716
+ },
717
+ "156980": {
718
+ "content": "<|reserved_token_85|>",
719
+ "lstrip": false,
720
+ "normalized": false,
721
+ "rstrip": false,
722
+ "single_word": false,
723
+ "special": true
724
+ },
725
+ "156981": {
726
+ "content": "<|reserved_token_86|>",
727
+ "lstrip": false,
728
+ "normalized": false,
729
+ "rstrip": false,
730
+ "single_word": false,
731
+ "special": true
732
+ },
733
+ "156982": {
734
+ "content": "<|reserved_token_87|>",
735
+ "lstrip": false,
736
+ "normalized": false,
737
+ "rstrip": false,
738
+ "single_word": false,
739
+ "special": true
740
+ },
741
+ "156983": {
742
+ "content": "<|reserved_token_88|>",
743
+ "lstrip": false,
744
+ "normalized": false,
745
+ "rstrip": false,
746
+ "single_word": false,
747
+ "special": true
748
+ },
749
+ "156984": {
750
+ "content": "<|reserved_token_89|>",
751
+ "lstrip": false,
752
+ "normalized": false,
753
+ "rstrip": false,
754
+ "single_word": false,
755
+ "special": true
756
+ },
757
+ "156985": {
758
+ "content": "<|reserved_token_90|>",
759
+ "lstrip": false,
760
+ "normalized": false,
761
+ "rstrip": false,
762
+ "single_word": false,
763
+ "special": true
764
+ },
765
+ "156986": {
766
+ "content": "<|reserved_token_91|>",
767
+ "lstrip": false,
768
+ "normalized": false,
769
+ "rstrip": false,
770
+ "single_word": false,
771
+ "special": true
772
+ },
773
+ "156987": {
774
+ "content": "<|reserved_token_92|>",
775
+ "lstrip": false,
776
+ "normalized": false,
777
+ "rstrip": false,
778
+ "single_word": false,
779
+ "special": true
780
+ },
781
+ "156988": {
782
+ "content": "<|reserved_token_93|>",
783
+ "lstrip": false,
784
+ "normalized": false,
785
+ "rstrip": false,
786
+ "single_word": false,
787
+ "special": true
788
+ },
789
+ "156989": {
790
+ "content": "<|reserved_token_94|>",
791
+ "lstrip": false,
792
+ "normalized": false,
793
+ "rstrip": false,
794
+ "single_word": false,
795
+ "special": true
796
+ },
797
+ "156990": {
798
+ "content": "<|reserved_token_95|>",
799
+ "lstrip": false,
800
+ "normalized": false,
801
+ "rstrip": false,
802
+ "single_word": false,
803
+ "special": true
804
+ },
805
+ "156991": {
806
+ "content": "<|reserved_token_96|>",
807
+ "lstrip": false,
808
+ "normalized": false,
809
+ "rstrip": false,
810
+ "single_word": false,
811
+ "special": true
812
+ },
813
+ "156992": {
814
+ "content": "<|reserved_token_97|>",
815
+ "lstrip": false,
816
+ "normalized": false,
817
+ "rstrip": false,
818
+ "single_word": false,
819
+ "special": true
820
+ },
821
+ "156993": {
822
+ "content": "<|reserved_token_98|>",
823
+ "lstrip": false,
824
+ "normalized": false,
825
+ "rstrip": false,
826
+ "single_word": false,
827
+ "special": true
828
+ },
829
+ "156994": {
830
+ "content": "<|reserved_token_99|>",
831
+ "lstrip": false,
832
+ "normalized": false,
833
+ "rstrip": false,
834
+ "single_word": false,
835
+ "special": true
836
+ },
837
+ "156995": {
838
+ "content": "<|reserved_token_100|>",
839
+ "lstrip": false,
840
+ "normalized": false,
841
+ "rstrip": false,
842
+ "single_word": false,
843
+ "special": true
844
+ },
845
+ "156996": {
846
+ "content": "<|reserved_token_101|>",
847
+ "lstrip": false,
848
+ "normalized": false,
849
+ "rstrip": false,
850
+ "single_word": false,
851
+ "special": true
852
+ },
853
+ "156997": {
854
+ "content": "<|reserved_token_102|>",
855
+ "lstrip": false,
856
+ "normalized": false,
857
+ "rstrip": false,
858
+ "single_word": false,
859
+ "special": true
860
+ },
861
+ "156998": {
862
+ "content": "<|reserved_token_103|>",
863
+ "lstrip": false,
864
+ "normalized": false,
865
+ "rstrip": false,
866
+ "single_word": false,
867
+ "special": true
868
+ },
869
+ "156999": {
870
+ "content": "<|reserved_token_104|>",
871
+ "lstrip": false,
872
+ "normalized": false,
873
+ "rstrip": false,
874
+ "single_word": false,
875
+ "special": true
876
+ },
877
+ "157000": {
878
+ "content": "<|reserved_token_105|>",
879
+ "lstrip": false,
880
+ "normalized": false,
881
+ "rstrip": false,
882
+ "single_word": false,
883
+ "special": true
884
+ },
885
+ "157001": {
886
+ "content": "<|reserved_token_106|>",
887
+ "lstrip": false,
888
+ "normalized": false,
889
+ "rstrip": false,
890
+ "single_word": false,
891
+ "special": true
892
+ },
893
+ "157002": {
894
+ "content": "<|reserved_token_107|>",
895
+ "lstrip": false,
896
+ "normalized": false,
897
+ "rstrip": false,
898
+ "single_word": false,
899
+ "special": true
900
+ },
901
+ "157003": {
902
+ "content": "<|reserved_token_108|>",
903
+ "lstrip": false,
904
+ "normalized": false,
905
+ "rstrip": false,
906
+ "single_word": false,
907
+ "special": true
908
+ },
909
+ "157004": {
910
+ "content": "<|reserved_token_109|>",
911
+ "lstrip": false,
912
+ "normalized": false,
913
+ "rstrip": false,
914
+ "single_word": false,
915
+ "special": true
916
+ },
917
+ "157005": {
918
+ "content": "<|reserved_token_110|>",
919
+ "lstrip": false,
920
+ "normalized": false,
921
+ "rstrip": false,
922
+ "single_word": false,
923
+ "special": true
924
+ },
925
+ "157006": {
926
+ "content": "<|reserved_token_111|>",
927
+ "lstrip": false,
928
+ "normalized": false,
929
+ "rstrip": false,
930
+ "single_word": false,
931
+ "special": true
932
+ },
933
+ "157007": {
934
+ "content": "<|reserved_token_112|>",
935
+ "lstrip": false,
936
+ "normalized": false,
937
+ "rstrip": false,
938
+ "single_word": false,
939
+ "special": true
940
+ },
941
+ "157008": {
942
+ "content": "<|reserved_token_113|>",
943
+ "lstrip": false,
944
+ "normalized": false,
945
+ "rstrip": false,
946
+ "single_word": false,
947
+ "special": true
948
+ },
949
+ "157009": {
950
+ "content": "<|reserved_token_114|>",
951
+ "lstrip": false,
952
+ "normalized": false,
953
+ "rstrip": false,
954
+ "single_word": false,
955
+ "special": true
956
+ },
957
+ "157010": {
958
+ "content": "<|reserved_token_115|>",
959
+ "lstrip": false,
960
+ "normalized": false,
961
+ "rstrip": false,
962
+ "single_word": false,
963
+ "special": true
964
+ },
965
+ "157011": {
966
+ "content": "<|reserved_token_116|>",
967
+ "lstrip": false,
968
+ "normalized": false,
969
+ "rstrip": false,
970
+ "single_word": false,
971
+ "special": true
972
+ },
973
+ "157012": {
974
+ "content": "<|reserved_token_117|>",
975
+ "lstrip": false,
976
+ "normalized": false,
977
+ "rstrip": false,
978
+ "single_word": false,
979
+ "special": true
980
+ },
981
+ "157013": {
982
+ "content": "<|reserved_token_118|>",
983
+ "lstrip": false,
984
+ "normalized": false,
985
+ "rstrip": false,
986
+ "single_word": false,
987
+ "special": true
988
+ },
989
+ "157014": {
990
+ "content": "<|reserved_token_119|>",
991
+ "lstrip": false,
992
+ "normalized": false,
993
+ "rstrip": false,
994
+ "single_word": false,
995
+ "special": true
996
+ },
997
+ "157015": {
998
+ "content": "<|reserved_token_120|>",
999
+ "lstrip": false,
1000
+ "normalized": false,
1001
+ "rstrip": false,
1002
+ "single_word": false,
1003
+ "special": true
1004
+ },
1005
+ "157016": {
1006
+ "content": "<|reserved_token_121|>",
1007
+ "lstrip": false,
1008
+ "normalized": false,
1009
+ "rstrip": false,
1010
+ "single_word": false,
1011
+ "special": true
1012
+ },
1013
+ "157017": {
1014
+ "content": "<|reserved_token_122|>",
1015
+ "lstrip": false,
1016
+ "normalized": false,
1017
+ "rstrip": false,
1018
+ "single_word": false,
1019
+ "special": true
1020
+ },
1021
+ "157018": {
1022
+ "content": "<|reserved_token_123|>",
1023
+ "lstrip": false,
1024
+ "normalized": false,
1025
+ "rstrip": false,
1026
+ "single_word": false,
1027
+ "special": true
1028
+ },
1029
+ "157019": {
1030
+ "content": "<|reserved_token_124|>",
1031
+ "lstrip": false,
1032
+ "normalized": false,
1033
+ "rstrip": false,
1034
+ "single_word": false,
1035
+ "special": true
1036
+ },
1037
+ "157020": {
1038
+ "content": "<|reserved_token_125|>",
1039
+ "lstrip": false,
1040
+ "normalized": false,
1041
+ "rstrip": false,
1042
+ "single_word": false,
1043
+ "special": true
1044
+ },
1045
+ "157021": {
1046
+ "content": "<|reserved_token_126|>",
1047
+ "lstrip": false,
1048
+ "normalized": false,
1049
+ "rstrip": false,
1050
+ "single_word": false,
1051
+ "special": true
1052
+ },
1053
+ "157022": {
1054
+ "content": "<|reserved_token_127|>",
1055
+ "lstrip": false,
1056
+ "normalized": false,
1057
+ "rstrip": false,
1058
+ "single_word": false,
1059
+ "special": true
1060
+ },
1061
+ "157023": {
1062
+ "content": "<|reserved_token_128|>",
1063
+ "lstrip": false,
1064
+ "normalized": false,
1065
+ "rstrip": false,
1066
+ "single_word": false,
1067
+ "special": true
1068
+ },
1069
+ "157024": {
1070
+ "content": "<|reserved_token_129|>",
1071
+ "lstrip": false,
1072
+ "normalized": false,
1073
+ "rstrip": false,
1074
+ "single_word": false,
1075
+ "special": true
1076
+ },
1077
+ "157025": {
1078
+ "content": "<|reserved_token_130|>",
1079
+ "lstrip": false,
1080
+ "normalized": false,
1081
+ "rstrip": false,
1082
+ "single_word": false,
1083
+ "special": true
1084
+ },
1085
+ "157026": {
1086
+ "content": "<|reserved_token_131|>",
1087
+ "lstrip": false,
1088
+ "normalized": false,
1089
+ "rstrip": false,
1090
+ "single_word": false,
1091
+ "special": true
1092
+ },
1093
+ "157027": {
1094
+ "content": "<|reserved_token_132|>",
1095
+ "lstrip": false,
1096
+ "normalized": false,
1097
+ "rstrip": false,
1098
+ "single_word": false,
1099
+ "special": true
1100
+ },
1101
+ "157028": {
1102
+ "content": "<|reserved_token_133|>",
1103
+ "lstrip": false,
1104
+ "normalized": false,
1105
+ "rstrip": false,
1106
+ "single_word": false,
1107
+ "special": true
1108
+ },
1109
+ "157029": {
1110
+ "content": "<|reserved_token_134|>",
1111
+ "lstrip": false,
1112
+ "normalized": false,
1113
+ "rstrip": false,
1114
+ "single_word": false,
1115
+ "special": true
1116
+ },
1117
+ "157030": {
1118
+ "content": "<|reserved_token_135|>",
1119
+ "lstrip": false,
1120
+ "normalized": false,
1121
+ "rstrip": false,
1122
+ "single_word": false,
1123
+ "special": true
1124
+ },
1125
+ "157031": {
1126
+ "content": "<|reserved_token_136|>",
1127
+ "lstrip": false,
1128
+ "normalized": false,
1129
+ "rstrip": false,
1130
+ "single_word": false,
1131
+ "special": true
1132
+ },
1133
+ "157032": {
1134
+ "content": "<|reserved_token_137|>",
1135
+ "lstrip": false,
1136
+ "normalized": false,
1137
+ "rstrip": false,
1138
+ "single_word": false,
1139
+ "special": true
1140
+ },
1141
+ "157033": {
1142
+ "content": "<|reserved_token_138|>",
1143
+ "lstrip": false,
1144
+ "normalized": false,
1145
+ "rstrip": false,
1146
+ "single_word": false,
1147
+ "special": true
1148
+ },
1149
+ "157034": {
1150
+ "content": "<|reserved_token_139|>",
1151
+ "lstrip": false,
1152
+ "normalized": false,
1153
+ "rstrip": false,
1154
+ "single_word": false,
1155
+ "special": true
1156
+ },
1157
+ "157035": {
1158
+ "content": "<|reserved_token_140|>",
1159
+ "lstrip": false,
1160
+ "normalized": false,
1161
+ "rstrip": false,
1162
+ "single_word": false,
1163
+ "special": true
1164
+ },
1165
+ "157036": {
1166
+ "content": "<|reserved_token_141|>",
1167
+ "lstrip": false,
1168
+ "normalized": false,
1169
+ "rstrip": false,
1170
+ "single_word": false,
1171
+ "special": true
1172
+ },
1173
+ "157037": {
1174
+ "content": "<|reserved_token_142|>",
1175
+ "lstrip": false,
1176
+ "normalized": false,
1177
+ "rstrip": false,
1178
+ "single_word": false,
1179
+ "special": true
1180
+ },
1181
+ "157038": {
1182
+ "content": "<|reserved_token_143|>",
1183
+ "lstrip": false,
1184
+ "normalized": false,
1185
+ "rstrip": false,
1186
+ "single_word": false,
1187
+ "special": true
1188
+ },
1189
+ "157039": {
1190
+ "content": "<|reserved_token_144|>",
1191
+ "lstrip": false,
1192
+ "normalized": false,
1193
+ "rstrip": false,
1194
+ "single_word": false,
1195
+ "special": true
1196
+ },
1197
+ "157040": {
1198
+ "content": "<|reserved_token_145|>",
1199
+ "lstrip": false,
1200
+ "normalized": false,
1201
+ "rstrip": false,
1202
+ "single_word": false,
1203
+ "special": true
1204
+ },
1205
+ "157041": {
1206
+ "content": "<|reserved_token_146|>",
1207
+ "lstrip": false,
1208
+ "normalized": false,
1209
+ "rstrip": false,
1210
+ "single_word": false,
1211
+ "special": true
1212
+ },
1213
+ "157042": {
1214
+ "content": "<|reserved_token_147|>",
1215
+ "lstrip": false,
1216
+ "normalized": false,
1217
+ "rstrip": false,
1218
+ "single_word": false,
1219
+ "special": true
1220
+ },
1221
+ "157043": {
1222
+ "content": "<|reserved_token_148|>",
1223
+ "lstrip": false,
1224
+ "normalized": false,
1225
+ "rstrip": false,
1226
+ "single_word": false,
1227
+ "special": true
1228
+ },
1229
+ "157044": {
1230
+ "content": "<|reserved_token_149|>",
1231
+ "lstrip": false,
1232
+ "normalized": false,
1233
+ "rstrip": false,
1234
+ "single_word": false,
1235
+ "special": true
1236
+ },
1237
+ "157045": {
1238
+ "content": "<|reserved_token_150|>",
1239
+ "lstrip": false,
1240
+ "normalized": false,
1241
+ "rstrip": false,
1242
+ "single_word": false,
1243
+ "special": true
1244
+ },
1245
+ "157046": {
1246
+ "content": "<|reserved_token_151|>",
1247
+ "lstrip": false,
1248
+ "normalized": false,
1249
+ "rstrip": false,
1250
+ "single_word": false,
1251
+ "special": true
1252
+ },
1253
+ "157047": {
1254
+ "content": "<|reserved_token_152|>",
1255
+ "lstrip": false,
1256
+ "normalized": false,
1257
+ "rstrip": false,
1258
+ "single_word": false,
1259
+ "special": true
1260
+ },
1261
+ "157048": {
1262
+ "content": "<|reserved_token_153|>",
1263
+ "lstrip": false,
1264
+ "normalized": false,
1265
+ "rstrip": false,
1266
+ "single_word": false,
1267
+ "special": true
1268
+ },
1269
+ "157049": {
1270
+ "content": "<|reserved_token_154|>",
1271
+ "lstrip": false,
1272
+ "normalized": false,
1273
+ "rstrip": false,
1274
+ "single_word": false,
1275
+ "special": true
1276
+ },
1277
+ "157050": {
1278
+ "content": "<|reserved_token_155|>",
1279
+ "lstrip": false,
1280
+ "normalized": false,
1281
+ "rstrip": false,
1282
+ "single_word": false,
1283
+ "special": true
1284
+ },
1285
+ "157051": {
1286
+ "content": "<|reserved_token_156|>",
1287
+ "lstrip": false,
1288
+ "normalized": false,
1289
+ "rstrip": false,
1290
+ "single_word": false,
1291
+ "special": true
1292
+ },
1293
+ "157052": {
1294
+ "content": "<|reserved_token_157|>",
1295
+ "lstrip": false,
1296
+ "normalized": false,
1297
+ "rstrip": false,
1298
+ "single_word": false,
1299
+ "special": true
1300
+ },
1301
+ "157053": {
1302
+ "content": "<|reserved_token_158|>",
1303
+ "lstrip": false,
1304
+ "normalized": false,
1305
+ "rstrip": false,
1306
+ "single_word": false,
1307
+ "special": true
1308
+ },
1309
+ "157054": {
1310
+ "content": "<|reserved_token_159|>",
1311
+ "lstrip": false,
1312
+ "normalized": false,
1313
+ "rstrip": false,
1314
+ "single_word": false,
1315
+ "special": true
1316
+ },
1317
+ "157055": {
1318
+ "content": "<|reserved_token_160|>",
1319
+ "lstrip": false,
1320
+ "normalized": false,
1321
+ "rstrip": false,
1322
+ "single_word": false,
1323
+ "special": true
1324
+ },
1325
+ "157056": {
1326
+ "content": "<|reserved_token_161|>",
1327
+ "lstrip": false,
1328
+ "normalized": false,
1329
+ "rstrip": false,
1330
+ "single_word": false,
1331
+ "special": true
1332
+ },
1333
+ "157057": {
1334
+ "content": "<|reserved_token_162|>",
1335
+ "lstrip": false,
1336
+ "normalized": false,
1337
+ "rstrip": false,
1338
+ "single_word": false,
1339
+ "special": true
1340
+ },
1341
+ "157058": {
1342
+ "content": "<|reserved_token_163|>",
1343
+ "lstrip": false,
1344
+ "normalized": false,
1345
+ "rstrip": false,
1346
+ "single_word": false,
1347
+ "special": true
1348
+ },
1349
+ "157059": {
1350
+ "content": "<|reserved_token_164|>",
1351
+ "lstrip": false,
1352
+ "normalized": false,
1353
+ "rstrip": false,
1354
+ "single_word": false,
1355
+ "special": true
1356
+ },
1357
+ "157060": {
1358
+ "content": "<|reserved_token_165|>",
1359
+ "lstrip": false,
1360
+ "normalized": false,
1361
+ "rstrip": false,
1362
+ "single_word": false,
1363
+ "special": true
1364
+ },
1365
+ "157061": {
1366
+ "content": "<|reserved_token_166|>",
1367
+ "lstrip": false,
1368
+ "normalized": false,
1369
+ "rstrip": false,
1370
+ "single_word": false,
1371
+ "special": true
1372
+ },
1373
+ "157062": {
1374
+ "content": "<|reserved_token_167|>",
1375
+ "lstrip": false,
1376
+ "normalized": false,
1377
+ "rstrip": false,
1378
+ "single_word": false,
1379
+ "special": true
1380
+ },
1381
+ "157063": {
1382
+ "content": "<|reserved_token_168|>",
1383
+ "lstrip": false,
1384
+ "normalized": false,
1385
+ "rstrip": false,
1386
+ "single_word": false,
1387
+ "special": true
1388
+ },
1389
+ "157064": {
1390
+ "content": "<|reserved_token_169|>",
1391
+ "lstrip": false,
1392
+ "normalized": false,
1393
+ "rstrip": false,
1394
+ "single_word": false,
1395
+ "special": true
1396
+ },
1397
+ "157065": {
1398
+ "content": "<|reserved_token_170|>",
1399
+ "lstrip": false,
1400
+ "normalized": false,
1401
+ "rstrip": false,
1402
+ "single_word": false,
1403
+ "special": true
1404
+ },
1405
+ "157066": {
1406
+ "content": "<|reserved_token_171|>",
1407
+ "lstrip": false,
1408
+ "normalized": false,
1409
+ "rstrip": false,
1410
+ "single_word": false,
1411
+ "special": true
1412
+ },
1413
+ "157067": {
1414
+ "content": "<|reserved_token_172|>",
1415
+ "lstrip": false,
1416
+ "normalized": false,
1417
+ "rstrip": false,
1418
+ "single_word": false,
1419
+ "special": true
1420
+ },
1421
+ "157068": {
1422
+ "content": "<|reserved_token_173|>",
1423
+ "lstrip": false,
1424
+ "normalized": false,
1425
+ "rstrip": false,
1426
+ "single_word": false,
1427
+ "special": true
1428
+ },
1429
+ "157069": {
1430
+ "content": "<|reserved_token_174|>",
1431
+ "lstrip": false,
1432
+ "normalized": false,
1433
+ "rstrip": false,
1434
+ "single_word": false,
1435
+ "special": true
1436
+ },
1437
+ "157070": {
1438
+ "content": "<|reserved_token_175|>",
1439
+ "lstrip": false,
1440
+ "normalized": false,
1441
+ "rstrip": false,
1442
+ "single_word": false,
1443
+ "special": true
1444
+ },
1445
+ "157071": {
1446
+ "content": "<|reserved_token_176|>",
1447
+ "lstrip": false,
1448
+ "normalized": false,
1449
+ "rstrip": false,
1450
+ "single_word": false,
1451
+ "special": true
1452
+ },
1453
+ "157072": {
1454
+ "content": "<|reserved_token_177|>",
1455
+ "lstrip": false,
1456
+ "normalized": false,
1457
+ "rstrip": false,
1458
+ "single_word": false,
1459
+ "special": true
1460
+ },
1461
+ "157073": {
1462
+ "content": "<|reserved_token_178|>",
1463
+ "lstrip": false,
1464
+ "normalized": false,
1465
+ "rstrip": false,
1466
+ "single_word": false,
1467
+ "special": true
1468
+ },
1469
+ "157074": {
1470
+ "content": "<|reserved_token_179|>",
1471
+ "lstrip": false,
1472
+ "normalized": false,
1473
+ "rstrip": false,
1474
+ "single_word": false,
1475
+ "special": true
1476
+ },
1477
+ "157075": {
1478
+ "content": "<|reserved_token_180|>",
1479
+ "lstrip": false,
1480
+ "normalized": false,
1481
+ "rstrip": false,
1482
+ "single_word": false,
1483
+ "special": true
1484
+ },
1485
+ "157076": {
1486
+ "content": "<|reserved_token_181|>",
1487
+ "lstrip": false,
1488
+ "normalized": false,
1489
+ "rstrip": false,
1490
+ "single_word": false,
1491
+ "special": true
1492
+ },
1493
+ "157077": {
1494
+ "content": "<|reserved_token_182|>",
1495
+ "lstrip": false,
1496
+ "normalized": false,
1497
+ "rstrip": false,
1498
+ "single_word": false,
1499
+ "special": true
1500
+ },
1501
+ "157078": {
1502
+ "content": "<|reserved_token_183|>",
1503
+ "lstrip": false,
1504
+ "normalized": false,
1505
+ "rstrip": false,
1506
+ "single_word": false,
1507
+ "special": true
1508
+ },
1509
+ "157079": {
1510
+ "content": "<|reserved_token_184|>",
1511
+ "lstrip": false,
1512
+ "normalized": false,
1513
+ "rstrip": false,
1514
+ "single_word": false,
1515
+ "special": true
1516
+ },
1517
+ "157080": {
1518
+ "content": "<|reserved_token_185|>",
1519
+ "lstrip": false,
1520
+ "normalized": false,
1521
+ "rstrip": false,
1522
+ "single_word": false,
1523
+ "special": true
1524
+ },
1525
+ "157081": {
1526
+ "content": "<|reserved_token_186|>",
1527
+ "lstrip": false,
1528
+ "normalized": false,
1529
+ "rstrip": false,
1530
+ "single_word": false,
1531
+ "special": true
1532
+ },
1533
+ "157082": {
1534
+ "content": "<|reserved_token_187|>",
1535
+ "lstrip": false,
1536
+ "normalized": false,
1537
+ "rstrip": false,
1538
+ "single_word": false,
1539
+ "special": true
1540
+ },
1541
+ "157083": {
1542
+ "content": "<|reserved_token_188|>",
1543
+ "lstrip": false,
1544
+ "normalized": false,
1545
+ "rstrip": false,
1546
+ "single_word": false,
1547
+ "special": true
1548
+ },
1549
+ "157084": {
1550
+ "content": "<|reserved_token_189|>",
1551
+ "lstrip": false,
1552
+ "normalized": false,
1553
+ "rstrip": false,
1554
+ "single_word": false,
1555
+ "special": true
1556
+ },
1557
+ "157085": {
1558
+ "content": "<|reserved_token_190|>",
1559
+ "lstrip": false,
1560
+ "normalized": false,
1561
+ "rstrip": false,
1562
+ "single_word": false,
1563
+ "special": true
1564
+ },
1565
+ "157086": {
1566
+ "content": "<|reserved_token_191|>",
1567
+ "lstrip": false,
1568
+ "normalized": false,
1569
+ "rstrip": false,
1570
+ "single_word": false,
1571
+ "special": true
1572
+ },
1573
+ "157087": {
1574
+ "content": "<|reserved_token_192|>",
1575
+ "lstrip": false,
1576
+ "normalized": false,
1577
+ "rstrip": false,
1578
+ "single_word": false,
1579
+ "special": true
1580
+ },
1581
+ "157088": {
1582
+ "content": "<|reserved_token_193|>",
1583
+ "lstrip": false,
1584
+ "normalized": false,
1585
+ "rstrip": false,
1586
+ "single_word": false,
1587
+ "special": true
1588
+ },
1589
+ "157089": {
1590
+ "content": "<|reserved_token_194|>",
1591
+ "lstrip": false,
1592
+ "normalized": false,
1593
+ "rstrip": false,
1594
+ "single_word": false,
1595
+ "special": true
1596
+ },
1597
+ "157090": {
1598
+ "content": "<|reserved_token_195|>",
1599
+ "lstrip": false,
1600
+ "normalized": false,
1601
+ "rstrip": false,
1602
+ "single_word": false,
1603
+ "special": true
1604
+ },
1605
+ "157091": {
1606
+ "content": "<|reserved_token_196|>",
1607
+ "lstrip": false,
1608
+ "normalized": false,
1609
+ "rstrip": false,
1610
+ "single_word": false,
1611
+ "special": true
1612
+ },
1613
+ "157092": {
1614
+ "content": "<|reserved_token_197|>",
1615
+ "lstrip": false,
1616
+ "normalized": false,
1617
+ "rstrip": false,
1618
+ "single_word": false,
1619
+ "special": true
1620
+ },
1621
+ "157093": {
1622
+ "content": "<|reserved_token_198|>",
1623
+ "lstrip": false,
1624
+ "normalized": false,
1625
+ "rstrip": false,
1626
+ "single_word": false,
1627
+ "special": true
1628
+ },
1629
+ "157094": {
1630
+ "content": "<|reserved_token_199|>",
1631
+ "lstrip": false,
1632
+ "normalized": false,
1633
+ "rstrip": false,
1634
+ "single_word": false,
1635
+ "special": true
1636
+ },
1637
+ "157095": {
1638
+ "content": "<|reserved_token_200|>",
1639
+ "lstrip": false,
1640
+ "normalized": false,
1641
+ "rstrip": false,
1642
+ "single_word": false,
1643
+ "special": true
1644
+ },
1645
+ "157096": {
1646
+ "content": "<|reserved_token_201|>",
1647
+ "lstrip": false,
1648
+ "normalized": false,
1649
+ "rstrip": false,
1650
+ "single_word": false,
1651
+ "special": true
1652
+ },
1653
+ "157097": {
1654
+ "content": "<|reserved_token_202|>",
1655
+ "lstrip": false,
1656
+ "normalized": false,
1657
+ "rstrip": false,
1658
+ "single_word": false,
1659
+ "special": true
1660
+ },
1661
+ "157098": {
1662
+ "content": "<|reserved_token_203|>",
1663
+ "lstrip": false,
1664
+ "normalized": false,
1665
+ "rstrip": false,
1666
+ "single_word": false,
1667
+ "special": true
1668
+ },
1669
+ "157099": {
1670
+ "content": "<|reserved_token_204|>",
1671
+ "lstrip": false,
1672
+ "normalized": false,
1673
+ "rstrip": false,
1674
+ "single_word": false,
1675
+ "special": true
1676
+ },
1677
+ "157100": {
1678
+ "content": "<|reserved_token_205|>",
1679
+ "lstrip": false,
1680
+ "normalized": false,
1681
+ "rstrip": false,
1682
+ "single_word": false,
1683
+ "special": true
1684
+ },
1685
+ "157101": {
1686
+ "content": "<|reserved_token_206|>",
1687
+ "lstrip": false,
1688
+ "normalized": false,
1689
+ "rstrip": false,
1690
+ "single_word": false,
1691
+ "special": true
1692
+ },
1693
+ "157102": {
1694
+ "content": "<|reserved_token_207|>",
1695
+ "lstrip": false,
1696
+ "normalized": false,
1697
+ "rstrip": false,
1698
+ "single_word": false,
1699
+ "special": true
1700
+ },
1701
+ "157103": {
1702
+ "content": "<|reserved_token_208|>",
1703
+ "lstrip": false,
1704
+ "normalized": false,
1705
+ "rstrip": false,
1706
+ "single_word": false,
1707
+ "special": true
1708
+ },
1709
+ "157104": {
1710
+ "content": "<|reserved_token_209|>",
1711
+ "lstrip": false,
1712
+ "normalized": false,
1713
+ "rstrip": false,
1714
+ "single_word": false,
1715
+ "special": true
1716
+ },
1717
+ "157105": {
1718
+ "content": "<|reserved_token_210|>",
1719
+ "lstrip": false,
1720
+ "normalized": false,
1721
+ "rstrip": false,
1722
+ "single_word": false,
1723
+ "special": true
1724
+ },
1725
+ "157106": {
1726
+ "content": "<|reserved_token_211|>",
1727
+ "lstrip": false,
1728
+ "normalized": false,
1729
+ "rstrip": false,
1730
+ "single_word": false,
1731
+ "special": true
1732
+ },
1733
+ "157107": {
1734
+ "content": "<|reserved_token_212|>",
1735
+ "lstrip": false,
1736
+ "normalized": false,
1737
+ "rstrip": false,
1738
+ "single_word": false,
1739
+ "special": true
1740
+ },
1741
+ "157108": {
1742
+ "content": "<|reserved_token_213|>",
1743
+ "lstrip": false,
1744
+ "normalized": false,
1745
+ "rstrip": false,
1746
+ "single_word": false,
1747
+ "special": true
1748
+ },
1749
+ "157109": {
1750
+ "content": "<|reserved_token_214|>",
1751
+ "lstrip": false,
1752
+ "normalized": false,
1753
+ "rstrip": false,
1754
+ "single_word": false,
1755
+ "special": true
1756
+ },
1757
+ "157110": {
1758
+ "content": "<|reserved_token_215|>",
1759
+ "lstrip": false,
1760
+ "normalized": false,
1761
+ "rstrip": false,
1762
+ "single_word": false,
1763
+ "special": true
1764
+ },
1765
+ "157111": {
1766
+ "content": "<|reserved_token_216|>",
1767
+ "lstrip": false,
1768
+ "normalized": false,
1769
+ "rstrip": false,
1770
+ "single_word": false,
1771
+ "special": true
1772
+ },
1773
+ "157112": {
1774
+ "content": "<|reserved_token_217|>",
1775
+ "lstrip": false,
1776
+ "normalized": false,
1777
+ "rstrip": false,
1778
+ "single_word": false,
1779
+ "special": true
1780
+ },
1781
+ "157113": {
1782
+ "content": "<|reserved_token_218|>",
1783
+ "lstrip": false,
1784
+ "normalized": false,
1785
+ "rstrip": false,
1786
+ "single_word": false,
1787
+ "special": true
1788
+ },
1789
+ "157114": {
1790
+ "content": "<|reserved_token_219|>",
1791
+ "lstrip": false,
1792
+ "normalized": false,
1793
+ "rstrip": false,
1794
+ "single_word": false,
1795
+ "special": true
1796
+ },
1797
+ "157115": {
1798
+ "content": "<|reserved_token_220|>",
1799
+ "lstrip": false,
1800
+ "normalized": false,
1801
+ "rstrip": false,
1802
+ "single_word": false,
1803
+ "special": true
1804
+ },
1805
+ "157116": {
1806
+ "content": "<|reserved_token_221|>",
1807
+ "lstrip": false,
1808
+ "normalized": false,
1809
+ "rstrip": false,
1810
+ "single_word": false,
1811
+ "special": true
1812
+ },
1813
+ "157117": {
1814
+ "content": "<|reserved_token_222|>",
1815
+ "lstrip": false,
1816
+ "normalized": false,
1817
+ "rstrip": false,
1818
+ "single_word": false,
1819
+ "special": true
1820
+ },
1821
+ "157118": {
1822
+ "content": "<|reserved_token_223|>",
1823
+ "lstrip": false,
1824
+ "normalized": false,
1825
+ "rstrip": false,
1826
+ "single_word": false,
1827
+ "special": true
1828
+ },
1829
+ "157119": {
1830
+ "content": "<|reserved_token_224|>",
1831
+ "lstrip": false,
1832
+ "normalized": false,
1833
+ "rstrip": false,
1834
+ "single_word": false,
1835
+ "special": true
1836
+ },
1837
+ "157120": {
1838
+ "content": "<|reserved_token_225|>",
1839
+ "lstrip": false,
1840
+ "normalized": false,
1841
+ "rstrip": false,
1842
+ "single_word": false,
1843
+ "special": true
1844
+ },
1845
+ "157121": {
1846
+ "content": "<|reserved_token_226|>",
1847
+ "lstrip": false,
1848
+ "normalized": false,
1849
+ "rstrip": false,
1850
+ "single_word": false,
1851
+ "special": true
1852
+ },
1853
+ "157122": {
1854
+ "content": "<|reserved_token_227|>",
1855
+ "lstrip": false,
1856
+ "normalized": false,
1857
+ "rstrip": false,
1858
+ "single_word": false,
1859
+ "special": true
1860
+ },
1861
+ "157123": {
1862
+ "content": "<|reserved_token_228|>",
1863
+ "lstrip": false,
1864
+ "normalized": false,
1865
+ "rstrip": false,
1866
+ "single_word": false,
1867
+ "special": true
1868
+ },
1869
+ "157124": {
1870
+ "content": "<|reserved_token_229|>",
1871
+ "lstrip": false,
1872
+ "normalized": false,
1873
+ "rstrip": false,
1874
+ "single_word": false,
1875
+ "special": true
1876
+ },
1877
+ "157125": {
1878
+ "content": "<|reserved_token_230|>",
1879
+ "lstrip": false,
1880
+ "normalized": false,
1881
+ "rstrip": false,
1882
+ "single_word": false,
1883
+ "special": true
1884
+ },
1885
+ "157126": {
1886
+ "content": "<|reserved_token_231|>",
1887
+ "lstrip": false,
1888
+ "normalized": false,
1889
+ "rstrip": false,
1890
+ "single_word": false,
1891
+ "special": true
1892
+ },
1893
+ "157127": {
1894
+ "content": "<|reserved_token_232|>",
1895
+ "lstrip": false,
1896
+ "normalized": false,
1897
+ "rstrip": false,
1898
+ "single_word": false,
1899
+ "special": true
1900
+ },
1901
+ "157128": {
1902
+ "content": "<|reserved_token_233|>",
1903
+ "lstrip": false,
1904
+ "normalized": false,
1905
+ "rstrip": false,
1906
+ "single_word": false,
1907
+ "special": true
1908
+ },
1909
+ "157129": {
1910
+ "content": "<|reserved_token_234|>",
1911
+ "lstrip": false,
1912
+ "normalized": false,
1913
+ "rstrip": false,
1914
+ "single_word": false,
1915
+ "special": true
1916
+ },
1917
+ "157130": {
1918
+ "content": "<|reserved_token_235|>",
1919
+ "lstrip": false,
1920
+ "normalized": false,
1921
+ "rstrip": false,
1922
+ "single_word": false,
1923
+ "special": true
1924
+ },
1925
+ "157131": {
1926
+ "content": "<|reserved_token_236|>",
1927
+ "lstrip": false,
1928
+ "normalized": false,
1929
+ "rstrip": false,
1930
+ "single_word": false,
1931
+ "special": true
1932
+ },
1933
+ "157132": {
1934
+ "content": "<|reserved_token_237|>",
1935
+ "lstrip": false,
1936
+ "normalized": false,
1937
+ "rstrip": false,
1938
+ "single_word": false,
1939
+ "special": true
1940
+ },
1941
+ "157133": {
1942
+ "content": "<|reserved_token_238|>",
1943
+ "lstrip": false,
1944
+ "normalized": false,
1945
+ "rstrip": false,
1946
+ "single_word": false,
1947
+ "special": true
1948
+ },
1949
+ "157134": {
1950
+ "content": "<|reserved_token_239|>",
1951
+ "lstrip": false,
1952
+ "normalized": false,
1953
+ "rstrip": false,
1954
+ "single_word": false,
1955
+ "special": true
1956
+ },
1957
+ "157135": {
1958
+ "content": "<|reserved_token_240|>",
1959
+ "lstrip": false,
1960
+ "normalized": false,
1961
+ "rstrip": false,
1962
+ "single_word": false,
1963
+ "special": true
1964
+ },
1965
+ "157136": {
1966
+ "content": "<|reserved_token_241|>",
1967
+ "lstrip": false,
1968
+ "normalized": false,
1969
+ "rstrip": false,
1970
+ "single_word": false,
1971
+ "special": true
1972
+ },
1973
+ "157137": {
1974
+ "content": "<|reserved_token_242|>",
1975
+ "lstrip": false,
1976
+ "normalized": false,
1977
+ "rstrip": false,
1978
+ "single_word": false,
1979
+ "special": true
1980
+ },
1981
+ "157138": {
1982
+ "content": "<|reserved_token_243|>",
1983
+ "lstrip": false,
1984
+ "normalized": false,
1985
+ "rstrip": false,
1986
+ "single_word": false,
1987
+ "special": true
1988
+ },
1989
+ "157139": {
1990
+ "content": "<|reserved_token_244|>",
1991
+ "lstrip": false,
1992
+ "normalized": false,
1993
+ "rstrip": false,
1994
+ "single_word": false,
1995
+ "special": true
1996
+ },
1997
+ "157140": {
1998
+ "content": "<|reserved_token_245|>",
1999
+ "lstrip": false,
2000
+ "normalized": false,
2001
+ "rstrip": false,
2002
+ "single_word": false,
2003
+ "special": true
2004
+ },
2005
+ "157141": {
2006
+ "content": "<|reserved_token_246|>",
2007
+ "lstrip": false,
2008
+ "normalized": false,
2009
+ "rstrip": false,
2010
+ "single_word": false,
2011
+ "special": true
2012
+ },
2013
+ "157142": {
2014
+ "content": "<|reserved_token_247|>",
2015
+ "lstrip": false,
2016
+ "normalized": false,
2017
+ "rstrip": false,
2018
+ "single_word": false,
2019
+ "special": true
2020
+ },
2021
+ "157143": {
2022
+ "content": "<|reserved_token_248|>",
2023
+ "lstrip": false,
2024
+ "normalized": false,
2025
+ "rstrip": false,
2026
+ "single_word": false,
2027
+ "special": true
2028
+ },
2029
+ "157144": {
2030
+ "content": "<|reserved_token_249|>",
2031
+ "lstrip": false,
2032
+ "normalized": false,
2033
+ "rstrip": false,
2034
+ "single_word": false,
2035
+ "special": true
2036
+ },
2037
+ "157145": {
2038
+ "content": "<|reserved_token_250|>",
2039
+ "lstrip": false,
2040
+ "normalized": false,
2041
+ "rstrip": false,
2042
+ "single_word": false,
2043
+ "special": true
2044
+ },
2045
+ "157146": {
2046
+ "content": "<|reserved_token_251|>",
2047
+ "lstrip": false,
2048
+ "normalized": false,
2049
+ "rstrip": false,
2050
+ "single_word": false,
2051
+ "special": true
2052
+ },
2053
+ "157147": {
2054
+ "content": "<|reserved_token_252|>",
2055
+ "lstrip": false,
2056
+ "normalized": false,
2057
+ "rstrip": false,
2058
+ "single_word": false,
2059
+ "special": true
2060
+ },
2061
+ "157148": {
2062
+ "content": "<|reserved_token_253|>",
2063
+ "lstrip": false,
2064
+ "normalized": false,
2065
+ "rstrip": false,
2066
+ "single_word": false,
2067
+ "special": true
2068
+ },
2069
+ "157149": {
2070
+ "content": "<|reserved_token_254|>",
2071
+ "lstrip": false,
2072
+ "normalized": false,
2073
+ "rstrip": false,
2074
+ "single_word": false,
2075
+ "special": true
2076
+ },
2077
+ "157150": {
2078
+ "content": "<|reserved_token_255|>",
2079
+ "lstrip": false,
2080
+ "normalized": false,
2081
+ "rstrip": false,
2082
+ "single_word": false,
2083
+ "special": true
2084
+ },
2085
+ "157151": {
2086
+ "content": "<role>",
2087
+ "lstrip": false,
2088
+ "normalized": false,
2089
+ "rstrip": false,
2090
+ "single_word": false,
2091
+ "special": true
2092
+ },
2093
+ "157152": {
2094
+ "content": "</role>",
2095
+ "lstrip": false,
2096
+ "normalized": false,
2097
+ "rstrip": false,
2098
+ "single_word": false,
2099
+ "special": true
2100
+ }
2101
+ },
2102
+ "bos_token": "<|startoftext|>",
2103
+ "clean_up_tokenization_spaces": false,
2104
+ "cls_token": "[CLS]",
2105
+ "eos_token": "<|endoftext|>",
2106
+ "extra_special_tokens": {},
2107
+ "fast_tokenizer": true,
2108
+ "gmask_token": "[gMASK]",
2109
+ "mask_token": "<|mask|>",
2110
+ "merges_file": null,
2111
+ "model_max_length": 32768,
2112
+ "pad_token": "<|endoftext|>",
2113
+ "padding_side": "right",
2114
+ "tokenizer_class": "PreTrainedTokenizerFast",
2115
+ "trust_remote_code": true
2116
+ }
models/dreamreasoner-8b/.gitattributes ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
models/dreamreasoner-8b/README.md ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
models/dreamreasoner-8b/added_tokens.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "</think>": 151668,
3
+ "</tool_call>": 151658,
4
+ "</tool_response>": 151666,
5
+ "<think>": 151667,
6
+ "<tool_call>": 151657,
7
+ "<tool_response>": 151665,
8
+ "<|MASK|>": 151669,
9
+ "<|box_end|>": 151649,
10
+ "<|box_start|>": 151648,
11
+ "<|endoftext|>": 151643,
12
+ "<|file_sep|>": 151664,
13
+ "<|fim_middle|>": 151660,
14
+ "<|fim_pad|>": 151662,
15
+ "<|fim_prefix|>": 151659,
16
+ "<|fim_suffix|>": 151661,
17
+ "<|im_end|>": 151645,
18
+ "<|im_start|>": 151644,
19
+ "<|image_pad|>": 151655,
20
+ "<|object_ref_end|>": 151647,
21
+ "<|object_ref_start|>": 151646,
22
+ "<|quad_end|>": 151651,
23
+ "<|quad_start|>": 151650,
24
+ "<|repo_name|>": 151663,
25
+ "<|video_pad|>": 151656,
26
+ "<|vision_end|>": 151653,
27
+ "<|vision_pad|>": 151654,
28
+ "<|vision_start|>": 151652
29
+ }
models/dreamreasoner-8b/chat_template.jinja ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {{- messages[0].content + '\n\n' }}
5
+ {%- endif %}
6
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
7
+ {%- for tool in tools %}
8
+ {{- "\n" }}
9
+ {{- tool | tojson }}
10
+ {%- endfor %}
11
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
12
+ {%- else %}
13
+ {%- if messages[0].role == 'system' %}
14
+ {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
15
+ {%- endif %}
16
+ {%- endif %}
17
+ {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
18
+ {%- for message in messages[::-1] %}
19
+ {%- set index = (messages|length - 1) - loop.index0 %}
20
+ {%- if ns.multi_step_tool and message.role == "user" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
21
+ {%- set ns.multi_step_tool = false %}
22
+ {%- set ns.last_query_index = index %}
23
+ {%- endif %}
24
+ {%- endfor %}
25
+ {%- for message in messages %}
26
+ {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
27
+ {{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
28
+ {%- elif message.role == "assistant" %}
29
+ {%- set content = message.content %}
30
+ {%- set reasoning_content = '' %}
31
+ {%- if message.reasoning_content is defined and message.reasoning_content is not none %}
32
+ {%- set reasoning_content = message.reasoning_content %}
33
+ {%- else %}
34
+ {%- if '</think>' in message.content %}
35
+ {%- set content = message.content.split('</think>')[-1].lstrip('\n') %}
36
+ {%- set reasoning_content = message.content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
37
+ {%- endif %}
38
+ {%- endif %}
39
+ {%- if loop.index0 > ns.last_query_index %}
40
+ {%- if loop.last or (not loop.last and reasoning_content) %}
41
+ {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
42
+ {%- else %}
43
+ {{- '<|im_start|>' + message.role + '\n' + content }}
44
+ {%- endif %}
45
+ {%- else %}
46
+ {{- '<|im_start|>' + message.role + '\n' + content }}
47
+ {%- endif %}
48
+ {%- if message.tool_calls %}
49
+ {%- for tool_call in message.tool_calls %}
50
+ {%- if (loop.first and content) or (not loop.first) %}
51
+ {{- '\n' }}
52
+ {%- endif %}
53
+ {%- if tool_call.function %}
54
+ {%- set tool_call = tool_call.function %}
55
+ {%- endif %}
56
+ {{- '<tool_call>\n{"name": "' }}
57
+ {{- tool_call.name }}
58
+ {{- '", "arguments": ' }}
59
+ {%- if tool_call.arguments is string %}
60
+ {{- tool_call.arguments }}
61
+ {%- else %}
62
+ {{- tool_call.arguments | tojson }}
63
+ {%- endif %}
64
+ {{- '}\n</tool_call>' }}
65
+ {%- endfor %}
66
+ {%- endif %}
67
+ {{- '<|im_end|>\n' }}
68
+ {%- elif message.role == "tool" %}
69
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
70
+ {{- '<|im_start|>user' }}
71
+ {%- endif %}
72
+ {{- '\n<tool_response>\n' }}
73
+ {{- message.content }}
74
+ {{- '\n</tool_response>' }}
75
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
76
+ {{- '<|im_end|>\n' }}
77
+ {%- endif %}
78
+ {%- endif %}
79
+ {%- endfor %}
80
+ {%- if add_generation_prompt %}
81
+ {{- '<|im_start|>assistant\n' }}
82
+ {%- if enable_thinking is defined and enable_thinking is false %}
83
+ {{- '<think>\n\n</think>\n\n' }}
84
+ {%- else %}
85
+ {{- '<think>\n' }}
86
+ {%- endif %}
87
+ {%- endif %}
models/dreamreasoner-8b/config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DreamForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "auto_map": {
8
+ "AutoConfig": "configuration_dream.DreamConfig",
9
+ "AutoModel": "modeling_dream.DreamForCausalLM",
10
+ "AutoModelForCausalLM": "modeling_dream.DreamForCausalLM"
11
+ },
12
+ "block_size": 32,
13
+ "bos_token_id": 151643,
14
+ "dtype": "bfloat16",
15
+ "eos_token_id": 151643,
16
+ "head_dim": 128,
17
+ "hidden_act": "silu",
18
+ "hidden_size": 4096,
19
+ "initializer_range": 0.02,
20
+ "intermediate_size": 12288,
21
+ "mask_token_id": 151669,
22
+ "max_position_embeddings": 32768,
23
+ "max_window_layers": 36,
24
+ "model_type": "Dream",
25
+ "num_attention_heads": 32,
26
+ "num_hidden_layers": 36,
27
+ "num_key_value_heads": 8,
28
+ "rms_norm_eps": 1e-06,
29
+ "rope_scaling": null,
30
+ "rope_theta": 1000000,
31
+ "sliding_window": null,
32
+ "tie_word_embeddings": false,
33
+ "torch_dtype": "bfloat16",
34
+ "transformers_version": "5.7.0",
35
+ "use_cache": false,
36
+ "use_sliding_window": false,
37
+ "vocab_size": 151936
38
+ }
models/dreamreasoner-8b/configuration_dream.py ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2024 The Dream team, HKUNLP Group and the HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
5
+ # and OPT and Qwen implementations in this library. It has been modified from its
6
+ # original forms to accommodate minor architectural differences compared
7
+ # to GPT-NeoX and OPT and Qwen used by the Meta AI and Qwen team that trained the model.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ """Dream model configuration"""
21
+
22
+ from typing import Optional
23
+
24
+ from transformers.configuration_utils import PretrainedConfig
25
+ from transformers.utils import logging
26
+
27
+
28
+ logger = logging.get_logger(__name__)
29
+
30
+
31
+ class DreamConfig(PretrainedConfig):
32
+ r"""
33
+ This is the configuration class to store the configuration of a [`DreamModel`]. It is used to instantiate a
34
+ Dream model according to the specified arguments, defining the model architecture. Instantiating a configuration
35
+ with the defaults will yield a similar configuration to that of
36
+ Dream-8B [Qwen/Dream-8B](https://huggingface.co/Qwen/Dream-8B).
37
+
38
+ Configuration objects inherit from [`PreTrainedConfig`] and can be used to control the model outputs. Read the
39
+ documentation from [`PreTrainedConfig`] for more information.
40
+
41
+
42
+ Args:
43
+ vocab_size (`int`, *optional*, defaults to 151936):
44
+ Vocabulary size of the Dream model. Defines the number of different tokens that can be represented by the
45
+ `inputs_ids` passed when calling [`DreamModel`]
46
+ hidden_size (`int`, *optional*, defaults to 4096):
47
+ Dimension of the hidden representations.
48
+ intermediate_size (`int`, *optional*, defaults to 12288):
49
+ Dimension of the MLP representations.
50
+ num_hidden_layers (`int`, *optional*, defaults to 36):
51
+ Number of hidden layers in the Transformer encoder.
52
+ num_attention_heads (`int`, *optional*, defaults to 32):
53
+ Number of attention heads for each attention layer in the Transformer encoder.
54
+ num_key_value_heads (`int`, *optional*, defaults to 8):
55
+ This is the number of key_value heads that should be used to implement Grouped Query Attention. If
56
+ `num_key_value_heads=num_attention_heads`, the model will use Multi Head Attention (MHA), if
57
+ `num_key_value_heads=1` the model will use Multi Query Attention (MQA) otherwise GQA is used. When
58
+ converting a multi-head checkpoint to a GQA checkpoint, each group key and value head should be constructed
59
+ by meanpooling all the original heads within that group. For more details, check out [this
60
+ paper](https://huggingface.co/papers/2305.13245). If it is not specified, will default to `32`.
61
+ head_dim (`int`, *optional*, defaults to 128):
62
+ The attention head dimension.
63
+ hidden_act (`str` or `function`, *optional*, defaults to `"silu"`):
64
+ The non-linear activation function (function or string) in the decoder.
65
+ max_position_embeddings (`int`, *optional*, defaults to 32768):
66
+ The maximum sequence length that this model might ever be used with.
67
+ initializer_range (`float`, *optional*, defaults to 0.02):
68
+ The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
69
+ rms_norm_eps (`float`, *optional*, defaults to 1e-06):
70
+ The epsilon used by the rms normalization layers.
71
+ use_cache (`bool`, *optional*, defaults to `False`):
72
+ Whether or not the model should return the last key/values attentions (not used by all models). Only
73
+ relevant if `config.is_decoder=True`.
74
+ tie_word_embeddings (`bool`, *optional*, defaults to `False`):
75
+ Whether the model's input and output word embeddings should be tied.
76
+ rope_theta (`float`, *optional*, defaults to 1000000.0):
77
+ The base period of the RoPE embeddings.
78
+ rope_scaling (`Dict`, *optional*):
79
+ Dictionary containing the scaling configuration for the RoPE embeddings. NOTE: if you apply new rope type
80
+ and you expect the model to work on longer `max_position_embeddings`, we recommend you to update this value
81
+ accordingly.
82
+ Expected contents:
83
+ `rope_type` (`str`):
84
+ The sub-variant of RoPE to use. Can be one of ['default', 'linear', 'dynamic', 'yarn', 'longrope',
85
+ 'llama3'], with 'default' being the original RoPE implementation.
86
+ `factor` (`float`, *optional*):
87
+ Used with all rope types except 'default'. The scaling factor to apply to the RoPE embeddings. In
88
+ most scaling types, a `factor` of x will enable the model to handle sequences of length x *
89
+ original maximum pre-trained length.
90
+ `original_max_position_embeddings` (`int`, *optional*):
91
+ Used with 'dynamic', 'longrope' and 'llama3'. The original max position embeddings used during
92
+ pretraining.
93
+ `attention_factor` (`float`, *optional*):
94
+ Used with 'yarn' and 'longrope'. The scaling factor to be applied on the attention
95
+ computation. If unspecified, it defaults to value recommended by the implementation, using the
96
+ `factor` field to infer the suggested value.
97
+ `beta_fast` (`float`, *optional*):
98
+ Only used with 'yarn'. Parameter to set the boundary for extrapolation (only) in the linear
99
+ ramp function. If unspecified, it defaults to 32.
100
+ `beta_slow` (`float`, *optional*):
101
+ Only used with 'yarn'. Parameter to set the boundary for interpolation (only) in the linear
102
+ ramp function. If unspecified, it defaults to 1.
103
+ `short_factor` (`List[float]`, *optional*):
104
+ Only used with 'longrope'. The scaling factor to be applied to short contexts (<
105
+ `original_max_position_embeddings`). Must be a list of numbers with the same length as the hidden
106
+ size divided by the number of attention heads divided by 2
107
+ `long_factor` (`List[float]`, *optional*):
108
+ Only used with 'longrope'. The scaling factor to be applied to long contexts (<
109
+ `original_max_position_embeddings`). Must be a list of numbers with the same length as the hidden
110
+ size divided by the number of attention heads divided by 2
111
+ `low_freq_factor` (`float`, *optional*):
112
+ Only used with 'llama3'. Scaling factor applied to low frequency components of the RoPE
113
+ `high_freq_factor` (`float`, *optional*):
114
+ Only used with 'llama3'. Scaling factor applied to high frequency components of the RoPE
115
+ attention_bias (`bool`, defaults to `False`, *optional*, defaults to `False`):
116
+ Whether to use a bias in the query, key, value and output projection layers during self-attention.
117
+ use_sliding_window (`bool`, *optional*, defaults to `False`):
118
+ Whether to use sliding window attention.
119
+ sliding_window (`int`, *optional*, defaults to 4096):
120
+ Sliding window attention (SWA) window size. If not specified, will default to `4096`.
121
+ max_window_layers (`int`, *optional*, defaults to 36):
122
+ The number of layers using full attention. The first `max_window_layers` layers will use full attention, while any
123
+ additional layer afterwards will use SWA (Sliding Window Attention).
124
+ layer_types (`list`, *optional*):
125
+ Attention pattern for each layer.
126
+ attention_dropout (`float`, *optional*, defaults to 0.0):
127
+ The dropout ratio for the attention probabilities.
128
+
129
+ ```python
130
+ >>> from transformers import DreamModel, DreamConfig
131
+
132
+ >>> # Initializing a Dream style configuration
133
+ >>> configuration = DreamConfig()
134
+
135
+ >>> # Initializing a model from the Dream-8B style configuration
136
+ >>> model = DreamModel(configuration)
137
+
138
+ >>> # Accessing the model configuration
139
+ >>> configuration = model.config
140
+ ```"""
141
+
142
+ model_type = "Dream"
143
+ keys_to_ignore_at_inference = ["past_key_values"]
144
+
145
+ # Default tensor parallel plan for base model `Dream`
146
+ base_model_tp_plan = {
147
+ "layers.*.self_attn.q_proj": "colwise",
148
+ "layers.*.self_attn.k_proj": "colwise",
149
+ "layers.*.self_attn.v_proj": "colwise",
150
+ "layers.*.self_attn.o_proj": "rowwise",
151
+ "layers.*.mlp.gate_proj": "colwise",
152
+ "layers.*.mlp.up_proj": "colwise",
153
+ "layers.*.mlp.down_proj": "rowwise",
154
+ }
155
+ base_model_pp_plan = {
156
+ "embed_tokens": (["input_ids"], ["inputs_embeds"]),
157
+ "layers": (["hidden_states", "attention_mask"], ["hidden_states"]),
158
+ "norm": (["hidden_states"], ["hidden_states"]),
159
+ }
160
+
161
+ def __init__(
162
+ self,
163
+ vocab_size: Optional[int] = 151936,
164
+ hidden_size: Optional[int] = 4096,
165
+ intermediate_size: Optional[int] = 12288,
166
+ num_hidden_layers: Optional[int] = 36,
167
+ num_attention_heads: Optional[int] = 32,
168
+ num_key_value_heads: Optional[int] = 8,
169
+ head_dim: Optional[int] = 128,
170
+ hidden_act: Optional[str] = "silu",
171
+ max_position_embeddings: Optional[int] = 32768,
172
+ initializer_range: Optional[float] = 0.02,
173
+ rms_norm_eps: Optional[float] = 1e-6,
174
+ use_cache: Optional[bool] = False,
175
+ tie_word_embeddings: Optional[bool] = False,
176
+ rope_theta: Optional[float] = 1000000.0,
177
+ rope_scaling: Optional[dict] = None,
178
+ attention_bias: Optional[bool] = False,
179
+ use_sliding_window: Optional[bool] = False,
180
+ sliding_window: Optional[int] = 4096,
181
+ max_window_layers: Optional[int] = 36,
182
+ layer_types: Optional[list[str]] = None,
183
+ attention_dropout: Optional[float] = 0.0,
184
+ **kwargs,
185
+ ):
186
+ self.vocab_size = vocab_size
187
+ self.max_position_embeddings = max_position_embeddings
188
+ self.hidden_size = hidden_size
189
+ self.intermediate_size = intermediate_size
190
+ self.num_hidden_layers = num_hidden_layers
191
+ self.num_attention_heads = num_attention_heads
192
+ self.use_sliding_window = use_sliding_window
193
+ self.sliding_window = sliding_window if self.use_sliding_window else None
194
+ self.max_window_layers = max_window_layers
195
+
196
+ # for backward compatibility
197
+ if num_key_value_heads is None:
198
+ num_key_value_heads = num_attention_heads
199
+
200
+ self.num_key_value_heads = num_key_value_heads
201
+ self.head_dim = head_dim
202
+ self.hidden_act = hidden_act
203
+ self.initializer_range = initializer_range
204
+ self.rms_norm_eps = rms_norm_eps
205
+ self.use_cache = use_cache
206
+ self.rope_theta = rope_theta
207
+ self.rope_scaling = rope_scaling
208
+ self.attention_bias = attention_bias
209
+ self.attention_dropout = attention_dropout
210
+ self.layer_types = layer_types
211
+
212
+ if self.rope_scaling is not None and "type" in self.rope_scaling:
213
+ self.rope_scaling["rope_type"] = self.rope_scaling["type"]
214
+ self.validate_rope()
215
+
216
+
217
+ super().__init__(
218
+ tie_word_embeddings=tie_word_embeddings,
219
+ **kwargs,
220
+ )
221
+
222
+
223
+ __all__ = ["DreamConfig"]
models/dreamreasoner-8b/generation_config.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 151643,
3
+ "eos_token_id": 151643,
4
+ "max_new_tokens": 2048,
5
+ "transformers_version": "5.7.0",
6
+ "trust_remote_code": true
7
+ }
models/dreamreasoner-8b/generation_utils.py ADDED
@@ -0,0 +1,469 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ """Block diffusion generation utilities for Dream models."""
3
+ from __future__ import annotations
4
+
5
+ from dataclasses import dataclass
6
+ from typing import List, Optional, Sequence, Union
7
+
8
+ import torch
9
+ from torch.nn import functional as F
10
+ from transformers.cache_utils import DynamicCache
11
+ from transformers.utils import ModelOutput
12
+
13
+
14
+ def top_k_logits(logits: torch.Tensor, k: int) -> torch.Tensor:
15
+ if k <= 0:
16
+ return logits
17
+ values, _ = torch.topk(logits, k)
18
+ min_values = values[..., -1, None]
19
+ return torch.where(logits < min_values, torch.full_like(logits, float('-inf')), logits)
20
+
21
+
22
+ def top_p_logits(logits: torch.Tensor, p: float) -> torch.Tensor:
23
+ sorted_logits, sorted_indices = torch.sort(logits, descending=True)
24
+ cumulative_probs = torch.cumsum(F.softmax(sorted_logits, dim=-1), dim=-1)
25
+ sorted_mask = cumulative_probs > p
26
+ sorted_mask[..., 1:] = sorted_mask[..., :-1].clone()
27
+ sorted_mask[..., 0] = False
28
+ mask_indices = torch.scatter(
29
+ torch.full_like(logits, False, dtype=torch.bool),
30
+ -1,
31
+ sorted_indices,
32
+ sorted_mask,
33
+ )
34
+ return logits.masked_fill(mask_indices, float('-inf'))
35
+
36
+
37
+ def sample_with_temperature_topk_topp(
38
+ logits: torch.Tensor,
39
+ temperature: float = 1.0,
40
+ top_k: int = 0,
41
+ top_p: float = 1.0,
42
+ ) -> tuple[torch.Tensor, torch.Tensor]:
43
+ orig_shape = logits.shape[:-1]
44
+ vocab_size = logits.shape[-1]
45
+ logits = logits.reshape(-1, vocab_size)
46
+
47
+ if temperature > 0:
48
+ logits = logits / temperature
49
+ if top_k > 0:
50
+ logits = top_k_logits(logits, top_k)
51
+ if top_p < 1.0:
52
+ logits = top_p_logits(logits, top_p)
53
+
54
+ probs = F.softmax(logits, dim=-1)
55
+ if temperature > 0:
56
+ token = torch.multinomial(probs, num_samples=1)
57
+ else:
58
+ token = probs.argmax(dim=-1, keepdim=True)
59
+ token_prob = torch.gather(probs, -1, token)
60
+ return token.view(*orig_shape), token_prob.view(*orig_shape)
61
+
62
+
63
+ def get_num_transfer_tokens(block_length: int, steps: int) -> torch.Tensor:
64
+ base = block_length // steps
65
+ remainder = block_length % steps
66
+ num_transfer_tokens = torch.zeros(steps, dtype=torch.int64) + base
67
+ num_transfer_tokens[:remainder] += 1
68
+ return num_transfer_tokens
69
+
70
+
71
+ def build_block_diffusion_attention_mask(
72
+ num_blocks: int,
73
+ block_length: int,
74
+ device: torch.device,
75
+ batch_size: int = 1,
76
+ ) -> torch.Tensor:
77
+ block_mask = torch.tril(torch.ones(num_blocks, num_blocks, device=device))
78
+ return block_mask.repeat_interleave(block_length, dim=0).repeat_interleave(block_length, dim=1).unsqueeze(0).expand(
79
+ batch_size, -1, -1
80
+ )
81
+
82
+
83
+ def _resolve_stopping_ids(stopping_criteria_idx: Optional[Union[int, Sequence[int]]]) -> Optional[List[int]]:
84
+ if stopping_criteria_idx is None:
85
+ return None
86
+ if isinstance(stopping_criteria_idx, int):
87
+ return [stopping_criteria_idx]
88
+ return list(stopping_criteria_idx)
89
+
90
+
91
+ def _should_stop(
92
+ generated_ids: torch.Tensor,
93
+ prompt_length: int,
94
+ stopping_criteria_idx: Optional[List[int]],
95
+ ) -> bool:
96
+ if not stopping_criteria_idx:
97
+ return False
98
+ gen_part = generated_ids[:, prompt_length:]
99
+ return any((gen_part == stop_id).any().item() for stop_id in stopping_criteria_idx)
100
+
101
+
102
+ def _default_use_kv_cache(model: torch.nn.Module) -> bool:
103
+ """Dream / Dream1 models use prefix KV cache during block diffusion decode."""
104
+ model_type = getattr(model.config, 'model_type', None)
105
+ if model_type is None:
106
+ return False
107
+ return model_type.lower() in ('dream', 'dream1')
108
+
109
+
110
+ def _select_transfer_index(
111
+ remasking_strategy: str,
112
+ mask_index: torch.Tensor,
113
+ x0: torch.Tensor,
114
+ x0_p: torch.Tensor,
115
+ num_transfer_tokens: torch.Tensor,
116
+ step: int,
117
+ confidence_threshold: float,
118
+ eb_threshold: Optional[float],
119
+ *,
120
+ force_accept: bool = False,
121
+ ) -> torch.Tensor:
122
+ if force_accept:
123
+ return mask_index.clone()
124
+
125
+ if remasking_strategy == 'sequential':
126
+ transfer_index = torch.zeros_like(x0, dtype=torch.bool)
127
+ for j in range(x0.shape[0]):
128
+ if not mask_index[j].any():
129
+ continue
130
+ first_mask_index = mask_index[j].nonzero(as_tuple=True)[0].min().item()
131
+ end = first_mask_index + int(num_transfer_tokens[step].item())
132
+ transfer_index[j, first_mask_index:end] = True
133
+ return transfer_index
134
+
135
+ if remasking_strategy == 'low_confidence_static':
136
+ confidence = torch.where(mask_index, x0_p, -torch.inf)
137
+ transfer_index = torch.zeros_like(x0, dtype=torch.bool)
138
+ k = max(1, int(num_transfer_tokens[step].item()))
139
+ for j in range(confidence.shape[0]):
140
+ _, idx = torch.topk(confidence[j], k)
141
+ transfer_index[j, idx] = True
142
+ return transfer_index
143
+
144
+ if remasking_strategy == 'low_confidence_dynamic':
145
+ confidence = torch.where(mask_index, x0_p, -torch.inf)
146
+ transfer_index = torch.zeros_like(x0, dtype=torch.bool)
147
+ k = max(1, int(num_transfer_tokens[step].item()))
148
+ for j in range(confidence.shape[0]):
149
+ high_conf_mask = confidence[j] > confidence_threshold
150
+ if int(high_conf_mask.sum().item()) >= k:
151
+ transfer_index[j] = high_conf_mask
152
+ else:
153
+ _, idx = torch.topk(confidence[j], k)
154
+ transfer_index[j, idx] = True
155
+ return transfer_index
156
+
157
+ if remasking_strategy == 'entropy_bounded':
158
+ if eb_threshold is None:
159
+ raise ValueError('eb_threshold is required for entropy_bounded remasking.')
160
+ eps = 1e-12
161
+ entropies = -(x0_p.clamp_min(eps) * x0_p.clamp_min(eps).log())
162
+ entropies = torch.where(mask_index, entropies, torch.inf)
163
+ ent_sorted, order = torch.sort(entropies, dim=1, descending=False)
164
+ cumsum = torch.cumsum(ent_sorted, dim=1)
165
+ transfer_index = torch.zeros_like(x0, dtype=torch.bool)
166
+ for j in range(x0_p.shape[0]):
167
+ k = torch.searchsorted(
168
+ cumsum[j], torch.tensor(eb_threshold, device=x0_p.device), right=False
169
+ ).item()
170
+ k = max(1, min(k, int(mask_index[j].sum().item())))
171
+ transfer_index[j, order[j, :k]] = True
172
+ return transfer_index
173
+
174
+ raise ValueError(f'Unknown remasking strategy: {remasking_strategy}')
175
+
176
+
177
+ def _denoise_current_block(
178
+ model: torch.nn.Module,
179
+ x: torch.Tensor,
180
+ num_block: int,
181
+ block_length: int,
182
+ mask_id: int,
183
+ block_diffusion_attention_mask: torch.Tensor,
184
+ position_ids: torch.Tensor,
185
+ denoising_steps: int,
186
+ num_transfer_tokens: torch.Tensor,
187
+ temperature: float,
188
+ top_k: int,
189
+ top_p: float,
190
+ remasking_strategy: str,
191
+ confidence_threshold: float,
192
+ eb_threshold: Optional[float],
193
+ *,
194
+ use_kv_cache: bool,
195
+ past_key_values: Optional[DynamicCache],
196
+ ) -> tuple[torch.Tensor, Optional[DynamicCache], int]:
197
+ block_start = num_block * block_length
198
+ block_end = block_start + block_length
199
+ cur_x = x[:, block_start:block_end].clone()
200
+ nfe = 0
201
+
202
+ for step in range(denoising_steps + 1):
203
+ mask_index = cur_x == mask_id
204
+ if mask_index.sum() == 0:
205
+ if use_kv_cache:
206
+ cur_attn_mask = block_diffusion_attention_mask[:, block_start:block_end, :block_end]
207
+ cur_position_ids = position_ids[:, block_start:block_end]
208
+ model(
209
+ cur_x,
210
+ attention_mask=cur_attn_mask,
211
+ position_ids=cur_position_ids,
212
+ past_key_values=past_key_values,
213
+ use_cache=True,
214
+ store_kv=True,
215
+ )
216
+ nfe += 1
217
+ break
218
+
219
+ force_accept = step == denoising_steps - 1
220
+ if use_kv_cache:
221
+ cur_attn_mask = block_diffusion_attention_mask[:, block_start:block_end, :block_end]
222
+ cur_position_ids = position_ids[:, block_start:block_end]
223
+ logits = model(
224
+ cur_x,
225
+ attention_mask=cur_attn_mask,
226
+ position_ids=cur_position_ids,
227
+ past_key_values=past_key_values,
228
+ use_cache=True,
229
+ store_kv=False,
230
+ ).logits
231
+ else:
232
+ seq_end = block_end
233
+ attn_mask = block_diffusion_attention_mask[:, :seq_end, :seq_end]
234
+ pos_ids = position_ids[:, :seq_end]
235
+ logits = model(
236
+ x[:, :seq_end],
237
+ attention_mask=attn_mask,
238
+ position_ids=pos_ids,
239
+ use_cache=False,
240
+ ).logits[:, block_start:block_end]
241
+
242
+ nfe += 1
243
+ x0, x0_p = sample_with_temperature_topk_topp(
244
+ logits,
245
+ temperature=temperature,
246
+ top_k=top_k,
247
+ top_p=top_p,
248
+ )
249
+ x0 = torch.where(mask_index, x0, cur_x)
250
+ transfer_index = _select_transfer_index(
251
+ remasking_strategy,
252
+ mask_index,
253
+ x0,
254
+ x0_p,
255
+ num_transfer_tokens,
256
+ step,
257
+ confidence_threshold,
258
+ eb_threshold,
259
+ force_accept=force_accept,
260
+ )
261
+ cur_x[transfer_index] = x0[transfer_index]
262
+ if not use_kv_cache:
263
+ x[:, block_start:block_end] = cur_x
264
+
265
+ return cur_x, past_key_values, nfe
266
+
267
+
268
+ @dataclass
269
+ class BlockDiffusionOutput(ModelOutput):
270
+ sequences: torch.LongTensor = None
271
+ nfe: Optional[int] = None
272
+ logits: Optional[tuple] = None
273
+
274
+
275
+ @torch.no_grad()
276
+ def block_diffusion_generate(
277
+ model: torch.nn.Module,
278
+ input_ids: torch.LongTensor,
279
+ mask_id: int,
280
+ gen_length: int = 128,
281
+ block_length: Optional[int] = None,
282
+ denoising_steps: Optional[int] = None,
283
+ temperature: float = 0.0,
284
+ top_k: int = 0,
285
+ top_p: float = 1.0,
286
+ remasking_strategy: str = 'low_confidence_dynamic',
287
+ confidence_threshold: float = 0.9,
288
+ eb_threshold: Optional[float] = 0.35,
289
+ stopping_criteria_idx: Optional[Union[int, Sequence[int]]] = None,
290
+ use_kv_cache: Optional[bool] = None,
291
+ return_dict_in_generate: bool = False,
292
+ ) -> Union[torch.LongTensor, BlockDiffusionOutput]:
293
+ """Block-wise diffusion decoding with optional prefix KV cache."""
294
+ model.eval()
295
+ if input_ids.dim() != 2:
296
+ raise ValueError(f'input_ids must be 2D, got shape {tuple(input_ids.shape)}')
297
+
298
+ device = input_ids.device
299
+ batch_size, prompt_length = input_ids.shape
300
+ block_length = block_length or getattr(model.config, 'block_size', 4)
301
+ if denoising_steps is None:
302
+ denoising_steps = 1 if remasking_strategy == 'low_confidence_static' else block_length
303
+ stopping_criteria_idx = _resolve_stopping_ids(stopping_criteria_idx)
304
+
305
+ if use_kv_cache is None:
306
+ use_kv_cache = _default_use_kv_cache(model)
307
+
308
+ num_blocks = (prompt_length + gen_length + block_length - 1) // block_length
309
+ total_length = num_blocks * block_length
310
+ block_diffusion_attention_mask = build_block_diffusion_attention_mask(
311
+ num_blocks, block_length, device, batch_size=batch_size
312
+ )
313
+ position_ids = torch.arange(total_length, device=device, dtype=torch.long).unsqueeze(0).expand(batch_size, -1)
314
+
315
+ x = torch.full((batch_size, total_length), mask_id, dtype=input_ids.dtype, device=device)
316
+ x[:, :prompt_length] = input_ids
317
+
318
+ prefill_blocks = prompt_length // block_length
319
+ prefill_length = prefill_blocks * block_length
320
+ past_key_values = DynamicCache() if use_kv_cache else None
321
+ nfe = 0
322
+
323
+ if use_kv_cache and prefill_length > 0:
324
+ cur_x = x[:, :prefill_length]
325
+ cur_attn_mask = block_diffusion_attention_mask[:, :prefill_length, :prefill_length]
326
+ cur_position_ids = position_ids[:, :prefill_length]
327
+ model(
328
+ cur_x,
329
+ attention_mask=cur_attn_mask,
330
+ position_ids=cur_position_ids,
331
+ past_key_values=past_key_values,
332
+ use_cache=True,
333
+ store_kv=True,
334
+ )
335
+ nfe += 1
336
+
337
+ num_transfer_tokens = get_num_transfer_tokens(block_length, denoising_steps)
338
+
339
+ for num_block in range(prefill_blocks, num_blocks):
340
+ cur_x, past_key_values, block_nfe = _denoise_current_block(
341
+ model,
342
+ x,
343
+ num_block,
344
+ block_length,
345
+ mask_id,
346
+ block_diffusion_attention_mask,
347
+ position_ids,
348
+ denoising_steps,
349
+ num_transfer_tokens,
350
+ temperature,
351
+ top_k,
352
+ top_p,
353
+ remasking_strategy,
354
+ confidence_threshold,
355
+ eb_threshold,
356
+ use_kv_cache=use_kv_cache,
357
+ past_key_values=past_key_values,
358
+ )
359
+ nfe += block_nfe
360
+ x[:, num_block * block_length:(num_block + 1) * block_length] = cur_x
361
+
362
+ if _should_stop(x, prompt_length, stopping_criteria_idx):
363
+ break
364
+
365
+ output_length = min(total_length, prompt_length + gen_length)
366
+ x = x[:, :output_length]
367
+
368
+ if return_dict_in_generate:
369
+ return BlockDiffusionOutput(sequences=x, nfe=nfe)
370
+ return x
371
+
372
+
373
+ # HF kwargs that ``generate()`` strips before calling ``block_diffusion_generate()``.
374
+ _UNSUPPORTED_HF_KEYS = (
375
+ 'stopping_criteria', 'num_return_sequences', 'num_beams', 'num_beam_groups',
376
+ 'penalty_alpha', 'use_cache', 'output_logits', 'output_scores', 'output_attentions',
377
+ 'output_hidden_states', 'return_legacy_cache', 'synced_gpus', 'streamer',
378
+ 'logits_processor', 'logits_warper', 'generation_config', 'tokenizer',
379
+ 'min_length', 'min_new_tokens', 'pad_token_id', 'bos_token_id', 'eos_token_id',
380
+ )
381
+
382
+
383
+ class BlockDiffusionGenerationMixin:
384
+
385
+ def _resolve_generation_mode(self, generation_mode: Optional[str] = None) -> str:
386
+ if generation_mode is not None:
387
+ return generation_mode
388
+ return getattr(self.config, 'generation_mode', 'block_diffusion')
389
+
390
+ @torch.no_grad()
391
+ def generate(
392
+ self,
393
+ input_ids: torch.LongTensor,
394
+ attention_mask: Optional[torch.Tensor] = None,
395
+ generation_mode: Optional[str] = None,
396
+ **kwargs,
397
+ ) -> Union[torch.LongTensor, BlockDiffusionOutput, ModelOutput]:
398
+ """HF-compatible ``generate`` entry point with pluggable decoding modes.
399
+
400
+ Supported modes (``generation_mode`` kwarg or ``config.generation_mode``):
401
+ - ``block_diffusion`` (default): calls :meth:`block_diffusion_generate`.
402
+ - ``autoregressive``: delegates to ``GenerationMixin.generate``.
403
+ """
404
+ mode = self._resolve_generation_mode(kwargs.pop('generation_mode', generation_mode))
405
+ return_dict_in_generate = kwargs.pop('return_dict_in_generate', False)
406
+
407
+ if mode == 'autoregressive':
408
+ return super().generate(
409
+ input_ids=input_ids,
410
+ attention_mask=attention_mask,
411
+ return_dict_in_generate=return_dict_in_generate,
412
+ **kwargs,
413
+ )
414
+ if mode != 'block_diffusion':
415
+ raise ValueError(f'Unknown generation_mode: {mode!r}. Supported: block_diffusion, autoregressive.')
416
+
417
+ # HF-only normalizations; sampling params pass through to block_diffusion_generate.
418
+ if kwargs.pop('do_sample', None) is False:
419
+ kwargs['temperature'] = 0.0
420
+ if 'max_new_tokens' not in kwargs and (max_length := kwargs.pop('max_length', None)) is not None:
421
+ kwargs['max_new_tokens'] = max(max_length - input_ids.shape[-1], 0)
422
+ for key in _UNSUPPORTED_HF_KEYS:
423
+ kwargs.pop(key, None)
424
+
425
+ return self.block_diffusion_generate(
426
+ input_ids=input_ids,
427
+ return_dict_in_generate=return_dict_in_generate,
428
+ **kwargs,
429
+ )
430
+
431
+ @torch.no_grad()
432
+ def block_diffusion_generate(
433
+ self,
434
+ input_ids: torch.LongTensor,
435
+ max_new_tokens: int = 128,
436
+ temperature: float = 0.0,
437
+ top_k: int = 0,
438
+ top_p: float = 1.0,
439
+ return_dict_in_generate: bool = False,
440
+ # block-diffusion specific
441
+ block_length: Optional[int] = None,
442
+ denoising_steps: Optional[int] = None,
443
+ remasking_strategy: str = 'low_confidence_dynamic',
444
+ confidence_threshold: float = 0.9,
445
+ eb_threshold: Optional[float] = 0.35,
446
+ use_kv_cache: Optional[bool] = None,
447
+ mask_token_id: Optional[int] = None,
448
+ ) -> Union[torch.LongTensor, BlockDiffusionOutput]:
449
+ mask_token_id = mask_token_id if mask_token_id is not None else self.config.mask_token_id
450
+ if mask_token_id is None:
451
+ raise ValueError('mask_token_id must be provided or set in model.config.mask_token_id')
452
+ stopping_criteria_idx = self.config.eos_token_id if getattr(self.config, 'eos_token_id', None) is not None else None
453
+ return block_diffusion_generate(
454
+ self,
455
+ input_ids=input_ids,
456
+ mask_id=mask_token_id,
457
+ gen_length=max_new_tokens,
458
+ block_length=block_length,
459
+ denoising_steps=denoising_steps,
460
+ temperature=temperature,
461
+ top_k=top_k,
462
+ top_p=top_p,
463
+ remasking_strategy=remasking_strategy,
464
+ confidence_threshold=confidence_threshold,
465
+ eb_threshold=eb_threshold,
466
+ stopping_criteria_idx=stopping_criteria_idx,
467
+ use_kv_cache=use_kv_cache,
468
+ return_dict_in_generate=return_dict_in_generate,
469
+ )
models/dreamreasoner-8b/merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
models/dreamreasoner-8b/model.safetensors.index.json ADDED
@@ -0,0 +1,406 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata": {
3
+ "total_size": 16381470720
4
+ },
5
+ "weight_map": {
6
+ "lm_head.weight": "model-00004-of-00004.safetensors",
7
+ "model.embed_tokens.weight": "model-00001-of-00004.safetensors",
8
+ "model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
9
+ "model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
10
+ "model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
11
+ "model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
12
+ "model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
13
+ "model.layers.0.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
14
+ "model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
15
+ "model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
16
+ "model.layers.0.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
17
+ "model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
18
+ "model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
19
+ "model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
20
+ "model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
21
+ "model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
22
+ "model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
23
+ "model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
24
+ "model.layers.1.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
25
+ "model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
26
+ "model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
27
+ "model.layers.1.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
28
+ "model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
29
+ "model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
30
+ "model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
31
+ "model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
32
+ "model.layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
33
+ "model.layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
34
+ "model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
35
+ "model.layers.10.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
36
+ "model.layers.10.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
37
+ "model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
38
+ "model.layers.10.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
39
+ "model.layers.10.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
40
+ "model.layers.10.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
41
+ "model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
42
+ "model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
43
+ "model.layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
44
+ "model.layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
45
+ "model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
46
+ "model.layers.11.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
47
+ "model.layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
48
+ "model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
49
+ "model.layers.11.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
50
+ "model.layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
51
+ "model.layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
52
+ "model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
53
+ "model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
54
+ "model.layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
55
+ "model.layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
56
+ "model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
57
+ "model.layers.12.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
58
+ "model.layers.12.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
59
+ "model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
60
+ "model.layers.12.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
61
+ "model.layers.12.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
62
+ "model.layers.12.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
63
+ "model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
64
+ "model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
65
+ "model.layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
66
+ "model.layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
67
+ "model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
68
+ "model.layers.13.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
69
+ "model.layers.13.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
70
+ "model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
71
+ "model.layers.13.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
72
+ "model.layers.13.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
73
+ "model.layers.13.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
74
+ "model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
75
+ "model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
76
+ "model.layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
77
+ "model.layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
78
+ "model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
79
+ "model.layers.14.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
80
+ "model.layers.14.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
81
+ "model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
82
+ "model.layers.14.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
83
+ "model.layers.14.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
84
+ "model.layers.14.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
85
+ "model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
86
+ "model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
87
+ "model.layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
88
+ "model.layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
89
+ "model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
90
+ "model.layers.15.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
91
+ "model.layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
92
+ "model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
93
+ "model.layers.15.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
94
+ "model.layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
95
+ "model.layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
96
+ "model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
97
+ "model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
98
+ "model.layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
99
+ "model.layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
100
+ "model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
101
+ "model.layers.16.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
102
+ "model.layers.16.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
103
+ "model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
104
+ "model.layers.16.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
105
+ "model.layers.16.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
106
+ "model.layers.16.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
107
+ "model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
108
+ "model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
109
+ "model.layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
110
+ "model.layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
111
+ "model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
112
+ "model.layers.17.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
113
+ "model.layers.17.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
114
+ "model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
115
+ "model.layers.17.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
116
+ "model.layers.17.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
117
+ "model.layers.17.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
118
+ "model.layers.18.input_layernorm.weight": "model-00002-of-00004.safetensors",
119
+ "model.layers.18.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
120
+ "model.layers.18.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
121
+ "model.layers.18.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
122
+ "model.layers.18.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
123
+ "model.layers.18.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
124
+ "model.layers.18.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
125
+ "model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
126
+ "model.layers.18.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
127
+ "model.layers.18.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
128
+ "model.layers.18.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
129
+ "model.layers.19.input_layernorm.weight": "model-00002-of-00004.safetensors",
130
+ "model.layers.19.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
131
+ "model.layers.19.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
132
+ "model.layers.19.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
133
+ "model.layers.19.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
134
+ "model.layers.19.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
135
+ "model.layers.19.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
136
+ "model.layers.19.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
137
+ "model.layers.19.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
138
+ "model.layers.19.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
139
+ "model.layers.19.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
140
+ "model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
141
+ "model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
142
+ "model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
143
+ "model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
144
+ "model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
145
+ "model.layers.2.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
146
+ "model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
147
+ "model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
148
+ "model.layers.2.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
149
+ "model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
150
+ "model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
151
+ "model.layers.20.input_layernorm.weight": "model-00002-of-00004.safetensors",
152
+ "model.layers.20.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
153
+ "model.layers.20.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
154
+ "model.layers.20.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
155
+ "model.layers.20.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
156
+ "model.layers.20.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
157
+ "model.layers.20.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
158
+ "model.layers.20.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
159
+ "model.layers.20.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
160
+ "model.layers.20.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
161
+ "model.layers.20.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
162
+ "model.layers.21.input_layernorm.weight": "model-00002-of-00004.safetensors",
163
+ "model.layers.21.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
164
+ "model.layers.21.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
165
+ "model.layers.21.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
166
+ "model.layers.21.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
167
+ "model.layers.21.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
168
+ "model.layers.21.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
169
+ "model.layers.21.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
170
+ "model.layers.21.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
171
+ "model.layers.21.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
172
+ "model.layers.21.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
173
+ "model.layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
174
+ "model.layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
175
+ "model.layers.22.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
176
+ "model.layers.22.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
177
+ "model.layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
178
+ "model.layers.22.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
179
+ "model.layers.22.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
180
+ "model.layers.22.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
181
+ "model.layers.22.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
182
+ "model.layers.22.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
183
+ "model.layers.22.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
184
+ "model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
185
+ "model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
186
+ "model.layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
187
+ "model.layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
188
+ "model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
189
+ "model.layers.23.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
190
+ "model.layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
191
+ "model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
192
+ "model.layers.23.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
193
+ "model.layers.23.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
194
+ "model.layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
195
+ "model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
196
+ "model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
197
+ "model.layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
198
+ "model.layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
199
+ "model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
200
+ "model.layers.24.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
201
+ "model.layers.24.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
202
+ "model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
203
+ "model.layers.24.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
204
+ "model.layers.24.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
205
+ "model.layers.24.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
206
+ "model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
207
+ "model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
208
+ "model.layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
209
+ "model.layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
210
+ "model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
211
+ "model.layers.25.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
212
+ "model.layers.25.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
213
+ "model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
214
+ "model.layers.25.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
215
+ "model.layers.25.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
216
+ "model.layers.25.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
217
+ "model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
218
+ "model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
219
+ "model.layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
220
+ "model.layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
221
+ "model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
222
+ "model.layers.26.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
223
+ "model.layers.26.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
224
+ "model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
225
+ "model.layers.26.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
226
+ "model.layers.26.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
227
+ "model.layers.26.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
228
+ "model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
229
+ "model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
230
+ "model.layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
231
+ "model.layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
232
+ "model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
233
+ "model.layers.27.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
234
+ "model.layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
235
+ "model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
236
+ "model.layers.27.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
237
+ "model.layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
238
+ "model.layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
239
+ "model.layers.28.input_layernorm.weight": "model-00003-of-00004.safetensors",
240
+ "model.layers.28.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
241
+ "model.layers.28.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
242
+ "model.layers.28.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
243
+ "model.layers.28.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
244
+ "model.layers.28.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
245
+ "model.layers.28.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
246
+ "model.layers.28.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
247
+ "model.layers.28.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
248
+ "model.layers.28.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
249
+ "model.layers.28.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
250
+ "model.layers.29.input_layernorm.weight": "model-00003-of-00004.safetensors",
251
+ "model.layers.29.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
252
+ "model.layers.29.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
253
+ "model.layers.29.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
254
+ "model.layers.29.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
255
+ "model.layers.29.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
256
+ "model.layers.29.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
257
+ "model.layers.29.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
258
+ "model.layers.29.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
259
+ "model.layers.29.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
260
+ "model.layers.29.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
261
+ "model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
262
+ "model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
263
+ "model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
264
+ "model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
265
+ "model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
266
+ "model.layers.3.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
267
+ "model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
268
+ "model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
269
+ "model.layers.3.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
270
+ "model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
271
+ "model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
272
+ "model.layers.30.input_layernorm.weight": "model-00003-of-00004.safetensors",
273
+ "model.layers.30.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
274
+ "model.layers.30.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
275
+ "model.layers.30.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
276
+ "model.layers.30.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
277
+ "model.layers.30.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
278
+ "model.layers.30.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
279
+ "model.layers.30.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
280
+ "model.layers.30.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
281
+ "model.layers.30.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
282
+ "model.layers.30.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
283
+ "model.layers.31.input_layernorm.weight": "model-00003-of-00004.safetensors",
284
+ "model.layers.31.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
285
+ "model.layers.31.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
286
+ "model.layers.31.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
287
+ "model.layers.31.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
288
+ "model.layers.31.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
289
+ "model.layers.31.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
290
+ "model.layers.31.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
291
+ "model.layers.31.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
292
+ "model.layers.31.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
293
+ "model.layers.31.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
294
+ "model.layers.32.input_layernorm.weight": "model-00003-of-00004.safetensors",
295
+ "model.layers.32.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
296
+ "model.layers.32.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
297
+ "model.layers.32.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
298
+ "model.layers.32.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
299
+ "model.layers.32.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
300
+ "model.layers.32.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
301
+ "model.layers.32.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
302
+ "model.layers.32.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
303
+ "model.layers.32.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
304
+ "model.layers.32.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
305
+ "model.layers.33.input_layernorm.weight": "model-00003-of-00004.safetensors",
306
+ "model.layers.33.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
307
+ "model.layers.33.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
308
+ "model.layers.33.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
309
+ "model.layers.33.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
310
+ "model.layers.33.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
311
+ "model.layers.33.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
312
+ "model.layers.33.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
313
+ "model.layers.33.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
314
+ "model.layers.33.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
315
+ "model.layers.33.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
316
+ "model.layers.34.input_layernorm.weight": "model-00003-of-00004.safetensors",
317
+ "model.layers.34.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
318
+ "model.layers.34.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
319
+ "model.layers.34.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
320
+ "model.layers.34.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
321
+ "model.layers.34.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
322
+ "model.layers.34.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
323
+ "model.layers.34.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
324
+ "model.layers.34.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
325
+ "model.layers.34.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
326
+ "model.layers.34.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
327
+ "model.layers.35.input_layernorm.weight": "model-00004-of-00004.safetensors",
328
+ "model.layers.35.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
329
+ "model.layers.35.mlp.gate_proj.weight": "model-00004-of-00004.safetensors",
330
+ "model.layers.35.mlp.up_proj.weight": "model-00004-of-00004.safetensors",
331
+ "model.layers.35.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
332
+ "model.layers.35.self_attn.k_norm.weight": "model-00004-of-00004.safetensors",
333
+ "model.layers.35.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
334
+ "model.layers.35.self_attn.o_proj.weight": "model-00004-of-00004.safetensors",
335
+ "model.layers.35.self_attn.q_norm.weight": "model-00004-of-00004.safetensors",
336
+ "model.layers.35.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
337
+ "model.layers.35.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
338
+ "model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
339
+ "model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
340
+ "model.layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
341
+ "model.layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
342
+ "model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
343
+ "model.layers.4.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
344
+ "model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
345
+ "model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
346
+ "model.layers.4.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
347
+ "model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
348
+ "model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
349
+ "model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
350
+ "model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
351
+ "model.layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
352
+ "model.layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
353
+ "model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
354
+ "model.layers.5.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
355
+ "model.layers.5.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
356
+ "model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
357
+ "model.layers.5.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
358
+ "model.layers.5.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
359
+ "model.layers.5.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
360
+ "model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
361
+ "model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
362
+ "model.layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
363
+ "model.layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
364
+ "model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
365
+ "model.layers.6.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
366
+ "model.layers.6.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
367
+ "model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
368
+ "model.layers.6.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
369
+ "model.layers.6.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
370
+ "model.layers.6.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
371
+ "model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
372
+ "model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
373
+ "model.layers.7.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
374
+ "model.layers.7.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
375
+ "model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
376
+ "model.layers.7.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
377
+ "model.layers.7.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
378
+ "model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
379
+ "model.layers.7.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
380
+ "model.layers.7.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
381
+ "model.layers.7.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
382
+ "model.layers.8.input_layernorm.weight": "model-00001-of-00004.safetensors",
383
+ "model.layers.8.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
384
+ "model.layers.8.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
385
+ "model.layers.8.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
386
+ "model.layers.8.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
387
+ "model.layers.8.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
388
+ "model.layers.8.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
389
+ "model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
390
+ "model.layers.8.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
391
+ "model.layers.8.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
392
+ "model.layers.8.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
393
+ "model.layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
394
+ "model.layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
395
+ "model.layers.9.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
396
+ "model.layers.9.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
397
+ "model.layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
398
+ "model.layers.9.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
399
+ "model.layers.9.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
400
+ "model.layers.9.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
401
+ "model.layers.9.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
402
+ "model.layers.9.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
403
+ "model.layers.9.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
404
+ "model.norm.weight": "model-00004-of-00004.safetensors"
405
+ }
406
+ }
models/dreamreasoner-8b/modeling_dream.py ADDED
@@ -0,0 +1,574 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2026 The Dream team, HKUNLP Group and the HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
5
+ # and OPT and Qwen implementations in this library. It has been modified from its
6
+ # original forms to accommodate minor architectural differences compared
7
+ # to GPT-NeoX and OPT and Qwen used by the Meta AI and Qwen team that trained the model.
8
+ #
9
+ # Licensed under the Apache License, Version 2.0 (the "License");
10
+ # you may not use this file except in compliance with the License.
11
+ # You may obtain a copy of the License at
12
+ #
13
+ # http://www.apache.org/licenses/LICENSE-2.0
14
+ #
15
+ # Unless required by applicable law or agreed to in writing, software
16
+ # distributed under the License is distributed on an "AS IS" BASIS,
17
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+
21
+
22
+ from typing import Callable, Optional, Tuple, Union
23
+
24
+ import torch
25
+ from torch import nn
26
+
27
+ from transformers.activations import ACT2FN
28
+ from transformers.cache_utils import Cache, DynamicCache, StaticCache
29
+ from transformers.generation import GenerationMixin
30
+ from transformers.integrations import use_kernel_forward_from_hub
31
+ from transformers.modeling_attn_mask_utils import AttentionMaskConverter
32
+ from transformers.modeling_flash_attention_utils import FlashAttentionKwargs
33
+ from transformers.modeling_layers import GradientCheckpointingLayer
34
+ from transformers.modeling_outputs import (
35
+ BaseModelOutputWithPast,
36
+ CausalLMOutputWithPast,
37
+ QuestionAnsweringModelOutput,
38
+ SequenceClassifierOutputWithPast,
39
+ TokenClassifierOutput,
40
+ )
41
+ from transformers.modeling_rope_utils import ROPE_INIT_FUNCTIONS, dynamic_rope_update
42
+ from transformers.modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
43
+ from transformers.processing_utils import Unpack
44
+ from transformers.utils import auto_docstring, can_return_tuple, logging, TransformersKwargs
45
+ from .configuration_dream import DreamConfig
46
+ from .generation_utils import BlockDiffusionGenerationMixin
47
+
48
+ @use_kernel_forward_from_hub("RMSNorm")
49
+ class DreamRMSNorm(nn.Module):
50
+ def __init__(self, hidden_size, eps: float = 1e-6) -> None:
51
+ """
52
+ DreamRMSNorm is equivalent to T5LayerNorm
53
+ """
54
+ super().__init__()
55
+ self.weight = nn.Parameter(torch.ones(hidden_size))
56
+ self.variance_epsilon = eps
57
+
58
+ def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
59
+ input_dtype = hidden_states.dtype
60
+ hidden_states = hidden_states.to(torch.float32)
61
+ variance = hidden_states.pow(2).mean(-1, keepdim=True)
62
+ hidden_states = hidden_states * torch.rsqrt(variance + self.variance_epsilon)
63
+ return self.weight * hidden_states.to(input_dtype)
64
+
65
+ def extra_repr(self):
66
+ return f"{tuple(self.weight.shape)}, eps={self.variance_epsilon}"
67
+
68
+ class DreamMLP(nn.Module):
69
+ def __init__(self, config):
70
+ super().__init__()
71
+ self.config = config
72
+ self.hidden_size = config.hidden_size
73
+ self.intermediate_size = config.intermediate_size
74
+ self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
75
+ self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
76
+ self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
77
+ self.act_fn = ACT2FN[config.hidden_act]
78
+
79
+ def forward(self, x):
80
+ down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
81
+ return down_proj
82
+
83
+
84
+
85
+ class DreamRotaryEmbedding(nn.Module):
86
+ inv_freq: torch.Tensor # fix linting for `register_buffer`
87
+
88
+ def __init__(self, config: DreamConfig, device=None):
89
+ super().__init__()
90
+ # BC: "rope_type" was originally "type"
91
+ if hasattr(config, "rope_scaling") and config.rope_scaling is not None:
92
+ self.rope_type = config.rope_scaling.get(
93
+ "rope_type", config.rope_scaling.get("type"))
94
+ else:
95
+ self.rope_type = "default"
96
+ self.max_seq_len_cached = config.max_position_embeddings
97
+ self.original_max_seq_len = config.max_position_embeddings
98
+
99
+ self.config = config
100
+ rope_init_fn: Callable = self.compute_default_rope_parameters
101
+ if self.rope_type != "default":
102
+ rope_init_fn = ROPE_INIT_FUNCTIONS[self.rope_type]
103
+
104
+ inv_freq, self.attention_scaling = rope_init_fn(
105
+ self.config, device)
106
+ self.register_buffer("inv_freq", inv_freq, persistent=False)
107
+ self.original_inv_freq = self.inv_freq
108
+
109
+ @staticmethod
110
+ def compute_default_rope_parameters(
111
+ config: Optional[DreamConfig] = None,
112
+ device: Optional["torch.device"] = None,
113
+ seq_len: Optional[int] = None,
114
+ ) -> tuple["torch.Tensor", float]:
115
+ """
116
+ Computes the inverse frequencies according to the original RoPE implementation
117
+ Args:
118
+ config ([`~transformers.PreTrainedConfig`]):
119
+ The model configuration.
120
+ device (`torch.device`):
121
+ The device to use for initialization of the inverse frequencies.
122
+ seq_len (`int`, *optional*):
123
+ The current sequence length. Unused for this type of RoPE.
124
+ Returns:
125
+ Tuple of (`torch.Tensor`, `float`), containing the inverse frequencies for the RoPE embeddings and the
126
+ post-processing scaling factor applied to the computed cos/sin (unused in this type of RoPE).
127
+ """
128
+ base = config.rope_theta
129
+ dim = getattr(config, "head_dim", None) or config.hidden_size // config.num_attention_heads
130
+
131
+ attention_factor = 1.0 # Unused in this type of RoPE
132
+
133
+ # Compute the inverse frequencies
134
+ inv_freq = 1.0 / (
135
+ base ** (torch.arange(0, dim, 2, dtype=torch.int64).to(device=device, dtype=torch.float) / dim)
136
+ )
137
+ return inv_freq, attention_factor
138
+
139
+ @torch.no_grad()
140
+ @dynamic_rope_update # power user: used with advanced RoPE types (e.g. dynamic rope)
141
+ def forward(self, x, position_ids):
142
+ inv_freq_expanded = self.inv_freq[None, :, None].float().expand(position_ids.shape[0], -1, 1).to(x.device)
143
+ position_ids_expanded = position_ids[:, None, :].float()
144
+
145
+ device_type = x.device.type if isinstance(x.device.type, str) and x.device.type != "mps" else "cpu"
146
+ with torch.autocast(device_type=device_type, enabled=False): # Force float32
147
+ freqs = (inv_freq_expanded.float() @ position_ids_expanded.float()).transpose(1, 2)
148
+ emb = torch.cat((freqs, freqs), dim=-1)
149
+ cos = emb.cos() * self.attention_scaling
150
+ sin = emb.sin() * self.attention_scaling
151
+
152
+ return cos.to(dtype=x.dtype), sin.to(dtype=x.dtype)
153
+
154
+ def rotate_half(x):
155
+ """Rotates half the hidden dims of the input."""
156
+ x1 = x[..., : x.shape[-1] // 2]
157
+ x2 = x[..., x.shape[-1] // 2 :]
158
+ return torch.cat((-x2, x1), dim=-1)
159
+
160
+
161
+ def apply_rotary_pos_emb(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
162
+ """Applies Rotary Position Embedding to the query and key tensors.
163
+
164
+ Args:
165
+ q (`torch.Tensor`): The query tensor.
166
+ k (`torch.Tensor`): The key tensor.
167
+ cos (`torch.Tensor`): The cosine part of the rotary embedding.
168
+ sin (`torch.Tensor`): The sine part of the rotary embedding.
169
+ position_ids (`torch.Tensor`, *optional*):
170
+ Deprecated and unused.
171
+ unsqueeze_dim (`int`, *optional*, defaults to 1):
172
+ The 'unsqueeze_dim' argument specifies the dimension along which to unsqueeze cos[position_ids] and
173
+ sin[position_ids] so that they can be properly broadcasted to the dimensions of q and k. For example, note
174
+ that cos[position_ids] and sin[position_ids] have the shape [batch_size, seq_len, head_dim]. Then, if q and
175
+ k have the shape [batch_size, heads, seq_len, head_dim], then setting unsqueeze_dim=1 makes
176
+ cos[position_ids] and sin[position_ids] broadcastable to the shapes of q and k. Similarly, if q and k have
177
+ the shape [batch_size, seq_len, heads, head_dim], then set unsqueeze_dim=2.
178
+ Returns:
179
+ `tuple(torch.Tensor)` comprising of the query and key tensors rotated using the Rotary Position Embedding.
180
+ """
181
+ cos = cos.unsqueeze(unsqueeze_dim)
182
+ sin = sin.unsqueeze(unsqueeze_dim)
183
+ q_embed = (q * cos) + (rotate_half(q) * sin)
184
+ k_embed = (k * cos) + (rotate_half(k) * sin)
185
+ return q_embed, k_embed
186
+
187
+ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor:
188
+ """
189
+ This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch,
190
+ num_key_value_heads, seqlen, head_dim) to (batch, num_attention_heads, seqlen, head_dim)
191
+ """
192
+ batch, num_key_value_heads, slen, head_dim = hidden_states.shape
193
+ if n_rep == 1:
194
+ return hidden_states
195
+ hidden_states = hidden_states[:, :, None, :, :].expand(batch, num_key_value_heads, n_rep, slen, head_dim)
196
+ return hidden_states.reshape(batch, num_key_value_heads * n_rep, slen, head_dim)
197
+
198
+
199
+ def _prepare_attention_mask_for_backend(
200
+ attention_mask: torch.Tensor,
201
+ query: torch.Tensor,
202
+ key_len: int,
203
+ attn_implementation: str,
204
+ ) -> torch.Tensor:
205
+ """Convert block-diffusion 0/1 masks for SDPA (bool) or eager (additive float)."""
206
+ if attention_mask.dim() == 2:
207
+ attention_mask = attention_mask.unsqueeze(0)
208
+ if attention_mask.dim() == 3:
209
+ attention_mask = attention_mask[:, None, :, :key_len]
210
+ else:
211
+ attention_mask = attention_mask[:, :, :, :key_len]
212
+
213
+ if attn_implementation == "sdpa":
214
+ if attention_mask.dtype != torch.bool:
215
+ attention_mask = attention_mask != 0
216
+ else:
217
+ min_value = torch.finfo(query.dtype).min
218
+ attention_mask = torch.where(
219
+ attention_mask.to(dtype=query.dtype) > 0,
220
+ torch.zeros((), dtype=query.dtype, device=query.device),
221
+ min_value,
222
+ )
223
+ return attention_mask
224
+
225
+
226
+ def eager_attention_forward(
227
+ module: nn.Module,
228
+ query: torch.Tensor,
229
+ key: torch.Tensor,
230
+ value: torch.Tensor,
231
+ attention_mask: Optional[torch.Tensor],
232
+ scaling: float,
233
+ dropout: float = 0.0,
234
+ **kwargs: Unpack[FlashAttentionKwargs],
235
+ ):
236
+ key_states = repeat_kv(key, module.num_key_value_groups)
237
+ value_states = repeat_kv(value, module.num_key_value_groups)
238
+
239
+ attn_weights = torch.matmul(query, key_states.transpose(2, 3)) * scaling
240
+ if attention_mask is not None:
241
+ causal_mask = attention_mask[:, :, :, : key_states.shape[-2]]
242
+ attn_weights = attn_weights + causal_mask
243
+
244
+ attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=torch.float32).to(query.dtype)
245
+ attn_weights = nn.functional.dropout(attn_weights, p=dropout, training=module.training)
246
+ attn_output = torch.matmul(attn_weights, value_states)
247
+ attn_output = attn_output.transpose(1, 2).contiguous()
248
+
249
+ return attn_output, attn_weights
250
+
251
+
252
+
253
+ class DreamAttention(nn.Module):
254
+ """Multi-headed attention from 'Attention Is All You Need' paper"""
255
+
256
+ def __init__(self, config: DreamConfig, layer_idx: int):
257
+ super().__init__()
258
+ self.config = config
259
+ self.layer_idx = layer_idx
260
+ self.head_dim = getattr(config, "head_dim", config.hidden_size // config.num_attention_heads)
261
+ self.num_key_value_groups = config.num_attention_heads // config.num_key_value_heads
262
+ self.scaling = self.head_dim**-0.5
263
+ self.attention_dropout = config.attention_dropout
264
+ self.is_causal = True
265
+
266
+ self.q_proj = nn.Linear(
267
+ config.hidden_size, config.num_attention_heads * self.head_dim, bias=config.attention_bias
268
+ )
269
+ self.k_proj = nn.Linear(
270
+ config.hidden_size, config.num_key_value_heads * self.head_dim, bias=config.attention_bias
271
+ )
272
+ self.v_proj = nn.Linear(
273
+ config.hidden_size, config.num_key_value_heads * self.head_dim, bias=config.attention_bias
274
+ )
275
+ self.o_proj = nn.Linear(
276
+ config.num_attention_heads * self.head_dim, config.hidden_size, bias=config.attention_bias
277
+ )
278
+ self.rotary_fn = apply_rotary_pos_emb
279
+ self.q_norm = DreamRMSNorm(self.head_dim, eps=config.rms_norm_eps) # unlike olmo, only on the head dim!
280
+ self.k_norm = DreamRMSNorm(self.head_dim, eps=config.rms_norm_eps) # thus post q_norm does not need reshape
281
+ self.sliding_window = config.sliding_window
282
+
283
+ def forward(
284
+ self,
285
+ hidden_states: torch.Tensor,
286
+ position_embeddings: tuple[torch.Tensor, torch.Tensor],
287
+ attention_mask: Optional[torch.Tensor],
288
+ past_key_values: Optional[Cache] = None,
289
+ cache_position: Optional[torch.LongTensor] = None,
290
+ **kwargs: Unpack[FlashAttentionKwargs],
291
+ ) -> tuple[torch.Tensor, Optional[torch.Tensor]]:
292
+ input_shape = hidden_states.shape[:-1]
293
+ hidden_shape = (*input_shape, -1, self.head_dim)
294
+
295
+ query_states = self.q_norm(self.q_proj(hidden_states).view(hidden_shape)).transpose(1, 2)
296
+ key_states = self.k_norm(self.k_proj(hidden_states).view(hidden_shape)).transpose(1, 2)
297
+ value_states = self.v_proj(hidden_states).view(hidden_shape).transpose(1, 2)
298
+
299
+ cos, sin = position_embeddings
300
+ query_states, key_states = apply_rotary_pos_emb(query_states, key_states, cos, sin)
301
+
302
+ if past_key_values is not None and kwargs.get("store_kv", False):
303
+ cache_kwargs = {"sin": sin, "cos": cos, "cache_position": cache_position}
304
+ key_states, value_states = past_key_values.update(key_states, value_states, self.layer_idx, cache_kwargs)
305
+ elif past_key_values is not None and not kwargs.get("store_kv", False) and len(past_key_values) > self.layer_idx:
306
+ cache_layer = past_key_values.layers[self.layer_idx]
307
+ if cache_layer.is_initialized and cache_layer.get_seq_length() > 0:
308
+ key_states = torch.cat([cache_layer.keys, key_states], dim=-2)
309
+ value_states = torch.cat([cache_layer.values, value_states], dim=-2)
310
+
311
+ attention_interface: Callable = eager_attention_forward
312
+ attn_implementation = self.config._attn_implementation
313
+ if attn_implementation != "eager":
314
+ attention_interface = ALL_ATTENTION_FUNCTIONS[attn_implementation]
315
+
316
+ prepared_attention_mask = attention_mask
317
+ if attention_mask is not None:
318
+ prepared_attention_mask = _prepare_attention_mask_for_backend(
319
+ attention_mask,
320
+ query_states,
321
+ key_states.shape[-2],
322
+ attn_implementation,
323
+ )
324
+
325
+ attn_output, attn_weights = attention_interface(
326
+ self,
327
+ query_states,
328
+ key_states,
329
+ value_states,
330
+ prepared_attention_mask,
331
+ dropout=0.0 if not self.training else self.attention_dropout,
332
+ scaling=self.scaling,
333
+ sliding_window=self.sliding_window, # diff with Llama
334
+ **kwargs,
335
+ )
336
+
337
+ attn_output = attn_output.reshape(*input_shape, -1).contiguous()
338
+ attn_output = self.o_proj(attn_output)
339
+ return attn_output, attn_weights
340
+
341
+ class DreamDecoderLayer(GradientCheckpointingLayer):
342
+ def __init__(self, config: DreamConfig, layer_idx: int):
343
+ super().__init__()
344
+ self.hidden_size = config.hidden_size
345
+
346
+ self.self_attn = DreamAttention(config=config, layer_idx=layer_idx)
347
+
348
+ self.mlp = DreamMLP(config)
349
+ self.input_layernorm = DreamRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
350
+ self.post_attention_layernorm = DreamRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
351
+
352
+ def forward(
353
+ self,
354
+ hidden_states: torch.Tensor,
355
+ attention_mask: Optional[torch.Tensor] = None,
356
+ position_ids: Optional[torch.LongTensor] = None,
357
+ past_key_values: Optional[Cache] = None,
358
+ use_cache: Optional[bool] = False,
359
+ cache_position: Optional[torch.LongTensor] = None,
360
+ store_kv: Optional[bool] = False,
361
+ position_embeddings: Optional[tuple[torch.Tensor, torch.Tensor]] = None,
362
+ **kwargs: Unpack[FlashAttentionKwargs],
363
+ ) -> torch.Tensor:
364
+ residual = hidden_states
365
+ hidden_states = self.input_layernorm(hidden_states)
366
+ # Self Attention
367
+ hidden_states, _ = self.self_attn(
368
+ hidden_states=hidden_states,
369
+ attention_mask=attention_mask,
370
+ position_ids=position_ids,
371
+ past_key_values=past_key_values,
372
+ use_cache=use_cache,
373
+ cache_position=cache_position,
374
+ store_kv=store_kv,
375
+ position_embeddings=position_embeddings,
376
+ **kwargs,
377
+ )
378
+ hidden_states = residual + hidden_states
379
+
380
+ # Fully Connected
381
+ residual = hidden_states
382
+ hidden_states = self.post_attention_layernorm(hidden_states)
383
+ hidden_states = self.mlp(hidden_states)
384
+ hidden_states = residual + hidden_states
385
+ return hidden_states
386
+
387
+ @auto_docstring
388
+ class DreamPreTrainedModel(PreTrainedModel):
389
+ config_class = DreamConfig
390
+ base_model_prefix = "model"
391
+ supports_gradient_checkpointing = True
392
+ _no_split_modules = ["DreamDecoderLayer"]
393
+ _skip_keys_device_placement = ["past_key_values"]
394
+ _supports_flash_attn = True
395
+ _supports_sdpa = True
396
+ _supports_flex_attn = True
397
+
398
+ _can_compile_fullgraph = True
399
+ _supports_attention_backend = True
400
+ _can_record_outputs = {
401
+ "hidden_states": DreamDecoderLayer,
402
+ "attentions": DreamAttention,
403
+ }
404
+
405
+
406
+ @auto_docstring
407
+ class DreamModel(DreamPreTrainedModel):
408
+ def __init__(self, config: DreamConfig):
409
+ super().__init__(config)
410
+ self.padding_idx = getattr(config, "pad_token_id", None) or config.eos_token_id
411
+ self.vocab_size = config.vocab_size
412
+
413
+ self.embed_tokens = nn.Embedding(config.vocab_size, config.hidden_size, self.padding_idx)
414
+ self.layers = nn.ModuleList(
415
+ [DreamDecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
416
+ )
417
+ self.norm = DreamRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
418
+ self.rotary_emb = DreamRotaryEmbedding(config=config)
419
+ self.gradient_checkpointing = False
420
+
421
+ # Initialize weights and apply final processing
422
+ self.post_init()
423
+
424
+ @auto_docstring
425
+ def forward(
426
+ self,
427
+ input_ids: Optional[torch.LongTensor] = None,
428
+ attention_mask: Optional[torch.Tensor] = None,
429
+ position_ids: Optional[torch.LongTensor] = None,
430
+ past_key_values: Optional[Cache] = None,
431
+ inputs_embeds: Optional[torch.FloatTensor] = None,
432
+ use_cache: Optional[bool] = None,
433
+ cache_position: Optional[torch.LongTensor] = None,
434
+ store_kv: Optional[bool] = None,
435
+ **kwargs: Unpack[FlashAttentionKwargs],
436
+ ) -> BaseModelOutputWithPast:
437
+ r"""
438
+ cache_position (`torch.LongTensor` of shape `(sequence_length)`, *optional*):
439
+ Indices depicting the position of the present input tokens in the KV cache. Used for position
440
+ embeddings and attention masking during generation.
441
+ store_kv (`bool`, *optional*):
442
+ Whether to store key-value states in the cache during this forward pass. When `True`, the computed
443
+ key and value states are updated in `past_key_values`.
444
+ """
445
+ if (input_ids is None) ^ (inputs_embeds is not None):
446
+ raise ValueError("You must specify exactly one of input_ids or inputs_embeds")
447
+
448
+ if inputs_embeds is None:
449
+ inputs_embeds = self.embed_tokens(input_ids)
450
+
451
+ if use_cache and past_key_values is None:
452
+ past_key_values = DynamicCache(config=self.config)
453
+
454
+ if cache_position is None:
455
+ past_seen_tokens = past_key_values.get_seq_length() if past_key_values is not None else 0
456
+ cache_position = torch.arange(
457
+ past_seen_tokens, past_seen_tokens + inputs_embeds.shape[1], device=inputs_embeds.device
458
+ )
459
+
460
+ if position_ids is None:
461
+ position_ids = cache_position.unsqueeze(0)
462
+
463
+ # We skip causal masking creation in Dream models
464
+
465
+ hidden_states = inputs_embeds
466
+ position_embeddings = self.rotary_emb(hidden_states, position_ids)
467
+
468
+ for decoder_layer in self.layers[: self.config.num_hidden_layers]:
469
+ hidden_states = decoder_layer(
470
+ hidden_states,
471
+ attention_mask=attention_mask,
472
+ position_embeddings=position_embeddings,
473
+ position_ids=position_ids,
474
+ past_key_values=past_key_values,
475
+ use_cache=use_cache,
476
+ cache_position=cache_position,
477
+ store_kv=store_kv,
478
+ **kwargs,
479
+ )
480
+
481
+ hidden_states = self.norm(hidden_states)
482
+ return BaseModelOutputWithPast(
483
+ last_hidden_state=hidden_states,
484
+ past_key_values=past_key_values if use_cache else None,
485
+ )
486
+
487
+ @auto_docstring
488
+ class DreamForCausalLM(DreamPreTrainedModel, BlockDiffusionGenerationMixin, GenerationMixin):
489
+ _tied_weights_keys = {"lm_head.weight": "model.embed_tokens.weight"}
490
+ _tp_plan = {"lm_head": "colwise_rep"}
491
+ _pp_plan = {"lm_head": (["hidden_states"], ["logits"])}
492
+
493
+ def __init__(self, config):
494
+ super().__init__(config)
495
+ self.model = DreamModel(config)
496
+ self.vocab_size = config.vocab_size
497
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
498
+
499
+ # Initialize weights and apply final processing
500
+ self.post_init()
501
+
502
+ @can_return_tuple
503
+ @auto_docstring
504
+ def forward(
505
+ self,
506
+ input_ids: Optional[torch.LongTensor] = None,
507
+ attention_mask: Optional[torch.Tensor] = None,
508
+ position_ids: Optional[torch.LongTensor] = None,
509
+ past_key_values: Optional[Cache] = None,
510
+ inputs_embeds: Optional[torch.FloatTensor] = None,
511
+ labels: Optional[torch.LongTensor] = None,
512
+ use_cache: Optional[bool] = None,
513
+ cache_position: Optional[torch.LongTensor] = None,
514
+ logits_to_keep: Union[int, torch.Tensor] = 0,
515
+ **kwargs: Unpack[TransformersKwargs],
516
+ ) -> CausalLMOutputWithPast:
517
+ r"""
518
+ cache_position (`torch.LongTensor` of shape `(sequence_length)`, *optional*):
519
+ Indices depicting the position of the present input tokens in the KV cache. Used for position
520
+ embeddings and attention masking during generation.
521
+ labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
522
+ Labels for computing the masked language modeling loss. Indices should either be in `[0, ...,
523
+ config.vocab_size]` or -100 (see `input_ids` docstring). Tokens with indices set to `-100` are ignored
524
+ (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`.
525
+
526
+ Example:
527
+
528
+ ```python
529
+ >>> from transformers import AutoTokenizer, DreamForCausalLM
530
+
531
+ >>> model = DreamForCausalLM.from_pretrained("Dream-org/Dream-Reasoner-8B")
532
+ >>> tokenizer = AutoTokenizer.from_pretrained("Dream-org/Dream-Reasoner-8B")
533
+
534
+ >>> prompt = "Hey, are you conscious? Can you talk to me?"
535
+ >>> inputs = tokenizer(prompt, return_tensors="pt")
536
+
537
+ >>> # Generate
538
+ >>> generate_ids = model.generate(inputs.input_ids, max_length=30)
539
+ >>> tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
540
+ "Hey, are you conscious? Can you talk to me?\nI'm not conscious, but I can talk to you."
541
+ ```"""
542
+ outputs: BaseModelOutputWithPast = self.model(
543
+ input_ids=input_ids,
544
+ attention_mask=attention_mask,
545
+ position_ids=position_ids,
546
+ past_key_values=past_key_values,
547
+ inputs_embeds=inputs_embeds,
548
+ use_cache=use_cache,
549
+ cache_position=cache_position,
550
+ **kwargs,
551
+ )
552
+
553
+ hidden_states = outputs.last_hidden_state
554
+ # Only compute necessary logits, and do not upcast them to float if we are not computing the loss
555
+ slice_indices = slice(-logits_to_keep, None) if isinstance(logits_to_keep, int) else logits_to_keep
556
+ logits = self.lm_head(hidden_states[:, slice_indices, :])
557
+
558
+ loss = None
559
+ if labels is not None:
560
+ loss = self.loss_function(logits=logits, labels=labels, vocab_size=self.config.vocab_size, **kwargs)
561
+
562
+ return CausalLMOutputWithPast(
563
+ loss=loss,
564
+ logits=logits,
565
+ past_key_values=outputs.past_key_values,
566
+ hidden_states=outputs.hidden_states,
567
+ attentions=outputs.attentions,
568
+ )
569
+
570
+ __all__ = [
571
+ "DreamForCausalLM",
572
+ "DreamModel",
573
+ "DreamPreTrainedModel",
574
+ ]
models/dreamreasoner-8b/special_tokens_map.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<|object_ref_start|>",
6
+ "<|object_ref_end|>",
7
+ "<|box_start|>",
8
+ "<|box_end|>",
9
+ "<|quad_start|>",
10
+ "<|quad_end|>",
11
+ "<|vision_start|>",
12
+ "<|vision_end|>",
13
+ "<|vision_pad|>",
14
+ "<|image_pad|>",
15
+ "<|video_pad|>",
16
+ "<|MASK|>"
17
+ ],
18
+ "eos_token": {
19
+ "content": "<|im_end|>",
20
+ "lstrip": false,
21
+ "normalized": false,
22
+ "rstrip": false,
23
+ "single_word": false
24
+ },
25
+ "mask_token": {
26
+ "content": "<|MASK|>",
27
+ "lstrip": false,
28
+ "normalized": false,
29
+ "rstrip": false,
30
+ "single_word": false
31
+ },
32
+ "pad_token": {
33
+ "content": "<|endoftext|>",
34
+ "lstrip": false,
35
+ "normalized": false,
36
+ "rstrip": false,
37
+ "single_word": false
38
+ }
39
+ }
models/dreamreasoner-8b/tokenization_dream.py ADDED
@@ -0,0 +1,342 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+ # Copyright 2024 The Dream team, HKUNLP Group and The HuggingFace Inc. team. All rights reserved.
3
+ #
4
+ # This code is based on Qwen's implementations in this library.
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ """Tokenization classes for DreamReasoner."""
17
+
18
+ import json
19
+ import os
20
+ import unicodedata
21
+ from functools import lru_cache
22
+ from typing import Optional, Tuple
23
+
24
+ import regex as re
25
+
26
+ from transformers.tokenization_utils import AddedToken, PreTrainedTokenizer
27
+ from transformers.utils import logging
28
+
29
+
30
+ logger = logging.get_logger(__name__)
31
+
32
+ VOCAB_FILES_NAMES = {
33
+ "vocab_file": "vocab.json",
34
+ "merges_file": "merges.txt",
35
+ }
36
+
37
+
38
+ MAX_MODEL_INPUT_SIZES = {"dream/dream-tokenizer": 32768}
39
+
40
+ PRETOKENIZE_REGEX = r"""(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\r\n\p{L}\p{N}]?\p{L}+|\p{N}| ?[^\s\p{L}\p{N}]+[\r\n]*|\s*[\r\n]+|\s+(?!\S)|\s+"""
41
+
42
+
43
+ @lru_cache()
44
+ # Copied from transformers.models.gpt2.tokenization_gpt2.bytes_to_unicode
45
+ def bytes_to_unicode():
46
+ """
47
+ Returns list of utf-8 byte and a mapping to unicode strings. We specifically avoids mapping to whitespace/control
48
+ characters the bpe code barfs on.
49
+
50
+ The reversible bpe codes work on unicode strings. This means you need a large # of unicode characters in your vocab
51
+ if you want to avoid UNKs. When you're at something like a 10B token dataset you end up needing around 5K for
52
+ decent coverage. This is a significant percentage of your normal, say, 32K bpe vocab. To avoid that, we want lookup
53
+ tables between utf-8 bytes and unicode strings.
54
+ """
55
+ bs = (
56
+ list(range(ord("!"), ord("~") + 1)) + list(range(ord("¡"), ord("¬") + 1)) + list(range(ord("®"), ord("ÿ") + 1))
57
+ )
58
+ cs = bs[:]
59
+ n = 0
60
+ for b in range(2**8):
61
+ if b not in bs:
62
+ bs.append(b)
63
+ cs.append(2**8 + n)
64
+ n += 1
65
+ cs = [chr(n) for n in cs]
66
+ return dict(zip(bs, cs))
67
+
68
+
69
+ # Copied from transformers.models.gpt2.tokenization_gpt2.get_pairs
70
+ def get_pairs(word):
71
+ """
72
+ Return set of symbol pairs in a word.
73
+
74
+ Word is represented as tuple of symbols (symbols being variable-length strings).
75
+ """
76
+ pairs = set()
77
+ prev_char = word[0]
78
+ for char in word[1:]:
79
+ pairs.add((prev_char, char))
80
+ prev_char = char
81
+ return pairs
82
+
83
+
84
+ class DreamTokenizer(PreTrainedTokenizer):
85
+ """
86
+ Construct a Dream tokenizer. Based on byte-level Byte-Pair-Encoding.
87
+
88
+ Same with GPT2Tokenizer, this tokenizer has been trained to treat spaces like parts of the tokens so a word will
89
+ be encoded differently whether it is at the beginning of the sentence (without space) or not:
90
+
91
+ ```python
92
+ >>> from transformers import AutoTokenizer
93
+
94
+ >>> tokenizer = AutoTokenizer.from_pretrained("Dream-org/Dream-v0-Base-7B", trust_remote_code=True)
95
+ >>> tokenizer("Hello world")["input_ids"]
96
+ [9707, 1879]
97
+
98
+ >>> tokenizer(" Hello world")["input_ids"]
99
+ [21927, 1879]
100
+ ```
101
+ This is expected.
102
+
103
+ You should not use GPT2Tokenizer instead, because of the different pretokenization rules.
104
+
105
+ This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
106
+ this superclass for more information regarding those methods.
107
+
108
+ Args:
109
+ vocab_file (`str`):
110
+ Path to the vocabulary file.
111
+ merges_file (`str`):
112
+ Path to the merges file.
113
+ errors (`str`, *optional*, defaults to `"replace"`):
114
+ Paradigm to follow when decoding bytes to UTF-8. See
115
+ [bytes.decode](https://docs.python.org/3/library/stdtypes.html#bytes.decode) for more information.
116
+ unk_token (`str`, *optional*, defaults to `"<|endoftext|>"`):
117
+ The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
118
+ token instead.
119
+ bos_token (`str`, *optional*):
120
+ The beginning of sequence token. Not applicable for this tokenizer.
121
+ eos_token (`str`, *optional*, defaults to `"<|endoftext|>"`):
122
+ The end of sequence token.
123
+ pad_token (`str`, *optional*, defaults to `"<|endoftext|>"`):
124
+ The token used for padding, for example when batching sequences of different lengths.
125
+ clean_up_tokenization_spaces (`bool`, *optional*, defaults to `False`):
126
+ Whether or not the model should cleanup the spaces that were added when splitting the input text during the
127
+ tokenization process. Not applicable to this tokenizer, since tokenization does not add spaces.
128
+ split_special_tokens (`bool`, *optional*, defaults to `False`):
129
+ Whether or not the special tokens should be split during the tokenization process. The default behavior is
130
+ to not split special tokens. This means that if `<|endoftext|>` is the `eos_token`, then `tokenizer.tokenize("<|endoftext|>") =
131
+ ['<|endoftext|>`]. Otherwise, if `split_special_tokens=True`, then `tokenizer.tokenize("<|endoftext|>")` will be give `['<',
132
+ '|', 'endo', 'ft', 'ext', '|', '>']`. This argument is only supported for `slow` tokenizers for the moment.
133
+ """
134
+
135
+ vocab_files_names = VOCAB_FILES_NAMES
136
+ model_input_names = ["input_ids", "attention_mask"]
137
+
138
+ def __init__(
139
+ self,
140
+ vocab_file,
141
+ merges_file,
142
+ errors="replace",
143
+ unk_token="<|endoftext|>",
144
+ bos_token=None,
145
+ eos_token="<|endoftext|>",
146
+ pad_token="<|endoftext|>",
147
+ clean_up_tokenization_spaces=False,
148
+ split_special_tokens=False,
149
+ **kwargs,
150
+ ):
151
+ # Dream vocab does not contain control tokens; added tokens need to be special
152
+ bos_token = (
153
+ AddedToken(bos_token, lstrip=False, rstrip=False, special=True, normalized=False)
154
+ if isinstance(bos_token, str)
155
+ else bos_token
156
+ )
157
+ eos_token = (
158
+ AddedToken(eos_token, lstrip=False, rstrip=False, special=True, normalized=False)
159
+ if isinstance(eos_token, str)
160
+ else eos_token
161
+ )
162
+ unk_token = (
163
+ AddedToken(unk_token, lstrip=False, rstrip=False, special=True, normalized=False)
164
+ if isinstance(unk_token, str)
165
+ else unk_token
166
+ )
167
+ pad_token = (
168
+ AddedToken(pad_token, lstrip=False, rstrip=False, special=True, normalized=False)
169
+ if isinstance(pad_token, str)
170
+ else pad_token
171
+ )
172
+
173
+ with open(vocab_file, encoding="utf-8") as vocab_handle:
174
+ self.encoder = json.load(vocab_handle)
175
+ self.decoder = {v: k for k, v in self.encoder.items()}
176
+ self.errors = errors # how to handle errors in decoding
177
+ self.byte_encoder = bytes_to_unicode()
178
+ self.byte_decoder = {v: k for k, v in self.byte_encoder.items()}
179
+ bpe_merges = []
180
+ with open(merges_file, encoding="utf-8") as merges_handle:
181
+ for i, line in enumerate(merges_handle):
182
+ line = line.strip()
183
+ if (i == 0 and line.startswith("#version:")) or not line:
184
+ continue
185
+ bpe_merges.append(tuple(line.split()))
186
+ self.bpe_ranks = dict(zip(bpe_merges, range(len(bpe_merges))))
187
+ # NOTE: the cache can grow without bound and will get really large for long running processes
188
+ # (esp. for texts of language that do not use space between word, e.g. Chinese); technically
189
+ # not a memory leak but appears as one.
190
+ # GPT2Tokenizer has the same problem, so let's be consistent.
191
+ self.cache = {}
192
+
193
+ self.pat = re.compile(PRETOKENIZE_REGEX)
194
+
195
+ if kwargs.get("add_prefix_space", False):
196
+ logger.warning_once(
197
+ f"{self.__class__.__name} does not support `add_prefix_space`, setting it to True has no effect."
198
+ )
199
+
200
+ super().__init__(
201
+ errors=errors,
202
+ bos_token=bos_token,
203
+ eos_token=eos_token,
204
+ pad_token=pad_token,
205
+ unk_token=unk_token,
206
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
207
+ split_special_tokens=split_special_tokens,
208
+ **kwargs,
209
+ )
210
+
211
+ @property
212
+ def vocab_size(self) -> int:
213
+ return len(self.encoder)
214
+
215
+ # Copied from transformers.models.gpt2.tokenization_gpt2.GPT2Tokenizer.get_vocab
216
+ def get_vocab(self):
217
+ return dict(self.encoder, **self.added_tokens_encoder)
218
+
219
+ # Copied from transformers.models.gpt2.tokenization_gpt2.GPT2Tokenizer.bpe
220
+ def bpe(self, token):
221
+ if token in self.cache:
222
+ return self.cache[token]
223
+ word = tuple(token)
224
+ pairs = get_pairs(word)
225
+
226
+ if not pairs:
227
+ return token
228
+
229
+ while True:
230
+ bigram = min(pairs, key=lambda pair: self.bpe_ranks.get(pair, float("inf")))
231
+ if bigram not in self.bpe_ranks:
232
+ break
233
+ first, second = bigram
234
+ new_word = []
235
+ i = 0
236
+ while i < len(word):
237
+ try:
238
+ j = word.index(first, i)
239
+ except ValueError:
240
+ new_word.extend(word[i:])
241
+ break
242
+ else:
243
+ new_word.extend(word[i:j])
244
+ i = j
245
+
246
+ if word[i] == first and i < len(word) - 1 and word[i + 1] == second:
247
+ new_word.append(first + second)
248
+ i += 2
249
+ else:
250
+ new_word.append(word[i])
251
+ i += 1
252
+ new_word = tuple(new_word)
253
+ word = new_word
254
+ if len(word) == 1:
255
+ break
256
+ else:
257
+ pairs = get_pairs(word)
258
+ word = " ".join(word)
259
+ self.cache[token] = word
260
+ return word
261
+
262
+ # Copied from transformers.models.gpt2.tokenization_gpt2.GPT2Tokenizer._tokenize
263
+ def _tokenize(self, text):
264
+ """Tokenize a string."""
265
+ bpe_tokens = []
266
+ for token in re.findall(self.pat, text):
267
+ token = "".join(
268
+ self.byte_encoder[b] for b in token.encode("utf-8")
269
+ ) # Maps all our bytes to unicode strings, avoiding control tokens of the BPE (spaces in our case)
270
+ bpe_tokens.extend(bpe_token for bpe_token in self.bpe(token).split(" "))
271
+ return bpe_tokens
272
+
273
+ # Copied from transformers.models.gpt2.tokenization_gpt2.GPT2Tokenizer._convert_token_to_id
274
+ def _convert_token_to_id(self, token):
275
+ """Converts a token (str) in an id using the vocab."""
276
+ return self.encoder.get(token, self.encoder.get(self.unk_token))
277
+
278
+ # Copied from transformers.models.gpt2.tokenization_gpt2.GPT2Tokenizer._convert_id_to_token
279
+ def _convert_id_to_token(self, index):
280
+ """Converts an index (integer) in a token (str) using the vocab."""
281
+ return self.decoder.get(index)
282
+
283
+ # Copied from transformers.models.gpt2.tokenization_gpt2.GPT2Tokenizer.convert_tokens_to_string
284
+ def convert_tokens_to_string(self, tokens):
285
+ """Converts a sequence of tokens (string) in a single string."""
286
+ text = "".join(tokens)
287
+ text = bytearray([self.byte_decoder[c] for c in text]).decode("utf-8", errors=self.errors)
288
+ return text
289
+
290
+ def decode(
291
+ self,
292
+ token_ids,
293
+ skip_special_tokens: bool = False,
294
+ clean_up_tokenization_spaces: Optional[bool] = False,
295
+ spaces_between_special_tokens: bool = False,
296
+ **kwargs,
297
+ ) -> str:
298
+ # `spaces_between_special_tokens` defaults to True for _decode in slow tokenizers
299
+ # and cannot be configured elsewhere, but it should default to False for DreamTokenizer
300
+ return super().decode(
301
+ token_ids,
302
+ skip_special_tokens=skip_special_tokens,
303
+ clean_up_tokenization_spaces=clean_up_tokenization_spaces,
304
+ spaces_between_special_tokens=spaces_between_special_tokens,
305
+ **kwargs,
306
+ )
307
+
308
+ # Copied from transformers.models.gpt2.tokenization_gpt2.GPT2Tokenizer.save_vocabulary
309
+ def save_vocabulary(self, save_directory: str, filename_prefix: Optional[str] = None) -> Tuple[str]:
310
+ if not os.path.isdir(save_directory):
311
+ logger.error(f"Vocabulary path ({save_directory}) should be a directory")
312
+ return
313
+ vocab_file = os.path.join(
314
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]
315
+ )
316
+ merge_file = os.path.join(
317
+ save_directory, (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["merges_file"]
318
+ )
319
+
320
+ with open(vocab_file, "w", encoding="utf-8") as f:
321
+ f.write(json.dumps(self.encoder, indent=2, sort_keys=True, ensure_ascii=False) + "\n")
322
+
323
+ index = 0
324
+ with open(merge_file, "w", encoding="utf-8") as writer:
325
+ writer.write("#version: 0.2\n")
326
+ for bpe_tokens, token_index in sorted(self.bpe_ranks.items(), key=lambda kv: kv[1]):
327
+ if index != token_index:
328
+ logger.warning(
329
+ f"Saving vocabulary to {merge_file}: BPE merge indices are not consecutive."
330
+ " Please check that the tokenizer is not corrupted!"
331
+ )
332
+ index = token_index
333
+ writer.write(" ".join(bpe_tokens) + "\n")
334
+ index += 1
335
+
336
+ return vocab_file, merge_file
337
+
338
+ def prepare_for_tokenization(self, text, **kwargs):
339
+ text = unicodedata.normalize("NFC", text)
340
+ return (text, kwargs)
341
+
342
+ __all__ = ["DreamTokenizer"]
models/dreamreasoner-8b/tokenizer_config.json ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "151643": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "151644": {
14
+ "content": "<|im_start|>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "151645": {
22
+ "content": "<|im_end|>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "151646": {
30
+ "content": "<|object_ref_start|>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "151647": {
38
+ "content": "<|object_ref_end|>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "151648": {
46
+ "content": "<|box_start|>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "151649": {
54
+ "content": "<|box_end|>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "151650": {
62
+ "content": "<|quad_start|>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "151651": {
70
+ "content": "<|quad_end|>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "151652": {
78
+ "content": "<|vision_start|>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "151653": {
86
+ "content": "<|vision_end|>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "151654": {
94
+ "content": "<|vision_pad|>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "151655": {
102
+ "content": "<|image_pad|>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "151656": {
110
+ "content": "<|video_pad|>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "151657": {
118
+ "content": "<tool_call>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": false
124
+ },
125
+ "151658": {
126
+ "content": "</tool_call>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": false
132
+ },
133
+ "151659": {
134
+ "content": "<|fim_prefix|>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": false
140
+ },
141
+ "151660": {
142
+ "content": "<|fim_middle|>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": false
148
+ },
149
+ "151661": {
150
+ "content": "<|fim_suffix|>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": false
156
+ },
157
+ "151662": {
158
+ "content": "<|fim_pad|>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": false
164
+ },
165
+ "151663": {
166
+ "content": "<|repo_name|>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": false
172
+ },
173
+ "151664": {
174
+ "content": "<|file_sep|>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": false
180
+ },
181
+ "151665": {
182
+ "content": "<tool_response>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": false
188
+ },
189
+ "151666": {
190
+ "content": "</tool_response>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": false
196
+ },
197
+ "151667": {
198
+ "content": "<think>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": false
204
+ },
205
+ "151668": {
206
+ "content": "</think>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": false
212
+ },
213
+ "151669": {
214
+ "content": "<|MASK|>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ }
221
+ },
222
+ "additional_special_tokens": [
223
+ "<|im_start|>",
224
+ "<|im_end|>",
225
+ "<|object_ref_start|>",
226
+ "<|object_ref_end|>",
227
+ "<|box_start|>",
228
+ "<|box_end|>",
229
+ "<|quad_start|>",
230
+ "<|quad_end|>",
231
+ "<|vision_start|>",
232
+ "<|vision_end|>",
233
+ "<|vision_pad|>",
234
+ "<|image_pad|>",
235
+ "<|video_pad|>",
236
+ "<|MASK|>"
237
+ ],
238
+ "auto_map": {
239
+ "AutoTokenizer": [
240
+ "tokenization_dream.DreamTokenizer",
241
+ null
242
+ ]
243
+ },
244
+ "bos_token": null,
245
+ "clean_up_tokenization_spaces": false,
246
+ "eos_token": "<|im_end|>",
247
+ "errors": "replace",
248
+ "extra_special_tokens": {},
249
+ "mask_token": "<|MASK|>",
250
+ "model_max_length": 131072,
251
+ "pad_token": "<|endoftext|>",
252
+ "padding_side": "right",
253
+ "split_special_tokens": false,
254
+ "tokenizer_class": "DreamTokenizer",
255
+ "unk_token": null
256
+ }
models/dreamreasoner-8b/vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
runs/basecode/bd-base-sweep_678190.err ADDED
File without changes
runs/basecode/bd-base-sweep_678190.out ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ [info] started_at=2026-07-09T01:28:25+08:00
2
+ [info] node=xcnc17
3
+ [info] output=/home/l/liyj/shiying/hku_diffusion_dllm/runs/basecode/sweep_678190.jsonl
4
+ [info] latest=/home/l/liyj/shiying/hku_diffusion_dllm/runs/basecode/latest_sweep.jsonl
5
+ [info] finished_at=2026-07-09T01:28:26+08:00
runs/basecode/latest_sweep.jsonl ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10], "text": "3 4 5 6 7 8 9 10", "nfe": 6, "elapsed_s": 0.000769949983805418, "tokens_per_forward": 1.3333333333333333, "metadata": {"method": "confidence", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 8, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 10390.285301988866, "sweep": {"method": "confidence", "steps": 6, "block_size": 8, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": false}}
2
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10], "text": "3 4 5 6 7 8 9 10", "nfe": 4, "elapsed_s": 0.0005228999652899802, "tokens_per_forward": 2.0, "metadata": {"method": "dmax", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 8, "num_blocks": 1, "steps": 4, "remask_ratio": 0.25, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 15299.293423290836, "sweep": {"method": "dmax", "steps": 4, "block_size": 8, "num_blocks": 1, "remask_ratio": 0.25, "use_cache": false}}
3
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10], "text": "3 4 5 6 7 8 9 10", "nfe": 6, "elapsed_s": 0.0007856350275687873, "tokens_per_forward": 1.3333333333333333, "metadata": {"method": "speculative", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 8, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 10182.845366195881, "sweep": {"method": "speculative", "steps": 6, "block_size": 8, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": true}}
4
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18", "nfe": 6, "elapsed_s": 0.001491333998274058, "tokens_per_forward": 2.6666666666666665, "metadata": {"method": "confidence", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 10728.64966433879, "sweep": {"method": "confidence", "steps": 6, "block_size": 16, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": false}}
5
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18", "nfe": 4, "elapsed_s": 0.0010131489834748209, "tokens_per_forward": 4.0, "metadata": {"method": "dmax", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 1, "steps": 4, "remask_ratio": 0.25, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 15792.346694288162, "sweep": {"method": "dmax", "steps": 4, "block_size": 16, "num_blocks": 1, "remask_ratio": 0.25, "use_cache": false}}
6
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18", "nfe": 6, "elapsed_s": 0.0014925010036677122, "tokens_per_forward": 2.6666666666666665, "metadata": {"method": "speculative", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 10720.260797601588, "sweep": {"method": "speculative", "steps": 6, "block_size": 16, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": true}}
7
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34", "nfe": 6, "elapsed_s": 0.0029353260179050267, "tokens_per_forward": 5.333333333333333, "metadata": {"method": "confidence", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 32, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 10901.68512962616, "sweep": {"method": "confidence", "steps": 6, "block_size": 32, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": false}}
8
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34", "nfe": 4, "elapsed_s": 0.0019988870481029153, "tokens_per_forward": 8.0, "metadata": {"method": "dmax", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 32, "num_blocks": 1, "steps": 4, "remask_ratio": 0.25, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 16008.908572583056, "sweep": {"method": "dmax", "steps": 4, "block_size": 32, "num_blocks": 1, "remask_ratio": 0.25, "use_cache": false}}
9
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34", "nfe": 6, "elapsed_s": 0.0029457149794325233, "tokens_per_forward": 5.333333333333333, "metadata": {"method": "speculative", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 32, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 10863.237014928252, "sweep": {"method": "speculative", "steps": 6, "block_size": 32, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": true}}
10
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34", "nfe": 8, "elapsed_s": 0.00392380595440045, "tokens_per_forward": 4.0, "metadata": {"method": "multiblock", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 2, "steps": 8, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 8155.347224577404, "sweep": {"method": "multiblock", "steps": 8, "block_size": 16, "num_blocks": 2, "remask_ratio": 0.5, "use_cache": true}}
11
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66", "nfe": 8, "elapsed_s": 0.008637683000415564, "tokens_per_forward": 8.0, "metadata": {"method": "multiblock", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 4, "steps": 8, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 7409.394393950429, "sweep": {"method": "multiblock", "steps": 8, "block_size": 16, "num_blocks": 4, "remask_ratio": 0.5, "use_cache": true}}
12
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 3, 4, 5], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 3 4 5", "nfe": 8, "elapsed_s": 0.01631542103132233, "tokens_per_forward": 16.0, "metadata": {"method": "multiblock", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 8, "steps": 8, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 7845.338453372777, "sweep": {"method": "multiblock", "steps": 8, "block_size": 16, "num_blocks": 8, "remask_ratio": 0.5, "use_cache": true}}
runs/basecode/sweep_678190.jsonl ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10], "text": "3 4 5 6 7 8 9 10", "nfe": 6, "elapsed_s": 0.000769949983805418, "tokens_per_forward": 1.3333333333333333, "metadata": {"method": "confidence", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 8, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 10390.285301988866, "sweep": {"method": "confidence", "steps": 6, "block_size": 8, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": false}}
2
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10], "text": "3 4 5 6 7 8 9 10", "nfe": 4, "elapsed_s": 0.0005228999652899802, "tokens_per_forward": 2.0, "metadata": {"method": "dmax", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 8, "num_blocks": 1, "steps": 4, "remask_ratio": 0.25, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 15299.293423290836, "sweep": {"method": "dmax", "steps": 4, "block_size": 8, "num_blocks": 1, "remask_ratio": 0.25, "use_cache": false}}
3
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10], "text": "3 4 5 6 7 8 9 10", "nfe": 6, "elapsed_s": 0.0007856350275687873, "tokens_per_forward": 1.3333333333333333, "metadata": {"method": "speculative", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 8, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 10182.845366195881, "sweep": {"method": "speculative", "steps": 6, "block_size": 8, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": true}}
4
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18", "nfe": 6, "elapsed_s": 0.001491333998274058, "tokens_per_forward": 2.6666666666666665, "metadata": {"method": "confidence", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 10728.64966433879, "sweep": {"method": "confidence", "steps": 6, "block_size": 16, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": false}}
5
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18", "nfe": 4, "elapsed_s": 0.0010131489834748209, "tokens_per_forward": 4.0, "metadata": {"method": "dmax", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 1, "steps": 4, "remask_ratio": 0.25, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 15792.346694288162, "sweep": {"method": "dmax", "steps": 4, "block_size": 16, "num_blocks": 1, "remask_ratio": 0.25, "use_cache": false}}
6
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18", "nfe": 6, "elapsed_s": 0.0014925010036677122, "tokens_per_forward": 2.6666666666666665, "metadata": {"method": "speculative", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 10720.260797601588, "sweep": {"method": "speculative", "steps": 6, "block_size": 16, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": true}}
7
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34", "nfe": 6, "elapsed_s": 0.0029353260179050267, "tokens_per_forward": 5.333333333333333, "metadata": {"method": "confidence", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 32, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 10901.68512962616, "sweep": {"method": "confidence", "steps": 6, "block_size": 32, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": false}}
8
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34", "nfe": 4, "elapsed_s": 0.0019988870481029153, "tokens_per_forward": 8.0, "metadata": {"method": "dmax", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 32, "num_blocks": 1, "steps": 4, "remask_ratio": 0.25, "use_cache": false, "draft_width": 4}}, "tokens_per_second": 16008.908572583056, "sweep": {"method": "dmax", "steps": 4, "block_size": 32, "num_blocks": 1, "remask_ratio": 0.25, "use_cache": false}}
9
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34", "nfe": 6, "elapsed_s": 0.0029457149794325233, "tokens_per_forward": 5.333333333333333, "metadata": {"method": "speculative", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 32, "num_blocks": 1, "steps": 6, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 10863.237014928252, "sweep": {"method": "speculative", "steps": 6, "block_size": 32, "num_blocks": 1, "remask_ratio": 0.5, "use_cache": true}}
10
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34", "nfe": 8, "elapsed_s": 0.00392380595440045, "tokens_per_forward": 4.0, "metadata": {"method": "multiblock", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 2, "steps": 8, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 8155.347224577404, "sweep": {"method": "multiblock", "steps": 8, "block_size": 16, "num_blocks": 2, "remask_ratio": 0.5, "use_cache": true}}
11
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66", "nfe": 8, "elapsed_s": 0.008637683000415564, "tokens_per_forward": 8.0, "metadata": {"method": "multiblock", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 4, "steps": 8, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 7409.394393950429, "sweep": {"method": "multiblock", "steps": 8, "block_size": 16, "num_blocks": 4, "remask_ratio": 0.5, "use_cache": true}}
12
+ {"tokens": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 3, 4, 5], "text": "3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 3 4 5", "nfe": 8, "elapsed_s": 0.01631542103132233, "tokens_per_forward": 16.0, "metadata": {"method": "multiblock", "config": {"vocab_size": 128, "mask_token_id": 0, "eos_token_id": 2, "block_size": 16, "num_blocks": 8, "steps": 8, "remask_ratio": 0.5, "use_cache": true, "draft_width": 4}}, "tokens_per_second": 7845.338453372777, "sweep": {"method": "multiblock", "steps": 8, "block_size": 16, "num_blocks": 8, "remask_ratio": 0.5, "use_cache": true}}
runs/elf_timestep_alignment/elf-a40_679746.err ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-10 18:01:48.806902: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2
+ WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
3
+ E0000 00:00:1783677708.952181 1362203 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
4
+ E0000 00:00:1783677708.996564 1362203 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
5
+ W0000 00:00:1783677709.354654 1362203 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
6
+ W0000 00:00:1783677709.354699 1362203 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
7
+ W0000 00:00:1783677709.354702 1362203 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
8
+ W0000 00:00:1783677709.354704 1362203 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
9
+ Failed to get TPU metadata (tpu-env) from instance metadata for variable CHIPS_PER_HOST_BOUNDS: DEADLINE_EXCEEDED: Timeout was reached
10
+ === Source Location Trace: ===
11
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
12
+ learning/45eac/tfrc/runtime/env_var_utils.cc:50
13
+
14
+ Failed to get TPU metadata (tpu-env) from instance metadata for variable HOST_BOUNDS: DEADLINE_EXCEEDED: Timeout was reached
15
+ === Source Location Trace: ===
16
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
17
+ learning/45eac/tfrc/runtime/env_var_utils.cc:50
18
+
19
+ Failed to get TPU metadata (tpu-env) from instance metadata for variable ALT: DEADLINE_EXCEEDED: Timeout was reached
20
+ === Source Location Trace: ===
21
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
22
+ learning/45eac/tfrc/runtime/env_var_utils.cc:50
23
+
24
+ Failed to get TPU metadata (tpu-env) from instance metadata for variable WRAP: DEADLINE_EXCEEDED: Timeout was reached
25
+ === Source Location Trace: ===
26
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
27
+ learning/45eac/tfrc/runtime/env_var_utils.cc:50
28
+
29
+ Failed to get TPU metadata (accelerator-type) from instance metadata for variable TPU_ACCELERATOR_TYPE: DEADLINE_EXCEEDED: Timeout was reached
30
+ === Source Location Trace: ===
31
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
32
+
33
+ Failed to find host bounds for accelerator type: WARNING: could not determine TPU accelerator type, please set env var `TPU_ACCELERATOR_TYPE` manually, otherwise libtpu.so may not properly initialize.
34
+ Failed to get TPU metadata (agent-worker-number) from instance metadata for variable TPU_WORKER_ID: DEADLINE_EXCEEDED: Timeout was reached
35
+ === Source Location Trace: ===
36
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
37
+
38
+ Failed to get TPU metadata (worker-network-endpoints) from instance metadata for variable TPU_WORKER_HOSTNAMES: DEADLINE_EXCEEDED: Timeout was reached
39
+ === Source Location Trace: ===
40
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
41
+
42
+ WARNING: Logging before InitGoogle() is written to STDERR
43
+ E0000 00:00:1783680350.013226 1362203 common_lib.cc:520] INVALID_ARGUMENT: Error: unexpected worker hostname 'WARNING: could not determine TPU worker hostnames or IP addresses' from env var TPU_WORKER_HOSTNAMES. Expecting a valid hostname or IP address without port number. (Full TPU workers' addr string: WARNING: could not determine TPU worker hostnames or IP addresses, please set env var `TPU_WORKER_HOSTNAMES` manually, otherwise libtpu.so may not properly initialize.)
44
+ === Source Location Trace: ===
45
+ learning/45eac/tfrc/runtime/libtpu_init_utils.cc:175
46
+ [2026-07-10T18:53:38.016] error: *** JOB 679746 ON xgph11 CANCELLED AT 2026-07-10T18:53:38 DUE to SIGNAL Terminated ***
runs/elf_timestep_alignment/elf-a40_679746.out ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-10T18:01:43+08:00
2
+ [info] node=xgph11
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_final_layer_t005_095_679746
4
+ Fri Jul 10 18:01:43 2026
5
+ +-----------------------------------------------------------------------------------------+
6
+ | NVIDIA-SMI 575.57.08 Driver Version: 575.57.08 CUDA Version: 12.9 |
7
+ |-----------------------------------------+------------------------+----------------------+
8
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
9
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
10
+ | | | MIG M. |
11
+ |=========================================+========================+======================|
12
+ | 0 NVIDIA A100 80GB PCIe On | 00000000:98:00.0 Off | On |
13
+ | N/A 65C P0 199W / 300W | 38634MiB / 81920MiB | N/A Default |
14
+ | | | Enabled |
15
+ +-----------------------------------------+------------------------+----------------------+
16
+
17
+ +-----------------------------------------------------------------------------------------+
18
+ | MIG devices: |
19
+ +------------------+----------------------------------+-----------+-----------------------+
20
+ | GPU GI CI MIG | Memory-Usage | Vol| Shared |
21
+ | ID ID Dev | BAR1-Usage | SM Unc| CE ENC DEC OFA JPG |
22
+ | | | ECC| |
23
+ |==================+==================================+===========+=======================|
24
+ | 0 2 0 0 | 107MiB / 40192MiB | 42 0 | 3 0 2 0 0 |
25
+ | | 0MiB / 65535MiB | | |
26
+ +------------------+----------------------------------+-----------+-----------------------+
27
+
28
+ +-----------------------------------------------------------------------------------------+
29
+ | Processes: |
30
+ | GPU GI CI PID Type Process name GPU Memory |
31
+ | ID ID Usage |
32
+ |=========================================================================================|
33
+ | No running processes found |
34
+ +-----------------------------------------------------------------------------------------+
runs/elf_timestep_alignment/elf-a80_679745.err ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Traceback (most recent call last):
2
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/numpy/core/__init__.py", line 24, in <module>
3
+ from . import multiarray
4
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/numpy/core/multiarray.py", line 10, in <module>
5
+ from . import overrides
6
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/numpy/core/overrides.py", line 8, in <module>
7
+ from numpy.core._multiarray_umath import (
8
+ ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
9
+
10
+ During handling of the above exception, another exception occurred:
11
+
12
+ Traceback (most recent call last):
13
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/numpy/__init__.py", line 130, in <module>
14
+ from numpy.__config__ import show as show_config
15
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/numpy/__config__.py", line 4, in <module>
16
+ from numpy.core._multiarray_umath import (
17
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/numpy/core/__init__.py", line 50, in <module>
18
+ raise ImportError(msg)
19
+ ImportError:
20
+
21
+ IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
22
+
23
+ Importing the numpy C-extensions failed. This error can happen for
24
+ many reasons, often due to issues with your setup or how NumPy was
25
+ installed.
26
+
27
+ We have compiled some common reasons and troubleshooting tips at:
28
+
29
+ https://numpy.org/devdocs/user/troubleshooting-importerror.html
30
+
31
+ Please note and check the following:
32
+
33
+ * The Python version is: Python3.12 from "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/bin/python"
34
+ * The NumPy version is: "1.26.4"
35
+
36
+ and make sure that they are the versions you expect.
37
+ Please carefully study the documentation linked above for further help.
38
+
39
+ Original error was: No module named 'numpy.core._multiarray_umath'
40
+
41
+
42
+ The above exception was the direct cause of the following exception:
43
+
44
+ Traceback (most recent call last):
45
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/compute_elf_alignment.py", line 21, in <module>
46
+ import numpy as np
47
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/numpy/__init__.py", line 135, in <module>
48
+ raise ImportError(msg) from e
49
+ ImportError: Error importing numpy: you should not try to import numpy from
50
+ its source directory; please exit the numpy source tree, and relaunch
51
+ your python interpreter from there.
runs/elf_timestep_alignment/elf-a80_679745.out ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-10T18:01:44+08:00
2
+ [info] node=xgpj0
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_final_layer_t005_095_679745
4
+ Fri Jul 10 18:01:44 2026
5
+ +-----------------------------------------------------------------------------------------+
6
+ | NVIDIA-SMI 580.159.03 Driver Version: 580.159.03 CUDA Version: 13.0 |
7
+ +-----------------------------------------+------------------------+----------------------+
8
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
9
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
10
+ | | | MIG M. |
11
+ |=========================================+========================+======================|
12
+ | 0 NVIDIA A100 80GB PCIe Off | 00000000:01:00.0 Off | 0 |
13
+ | N/A 32C P0 42W / 300W | 0MiB / 81920MiB | 0% Default |
14
+ | | | Disabled |
15
+ +-----------------------------------------+------------------------+----------------------+
16
+
17
+ +-----------------------------------------------------------------------------------------+
18
+ | Processes: |
19
+ | GPU GI CI PID Type Process name GPU Memory |
20
+ | ID ID Usage |
21
+ |=========================================================================================|
22
+ | No running processes found |
23
+ +-----------------------------------------------------------------------------------------+
runs/elf_timestep_alignment/elf-align_679699.err ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ ERROR: Ignored the following versions that require a different python version: 1.10.0 Requires-Python >=3.8,<3.12; 1.10.0rc1 Requires-Python >=3.8,<3.12; 1.10.0rc2 Requires-Python >=3.8,<3.12; 1.10.1 Requires-Python >=3.8,<3.12; 1.11.0 Requires-Python >=3.9,<3.13; 1.11.0rc1 Requires-Python >=3.9,<3.13; 1.11.0rc2 Requires-Python >=3.9,<3.13; 1.11.1 Requires-Python >=3.9,<3.13; 1.11.2 Requires-Python >=3.9,<3.13; 1.11.3 Requires-Python >=3.9,<3.13; 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11; 1.26.0 Requires-Python >=3.9,<3.13; 1.26.1 Requires-Python >=3.9,<3.13; 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10; 1.7.2 Requires-Python >=3.7,<3.11; 1.7.3 Requires-Python >=3.7,<3.11; 1.8.0 Requires-Python >=3.8,<3.11; 1.8.0rc1 Requires-Python >=3.8,<3.11; 1.8.0rc2 Requires-Python >=3.8,<3.11; 1.8.0rc3 Requires-Python >=3.8,<3.11; 1.8.0rc4 Requires-Python >=3.8,<3.11; 1.8.1 Requires-Python >=3.8,<3.11; 1.9.0 Requires-Python >=3.8,<3.12; 1.9.0rc1 Requires-Python >=3.8,<3.12; 1.9.0rc2 Requires-Python >=3.8,<3.12; 1.9.0rc3 Requires-Python >=3.8,<3.12; 1.9.1 Requires-Python >=3.8,<3.12
2
+ ERROR: Could not find a version that satisfies the requirement torch==2.3.0 (from versions: 2.5.0, 2.5.1, 2.6.0, 2.7.0, 2.7.1, 2.8.0, 2.9.0, 2.9.1, 2.10.0, 2.11.0, 2.12.0, 2.12.1, 2.13.0)
3
+ ERROR: No matching distribution found for torch==2.3.0
runs/elf_timestep_alignment/elf-align_679716.err ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
2
+ torch 2.3.0 requires nvidia-cudnn-cu12==8.9.2.26; platform_system == "Linux" and platform_machine == "x86_64", but you have nvidia-cudnn-cu12 9.24.0.43 which is incompatible.
3
+ Traceback (most recent call last):
4
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/compute_elf_alignment.py", line 369, in <module>
5
+ main()
6
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/compute_elf_alignment.py", line 164, in main
7
+ from transformers import AutoTokenizer
8
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/transformers/__init__.py", line 26, in <module>
9
+ from . import dependency_versions_check
10
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/transformers/dependency_versions_check.py", line 16, in <module>
11
+ from .utils.versions import require_version, require_version_core
12
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/transformers/utils/__init__.py", line 34, in <module>
13
+ from .generic import (
14
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/transformers/utils/generic.py", line 462, in <module>
15
+ import torch.utils._pytree as _torch_pytree
16
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/.venv-elf-py312/lib/python3.12/site-packages/torch/__init__.py", line 237, in <module>
17
+ from torch._C import * # noqa: F403
18
+ ^^^^^^^^^^^^^^^^^^^^^^
19
+ ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory
runs/elf_timestep_alignment/elf-align_679741.err ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`.
2
+
3
+ 2026-07-10 17:59:17.190345: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
4
+ WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
5
+ E0000 00:00:1783677557.203174 1920482 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
6
+ E0000 00:00:1783677557.207139 1920482 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
7
+ W0000 00:00:1783677557.219085 1920482 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
8
+ W0000 00:00:1783677557.219109 1920482 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
9
+ W0000 00:00:1783677557.219112 1920482 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
10
+ W0000 00:00:1783677557.219115 1920482 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
11
+ Traceback (most recent call last):
12
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/compute_elf_alignment.py", line 369, in <module>
13
+ main()
14
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/compute_elf_alignment.py", line 177, in main
15
+ config = load_config_from_yaml(args.config)
16
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/reference/code/ELF/src/configs/config.py", line 145, in load_config_from_yaml
18
+ config.sampling_configs = load_sampling_configs(config.sampling_configs_path)
19
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
+ File "/home/l/liyj/shiying/hku_diffusion_dllm/reference/code/ELF/src/configs/config.py", line 211, in load_sampling_configs
21
+ with open(sampling_configs_path, "r") as f:
22
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
+ FileNotFoundError: [Errno 2] No such file or directory: 'configs/sampling_configs/uncond_sampling_configs.yml'
runs/elf_timestep_alignment/elf-h47_679742.err ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-10 18:01:45.757714: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2
+ WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
3
+ E0000 00:00:1783677705.770011 1921410 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
4
+ E0000 00:00:1783677705.773703 1921410 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
5
+ W0000 00:00:1783677705.785354 1921410 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
6
+ W0000 00:00:1783677705.785376 1921410 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
7
+ W0000 00:00:1783677705.785380 1921410 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
8
+ W0000 00:00:1783677705.785382 1921410 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
9
+ Failed to get TPU metadata (tpu-env) from instance metadata for variable CHIPS_PER_HOST_BOUNDS: DEADLINE_EXCEEDED: Timeout was reached
10
+ === Source Location Trace: ===
11
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
12
+ learning/45eac/tfrc/runtime/env_var_utils.cc:50
13
+
14
+ Failed to get TPU metadata (tpu-env) from instance metadata for variable HOST_BOUNDS: DEADLINE_EXCEEDED: Timeout was reached
15
+ === Source Location Trace: ===
16
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
17
+ learning/45eac/tfrc/runtime/env_var_utils.cc:50
18
+
19
+ Failed to get TPU metadata (tpu-env) from instance metadata for variable ALT: DEADLINE_EXCEEDED: Timeout was reached
20
+ === Source Location Trace: ===
21
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
22
+ learning/45eac/tfrc/runtime/env_var_utils.cc:50
23
+
24
+ Failed to get TPU metadata (tpu-env) from instance metadata for variable WRAP: DEADLINE_EXCEEDED: Timeout was reached
25
+ === Source Location Trace: ===
26
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
27
+ learning/45eac/tfrc/runtime/env_var_utils.cc:50
28
+
29
+ Failed to get TPU metadata (accelerator-type) from instance metadata for variable TPU_ACCELERATOR_TYPE: DEADLINE_EXCEEDED: Timeout was reached
30
+ === Source Location Trace: ===
31
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
32
+
33
+ Failed to find host bounds for accelerator type: WARNING: could not determine TPU accelerator type, please set env var `TPU_ACCELERATOR_TYPE` manually, otherwise libtpu.so may not properly initialize.
34
+ Failed to get TPU metadata (agent-worker-number) from instance metadata for variable TPU_WORKER_ID: DEADLINE_EXCEEDED: Timeout was reached
35
+ === Source Location Trace: ===
36
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
37
+
38
+ Failed to get TPU metadata (worker-network-endpoints) from instance metadata for variable TPU_WORKER_HOSTNAMES: DEADLINE_EXCEEDED: Timeout was reached
39
+ === Source Location Trace: ===
40
+ learning/45eac/tfrc/runtime/gcp_metadata_utils.cc:84
41
+
42
+ WARNING: Logging before InitGoogle() is written to STDERR
43
+ E0000 00:00:1783680343.250683 1921410 common_lib.cc:520] INVALID_ARGUMENT: Error: unexpected worker hostname 'WARNING: could not determine TPU worker hostnames or IP addresses' from env var TPU_WORKER_HOSTNAMES. Expecting a valid hostname or IP address without port number. (Full TPU workers' addr string: WARNING: could not determine TPU worker hostnames or IP addresses, please set env var `TPU_WORKER_HOSTNAMES` manually, otherwise libtpu.so may not properly initialize.)
44
+ === Source Location Trace: ===
45
+ learning/45eac/tfrc/runtime/libtpu_init_utils.cc:175
46
+ [2026-07-10T18:53:37.997] error: *** JOB 679742 ON xgpi13 CANCELLED AT 2026-07-10T18:53:37 DUE to SIGNAL Terminated ***
runs/elf_timestep_alignment/elf-h47_679742.out ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-10T18:01:43+08:00
2
+ [info] node=xgpi13
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_final_layer_t005_095_679742
4
+ Fri Jul 10 18:01:43 2026
5
+ +-----------------------------------------------------------------------------------------+
6
+ | NVIDIA-SMI 575.57.08 Driver Version: 575.57.08 CUDA Version: 12.9 |
7
+ |-----------------------------------------+------------------------+----------------------+
8
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
9
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
10
+ | | | MIG M. |
11
+ |=========================================+========================+======================|
12
+ | 0 NVIDIA H100 NVL On | 00000000:82:00.0 Off | On |
13
+ | N/A 69C P0 290W / 400W | 6233MiB / 95830MiB | N/A Default |
14
+ | | | Enabled |
15
+ +-----------------------------------------+------------------------+----------------------+
16
+
17
+ +-----------------------------------------------------------------------------------------+
18
+ | MIG devices: |
19
+ +------------------+----------------------------------+-----------+-----------------------+
20
+ | GPU GI CI MIG | Memory-Usage | Vol| Shared |
21
+ | ID ID Dev | BAR1-Usage | SM Unc| CE ENC DEC OFA JPG |
22
+ | | | ECC| |
23
+ |==================+==================================+===========+=======================|
24
+ | 0 2 0 0 | 44MiB / 47488MiB | 60 0 | 3 0 3 0 3 |
25
+ | | 0MiB / 65535MiB | | |
26
+ +------------------+----------------------------------+-----------+-----------------------+
27
+
28
+ +-----------------------------------------------------------------------------------------+
29
+ | Processes: |
30
+ | GPU GI CI PID Type Process name GPU Memory |
31
+ | ID ID Usage |
32
+ |=========================================================================================|
33
+ | No running processes found |
34
+ +-----------------------------------------------------------------------------------------+
runs/elf_timestep_alignment/elf-h96_679743.out ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-10T18:33:46+08:00
2
+ [info] node=xgpi12
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_final_layer_t005_095_679743
4
+ Fri Jul 10 18:33:46 2026
5
+ +-----------------------------------------------------------------------------------------+
6
+ | NVIDIA-SMI 575.57.08 Driver Version: 575.57.08 CUDA Version: 12.9 |
7
+ |-----------------------------------------+------------------------+----------------------+
8
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
9
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
10
+ | | | MIG M. |
11
+ |=========================================+========================+======================|
12
+ | 0 NVIDIA H100 NVL On | 00000000:E3:00.0 Off | On |
13
+ | N/A 64C P0 75W / 400W | 87MiB / 95830MiB | N/A Default |
14
+ | | | Enabled |
15
+ +-----------------------------------------+------------------------+----------------------+
16
+
17
+ +-----------------------------------------------------------------------------------------+
18
+ | MIG devices: |
19
+ +------------------+----------------------------------+-----------+-----------------------+
20
+ | GPU GI CI MIG | Memory-Usage | Vol| Shared |
21
+ | ID ID Dev | BAR1-Usage | SM Unc| CE ENC DEC OFA JPG |
22
+ | | | ECC| |
23
+ |==================+==================================+===========+=======================|
24
+ | 0 1 0 0 | 44MiB / 47488MiB | 60 0 | 3 0 3 0 3 |
25
+ | | 0MiB / 65535MiB | | |
26
+ +------------------+----------------------------------+-----------+-----------------------+
27
+ | 0 2 0 1 | 44MiB / 47488MiB | 60 0 | 3 0 3 0 3 |
28
+ | | 0MiB / 65535MiB | | |
29
+ +------------------+----------------------------------+-----------+-----------------------+
30
+
31
+ +-----------------------------------------------------------------------------------------+
32
+ | Processes: |
33
+ | GPU GI CI PID Type Process name GPU Memory |
34
+ | ID ID Usage |
35
+ |=========================================================================================|
36
+ | No running processes found |
37
+ +-----------------------------------------------------------------------------------------+
runs/elf_timestep_alignment/elfa-deep-s41_680360.err ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-11 12:01:32.916517: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2
+ WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
3
+ E0000 00:00:1783742493.166854 626198 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
4
+ E0000 00:00:1783742493.236121 626198 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
5
+ W0000 00:00:1783742493.796499 626198 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
6
+ W0000 00:00:1783742493.796555 626198 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
7
+ W0000 00:00:1783742493.796563 626198 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
8
+ W0000 00:00:1783742493.796570 626198 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
9
+
10
+ WARNING:absl:The transformations API will eventually be replaced by an upgraded design. The current API will not be removed until this point, but it will no longer be actively worked on.
runs/elf_timestep_alignment/elfa-deep-s41_680360.out ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-11T12:01:25+08:00
2
+ [info] node=xgpg4
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed41_680360
4
+ [info] seed=41 samples=16 t_values=0.15:0.01:0.50
5
+ [info] grad_regex=blocks_11 texts_file=/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/text_samples_32.txt
6
+ Sat Jul 11 12:01:25 2026
7
+ +-----------------------------------------------------------------------------------------+
8
+ | NVIDIA-SMI 575.57.08 Driver Version: 575.57.08 CUDA Version: 12.9 |
9
+ |-----------------------------------------+------------------------+----------------------+
10
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
11
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
12
+ | | | MIG M. |
13
+ |=========================================+========================+======================|
14
+ | 0 NVIDIA A100-PCIE-40GB On | 00000000:01:00.0 Off | 0 |
15
+ | N/A 44C P0 39W / 250W | 0MiB / 40960MiB | 0% Default |
16
+ | | | Disabled |
17
+ +-----------------------------------------+------------------------+----------------------+
18
+
19
+ +-----------------------------------------------------------------------------------------+
20
+ | Processes: |
21
+ | GPU GI CI PID Type Process name GPU Memory |
22
+ | ID ID Usage |
23
+ |=========================================================================================|
24
+ | No running processes found |
25
+ +-----------------------------------------------------------------------------------------+
26
+ [info] jax_backend=gpu
27
+ [info] jax_devices=[CudaDevice(id=0)]
28
+ {
29
+ "mode": "elf_flow_matching",
30
+ "model": "ELF-B",
31
+ "t_values": [
32
+ 0.15,
33
+ 0.16,
34
+ 0.17,
35
+ 0.18,
36
+ 0.19,
37
+ 0.2,
38
+ 0.21,
39
+ 0.22,
40
+ 0.23,
41
+ 0.24,
42
+ 0.25,
43
+ 0.26,
44
+ 0.27,
45
+ 0.28,
46
+ 0.29,
47
+ 0.3,
48
+ 0.31,
49
+ 0.32,
50
+ 0.33,
51
+ 0.34,
52
+ 0.35,
53
+ 0.36,
54
+ 0.37,
55
+ 0.38,
56
+ 0.39,
57
+ 0.4,
58
+ 0.41,
59
+ 0.42,
60
+ 0.43,
61
+ 0.44,
62
+ 0.45,
63
+ 0.46,
64
+ 0.47,
65
+ 0.48,
66
+ 0.49,
67
+ 0.5
68
+ ],
69
+ "loss_by_t": [
70
+ 0.7687702775001526,
71
+ 0.7881273031234741,
72
+ 0.8076191544532776,
73
+ 0.8299820423126221,
74
+ 0.8552634119987488,
75
+ 0.8814494013786316,
76
+ 0.9066674709320068,
77
+ 0.933702826499939,
78
+ 0.9614684581756592,
79
+ 0.9797762036323547,
80
+ 0.9908438920974731,
81
+ 1.0052367448806763,
82
+ 1.028529167175293,
83
+ 1.0447502136230469,
84
+ 1.0593575239181519,
85
+ 1.0711325407028198,
86
+ 1.0827609300613403,
87
+ 1.0864359140396118,
88
+ 1.1015979051589966,
89
+ 1.1140385866165161,
90
+ 1.125871181488037,
91
+ 1.1202373504638672,
92
+ 1.1312713623046875,
93
+ 1.148082971572876,
94
+ 1.1602612733840942,
95
+ 1.1670055389404297,
96
+ 1.183816909790039,
97
+ 1.2126374244689941,
98
+ 1.239477276802063,
99
+ 1.2786539793014526,
100
+ 1.3062680959701538,
101
+ 1.3161256313323975,
102
+ 1.3360689878463745,
103
+ 1.3640625476837158,
104
+ 1.3931139707565308,
105
+ 1.420563817024231
106
+ ],
107
+ "adjacent_cosines": [
108
+ {
109
+ "from": 0.15,
110
+ "to": 0.16,
111
+ "cosine": 0.9962546965456975
112
+ },
113
+ {
114
+ "from": 0.16,
115
+ "to": 0.17,
116
+ "cosine": 0.9958086557639261
117
+ },
118
+ {
119
+ "from": 0.17,
120
+ "to": 0.18,
121
+ "cosine": 0.9952199417358164
122
+ },
123
+ {
124
+ "from": 0.18,
125
+ "to": 0.19,
126
+ "cosine": 0.9957765763378329
127
+ },
128
+ {
129
+ "from": 0.19,
130
+ "to": 0.2,
131
+ "cosine": 0.9961950155835183
132
+ },
133
+ {
134
+ "from": 0.2,
135
+ "to": 0.21,
136
+ "cosine": 0.9954582738655838
137
+ },
138
+ {
139
+ "from": 0.21,
140
+ "to": 0.22,
141
+ "cosine": 0.9934789887691607
142
+ },
143
+ {
144
+ "from": 0.22,
145
+ "to": 0.23,
146
+ "cosine": 0.9951807053251995
147
+ },
148
+ {
149
+ "from": 0.23,
150
+ "to": 0.24,
151
+ "cosine": 0.997011617832636
152
+ },
153
+ {
154
+ "from": 0.24,
155
+ "to": 0.25,
156
+ "cosine": 0.996136504453141
157
+ },
158
+ {
159
+ "from": 0.25,
160
+ "to": 0.26,
161
+ "cosine": 0.9936256119439957
162
+ },
163
+ {
164
+ "from": 0.26,
165
+ "to": 0.27,
166
+ "cosine": 0.9953386437777826
167
+ },
168
+ {
169
+ "from": 0.27,
170
+ "to": 0.28,
171
+ "cosine": 0.99665726559883
172
+ },
173
+ {
174
+ "from": 0.28,
175
+ "to": 0.29,
176
+ "cosine": 0.9974246236472415
177
+ },
178
+ {
179
+ "from": 0.29,
180
+ "to": 0.3,
181
+ "cosine": 0.9976000336202412
182
+ },
183
+ {
184
+ "from": 0.3,
185
+ "to": 0.31,
186
+ "cosine": 0.9977129935271191
187
+ },
188
+ {
189
+ "from": 0.31,
190
+ "to": 0.32,
191
+ "cosine": 0.9972786842646635
192
+ },
193
+ {
194
+ "from": 0.32,
195
+ "to": 0.33,
196
+ "cosine": 0.9977804207708572
197
+ },
198
+ {
199
+ "from": 0.33,
200
+ "to": 0.34,
201
+ "cosine": 0.9970579865710971
202
+ },
203
+ {
204
+ "from": 0.34,
205
+ "to": 0.35,
206
+ "cosine": 0.9880092997472294
207
+ },
208
+ {
209
+ "from": 0.35,
210
+ "to": 0.36,
211
+ "cosine": 0.9907945894296982
212
+ },
213
+ {
214
+ "from": 0.36,
215
+ "to": 0.37,
216
+ "cosine": 0.9904425952017323
217
+ },
218
+ {
219
+ "from": 0.37,
220
+ "to": 0.38,
221
+ "cosine": 0.9935099687507755
222
+ },
223
+ {
224
+ "from": 0.38,
225
+ "to": 0.39,
226
+ "cosine": 0.9977455672094535
227
+ },
228
+ {
229
+ "from": 0.39,
230
+ "to": 0.4,
231
+ "cosine": 0.9962772579743102
232
+ },
233
+ {
234
+ "from": 0.4,
235
+ "to": 0.41,
236
+ "cosine": 0.9974000695241294
237
+ },
238
+ {
239
+ "from": 0.41,
240
+ "to": 0.42,
241
+ "cosine": 0.9959696618678843
242
+ },
243
+ {
244
+ "from": 0.42,
245
+ "to": 0.43,
246
+ "cosine": 0.9951299312313682
247
+ },
248
+ {
249
+ "from": 0.43,
250
+ "to": 0.44,
251
+ "cosine": 0.9933298782853635
252
+ },
253
+ {
254
+ "from": 0.44,
255
+ "to": 0.45,
256
+ "cosine": 0.9928438941296612
257
+ },
258
+ {
259
+ "from": 0.45,
260
+ "to": 0.46,
261
+ "cosine": 0.9987327659673764
262
+ },
263
+ {
264
+ "from": 0.46,
265
+ "to": 0.47,
266
+ "cosine": 0.9990603713522872
267
+ },
268
+ {
269
+ "from": 0.47,
270
+ "to": 0.48,
271
+ "cosine": 0.9988712946382723
272
+ },
273
+ {
274
+ "from": 0.48,
275
+ "to": 0.49,
276
+ "cosine": 0.9992366335088162
277
+ },
278
+ {
279
+ "from": 0.49,
280
+ "to": 0.5,
281
+ "cosine": 0.9981090700779052
282
+ }
283
+ ]
284
+ }
285
+ {
286
+ "updated_at": "2026-07-11T04:04:04.559961+00:00",
287
+ "inputs": [
288
+ "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed41_680360/alignment.json"
289
+ ],
290
+ "num_runs": 1,
291
+ "axis": [
292
+ 0.15,
293
+ 0.16,
294
+ 0.17,
295
+ 0.18,
296
+ 0.19,
297
+ 0.2,
298
+ 0.21,
299
+ 0.22,
300
+ 0.23,
301
+ 0.24,
302
+ 0.25,
303
+ 0.26,
304
+ 0.27,
305
+ 0.28,
306
+ 0.29,
307
+ 0.3,
308
+ 0.31,
309
+ 0.32,
310
+ 0.33,
311
+ 0.34,
312
+ 0.35,
313
+ 0.36,
314
+ 0.37,
315
+ 0.38,
316
+ 0.39,
317
+ 0.4,
318
+ 0.41,
319
+ 0.42,
320
+ 0.43,
321
+ 0.44,
322
+ 0.45,
323
+ 0.46,
324
+ 0.47,
325
+ 0.48,
326
+ 0.49,
327
+ 0.5
328
+ ],
329
+ "best_split": {
330
+ "split_index": 19,
331
+ "left_t": 0.33,
332
+ "right_t": 0.34,
333
+ "boundary": 0.335,
334
+ "within_mean": 0.8985269586014996,
335
+ "between_mean": 0.6242743197364485,
336
+ "gap": 0.274252638865051
337
+ },
338
+ "adjacent_minimum": {
339
+ "from": 0.34,
340
+ "to": 0.35,
341
+ "boundary": 0.345,
342
+ "cosine": 0.9880092997472294
343
+ },
344
+ "per_run_best_split": [
345
+ {
346
+ "path": "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed41_680360/alignment.json",
347
+ "split_index": 19,
348
+ "left_t": 0.33,
349
+ "right_t": 0.34,
350
+ "boundary": 0.335,
351
+ "within_mean": 0.8985269586014996,
352
+ "between_mean": 0.6242743197364485,
353
+ "gap": 0.274252638865051
354
+ }
355
+ ],
356
+ "bootstrap_repetitions": 0,
357
+ "bootstrap_boundary_counts": {}
358
+ }
359
+ [info] finished_at=2026-07-11T12:04:05+08:00
runs/elf_timestep_alignment/elfa-deep-s42_680361.out ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-11T12:01:26+08:00
2
+ [info] node=xgpg5
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed42_680361
4
+ [info] seed=42 samples=16 t_values=0.15:0.01:0.50
5
+ [info] grad_regex=blocks_11 texts_file=/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/text_samples_32.txt
6
+ Sat Jul 11 12:01:26 2026
7
+ +-----------------------------------------------------------------------------------------+
8
+ | NVIDIA-SMI 575.57.08 Driver Version: 575.57.08 CUDA Version: 12.9 |
9
+ |-----------------------------------------+------------------------+----------------------+
10
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
11
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
12
+ | | | MIG M. |
13
+ |=========================================+========================+======================|
14
+ | 0 NVIDIA A100-PCIE-40GB On | 00000000:01:00.0 Off | 0 |
15
+ | N/A 46C P0 38W / 250W | 0MiB / 40960MiB | 0% Default |
16
+ | | | Disabled |
17
+ +-----------------------------------------+------------------------+----------------------+
18
+
19
+ +-----------------------------------------------------------------------------------------+
20
+ | Processes: |
21
+ | GPU GI CI PID Type Process name GPU Memory |
22
+ | ID ID Usage |
23
+ |=========================================================================================|
24
+ | No running processes found |
25
+ +-----------------------------------------------------------------------------------------+
26
+ [info] jax_backend=gpu
27
+ [info] jax_devices=[CudaDevice(id=0)]
28
+ {
29
+ "mode": "elf_flow_matching",
30
+ "model": "ELF-B",
31
+ "t_values": [
32
+ 0.15,
33
+ 0.16,
34
+ 0.17,
35
+ 0.18,
36
+ 0.19,
37
+ 0.2,
38
+ 0.21,
39
+ 0.22,
40
+ 0.23,
41
+ 0.24,
42
+ 0.25,
43
+ 0.26,
44
+ 0.27,
45
+ 0.28,
46
+ 0.29,
47
+ 0.3,
48
+ 0.31,
49
+ 0.32,
50
+ 0.33,
51
+ 0.34,
52
+ 0.35,
53
+ 0.36,
54
+ 0.37,
55
+ 0.38,
56
+ 0.39,
57
+ 0.4,
58
+ 0.41,
59
+ 0.42,
60
+ 0.43,
61
+ 0.44,
62
+ 0.45,
63
+ 0.46,
64
+ 0.47,
65
+ 0.48,
66
+ 0.49,
67
+ 0.5
68
+ ],
69
+ "loss_by_t": [
70
+ 0.7894503474235535,
71
+ 0.8079524040222168,
72
+ 0.8270783424377441,
73
+ 0.8486059904098511,
74
+ 0.872994065284729,
75
+ 0.8972299098968506,
76
+ 0.9237579107284546,
77
+ 0.9506700038909912,
78
+ 0.9688873291015625,
79
+ 0.9816381931304932,
80
+ 0.99869304895401,
81
+ 1.0168174505233765,
82
+ 1.0352503061294556,
83
+ 1.0519922971725464,
84
+ 1.0608059167861938,
85
+ 1.0697757005691528,
86
+ 1.0704327821731567,
87
+ 1.0813257694244385,
88
+ 1.1016240119934082,
89
+ 1.1162893772125244,
90
+ 1.1168100833892822,
91
+ 1.1151463985443115,
92
+ 1.1108323335647583,
93
+ 1.0977319478988647,
94
+ 1.1078706979751587,
95
+ 1.1296074390411377,
96
+ 1.1423625946044922,
97
+ 1.1698291301727295,
98
+ 1.2012135982513428,
99
+ 1.2234262228012085,
100
+ 1.2518868446350098,
101
+ 1.2801848649978638,
102
+ 1.3058077096939087,
103
+ 1.3293050527572632,
104
+ 1.363580346107483,
105
+ 1.399135708808899
106
+ ],
107
+ "adjacent_cosines": [
108
+ {
109
+ "from": 0.15,
110
+ "to": 0.16,
111
+ "cosine": 0.9969856025348265
112
+ },
113
+ {
114
+ "from": 0.16,
115
+ "to": 0.17,
116
+ "cosine": 0.9960913436074166
117
+ },
118
+ {
119
+ "from": 0.17,
120
+ "to": 0.18,
121
+ "cosine": 0.9946922842884732
122
+ },
123
+ {
124
+ "from": 0.18,
125
+ "to": 0.19,
126
+ "cosine": 0.9932789356000828
127
+ },
128
+ {
129
+ "from": 0.19,
130
+ "to": 0.2,
131
+ "cosine": 0.9936398333671173
132
+ },
133
+ {
134
+ "from": 0.2,
135
+ "to": 0.21,
136
+ "cosine": 0.9945562094093469
137
+ },
138
+ {
139
+ "from": 0.21,
140
+ "to": 0.22,
141
+ "cosine": 0.9941701291965652
142
+ },
143
+ {
144
+ "from": 0.22,
145
+ "to": 0.23,
146
+ "cosine": 0.9966545676856795
147
+ },
148
+ {
149
+ "from": 0.23,
150
+ "to": 0.24,
151
+ "cosine": 0.9959261758544973
152
+ },
153
+ {
154
+ "from": 0.24,
155
+ "to": 0.25,
156
+ "cosine": 0.9970681055822745
157
+ },
158
+ {
159
+ "from": 0.25,
160
+ "to": 0.26,
161
+ "cosine": 0.9966301047115543
162
+ },
163
+ {
164
+ "from": 0.26,
165
+ "to": 0.27,
166
+ "cosine": 0.9944628573126317
167
+ },
168
+ {
169
+ "from": 0.27,
170
+ "to": 0.28,
171
+ "cosine": 0.9965534005540374
172
+ },
173
+ {
174
+ "from": 0.28,
175
+ "to": 0.29,
176
+ "cosine": 0.9966129983478746
177
+ },
178
+ {
179
+ "from": 0.29,
180
+ "to": 0.3,
181
+ "cosine": 0.9967550461221731
182
+ },
183
+ {
184
+ "from": 0.3,
185
+ "to": 0.31,
186
+ "cosine": 0.9949799731487935
187
+ },
188
+ {
189
+ "from": 0.31,
190
+ "to": 0.32,
191
+ "cosine": 0.9952240562505341
192
+ },
193
+ {
194
+ "from": 0.32,
195
+ "to": 0.33,
196
+ "cosine": 0.9957941025804731
197
+ },
198
+ {
199
+ "from": 0.33,
200
+ "to": 0.34,
201
+ "cosine": 0.9964363140549877
202
+ },
203
+ {
204
+ "from": 0.34,
205
+ "to": 0.35,
206
+ "cosine": 0.997065057354391
207
+ },
208
+ {
209
+ "from": 0.35,
210
+ "to": 0.36,
211
+ "cosine": 0.9973318041458271
212
+ },
213
+ {
214
+ "from": 0.36,
215
+ "to": 0.37,
216
+ "cosine": 0.9977542815094094
217
+ },
218
+ {
219
+ "from": 0.37,
220
+ "to": 0.38,
221
+ "cosine": 0.9958980031408313
222
+ },
223
+ {
224
+ "from": 0.38,
225
+ "to": 0.39,
226
+ "cosine": 0.9916347110302582
227
+ },
228
+ {
229
+ "from": 0.39,
230
+ "to": 0.4,
231
+ "cosine": 0.9919780723496313
232
+ },
233
+ {
234
+ "from": 0.4,
235
+ "to": 0.41,
236
+ "cosine": 0.9955634416117262
237
+ },
238
+ {
239
+ "from": 0.41,
240
+ "to": 0.42,
241
+ "cosine": 0.9948527741651921
242
+ },
243
+ {
244
+ "from": 0.42,
245
+ "to": 0.43,
246
+ "cosine": 0.9945672635658813
247
+ },
248
+ {
249
+ "from": 0.43,
250
+ "to": 0.44,
251
+ "cosine": 0.9970740377487571
252
+ },
253
+ {
254
+ "from": 0.44,
255
+ "to": 0.45,
256
+ "cosine": 0.9972080504857049
257
+ },
258
+ {
259
+ "from": 0.45,
260
+ "to": 0.46,
261
+ "cosine": 0.997424196831476
262
+ },
263
+ {
264
+ "from": 0.46,
265
+ "to": 0.47,
266
+ "cosine": 0.9983774332413492
267
+ },
268
+ {
269
+ "from": 0.47,
270
+ "to": 0.48,
271
+ "cosine": 0.9987911011637768
272
+ },
273
+ {
274
+ "from": 0.48,
275
+ "to": 0.49,
276
+ "cosine": 0.9991536503708132
277
+ },
278
+ {
279
+ "from": 0.49,
280
+ "to": 0.5,
281
+ "cosine": 0.9989211079789755
282
+ }
283
+ ]
284
+ }
285
+ {
286
+ "updated_at": "2026-07-11T04:04:04.754417+00:00",
287
+ "inputs": [
288
+ "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed42_680361/alignment.json"
289
+ ],
290
+ "num_runs": 1,
291
+ "axis": [
292
+ 0.15,
293
+ 0.16,
294
+ 0.17,
295
+ 0.18,
296
+ 0.19,
297
+ 0.2,
298
+ 0.21,
299
+ 0.22,
300
+ 0.23,
301
+ 0.24,
302
+ 0.25,
303
+ 0.26,
304
+ 0.27,
305
+ 0.28,
306
+ 0.29,
307
+ 0.3,
308
+ 0.31,
309
+ 0.32,
310
+ 0.33,
311
+ 0.34,
312
+ 0.35,
313
+ 0.36,
314
+ 0.37,
315
+ 0.38,
316
+ 0.39,
317
+ 0.4,
318
+ 0.41,
319
+ 0.42,
320
+ 0.43,
321
+ 0.44,
322
+ 0.45,
323
+ 0.46,
324
+ 0.47,
325
+ 0.48,
326
+ 0.49,
327
+ 0.5
328
+ ],
329
+ "best_split": {
330
+ "split_index": 18,
331
+ "left_t": 0.32,
332
+ "right_t": 0.33,
333
+ "boundary": 0.325,
334
+ "within_mean": 0.8942345505344492,
335
+ "between_mean": 0.6245899802614596,
336
+ "gap": 0.2696445702729896
337
+ },
338
+ "adjacent_minimum": {
339
+ "from": 0.38,
340
+ "to": 0.39,
341
+ "boundary": 0.385,
342
+ "cosine": 0.9916347110302582
343
+ },
344
+ "per_run_best_split": [
345
+ {
346
+ "path": "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed42_680361/alignment.json",
347
+ "split_index": 18,
348
+ "left_t": 0.32,
349
+ "right_t": 0.33,
350
+ "boundary": 0.325,
351
+ "within_mean": 0.8942345505344492,
352
+ "between_mean": 0.6245899802614596,
353
+ "gap": 0.2696445702729896
354
+ }
355
+ ],
356
+ "bootstrap_repetitions": 0,
357
+ "bootstrap_boundary_counts": {}
358
+ }
359
+ [info] finished_at=2026-07-11T12:04:06+08:00
runs/elf_timestep_alignment/elfa-deep-s45_680362.err ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-11 12:01:32.916920: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2
+ WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
3
+ E0000 00:00:1783742493.167341 632218 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
4
+ E0000 00:00:1783742493.236577 632218 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
5
+ W0000 00:00:1783742493.796702 632218 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
6
+ W0000 00:00:1783742493.796749 632218 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
7
+ W0000 00:00:1783742493.796757 632218 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
8
+ W0000 00:00:1783742493.796764 632218 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
9
+
10
+ WARNING:absl:The transformations API will eventually be replaced by an upgraded design. The current API will not be removed until this point, but it will no longer be actively worked on.
runs/elf_timestep_alignment/elfa-final-s42_680358.err ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-11 12:01:32.920334: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2
+ WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
3
+ E0000 00:00:1783742493.170620 1080666 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
4
+ E0000 00:00:1783742493.240019 1080666 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
5
+ W0000 00:00:1783742493.800083 1080666 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
6
+ W0000 00:00:1783742493.800107 1080666 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
7
+ W0000 00:00:1783742493.800109 1080666 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
8
+ W0000 00:00:1783742493.800111 1080666 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
9
+
10
+ WARNING:absl:The transformations API will eventually be replaced by an upgraded design. The current API will not be removed until this point, but it will no longer be actively worked on.
runs/elf_timestep_alignment/elfa-final-s43_680359.out ADDED
@@ -0,0 +1,359 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-11T12:01:25+08:00
2
+ [info] node=xgpg3
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_final_t015_050_s001_n16_seed43_680359
4
+ [info] seed=43 samples=16 t_values=0.15:0.01:0.50
5
+ [info] grad_regex=final_layer|proj_kernel|proj_bias texts_file=/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/text_samples_32.txt
6
+ Sat Jul 11 12:01:25 2026
7
+ +-----------------------------------------------------------------------------------------+
8
+ | NVIDIA-SMI 575.57.08 Driver Version: 575.57.08 CUDA Version: 12.9 |
9
+ |-----------------------------------------+------------------------+----------------------+
10
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
11
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
12
+ | | | MIG M. |
13
+ |=========================================+========================+======================|
14
+ | 0 NVIDIA A100-PCIE-40GB On | 00000000:01:00.0 Off | 0 |
15
+ | N/A 46C P0 37W / 250W | 0MiB / 40960MiB | 0% Default |
16
+ | | | Disabled |
17
+ +-----------------------------------------+------------------------+----------------------+
18
+
19
+ +-----------------------------------------------------------------------------------------+
20
+ | Processes: |
21
+ | GPU GI CI PID Type Process name GPU Memory |
22
+ | ID ID Usage |
23
+ |=========================================================================================|
24
+ | No running processes found |
25
+ +-----------------------------------------------------------------------------------------+
26
+ [info] jax_backend=gpu
27
+ [info] jax_devices=[CudaDevice(id=0)]
28
+ {
29
+ "mode": "elf_flow_matching",
30
+ "model": "ELF-B",
31
+ "t_values": [
32
+ 0.15,
33
+ 0.16,
34
+ 0.17,
35
+ 0.18,
36
+ 0.19,
37
+ 0.2,
38
+ 0.21,
39
+ 0.22,
40
+ 0.23,
41
+ 0.24,
42
+ 0.25,
43
+ 0.26,
44
+ 0.27,
45
+ 0.28,
46
+ 0.29,
47
+ 0.3,
48
+ 0.31,
49
+ 0.32,
50
+ 0.33,
51
+ 0.34,
52
+ 0.35,
53
+ 0.36,
54
+ 0.37,
55
+ 0.38,
56
+ 0.39,
57
+ 0.4,
58
+ 0.41,
59
+ 0.42,
60
+ 0.43,
61
+ 0.44,
62
+ 0.45,
63
+ 0.46,
64
+ 0.47,
65
+ 0.48,
66
+ 0.49,
67
+ 0.5
68
+ ],
69
+ "loss_by_t": [
70
+ 0.788937509059906,
71
+ 0.8132213354110718,
72
+ 0.8401293754577637,
73
+ 0.8684554696083069,
74
+ 0.8944187760353088,
75
+ 0.9147629737854004,
76
+ 0.9380487203598022,
77
+ 0.9609002470970154,
78
+ 0.9864038825035095,
79
+ 1.0159869194030762,
80
+ 1.042405366897583,
81
+ 1.0616533756256104,
82
+ 1.0812407732009888,
83
+ 1.0957436561584473,
84
+ 1.1030596494674683,
85
+ 1.1138523817062378,
86
+ 1.1278197765350342,
87
+ 1.1449909210205078,
88
+ 1.1479227542877197,
89
+ 1.1593621969223022,
90
+ 1.1712638139724731,
91
+ 1.1633938550949097,
92
+ 1.1800318956375122,
93
+ 1.1783900260925293,
94
+ 1.188826560974121,
95
+ 1.2003947496414185,
96
+ 1.2203037738800049,
97
+ 1.246224045753479,
98
+ 1.274021863937378,
99
+ 1.303206443786621,
100
+ 1.3329801559448242,
101
+ 1.366233468055725,
102
+ 1.4012446403503418,
103
+ 1.4246362447738647,
104
+ 1.4459913969039917,
105
+ 1.4678287506103516
106
+ ],
107
+ "adjacent_cosines": [
108
+ {
109
+ "from": 0.15,
110
+ "to": 0.16,
111
+ "cosine": 0.9982446478223043
112
+ },
113
+ {
114
+ "from": 0.16,
115
+ "to": 0.17,
116
+ "cosine": 0.9986869563134316
117
+ },
118
+ {
119
+ "from": 0.17,
120
+ "to": 0.18,
121
+ "cosine": 0.9990163607839365
122
+ },
123
+ {
124
+ "from": 0.18,
125
+ "to": 0.19,
126
+ "cosine": 0.999356143459096
127
+ },
128
+ {
129
+ "from": 0.19,
130
+ "to": 0.2,
131
+ "cosine": 0.9987424978996888
132
+ },
133
+ {
134
+ "from": 0.2,
135
+ "to": 0.21,
136
+ "cosine": 0.9983072190559795
137
+ },
138
+ {
139
+ "from": 0.21,
140
+ "to": 0.22,
141
+ "cosine": 0.9984089120028304
142
+ },
143
+ {
144
+ "from": 0.22,
145
+ "to": 0.23,
146
+ "cosine": 0.9975184048851281
147
+ },
148
+ {
149
+ "from": 0.23,
150
+ "to": 0.24,
151
+ "cosine": 0.9972021092633733
152
+ },
153
+ {
154
+ "from": 0.24,
155
+ "to": 0.25,
156
+ "cosine": 0.9972048499906594
157
+ },
158
+ {
159
+ "from": 0.25,
160
+ "to": 0.26,
161
+ "cosine": 0.9972697890148098
162
+ },
163
+ {
164
+ "from": 0.26,
165
+ "to": 0.27,
166
+ "cosine": 0.9971426894019264
167
+ },
168
+ {
169
+ "from": 0.27,
170
+ "to": 0.28,
171
+ "cosine": 0.9973506080245123
172
+ },
173
+ {
174
+ "from": 0.28,
175
+ "to": 0.29,
176
+ "cosine": 0.9972721487892194
177
+ },
178
+ {
179
+ "from": 0.29,
180
+ "to": 0.3,
181
+ "cosine": 0.9979230340784457
182
+ },
183
+ {
184
+ "from": 0.3,
185
+ "to": 0.31,
186
+ "cosine": 0.9977883464133772
187
+ },
188
+ {
189
+ "from": 0.31,
190
+ "to": 0.32,
191
+ "cosine": 0.9972405676335042
192
+ },
193
+ {
194
+ "from": 0.32,
195
+ "to": 0.33,
196
+ "cosine": 0.9975753358496272
197
+ },
198
+ {
199
+ "from": 0.33,
200
+ "to": 0.34,
201
+ "cosine": 0.9961770108426754
202
+ },
203
+ {
204
+ "from": 0.34,
205
+ "to": 0.35,
206
+ "cosine": 0.9976173199484535
207
+ },
208
+ {
209
+ "from": 0.35,
210
+ "to": 0.36,
211
+ "cosine": 0.9977780902829744
212
+ },
213
+ {
214
+ "from": 0.36,
215
+ "to": 0.37,
216
+ "cosine": 0.996919018490538
217
+ },
218
+ {
219
+ "from": 0.37,
220
+ "to": 0.38,
221
+ "cosine": 0.9981407498405426
222
+ },
223
+ {
224
+ "from": 0.38,
225
+ "to": 0.39,
226
+ "cosine": 0.9984868120483484
227
+ },
228
+ {
229
+ "from": 0.39,
230
+ "to": 0.4,
231
+ "cosine": 0.9987313807889135
232
+ },
233
+ {
234
+ "from": 0.4,
235
+ "to": 0.41,
236
+ "cosine": 0.9989361296191474
237
+ },
238
+ {
239
+ "from": 0.41,
240
+ "to": 0.42,
241
+ "cosine": 0.9990464199582916
242
+ },
243
+ {
244
+ "from": 0.42,
245
+ "to": 0.43,
246
+ "cosine": 0.9989740860278867
247
+ },
248
+ {
249
+ "from": 0.43,
250
+ "to": 0.44,
251
+ "cosine": 0.999130299979199
252
+ },
253
+ {
254
+ "from": 0.44,
255
+ "to": 0.45,
256
+ "cosine": 0.9993108486014458
257
+ },
258
+ {
259
+ "from": 0.45,
260
+ "to": 0.46,
261
+ "cosine": 0.9993110275865007
262
+ },
263
+ {
264
+ "from": 0.46,
265
+ "to": 0.47,
266
+ "cosine": 0.9993452632608613
267
+ },
268
+ {
269
+ "from": 0.47,
270
+ "to": 0.48,
271
+ "cosine": 0.9993674563567321
272
+ },
273
+ {
274
+ "from": 0.48,
275
+ "to": 0.49,
276
+ "cosine": 0.9993966878649299
277
+ },
278
+ {
279
+ "from": 0.49,
280
+ "to": 0.5,
281
+ "cosine": 0.9994516143437041
282
+ }
283
+ ]
284
+ }
285
+ {
286
+ "updated_at": "2026-07-11T04:03:52.830465+00:00",
287
+ "inputs": [
288
+ "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_final_t015_050_s001_n16_seed43_680359/alignment.json"
289
+ ],
290
+ "num_runs": 1,
291
+ "axis": [
292
+ 0.15,
293
+ 0.16,
294
+ 0.17,
295
+ 0.18,
296
+ 0.19,
297
+ 0.2,
298
+ 0.21,
299
+ 0.22,
300
+ 0.23,
301
+ 0.24,
302
+ 0.25,
303
+ 0.26,
304
+ 0.27,
305
+ 0.28,
306
+ 0.29,
307
+ 0.3,
308
+ 0.31,
309
+ 0.32,
310
+ 0.33,
311
+ 0.34,
312
+ 0.35,
313
+ 0.36,
314
+ 0.37,
315
+ 0.38,
316
+ 0.39,
317
+ 0.4,
318
+ 0.41,
319
+ 0.42,
320
+ 0.43,
321
+ 0.44,
322
+ 0.45,
323
+ 0.46,
324
+ 0.47,
325
+ 0.48,
326
+ 0.49,
327
+ 0.5
328
+ ],
329
+ "best_split": {
330
+ "split_index": 16,
331
+ "left_t": 0.3,
332
+ "right_t": 0.31,
333
+ "boundary": 0.305,
334
+ "within_mean": 0.9469304948557973,
335
+ "between_mean": 0.7281832713353107,
336
+ "gap": 0.2187472235204866
337
+ },
338
+ "adjacent_minimum": {
339
+ "from": 0.33,
340
+ "to": 0.34,
341
+ "boundary": 0.335,
342
+ "cosine": 0.9961770108426754
343
+ },
344
+ "per_run_best_split": [
345
+ {
346
+ "path": "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_final_t015_050_s001_n16_seed43_680359/alignment.json",
347
+ "split_index": 16,
348
+ "left_t": 0.3,
349
+ "right_t": 0.31,
350
+ "boundary": 0.305,
351
+ "within_mean": 0.9469304948557973,
352
+ "between_mean": 0.7281832713353107,
353
+ "gap": 0.2187472235204866
354
+ }
355
+ ],
356
+ "bootstrap_repetitions": 0,
357
+ "bootstrap_boundary_counts": {}
358
+ }
359
+ [info] finished_at=2026-07-11T12:03:54+08:00
runs/elf_timestep_alignment/elfb-deep-s43_680027.err ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-11 00:50:12.214320: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2
+ WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
3
+ E0000 00:00:1783702212.587122 1392060 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
4
+ E0000 00:00:1783702212.680281 1392060 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
5
+ W0000 00:00:1783702213.425704 1392060 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
6
+ W0000 00:00:1783702213.425781 1392060 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
7
+ W0000 00:00:1783702213.425789 1392060 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
8
+ W0000 00:00:1783702213.425796 1392060 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
9
+
10
+ WARNING:absl:The transformations API will eventually be replaced by an upgraded design. The current API will not be removed until this point, but it will no longer be actively worked on.
runs/elf_timestep_alignment/elfb-deep-s44_680028.err ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-11 01:06:22.803380: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2
+ WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
3
+ E0000 00:00:1783703182.816327 1955063 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
4
+ E0000 00:00:1783703182.820107 1955063 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
5
+ W0000 00:00:1783703182.832872 1955063 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
6
+ W0000 00:00:1783703182.832894 1955063 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
7
+ W0000 00:00:1783703182.832897 1955063 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
8
+ W0000 00:00:1783703182.832900 1955063 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
9
+
10
+ WARNING:absl:The transformations API will eventually be replaced by an upgraded design. The current API will not be removed until this point, but it will no longer be actively worked on.
runs/elf_timestep_alignment/elfb-deep-s44_680028.out ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-11T01:06:19+08:00
2
+ [info] node=xgpi13
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed44_680028
4
+ [info] seed=44 samples=16 t_values=0.15:0.01:0.50
5
+ [info] grad_regex=blocks_11 texts_file=/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/text_samples_32.txt
6
+ Sat Jul 11 01:06:19 2026
7
+ +-----------------------------------------------------------------------------------------+
8
+ | NVIDIA-SMI 575.57.08 Driver Version: 575.57.08 CUDA Version: 12.9 |
9
+ |-----------------------------------------+------------------------+----------------------+
10
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
11
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
12
+ | | | MIG M. |
13
+ |=========================================+========================+======================|
14
+ | 0 NVIDIA H100 NVL On | 00000000:82:00.0 Off | On |
15
+ | N/A 58C P0 240W / 400W | 24743MiB / 95830MiB | N/A Default |
16
+ | | | Enabled |
17
+ +-----------------------------------------+------------------------+----------------------+
18
+
19
+ +-----------------------------------------------------------------------------------------+
20
+ | MIG devices: |
21
+ +------------------+----------------------------------+-----------+-----------------------+
22
+ | GPU GI CI MIG | Memory-Usage | Vol| Shared |
23
+ | ID ID Dev | BAR1-Usage | SM Unc| CE ENC DEC OFA JPG |
24
+ | | | ECC| |
25
+ |==================+==================================+===========+=======================|
26
+ | 0 2 0 0 | 44MiB / 47488MiB | 60 0 | 3 0 3 0 3 |
27
+ | | 0MiB / 65535MiB | | |
28
+ +------------------+----------------------------------+-----------+-----------------------+
29
+
30
+ +-----------------------------------------------------------------------------------------+
31
+ | Processes: |
32
+ | GPU GI CI PID Type Process name GPU Memory |
33
+ | ID ID Usage |
34
+ |=========================================================================================|
35
+ | No running processes found |
36
+ +-----------------------------------------------------------------------------------------+
37
+ [info] jax_backend=gpu
38
+ [info] jax_devices=[CudaDevice(id=0)]
39
+ {
40
+ "mode": "elf_flow_matching",
41
+ "model": "ELF-B",
42
+ "t_values": [
43
+ 0.15,
44
+ 0.16,
45
+ 0.17,
46
+ 0.18,
47
+ 0.19,
48
+ 0.2,
49
+ 0.21,
50
+ 0.22,
51
+ 0.23,
52
+ 0.24,
53
+ 0.25,
54
+ 0.26,
55
+ 0.27,
56
+ 0.28,
57
+ 0.29,
58
+ 0.3,
59
+ 0.31,
60
+ 0.32,
61
+ 0.33,
62
+ 0.34,
63
+ 0.35,
64
+ 0.36,
65
+ 0.37,
66
+ 0.38,
67
+ 0.39,
68
+ 0.4,
69
+ 0.41,
70
+ 0.42,
71
+ 0.43,
72
+ 0.44,
73
+ 0.45,
74
+ 0.46,
75
+ 0.47,
76
+ 0.48,
77
+ 0.49,
78
+ 0.5
79
+ ],
80
+ "loss_by_t": [
81
+ 0.7627679705619812,
82
+ 0.7817412614822388,
83
+ 0.8025046586990356,
84
+ 0.82469642162323,
85
+ 0.8481600284576416,
86
+ 0.8676245212554932,
87
+ 0.8870224952697754,
88
+ 0.9036419987678528,
89
+ 0.9500153064727783,
90
+ 0.9626415967941284,
91
+ 0.9728938937187195,
92
+ 0.9880105257034302,
93
+ 0.9993098378181458,
94
+ 1.0243895053863525,
95
+ 1.0442224740982056,
96
+ 1.0454508066177368,
97
+ 1.0349785089492798,
98
+ 1.034855842590332,
99
+ 1.0424922704696655,
100
+ 1.0538352727890015,
101
+ 1.0678465366363525,
102
+ 1.0883949995040894,
103
+ 1.1084671020507812,
104
+ 1.1251789331436157,
105
+ 1.1478139162063599,
106
+ 1.1632744073867798,
107
+ 1.1861265897750854,
108
+ 1.202358365058899,
109
+ 1.2165666818618774,
110
+ 1.238524079322815,
111
+ 1.2581349611282349,
112
+ 1.2842414379119873,
113
+ 1.3230923414230347,
114
+ 1.357128381729126,
115
+ 1.3853179216384888,
116
+ 1.4156414270401
117
+ ],
118
+ "adjacent_cosines": [
119
+ {
120
+ "from": 0.15,
121
+ "to": 0.16,
122
+ "cosine": 0.9956201655094372
123
+ },
124
+ {
125
+ "from": 0.16,
126
+ "to": 0.17,
127
+ "cosine": 0.9946803134385943
128
+ },
129
+ {
130
+ "from": 0.17,
131
+ "to": 0.18,
132
+ "cosine": 0.994622392865257
133
+ },
134
+ {
135
+ "from": 0.18,
136
+ "to": 0.19,
137
+ "cosine": 0.9945958226289133
138
+ },
139
+ {
140
+ "from": 0.19,
141
+ "to": 0.2,
142
+ "cosine": 0.99561790601484
143
+ },
144
+ {
145
+ "from": 0.2,
146
+ "to": 0.21,
147
+ "cosine": 0.994733359162385
148
+ },
149
+ {
150
+ "from": 0.21,
151
+ "to": 0.22,
152
+ "cosine": 0.9956387362908341
153
+ },
154
+ {
155
+ "from": 0.22,
156
+ "to": 0.23,
157
+ "cosine": 0.9591980706963354
158
+ },
159
+ {
160
+ "from": 0.23,
161
+ "to": 0.24,
162
+ "cosine": 0.990455340728805
163
+ },
164
+ {
165
+ "from": 0.24,
166
+ "to": 0.25,
167
+ "cosine": 0.9939695710377966
168
+ },
169
+ {
170
+ "from": 0.25,
171
+ "to": 0.26,
172
+ "cosine": 0.9955205558288159
173
+ },
174
+ {
175
+ "from": 0.26,
176
+ "to": 0.27,
177
+ "cosine": 0.9955783770571687
178
+ },
179
+ {
180
+ "from": 0.27,
181
+ "to": 0.28,
182
+ "cosine": 0.9941638626636766
183
+ },
184
+ {
185
+ "from": 0.28,
186
+ "to": 0.29,
187
+ "cosine": 0.9961058749711726
188
+ },
189
+ {
190
+ "from": 0.29,
191
+ "to": 0.3,
192
+ "cosine": 0.9969421501983707
193
+ },
194
+ {
195
+ "from": 0.3,
196
+ "to": 0.31,
197
+ "cosine": 0.9953219324817955
198
+ },
199
+ {
200
+ "from": 0.31,
201
+ "to": 0.32,
202
+ "cosine": 0.9952163932489749
203
+ },
204
+ {
205
+ "from": 0.32,
206
+ "to": 0.33,
207
+ "cosine": 0.994137222151749
208
+ },
209
+ {
210
+ "from": 0.33,
211
+ "to": 0.34,
212
+ "cosine": 0.9930571229041386
213
+ },
214
+ {
215
+ "from": 0.34,
216
+ "to": 0.35,
217
+ "cosine": 0.9943159135370286
218
+ },
219
+ {
220
+ "from": 0.35,
221
+ "to": 0.36,
222
+ "cosine": 0.9983593567037766
223
+ },
224
+ {
225
+ "from": 0.36,
226
+ "to": 0.37,
227
+ "cosine": 0.9973887652174955
228
+ },
229
+ {
230
+ "from": 0.37,
231
+ "to": 0.38,
232
+ "cosine": 0.9961969737975683
233
+ },
234
+ {
235
+ "from": 0.38,
236
+ "to": 0.39,
237
+ "cosine": 0.9953705215627234
238
+ },
239
+ {
240
+ "from": 0.39,
241
+ "to": 0.4,
242
+ "cosine": 0.9960464212033776
243
+ },
244
+ {
245
+ "from": 0.4,
246
+ "to": 0.41,
247
+ "cosine": 0.9969713843778287
248
+ },
249
+ {
250
+ "from": 0.41,
251
+ "to": 0.42,
252
+ "cosine": 0.9968156785889787
253
+ },
254
+ {
255
+ "from": 0.42,
256
+ "to": 0.43,
257
+ "cosine": 0.997473862583549
258
+ },
259
+ {
260
+ "from": 0.43,
261
+ "to": 0.44,
262
+ "cosine": 0.996572437450513
263
+ },
264
+ {
265
+ "from": 0.44,
266
+ "to": 0.45,
267
+ "cosine": 0.9988315457491682
268
+ },
269
+ {
270
+ "from": 0.45,
271
+ "to": 0.46,
272
+ "cosine": 0.9990782355591911
273
+ },
274
+ {
275
+ "from": 0.46,
276
+ "to": 0.47,
277
+ "cosine": 0.9971105669983424
278
+ },
279
+ {
280
+ "from": 0.47,
281
+ "to": 0.48,
282
+ "cosine": 0.9988924458174007
283
+ },
284
+ {
285
+ "from": 0.48,
286
+ "to": 0.49,
287
+ "cosine": 0.9991129422845241
288
+ },
289
+ {
290
+ "from": 0.49,
291
+ "to": 0.5,
292
+ "cosine": 0.9985156098772441
293
+ }
294
+ ]
295
+ }
296
+ {
297
+ "updated_at": "2026-07-10T17:08:00.808609+00:00",
298
+ "inputs": [
299
+ "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed44_680028/alignment.json"
300
+ ],
301
+ "num_runs": 1,
302
+ "axis": [
303
+ 0.15,
304
+ 0.16,
305
+ 0.17,
306
+ 0.18,
307
+ 0.19,
308
+ 0.2,
309
+ 0.21,
310
+ 0.22,
311
+ 0.23,
312
+ 0.24,
313
+ 0.25,
314
+ 0.26,
315
+ 0.27,
316
+ 0.28,
317
+ 0.29,
318
+ 0.3,
319
+ 0.31,
320
+ 0.32,
321
+ 0.33,
322
+ 0.34,
323
+ 0.35,
324
+ 0.36,
325
+ 0.37,
326
+ 0.38,
327
+ 0.39,
328
+ 0.4,
329
+ 0.41,
330
+ 0.42,
331
+ 0.43,
332
+ 0.44,
333
+ 0.45,
334
+ 0.46,
335
+ 0.47,
336
+ 0.48,
337
+ 0.49,
338
+ 0.5
339
+ ],
340
+ "best_split": {
341
+ "split_index": 14,
342
+ "left_t": 0.28,
343
+ "right_t": 0.29,
344
+ "boundary": 0.28500000000000003,
345
+ "within_mean": 0.9024637474103743,
346
+ "between_mean": 0.630875260075048,
347
+ "gap": 0.27158848733532626
348
+ },
349
+ "adjacent_minimum": {
350
+ "from": 0.22,
351
+ "to": 0.23,
352
+ "boundary": 0.225,
353
+ "cosine": 0.9591980706963354
354
+ },
355
+ "per_run_best_split": [
356
+ {
357
+ "path": "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_block11_t015_050_s001_n16_seed44_680028/alignment.json",
358
+ "split_index": 14,
359
+ "left_t": 0.28,
360
+ "right_t": 0.29,
361
+ "boundary": 0.28500000000000003,
362
+ "within_mean": 0.9024637474103743,
363
+ "between_mean": 0.630875260075048,
364
+ "gap": 0.27158848733532626
365
+ }
366
+ ],
367
+ "bootstrap_repetitions": 0,
368
+ "bootstrap_boundary_counts": {}
369
+ }
370
+ [info] finished_at=2026-07-11T01:08:01+08:00
runs/elf_timestep_alignment/elfb-final-s41_680020.out ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [info] started_at=2026-07-11T01:03:08+08:00
2
+ [info] node=xgpi13
3
+ [info] run_dir=/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_final_t015_050_s001_n16_seed41_680020
4
+ [info] seed=41 samples=16 t_values=0.15:0.01:0.50
5
+ [info] grad_regex=final_layer|proj_kernel|proj_bias texts_file=/home/l/liyj/shiying/hku_diffusion_dllm/experiments/elf_timestep_alignment/text_samples_32.txt
6
+ Sat Jul 11 01:03:08 2026
7
+ +-----------------------------------------------------------------------------------------+
8
+ | NVIDIA-SMI 575.57.08 Driver Version: 575.57.08 CUDA Version: 12.9 |
9
+ |-----------------------------------------+------------------------+----------------------+
10
+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
11
+ | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
12
+ | | | MIG M. |
13
+ |=========================================+========================+======================|
14
+ | 0 NVIDIA H100 NVL On | 00000000:82:00.0 Off | On |
15
+ | N/A 72C P0 256W / 400W | 8831MiB / 95830MiB | N/A Default |
16
+ | | | Enabled |
17
+ +-----------------------------------------+------------------------+----------------------+
18
+
19
+ +-----------------------------------------------------------------------------------------+
20
+ | MIG devices: |
21
+ +------------------+----------------------------------+-----------+-----------------------+
22
+ | GPU GI CI MIG | Memory-Usage | Vol| Shared |
23
+ | ID ID Dev | BAR1-Usage | SM Unc| CE ENC DEC OFA JPG |
24
+ | | | ECC| |
25
+ |==================+==================================+===========+=======================|
26
+ | 0 2 0 0 | 44MiB / 47488MiB | 60 0 | 3 0 3 0 3 |
27
+ | | 0MiB / 65535MiB | | |
28
+ +------------------+----------------------------------+-----------+-----------------------+
29
+
30
+ +-----------------------------------------------------------------------------------------+
31
+ | Processes: |
32
+ | GPU GI CI PID Type Process name GPU Memory |
33
+ | ID ID Usage |
34
+ |=========================================================================================|
35
+ | No running processes found |
36
+ +-----------------------------------------------------------------------------------------+
37
+ [info] jax_backend=gpu
38
+ [info] jax_devices=[CudaDevice(id=0)]
39
+ {
40
+ "mode": "elf_flow_matching",
41
+ "model": "ELF-B",
42
+ "t_values": [
43
+ 0.15,
44
+ 0.16,
45
+ 0.17,
46
+ 0.18,
47
+ 0.19,
48
+ 0.2,
49
+ 0.21,
50
+ 0.22,
51
+ 0.23,
52
+ 0.24,
53
+ 0.25,
54
+ 0.26,
55
+ 0.27,
56
+ 0.28,
57
+ 0.29,
58
+ 0.3,
59
+ 0.31,
60
+ 0.32,
61
+ 0.33,
62
+ 0.34,
63
+ 0.35,
64
+ 0.36,
65
+ 0.37,
66
+ 0.38,
67
+ 0.39,
68
+ 0.4,
69
+ 0.41,
70
+ 0.42,
71
+ 0.43,
72
+ 0.44,
73
+ 0.45,
74
+ 0.46,
75
+ 0.47,
76
+ 0.48,
77
+ 0.49,
78
+ 0.5
79
+ ],
80
+ "loss_by_t": [
81
+ 0.7688165903091431,
82
+ 0.7881860733032227,
83
+ 0.8076627254486084,
84
+ 0.8300124406814575,
85
+ 0.8552974462509155,
86
+ 0.8814648389816284,
87
+ 0.9066751599311829,
88
+ 0.9337313771247864,
89
+ 0.9615678787231445,
90
+ 0.9800011515617371,
91
+ 0.9911522269248962,
92
+ 1.005384087562561,
93
+ 1.0285662412643433,
94
+ 1.04488205909729,
95
+ 1.0595942735671997,
96
+ 1.0713118314743042,
97
+ 1.0829862356185913,
98
+ 1.0868176221847534,
99
+ 1.101675271987915,
100
+ 1.114145040512085,
101
+ 1.126178503036499,
102
+ 1.1216404438018799,
103
+ 1.131507396697998,
104
+ 1.1484925746917725,
105
+ 1.1604516506195068,
106
+ 1.167521595954895,
107
+ 1.1840507984161377,
108
+ 1.2131421566009521,
109
+ 1.2396544218063354,
110
+ 1.2780667543411255,
111
+ 1.3072309494018555,
112
+ 1.3171030282974243,
113
+ 1.3367830514907837,
114
+ 1.364898920059204,
115
+ 1.3939350843429565,
116
+ 1.4213314056396484
117
+ ],
118
+ "adjacent_cosines": [
119
+ {
120
+ "from": 0.15,
121
+ "to": 0.16,
122
+ "cosine": 0.9988865875881188
123
+ },
124
+ {
125
+ "from": 0.16,
126
+ "to": 0.17,
127
+ "cosine": 0.9985909630144116
128
+ },
129
+ {
130
+ "from": 0.17,
131
+ "to": 0.18,
132
+ "cosine": 0.9985002482292916
133
+ },
134
+ {
135
+ "from": 0.18,
136
+ "to": 0.19,
137
+ "cosine": 0.9987054461676875
138
+ },
139
+ {
140
+ "from": 0.19,
141
+ "to": 0.2,
142
+ "cosine": 0.9986596233989851
143
+ },
144
+ {
145
+ "from": 0.2,
146
+ "to": 0.21,
147
+ "cosine": 0.9981939347981107
148
+ },
149
+ {
150
+ "from": 0.21,
151
+ "to": 0.22,
152
+ "cosine": 0.9972620881622799
153
+ },
154
+ {
155
+ "from": 0.22,
156
+ "to": 0.23,
157
+ "cosine": 0.9975541266823477
158
+ },
159
+ {
160
+ "from": 0.23,
161
+ "to": 0.24,
162
+ "cosine": 0.9974673401932552
163
+ },
164
+ {
165
+ "from": 0.24,
166
+ "to": 0.25,
167
+ "cosine": 0.9964224760899152
168
+ },
169
+ {
170
+ "from": 0.25,
171
+ "to": 0.26,
172
+ "cosine": 0.9957857414630581
173
+ },
174
+ {
175
+ "from": 0.26,
176
+ "to": 0.27,
177
+ "cosine": 0.997104777552731
178
+ },
179
+ {
180
+ "from": 0.27,
181
+ "to": 0.28,
182
+ "cosine": 0.9968518940775081
183
+ },
184
+ {
185
+ "from": 0.28,
186
+ "to": 0.29,
187
+ "cosine": 0.997847468506239
188
+ },
189
+ {
190
+ "from": 0.29,
191
+ "to": 0.3,
192
+ "cosine": 0.9979465524442366
193
+ },
194
+ {
195
+ "from": 0.3,
196
+ "to": 0.31,
197
+ "cosine": 0.9980341484829286
198
+ },
199
+ {
200
+ "from": 0.31,
201
+ "to": 0.32,
202
+ "cosine": 0.9980169360118402
203
+ },
204
+ {
205
+ "from": 0.32,
206
+ "to": 0.33,
207
+ "cosine": 0.9980631346612001
208
+ },
209
+ {
210
+ "from": 0.33,
211
+ "to": 0.34,
212
+ "cosine": 0.9979939141146454
213
+ },
214
+ {
215
+ "from": 0.34,
216
+ "to": 0.35,
217
+ "cosine": 0.9968067671243962
218
+ },
219
+ {
220
+ "from": 0.35,
221
+ "to": 0.36,
222
+ "cosine": 0.9962136500314553
223
+ },
224
+ {
225
+ "from": 0.36,
226
+ "to": 0.37,
227
+ "cosine": 0.9970017371532452
228
+ },
229
+ {
230
+ "from": 0.37,
231
+ "to": 0.38,
232
+ "cosine": 0.9978530871598346
233
+ },
234
+ {
235
+ "from": 0.38,
236
+ "to": 0.39,
237
+ "cosine": 0.998573715500597
238
+ },
239
+ {
240
+ "from": 0.39,
241
+ "to": 0.4,
242
+ "cosine": 0.9984291187651212
243
+ },
244
+ {
245
+ "from": 0.4,
246
+ "to": 0.41,
247
+ "cosine": 0.9984658010801796
248
+ },
249
+ {
250
+ "from": 0.41,
251
+ "to": 0.42,
252
+ "cosine": 0.998314890438336
253
+ },
254
+ {
255
+ "from": 0.42,
256
+ "to": 0.43,
257
+ "cosine": 0.9983219401949588
258
+ },
259
+ {
260
+ "from": 0.43,
261
+ "to": 0.44,
262
+ "cosine": 0.9987270523736189
263
+ },
264
+ {
265
+ "from": 0.44,
266
+ "to": 0.45,
267
+ "cosine": 0.9987952594735235
268
+ },
269
+ {
270
+ "from": 0.45,
271
+ "to": 0.46,
272
+ "cosine": 0.9990234184096225
273
+ },
274
+ {
275
+ "from": 0.46,
276
+ "to": 0.47,
277
+ "cosine": 0.9991560736232648
278
+ },
279
+ {
280
+ "from": 0.47,
281
+ "to": 0.48,
282
+ "cosine": 0.9992886696923636
283
+ },
284
+ {
285
+ "from": 0.48,
286
+ "to": 0.49,
287
+ "cosine": 0.9993453410767242
288
+ },
289
+ {
290
+ "from": 0.49,
291
+ "to": 0.5,
292
+ "cosine": 0.9993858321293491
293
+ }
294
+ ]
295
+ }
296
+ {
297
+ "updated_at": "2026-07-10T17:04:42.505672+00:00",
298
+ "inputs": [
299
+ "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_final_t015_050_s001_n16_seed41_680020/alignment.json"
300
+ ],
301
+ "num_runs": 1,
302
+ "axis": [
303
+ 0.15,
304
+ 0.16,
305
+ 0.17,
306
+ 0.18,
307
+ 0.19,
308
+ 0.2,
309
+ 0.21,
310
+ 0.22,
311
+ 0.23,
312
+ 0.24,
313
+ 0.25,
314
+ 0.26,
315
+ 0.27,
316
+ 0.28,
317
+ 0.29,
318
+ 0.3,
319
+ 0.31,
320
+ 0.32,
321
+ 0.33,
322
+ 0.34,
323
+ 0.35,
324
+ 0.36,
325
+ 0.37,
326
+ 0.38,
327
+ 0.39,
328
+ 0.4,
329
+ 0.41,
330
+ 0.42,
331
+ 0.43,
332
+ 0.44,
333
+ 0.45,
334
+ 0.46,
335
+ 0.47,
336
+ 0.48,
337
+ 0.49,
338
+ 0.5
339
+ ],
340
+ "best_split": {
341
+ "split_index": 16,
342
+ "left_t": 0.3,
343
+ "right_t": 0.31,
344
+ "boundary": 0.305,
345
+ "within_mean": 0.935255293415878,
346
+ "between_mean": 0.7070568765599928,
347
+ "gap": 0.22819841685588516
348
+ },
349
+ "adjacent_minimum": {
350
+ "from": 0.25,
351
+ "to": 0.26,
352
+ "boundary": 0.255,
353
+ "cosine": 0.9957857414630581
354
+ },
355
+ "per_run_best_split": [
356
+ {
357
+ "path": "/home/l/liyj/shiying/hku_diffusion_dllm/runs/elf_timestep_alignment/elf_b_owt_boundary_final_t015_050_s001_n16_seed41_680020/alignment.json",
358
+ "split_index": 16,
359
+ "left_t": 0.3,
360
+ "right_t": 0.31,
361
+ "boundary": 0.305,
362
+ "within_mean": 0.935255293415878,
363
+ "between_mean": 0.7070568765599928,
364
+ "gap": 0.22819841685588516
365
+ }
366
+ ],
367
+ "bootstrap_repetitions": 0,
368
+ "bootstrap_boundary_counts": {}
369
+ }
370
+ [info] finished_at=2026-07-11T01:04:43+08:00