suchirsalhan commited on
Commit
f73714d
·
verified ·
1 Parent(s): 15f7562

main <- step 0

Browse files
Files changed (4) hide show
  1. README.md +31 -0
  2. config.json +170 -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_hnet_s3
8
+
9
+ A byte-level H-Net run from [beetle-hnet](https://github.com/suchirsalhan/beetle-hnet)
10
+ (`architecture=hnet`, `objective=ratio`
11
+ `schedule=None`, `dechunk=ema`, seed 3,
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_hnet_s3", "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,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "arch": "hnet",
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": null,
22
+ "tied_weights": {
23
+ "head.weight": "emb.weight"
24
+ },
25
+ "config": {
26
+ "model": {
27
+ "architecture": "hnet",
28
+ "d_enc": 256,
29
+ "d_main": 512,
30
+ "n_enc": 2,
31
+ "n_dec": 2,
32
+ "n_main": 6,
33
+ "n_heads_enc": 4,
34
+ "n_heads_main": 8,
35
+ "seq_len": 1024,
36
+ "dropout": 0.0,
37
+ "target_ratio": 6.0,
38
+ "max_chunk_mult": 3.0,
39
+ "dechunk": "ema",
40
+ "router_noise": 0.0,
41
+ "rope_base": 10000.0
42
+ },
43
+ "memory": {
44
+ "ali": {
45
+ "budget_B": 65536,
46
+ "staging_capacity": 262144,
47
+ "policy": "utility",
48
+ "value_mode": "learned",
49
+ "candidate_types": [
50
+ "surface",
51
+ "split",
52
+ "merge",
53
+ "skel"
54
+ ],
55
+ "write_rule": "mean",
56
+ "eta_min": 0.0,
57
+ "memory_scope": "persistent",
58
+ "consolidate_every": 50,
59
+ "max_span": 64,
60
+ "gate": "vector",
61
+ "retrieval": true,
62
+ "read_dropout": 0.1,
63
+ "gate_hidden": 0,
64
+ "type_dim": 16,
65
+ "gate_bias_init": -2.0,
66
+ "probe_seqs": 2,
67
+ "probe_reps": 8,
68
+ "horizon": 32,
69
+ "predictor": "mlp",
70
+ "lambda_util": 0.1,
71
+ "enabled": true,
72
+ "inventory_kwargs": {},
73
+ "probe_mix": null,
74
+ "util_batch_slots": 1024
75
+ },
76
+ "pkm": {
77
+ "n_keys": 256,
78
+ "topk": 8,
79
+ "heads": 1,
80
+ "d_key": null,
81
+ "value_lr_mult": 1.0
82
+ }
83
+ },
84
+ "objective": {
85
+ "name": "ratio",
86
+ "schedule": null,
87
+ "alpha": 0.03,
88
+ "alpha_parity_cap": 0.06,
89
+ "global_anchor": 0.0,
90
+ "premium_clip": 4.0,
91
+ "premium_kind": "flores_per_sent",
92
+ "tau1": 0.4,
93
+ "tau2": 0.7,
94
+ "freeze_scope": "router",
95
+ "cpc_decay": 0.9,
96
+ "genreg_target_entropy": null,
97
+ "genreg_eta": 0.05
98
+ },
99
+ "data": {
100
+ "corpus": "corpus",
101
+ "langs": [
102
+ "en",
103
+ "tr",
104
+ "fi"
105
+ ],
106
+ "mixture": null,
107
+ "doc_filters": null,
108
+ "byte_classes": "scratch/data/byte_classes.json"
109
+ },
110
+ "training": {
111
+ "seed": 3,
112
+ "max_steps": 6000,
113
+ "batch_size": 32,
114
+ "grad_accum": 1,
115
+ "lr": 0.0003,
116
+ "min_lr_frac": 0.1,
117
+ "warmup": 300,
118
+ "weight_decay": 0.1,
119
+ "grad_clip": 1.0,
120
+ "betas": [
121
+ 0.9,
122
+ 0.95
123
+ ],
124
+ "router_lr_mult": 1.0,
125
+ "log_every": 50,
126
+ "amp": "bf16",
127
+ "compile": false,
128
+ "device": "cuda"
129
+ },
130
+ "checkpointing": {
131
+ "run_name": "ali_hnet_s3",
132
+ "runs_dir": "runs",
133
+ "ckpt_every": 200,
134
+ "keep": false,
135
+ "milestones": [
136
+ 1000,
137
+ 3000
138
+ ],
139
+ "resume": "auto",
140
+ "keep_schedule": "log2",
141
+ "keep_extra_offsets": [
142
+ 2,
143
+ 4,
144
+ 6,
145
+ 8
146
+ ],
147
+ "hub_repo": "AdaptiveChunking/{run_name}",
148
+ "hub_private": false,
149
+ "keep_local": false
150
+ },
151
+ "evaluation": {
152
+ "eval_every": 200,
153
+ "eval_batches": 8,
154
+ "probe_sents": 128,
155
+ "probe_bpb_batches": 4,
156
+ "log_spaced_probe": true,
157
+ "dense_early_every": 0,
158
+ "dense_early_until": 0,
159
+ "dump_reps": true,
160
+ "dump_reps_thresholds": [
161
+ 0.3,
162
+ 0.4,
163
+ 0.5,
164
+ 0.6,
165
+ 0.7
166
+ ]
167
+ }
168
+ },
169
+ "format": "beetle-hnet step branch v1 (src/checkpointing/hub.py)"
170
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2a5ce9aedc11e1540bb7758c57b0bd7343d06b1749e4ef7dcebcd7fe419325d
3
+ size 90078272
training_config.yaml ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ model:
2
+ architecture: hnet
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: utility
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: 3
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_hnet_s3
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