suchirsalhan commited on
Commit
167eadf
·
verified ·
1 Parent(s): b29a2c5

main <- step 0

Browse files
Files changed (4) hide show
  1. README.md +31 -0
  2. config.json +199 -0
  3. model.safetensors +3 -0
  4. training_config.yaml +127 -0
README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: pytorch
4
+ tags: [dynamic-chunking, tokenization, hnet, byte-level, beetle-hnet]
5
+ ---
6
+
7
+ # ali_mem-mixed_s1
8
+
9
+ A byte-level H-Net run from [beetle-hnet](https://github.com/suchirsalhan/beetle-hnet)
10
+ (`architecture=ali`, `objective=ratio`
11
+ `schedule=None`, `dechunk=ema`, seed 1,
12
+ 6000 steps x 32 x 1024 bytes, langs ['en', 'tr', 'fi']).
13
+
14
+ ## Layout (Beetle-style)
15
+
16
+ - **`step-N` branches**, one per kept checkpoint on a phase-aware log2 schedule (0, 1, 2, 4, 6,
17
+ 8, 16, ..., 2^k from every objective-phase start, plus the final step). Each holds
18
+ `model.safetensors`, `config.json`, `training_config.yaml` and the full resumable trainer
19
+ state `training_state/checkpoint.pt` (for inventory arms this includes the inventory).
20
+ - **`main`**: the latest step's weights and config, plus `log.jsonl`, `final.json` and the
21
+ FLORES+ boundary probes `probe/` once the run has finished.
22
+
23
+ ```python
24
+ from huggingface_hub import hf_hub_download
25
+ import torch
26
+ p = hf_hub_download("AdaptiveChunking/ali_mem-mixed_s1", "training_state/checkpoint.pt", revision="step-1024")
27
+ state = torch.load(p, map_location="cpu", weights_only=False)
28
+ ```
29
+
30
+ `model.safetensors` stores each tied tensor once; `config.json["tied_weights"]` maps the
31
+ dropped names to the stored ones.
config.json ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "arch": "ali",
3
+ "step": 0,
4
+ "model_config": {
5
+ "vocab_size": 256,
6
+ "d_enc": 256,
7
+ "d_main": 512,
8
+ "n_enc": 2,
9
+ "n_dec": 2,
10
+ "n_main": 6,
11
+ "n_heads_enc": 4,
12
+ "n_heads_main": 8,
13
+ "seq_len": 1024,
14
+ "dropout": 0.0,
15
+ "target_ratio": 6.0,
16
+ "max_chunk_mult": 3.0,
17
+ "dechunk": "ema",
18
+ "router_noise": 0.0,
19
+ "rope_base": 10000.0
20
+ },
21
+ "ali_config": {
22
+ "enabled": true,
23
+ "budget_B": 65536,
24
+ "staging_capacity": 262144,
25
+ "policy": "frequency",
26
+ "value_mode": "learned",
27
+ "candidate_types": [
28
+ "surface",
29
+ "split",
30
+ "merge",
31
+ "skel"
32
+ ],
33
+ "gate": "vector",
34
+ "retrieval": true,
35
+ "memory_scope": "persistent",
36
+ "read_dropout": 0.1,
37
+ "write_rule": "mean",
38
+ "eta_min": 0.0,
39
+ "consolidate_every": 50,
40
+ "probe_seqs": 2,
41
+ "probe_reps": 8,
42
+ "horizon": 32,
43
+ "predictor": "mlp",
44
+ "lambda_util": 0.1,
45
+ "max_span": 64,
46
+ "byte_classes_path": "/local/scratch/sas245/beetle-hnet/scratch/data/byte_classes.json",
47
+ "gate_hidden": 0,
48
+ "type_dim": 16,
49
+ "gate_bias_init": -2.0
50
+ },
51
+ "tied_weights": {
52
+ "head.weight": "emb.weight"
53
+ },
54
+ "config": {
55
+ "model": {
56
+ "architecture": "ali",
57
+ "d_enc": 256,
58
+ "d_main": 512,
59
+ "n_enc": 2,
60
+ "n_dec": 2,
61
+ "n_main": 6,
62
+ "n_heads_enc": 4,
63
+ "n_heads_main": 8,
64
+ "seq_len": 1024,
65
+ "dropout": 0.0,
66
+ "target_ratio": 6.0,
67
+ "max_chunk_mult": 3.0,
68
+ "dechunk": "ema",
69
+ "router_noise": 0.0,
70
+ "rope_base": 10000.0
71
+ },
72
+ "memory": {
73
+ "ali": {
74
+ "budget_B": 65536,
75
+ "staging_capacity": 262144,
76
+ "policy": "frequency",
77
+ "value_mode": "learned",
78
+ "candidate_types": [
79
+ "surface",
80
+ "split",
81
+ "merge",
82
+ "skel"
83
+ ],
84
+ "write_rule": "mean",
85
+ "eta_min": 0.0,
86
+ "memory_scope": "persistent",
87
+ "consolidate_every": 50,
88
+ "max_span": 64,
89
+ "gate": "vector",
90
+ "retrieval": true,
91
+ "read_dropout": 0.1,
92
+ "gate_hidden": 0,
93
+ "type_dim": 16,
94
+ "gate_bias_init": -2.0,
95
+ "probe_seqs": 2,
96
+ "probe_reps": 8,
97
+ "horizon": 32,
98
+ "predictor": "mlp",
99
+ "lambda_util": 0.1,
100
+ "enabled": true,
101
+ "inventory_kwargs": {},
102
+ "probe_mix": null,
103
+ "util_batch_slots": 1024
104
+ },
105
+ "pkm": {
106
+ "n_keys": 256,
107
+ "topk": 8,
108
+ "heads": 1,
109
+ "d_key": null,
110
+ "value_lr_mult": 1.0
111
+ }
112
+ },
113
+ "objective": {
114
+ "name": "ratio",
115
+ "schedule": null,
116
+ "alpha": 0.03,
117
+ "alpha_parity_cap": 0.06,
118
+ "global_anchor": 0.0,
119
+ "premium_clip": 4.0,
120
+ "premium_kind": "flores_per_sent",
121
+ "tau1": 0.4,
122
+ "tau2": 0.7,
123
+ "freeze_scope": "router",
124
+ "cpc_decay": 0.9,
125
+ "genreg_target_entropy": null,
126
+ "genreg_eta": 0.05
127
+ },
128
+ "data": {
129
+ "corpus": "corpus",
130
+ "langs": [
131
+ "en",
132
+ "tr",
133
+ "fi"
134
+ ],
135
+ "mixture": null,
136
+ "doc_filters": null,
137
+ "byte_classes": "scratch/data/byte_classes.json"
138
+ },
139
+ "training": {
140
+ "seed": 1,
141
+ "max_steps": 6000,
142
+ "batch_size": 32,
143
+ "grad_accum": 1,
144
+ "lr": 0.0003,
145
+ "min_lr_frac": 0.1,
146
+ "warmup": 300,
147
+ "weight_decay": 0.1,
148
+ "grad_clip": 1.0,
149
+ "betas": [
150
+ 0.9,
151
+ 0.95
152
+ ],
153
+ "router_lr_mult": 1.0,
154
+ "log_every": 50,
155
+ "amp": "bf16",
156
+ "compile": false,
157
+ "device": "cuda"
158
+ },
159
+ "checkpointing": {
160
+ "run_name": "ali_mem-mixed_s1",
161
+ "runs_dir": "runs",
162
+ "ckpt_every": 200,
163
+ "keep": false,
164
+ "milestones": [
165
+ 1000,
166
+ 3000
167
+ ],
168
+ "resume": "auto",
169
+ "keep_schedule": "log2",
170
+ "keep_extra_offsets": [
171
+ 2,
172
+ 4,
173
+ 6,
174
+ 8
175
+ ],
176
+ "hub_repo": "AdaptiveChunking/{run_name}",
177
+ "hub_private": false,
178
+ "keep_local": false
179
+ },
180
+ "evaluation": {
181
+ "eval_every": 200,
182
+ "eval_batches": 8,
183
+ "probe_sents": 128,
184
+ "probe_bpb_batches": 4,
185
+ "log_spaced_probe": true,
186
+ "dense_early_every": 0,
187
+ "dense_early_until": 0,
188
+ "dump_reps": true,
189
+ "dump_reps_thresholds": [
190
+ 0.3,
191
+ 0.4,
192
+ 0.5,
193
+ 0.6,
194
+ 0.7
195
+ ]
196
+ }
197
+ },
198
+ "format": "beetle-hnet step branch v1 (src/checkpointing/hub.py)"
199
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82d9b9205b53fa655e0add4c8645868372304605819726dfdd7d832cada4a3d6
3
+ size 91151512
training_config.yaml ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model:
2
+ architecture: ali
3
+ d_enc: 256
4
+ d_main: 512
5
+ n_enc: 2
6
+ n_dec: 2
7
+ n_main: 6
8
+ n_heads_enc: 4
9
+ n_heads_main: 8
10
+ seq_len: 1024
11
+ dropout: 0.0
12
+ target_ratio: 6.0
13
+ max_chunk_mult: 3.0
14
+ dechunk: ema
15
+ router_noise: 0.0
16
+ rope_base: 10000.0
17
+ memory:
18
+ ali:
19
+ budget_B: 65536
20
+ staging_capacity: 262144
21
+ policy: frequency
22
+ value_mode: learned
23
+ candidate_types:
24
+ - surface
25
+ - split
26
+ - merge
27
+ - skel
28
+ write_rule: mean
29
+ eta_min: 0.0
30
+ memory_scope: persistent
31
+ consolidate_every: 50
32
+ max_span: 64
33
+ gate: vector
34
+ retrieval: true
35
+ read_dropout: 0.1
36
+ gate_hidden: 0
37
+ type_dim: 16
38
+ gate_bias_init: -2.0
39
+ probe_seqs: 2
40
+ probe_reps: 8
41
+ horizon: 32
42
+ predictor: mlp
43
+ lambda_util: 0.1
44
+ enabled: true
45
+ inventory_kwargs: {}
46
+ probe_mix: null
47
+ util_batch_slots: 1024
48
+ pkm:
49
+ n_keys: 256
50
+ topk: 8
51
+ heads: 1
52
+ d_key: null
53
+ value_lr_mult: 1.0
54
+ objective:
55
+ name: ratio
56
+ schedule: null
57
+ alpha: 0.03
58
+ alpha_parity_cap: 0.06
59
+ global_anchor: 0.0
60
+ premium_clip: 4.0
61
+ premium_kind: flores_per_sent
62
+ tau1: 0.4
63
+ tau2: 0.7
64
+ freeze_scope: router
65
+ cpc_decay: 0.9
66
+ genreg_target_entropy: null
67
+ genreg_eta: 0.05
68
+ data:
69
+ corpus: corpus
70
+ langs:
71
+ - en
72
+ - tr
73
+ - fi
74
+ mixture: null
75
+ doc_filters: null
76
+ byte_classes: scratch/data/byte_classes.json
77
+ training:
78
+ seed: 1
79
+ max_steps: 6000
80
+ batch_size: 32
81
+ grad_accum: 1
82
+ lr: 0.0003
83
+ min_lr_frac: 0.1
84
+ warmup: 300
85
+ weight_decay: 0.1
86
+ grad_clip: 1.0
87
+ betas:
88
+ - 0.9
89
+ - 0.95
90
+ router_lr_mult: 1.0
91
+ log_every: 50
92
+ amp: bf16
93
+ compile: false
94
+ device: cuda
95
+ checkpointing:
96
+ run_name: ali_mem-mixed_s1
97
+ runs_dir: runs
98
+ ckpt_every: 200
99
+ keep: false
100
+ milestones:
101
+ - 1000
102
+ - 3000
103
+ resume: auto
104
+ keep_schedule: log2
105
+ keep_extra_offsets:
106
+ - 2
107
+ - 4
108
+ - 6
109
+ - 8
110
+ hub_repo: AdaptiveChunking/{run_name}
111
+ hub_private: false
112
+ keep_local: false
113
+ evaluation:
114
+ eval_every: 200
115
+ eval_batches: 8
116
+ probe_sents: 128
117
+ probe_bpb_batches: 4
118
+ log_spaced_probe: true
119
+ dense_early_every: 0
120
+ dense_early_until: 0
121
+ dump_reps: true
122
+ dump_reps_thresholds:
123
+ - 0.3
124
+ - 0.4
125
+ - 0.5
126
+ - 0.6
127
+ - 0.7