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