Merge branch 'main' of hf.co:tangledgroup/tangled-alpha-0.10-core
Browse files- README.md +63 -0
- config-1.json +29 -0
- scripts/pretrain_core_model_1.yaml +154 -0
README.md
CHANGED
@@ -108,6 +108,16 @@ Epoch 1 | iter 512 step 8 | loss train: 11.973, val: n/a | iter time: 403.80 ms
|
|
108 |
Epoch 1 | iter 576 step 9 | loss train: 11.972, val: n/a | iter time: 403.23 ms (step) remaining time: 6 days, 15:21:59
|
109 |
Epoch 1 | iter 640 step 10 | loss train: 11.967, val: n/a | iter time: 403.38 ms (step) remaining time: 6 days, 13:43:53
|
110 |
# ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
```
|
112 |
|
113 |
Backup `wandb`:
|
@@ -133,4 +143,57 @@ CUDA_VISIBLE_DEVICES=0 CUDA_LAUNCH_BLOCKING=0 PYTORCH_CUDA_ALLOC_CONF=expandable
|
|
133 |
```
|
134 |
|
135 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
```
|
|
|
108 |
Epoch 1 | iter 576 step 9 | loss train: 11.972, val: n/a | iter time: 403.23 ms (step) remaining time: 6 days, 15:21:59
|
109 |
Epoch 1 | iter 640 step 10 | loss train: 11.967, val: n/a | iter time: 403.38 ms (step) remaining time: 6 days, 13:43:53
|
110 |
# ...
|
111 |
+
Epoch 2 | iter 1364224 step 21316 | loss train: 2.805, val: 2.809 | iter time: 404.72 ms (step) remaining time: 0:00:06
|
112 |
+
Validating ...
|
113 |
+
Final evaluation | val loss: 2.809 | val ppl: 16.592
|
114 |
+
Saving checkpoint to '../out/pretrain-core-0/final/lit_model.pth'
|
115 |
+
----------------------------------------
|
116 |
+
| Performance
|
117 |
+
| - Total tokens : 11,186,768,000
|
118 |
+
| - Training Time : 53900.17 s
|
119 |
+
| - Tok/sec : 34385052.80 tok/s
|
120 |
+
| ----------------------------------------
|
121 |
```
|
122 |
|
123 |
Backup `wandb`:
|
|
|
143 |
```
|
144 |
|
145 |
```
|
146 |
+
Tasks |Version|Filter|n-shot| Metric | |Value | |Stderr|
|
147 |
+
|-----------------------------------------------------------|-------|------|-----:|-----------------------|---|-----:|---|------|
|
148 |
+
|leaderboard | N/A| | | | | | | |
|
149 |
+
| - leaderboard_bbh | N/A| | | | | | | |
|
150 |
+
| - leaderboard_bbh_boolean_expressions | 1|none | 3|acc_norm |↑ |0.4680|± |0.0316|
|
151 |
+
| - leaderboard_bbh_causal_judgement | 1|none | 3|acc_norm |↑ |0.5187|± |0.0366|
|
152 |
+
| - leaderboard_bbh_date_understanding | 1|none | 3|acc_norm |↑ |0.2080|± |0.0257|
|
153 |
+
| - leaderboard_bbh_disambiguation_qa | 1|none | 3|acc_norm |↑ |0.3760|± |0.0307|
|
154 |
+
| - leaderboard_bbh_formal_fallacies | 1|none | 3|acc_norm |↑ |0.5320|± |0.0316|
|
155 |
+
| - leaderboard_bbh_geometric_shapes | 1|none | 3|acc_norm |↑ |0.1160|± |0.0203|
|
156 |
+
| - leaderboard_bbh_hyperbaton | 1|none | 3|acc_norm |↑ |0.5160|± |0.0317|
|
157 |
+
| - leaderboard_bbh_logical_deduction_five_objects | 1|none | 3|acc_norm |↑ |0.2000|± |0.0253|
|
158 |
+
| - leaderboard_bbh_logical_deduction_seven_objects | 1|none | 3|acc_norm |↑ |0.1280|± |0.0212|
|
159 |
+
| - leaderboard_bbh_logical_deduction_three_objects | 1|none | 3|acc_norm |↑ |0.3440|± |0.0301|
|
160 |
+
| - leaderboard_bbh_movie_recommendation | 1|none | 3|acc_norm |↑ |0.2400|± |0.0271|
|
161 |
+
| - leaderboard_bbh_navigate | 1|none | 3|acc_norm |↑ |0.4200|± |0.0313|
|
162 |
+
| - leaderboard_bbh_object_counting | 1|none | 3|acc_norm |↑ |0.0560|± |0.0146|
|
163 |
+
| - leaderboard_bbh_penguins_in_a_table | 1|none | 3|acc_norm |↑ |0.2260|± |0.0347|
|
164 |
+
| - leaderboard_bbh_reasoning_about_colored_objects | 1|none | 3|acc_norm |↑ |0.1520|± |0.0228|
|
165 |
+
| - leaderboard_bbh_ruin_names | 1|none | 3|acc_norm |↑ |0.2080|± |0.0257|
|
166 |
+
| - leaderboard_bbh_salient_translation_error_detection | 1|none | 3|acc_norm |↑ |0.2240|± |0.0264|
|
167 |
+
| - leaderboard_bbh_snarks | 1|none | 3|acc_norm |↑ |0.4831|± |0.0376|
|
168 |
+
| - leaderboard_bbh_sports_understanding | 1|none | 3|acc_norm |↑ |0.4640|± |0.0316|
|
169 |
+
| - leaderboard_bbh_temporal_sequences | 1|none | 3|acc_norm |↑ |0.2520|± |0.0275|
|
170 |
+
| - leaderboard_bbh_tracking_shuffled_objects_five_objects | 1|none | 3|acc_norm |↑ |0.1720|± |0.0239|
|
171 |
+
| - leaderboard_bbh_tracking_shuffled_objects_seven_objects| 1|none | 3|acc_norm |↑ |0.1480|± |0.0225|
|
172 |
+
| - leaderboard_bbh_tracking_shuffled_objects_three_objects| 1|none | 3|acc_norm |↑ |0.3320|± |0.0298|
|
173 |
+
| - leaderboard_bbh_web_of_lies | 1|none | 3|acc_norm |↑ |0.4880|± |0.0317|
|
174 |
+
| - leaderboard_gpqa | N/A| | | | | | | |
|
175 |
+
| - leaderboard_gpqa_diamond | 1|none | 0|acc_norm |↑ |0.2071|± |0.0289|
|
176 |
+
| - leaderboard_gpqa_extended | 1|none | 0|acc_norm |↑ |0.2619|± |0.0188|
|
177 |
+
| - leaderboard_gpqa_main | 1|none | 0|acc_norm |↑ |0.2545|± |0.0206|
|
178 |
+
| - leaderboard_ifeval | 3|none | 0|inst_level_loose_acc |↑ |0.2710|± | N/A|
|
179 |
+
| | |none | 0|inst_level_strict_acc |↑ |0.2626|± | N/A|
|
180 |
+
| | |none | 0|prompt_level_loose_acc |↑ |0.1165|± |0.0138|
|
181 |
+
| | |none | 0|prompt_level_strict_acc|↑ |0.1128|± |0.0136|
|
182 |
+
| - leaderboard_math_hard | N/A| | | | | | | |
|
183 |
+
| - leaderboard_math_algebra_hard | 2|none | 4|exact_match |↑ |0.0194|± |0.0040|
|
184 |
+
| - leaderboard_math_counting_and_prob_hard | 2|none | 4|exact_match |↑ |0.0148|± |0.0055|
|
185 |
+
| - leaderboard_math_geometry_hard | 2|none | 4|exact_match |↑ |0.0042|± |0.0029|
|
186 |
+
| - leaderboard_math_intermediate_algebra_hard | 2|none | 4|exact_match |↑ |0.0111|± |0.0035|
|
187 |
+
| - leaderboard_math_num_theory_hard | 2|none | 4|exact_match |↑ |0.0056|± |0.0032|
|
188 |
+
| - leaderboard_math_prealgebra_hard | 2|none | 4|exact_match |↑ |0.0161|± |0.0043|
|
189 |
+
| - leaderboard_math_precalculus_hard | 2|none | 4|exact_match |↑ |0.0092|± |0.0041|
|
190 |
+
| - leaderboard_mmlu_pro | 0.1|none | 5|acc |↑ |0.1184|± |0.0029|
|
191 |
+
| - leaderboard_musr | N/A| | | | | | | |
|
192 |
+
| - leaderboard_musr_murder_mysteries | 1|none | 0|acc_norm |↑ |0.5240|± |0.0316|
|
193 |
+
| - leaderboard_musr_object_placements | 1|none | 0|acc_norm |↑ |0.2344|± |0.0265|
|
194 |
+
| - leaderboard_musr_team_allocation | 1|none | 0|acc_norm |↑ |0.3000|± |0.0290|
|
195 |
+
```
|
196 |
+
|
197 |
+
```bash
|
198 |
+
litgpt convert_pretrained_checkpoint ../out/pretrain-core-0/final ../out/pretrain-core-0/checkpoint
|
199 |
```
|
config-1.json
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"LlamaForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_bias": false,
|
6 |
+
"attention_dropout": 0.0,
|
7 |
+
"bos_token_id": 0,
|
8 |
+
"eos_token_id": 1,
|
9 |
+
"head_dim": 64,
|
10 |
+
"hidden_act": "silu",
|
11 |
+
"hidden_size": 768,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 2048,
|
14 |
+
"max_position_embeddings": 131072,
|
15 |
+
"mlp_bias": false,
|
16 |
+
"model_type": "llama",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 32,
|
19 |
+
"num_key_value_heads": 4,
|
20 |
+
"pretraining_tp": 1,
|
21 |
+
"rms_norm_eps": 1e-05,
|
22 |
+
"rope_scaling": null,
|
23 |
+
"rope_theta": 16000.0,
|
24 |
+
"tie_word_embeddings": false,
|
25 |
+
"torch_dtype": "bfloat16",
|
26 |
+
"transformers_version": "4.45.0.dev0",
|
27 |
+
"use_cache": true,
|
28 |
+
"vocab_size": 131072
|
29 |
+
}
|
scripts/pretrain_core_model_1.yaml
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# The name of the model to pretrain. Choose from names in ``litgpt.config``. Mutually exclusive with
|
2 |
+
# ``model_config``. (type: Optional[str], default: null)
|
3 |
+
model_name: 'tangled-alpha-0.10-core'
|
4 |
+
|
5 |
+
# A ``litgpt.Config`` object to define the model architecture. Mutually exclusive with
|
6 |
+
# ``model_config``. (type: Optional[Config], default: null)
|
7 |
+
model_config:
|
8 |
+
name: 'tangled-alpha-0.10-core'
|
9 |
+
block_size: 131072
|
10 |
+
vocab_size: 131072
|
11 |
+
padded_vocab_size: 131072
|
12 |
+
n_layer: 32
|
13 |
+
n_head: 12
|
14 |
+
n_embd: 768
|
15 |
+
n_query_groups: 4
|
16 |
+
rotary_percentage: 1.0
|
17 |
+
parallel_residual: False
|
18 |
+
bias: False
|
19 |
+
norm_class_name: "RMSNorm"
|
20 |
+
mlp_class_name: "LLaMAMLP"
|
21 |
+
intermediate_size: 2048 # n_embd * 2.666
|
22 |
+
norm_eps: 1e-5
|
23 |
+
rope_base: 16000 # https://arxiv.org/pdf/2405.14591
|
24 |
+
head_size: 64 # n_embd / n_head
|
25 |
+
|
26 |
+
# Directory in which to save checkpoints and logs. If running in a Lightning Studio Job, look for it in
|
27 |
+
# /teamspace/jobs/<job-name>/share. (type: <class 'Path'>, default: out/pretrain)
|
28 |
+
out_dir: "../out/pretrain-core-1/"
|
29 |
+
|
30 |
+
# The precision to use for pretraining. Possible choices: "bf16-true", "bf16-mixed", "32-true". (type: Optional[str], default: null)
|
31 |
+
# precision: bf16-mixed
|
32 |
+
precision: bf16-true
|
33 |
+
|
34 |
+
# Optional path to a checkpoint directory to initialize the model from.
|
35 |
+
# Useful for continued pretraining. Mutually exclusive with ``resume``. (type: Optional[Path], default: null)
|
36 |
+
initial_checkpoint_dir: "../out/pretrain-core-0/checkpoint"
|
37 |
+
|
38 |
+
# Path to a checkpoint directory to resume from in case training was interrupted, or ``True`` to resume
|
39 |
+
# from the latest checkpoint in ``out_dir``. An error will be raised if no checkpoint is found. Passing
|
40 |
+
# ``'auto'`` will resume from the latest checkpoint but not error if no checkpoint exists.
|
41 |
+
# (type: Union[bool, Literal["auto"], Path], default: False)
|
42 |
+
resume:
|
43 |
+
|
44 |
+
# Data-related arguments. If not provided, the default is ``litgpt.data.TinyLlama``.
|
45 |
+
data:
|
46 |
+
class_path: LitData
|
47 |
+
|
48 |
+
init_args:
|
49 |
+
data_path: "../core-data-1-1025-2049-2049-8000/"
|
50 |
+
num_workers: 32
|
51 |
+
|
52 |
+
# Training-related arguments. See ``litgpt.args.TrainArgs`` for details
|
53 |
+
train:
|
54 |
+
# Number of optimizer steps between saving checkpoints (type: Optional[int], default: 1000)
|
55 |
+
save_interval: 50
|
56 |
+
|
57 |
+
# Number of iterations between logging calls (type: int, default: 1)
|
58 |
+
log_interval: 1
|
59 |
+
|
60 |
+
# Number of samples between optimizer steps across data-parallel ranks (type: int, default: 512)
|
61 |
+
global_batch_size: 512
|
62 |
+
|
63 |
+
# Number of samples per data-parallel rank (type: int, default: 4)
|
64 |
+
micro_batch_size: 4
|
65 |
+
|
66 |
+
# Number of iterations with learning rate warmup active (type: int, default: 2000)
|
67 |
+
lr_warmup_steps: 0
|
68 |
+
|
69 |
+
# Number of epochs to train on (type: Optional[int], default: null)
|
70 |
+
epochs:
|
71 |
+
|
72 |
+
# Total number of tokens to train on (type: Optional[int], default: 3000000000000)
|
73 |
+
max_tokens: 1830709785
|
74 |
+
|
75 |
+
# Limits the number of optimizer steps to run. (type: Optional[int], default: null)
|
76 |
+
max_steps:
|
77 |
+
|
78 |
+
# Limits the length of samples. Off by default (type: Optional[int], default: null)
|
79 |
+
max_seq_length: 2049
|
80 |
+
|
81 |
+
# Whether to tie the embedding weights with the language modeling head weights. (type: Optional[bool], default: False)
|
82 |
+
tie_embeddings: false
|
83 |
+
|
84 |
+
# (type: Optional[float], default: 1.0)
|
85 |
+
max_norm: 1.0
|
86 |
+
|
87 |
+
# (type: float, default: 4e-05)
|
88 |
+
min_lr: 1e-6
|
89 |
+
|
90 |
+
# Evaluation-related arguments. See ``litgpt.args.EvalArgs`` for details
|
91 |
+
eval:
|
92 |
+
# Number of optimizer steps between evaluation calls (type: int, default: 1000)
|
93 |
+
interval: 50
|
94 |
+
|
95 |
+
# Number of tokens to generate (type: Optional[int], default: null)
|
96 |
+
max_new_tokens:
|
97 |
+
|
98 |
+
# Number of iterations (type: int, default: 100)
|
99 |
+
max_iters: 100
|
100 |
+
|
101 |
+
# Whether to evaluate on the validation set at the beginning of the training
|
102 |
+
initial_validation: true
|
103 |
+
|
104 |
+
# Whether to evaluate on the validation set at the end the training
|
105 |
+
final_validation: true
|
106 |
+
|
107 |
+
# Optimizer-related arguments
|
108 |
+
# optimizer:
|
109 |
+
# class_path: torch.optim.AdamW
|
110 |
+
# init_args:
|
111 |
+
# # (type: float, default: 0.001)
|
112 |
+
# lr: 3e-4
|
113 |
+
# # (type: float, default: 0.01)
|
114 |
+
# weight_decay: 0.01
|
115 |
+
# # (type: tuple, default: (0.9,0.999))
|
116 |
+
# betas:
|
117 |
+
# - 0.9
|
118 |
+
# - 0.999
|
119 |
+
|
120 |
+
# optimizer:
|
121 |
+
# class_path: sophia_opt.SophiaG
|
122 |
+
# init_args:
|
123 |
+
# lr: 3e-4
|
124 |
+
# betas:
|
125 |
+
# - 0.9
|
126 |
+
# - 0.95
|
127 |
+
# rho: 0.05
|
128 |
+
# weight_decay: 0.1
|
129 |
+
|
130 |
+
optimizer:
|
131 |
+
class_path: sophia_opt.SophiaG
|
132 |
+
init_args:
|
133 |
+
lr: 1e-5
|
134 |
+
betas:
|
135 |
+
- 0.965
|
136 |
+
- 0.99
|
137 |
+
rho: 0.04
|
138 |
+
weight_decay: 1e-1
|
139 |
+
|
140 |
+
# How many devices/GPUs to use. Uses all GPUs by default. (type: Union[int, str], default: auto)
|
141 |
+
devices: auto
|
142 |
+
|
143 |
+
# How many nodes to use. (type: int, default: 1)
|
144 |
+
num_nodes: 1
|
145 |
+
|
146 |
+
# Optional path to the tokenizer dir that was used for preprocessing the dataset. Only some data
|
147 |
+
# module require this. (type: Optional[Path], default: null)
|
148 |
+
tokenizer_dir: "../tokenizer"
|
149 |
+
|
150 |
+
# The name of the logger to send metrics to. (type: Literal['wandb', 'tensorboard', 'csv'], default: tensorboard)
|
151 |
+
logger_name: "wandb"
|
152 |
+
|
153 |
+
# The random seed to use for reproducibility. (type: int, default: 42)
|
154 |
+
seed: 23
|