Kye Gomez commited on
Commit
5ffb897
·
1 Parent(s): 97bc414

[feat][training-script][add 3b fineweb-edu training

Browse files

script][feat][tokenizer][add MythosTokenizer class with encode
decode][improvement][deps][add transformers and datasets
dependencies][docs][readme-training][add training section with run
commands][improvement][pyproject][pin torch and add new deps]

README.md CHANGED
@@ -106,6 +106,34 @@ print(f"Parameters: {total:,}")
106
 
107
  ---
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  ## Documentation
110
 
111
  | Page | Description |
 
106
 
107
  ---
108
 
109
+ ## Training
110
+
111
+ The training script for the 3B model on FineWeb-Edu is at [`training/3b_fine_web_edu.py`](training/3b_fine_web_edu.py).
112
+
113
+ **Single GPU:**
114
+ ```bash
115
+ python training/3b_fine_web_edu.py
116
+ ```
117
+
118
+ **Multi-GPU (auto-detects GPU count):**
119
+ ```bash
120
+ torchrun --nproc_per_node=$(python -c "import torch; print(torch.cuda.device_count())") training/3b_fine_web_edu.py
121
+ ```
122
+
123
+ Key design choices:
124
+
125
+ | Feature | Detail |
126
+ |---|---|
127
+ | Optimizer | Muon for 2D weight matrices, AdamW for embeddings/norms |
128
+ | Dataset | `HuggingFaceFW/fineweb-edu` (`sample-10BT` by default, swap to `sample-100BT` or `default` for full run) |
129
+ | Tokenizer | `openai/gpt-oss-20b` via `MythosTokenizer` |
130
+ | Parallelism | PyTorch DDP via `torchrun`, sharded streaming dataset |
131
+ | Precision | bfloat16 on H100/A100, float16 + GradScaler on older GPUs |
132
+ | Schedule | Linear warmup (2000 steps) → cosine decay |
133
+ | Target | 30B tokens (~Chinchilla-adjusted for looped architecture) |
134
+
135
+ ---
136
+
137
  ## Documentation
138
 
139
  | Page | Description |
pyproject.toml CHANGED
@@ -38,7 +38,9 @@ classifiers = [
38
 
39
  [tool.poetry.dependencies]
40
  python = ">=3.10,<4.0"
41
- torch = "*"
 
 
42
 
43
 
44
  [tool.poetry.group.lint.dependencies]
 
38
 
39
  [tool.poetry.dependencies]
40
  python = ">=3.10,<4.0"
41
+ torch = "2.11.0"
42
+ transformers = ">=4.40.0"
43
+ datasets = ">=2.18.0"
44
 
45
 
46
  [tool.poetry.group.lint.dependencies]
requirements.txt CHANGED
@@ -1,2 +1,4 @@
1
  torch>=2.1.0
 
 
2
  pytest>=7.0.0
 
1
  torch>=2.1.0
2
+ transformers>=4.40.0
3
+ datasets>=2.18.0
4
  pytest>=7.0.0
train.py → training/3b_fine_web_edu.py RENAMED
File without changes