w-ahmad commited on
Commit
568d07a
·
verified ·
1 Parent(s): 47f8f46

Auto upload zain 2026-08-12T18:22:01.542466

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. zain/Activation/README.md +1 -0
  3. zain/Activation/__pycache__/exp.cpython-311.pyc +0 -0
  4. zain/Activation/exp.py +1265 -0
  5. zain/Activation/llm_analyzer_wandb.py +570 -0
  6. zain/Activation/out/glu-gelu-150L_run/training_log.jsonl +2 -0
  7. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/config.json +36 -0
  8. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/model.safetensors +3 -0
  9. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/optimizer.pt +3 -0
  10. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/rng_state.pth +3 -0
  11. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/scheduler.pt +3 -0
  12. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/tokenizer.json +0 -0
  13. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/tokenizer_config.json +13 -0
  14. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/trainer_state.json +544 -0
  15. zain/Activation/out/glu-relu-150L_run/checkpoint-1000/training_args.bin +3 -0
  16. zain/Activation/out/glu-relu-150L_run/config.json +36 -0
  17. zain/Activation/out/glu-relu-150L_run/model.safetensors +3 -0
  18. zain/Activation/out/glu-relu-150L_run/tokenizer.json +0 -0
  19. zain/Activation/out/glu-relu-150L_run/tokenizer_config.json +13 -0
  20. zain/Activation/out/glu-relu-150L_run/training_args.bin +3 -0
  21. zain/Activation/out/glu-relu-150L_run/training_log.jsonl +72 -0
  22. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/config.json +36 -0
  23. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/model.safetensors +3 -0
  24. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/optimizer.pt +3 -0
  25. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/rng_state.pth +3 -0
  26. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/scheduler.pt +3 -0
  27. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/tokenizer.json +0 -0
  28. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/tokenizer_config.json +13 -0
  29. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/trainer_state.json +544 -0
  30. zain/Activation/out/glu-silu-150L_run/checkpoint-1000/training_args.bin +3 -0
  31. zain/Activation/out/glu-silu-150L_run/config.json +36 -0
  32. zain/Activation/out/glu-silu-150L_run/model.safetensors +3 -0
  33. zain/Activation/out/glu-silu-150L_run/tokenizer.json +0 -0
  34. zain/Activation/out/glu-silu-150L_run/tokenizer_config.json +13 -0
  35. zain/Activation/out/glu-silu-150L_run/training_args.bin +3 -0
  36. zain/Activation/out/glu-silu-150L_run/training_log.jsonl +72 -0
  37. zain/Activation/sweep.py +180 -0
  38. zain/Activation/train.py +79 -0
  39. zain/Activation/wandb/debug-internal.log +13 -0
  40. zain/Activation/wandb/debug.log +20 -0
  41. zain/Activation/wandb/run-20260812_175304-hrggki9k/files/config.yaml +445 -0
  42. zain/Activation/wandb/run-20260812_175304-hrggki9k/files/output.log +85 -0
  43. zain/Activation/wandb/run-20260812_175304-hrggki9k/files/requirements.txt +149 -0
  44. zain/Activation/wandb/run-20260812_175304-hrggki9k/files/wandb-metadata.json +107 -0
  45. zain/Activation/wandb/run-20260812_175304-hrggki9k/files/wandb-summary.json +1 -0
  46. zain/Activation/wandb/run-20260812_175304-hrggki9k/logs/debug-core.log +34 -0
  47. zain/Activation/wandb/run-20260812_175304-hrggki9k/logs/debug-internal.log +129 -0
  48. zain/Activation/wandb/run-20260812_175304-hrggki9k/logs/debug.log +28 -0
  49. zain/Activation/wandb/run-20260812_175304-hrggki9k/run-hrggki9k.wandb +3 -0
  50. zain/Activation/wandb/run-20260812_180713-utqzlg67/files/config.yaml +445 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ zain/Activation/wandb/run-20260812_175304-hrggki9k/run-hrggki9k.wandb filter=lfs diff=lfs merge=lfs -text
37
+ zain/Activation/wandb/run-20260812_180713-utqzlg67/run-utqzlg67.wandb filter=lfs diff=lfs merge=lfs -text
zain/Activation/README.md ADDED
@@ -0,0 +1 @@
 
 
1
+ # Activation
zain/Activation/__pycache__/exp.cpython-311.pyc ADDED
Binary file (68.8 kB). View file
 
zain/Activation/exp.py ADDED
@@ -0,0 +1,1265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Tiny Llama GLU Lab — Consolidated training library.
3
+ One file: model definition, activation registry, stability monitoring,
4
+ time tracking, dataset builder, and Trainer factory.
5
+ """
6
+
7
+ import math
8
+ import os
9
+ import time
10
+ import json
11
+ import re
12
+ from pathlib import Path
13
+ from itertools import chain
14
+ from typing import Dict, Callable, Optional, List, Any, Tuple
15
+
16
+ import torch
17
+ import torch.nn as nn
18
+ from transformers import (
19
+ LlamaConfig,
20
+ LlamaPreTrainedModel,
21
+ Trainer,
22
+ TrainerCallback,
23
+ TrainingArguments,
24
+ DataCollatorForLanguageModeling,
25
+ AutoTokenizer,
26
+ set_seed,
27
+ )
28
+ from transformers.models.llama.modeling_llama import (
29
+ LlamaAttention,
30
+ LlamaRMSNorm,
31
+ LlamaRotaryEmbedding,
32
+ )
33
+ from transformers.modeling_outputs import CausalLMOutputWithPast
34
+ from datasets import load_dataset
35
+
36
+
37
+ # =============================================================================
38
+ # 1. ACTIVATION REGISTRY
39
+ # =============================================================================
40
+
41
+ class GLUActivationRegistry:
42
+ """Own every gating activation you test. Add new variants in one line."""
43
+ _registry: Dict[str, Callable[[torch.Tensor], torch.Tensor]] = {}
44
+
45
+ @classmethod
46
+ def register(cls, name: str, fn: Callable[[torch.Tensor], torch.Tensor]) -> None:
47
+ cls._registry[name] = fn
48
+
49
+ @classmethod
50
+ def get(cls, name: str) -> Callable[[torch.Tensor], torch.Tensor]:
51
+ if name not in cls._registry:
52
+ raise KeyError(
53
+ f"Activation '{name}' not found. Available: {list(cls._registry.keys())}"
54
+ )
55
+ return cls._registry[name]
56
+
57
+
58
+ # Built-ins
59
+ GLUActivationRegistry.register("silu", nn.functional.silu)
60
+ GLUActivationRegistry.register("swish", nn.functional.silu)
61
+ GLUActivationRegistry.register("relu", nn.functional.relu)
62
+ GLUActivationRegistry.register("gelu", nn.functional.gelu)
63
+ GLUActivationRegistry.register("sigmoid", torch.sigmoid)
64
+ GLUActivationRegistry.register("tanh", torch.tanh)
65
+ GLUActivationRegistry.register("softplus", nn.functional.softplus)
66
+ GLUActivationRegistry.register("linear", lambda x: x)
67
+
68
+ # Custom
69
+ GLUActivationRegistry.register("s10", lambda x: x * x * torch.sigmoid(x))
70
+ GLUActivationRegistry.register("w1a", lambda x: x * torch.tanh(x))
71
+
72
+
73
+ # =============================================================================
74
+ # 2. CONFIG
75
+ # =============================================================================
76
+
77
+ class TinyLlamaConfig(LlamaConfig):
78
+ """
79
+ Exact Llama config plus two fields:
80
+ - mlp_type: "glu" or "mlp" (standard Transformer MLP)
81
+ - activation: name of the activation function to use inside the MLP block.
82
+ - waleed_beta: β_cap for the waleed10 post‑clip (default 10.0)
83
+ Enforces pure MHA by requiring num_key_value_heads == num_attention_heads.
84
+ """
85
+ model_type = "tiny_llama"
86
+
87
+ def __init__(
88
+ self,
89
+ mlp_type: str = "glu",
90
+ activation: str = "silu",
91
+ waleed_beta: float = 10.0,
92
+ **kwargs
93
+ ):
94
+ super().__init__(**kwargs)
95
+ self.mlp_type = mlp_type
96
+ self.activation = activation
97
+ self.waleed_beta = waleed_beta
98
+ if self.num_key_value_heads != self.num_attention_heads:
99
+ raise ValueError(
100
+ f"Pure MHA required: num_key_value_heads ({self.num_key_value_heads}) "
101
+ f"must equal num_attention_heads ({self.num_attention_heads})."
102
+ )
103
+
104
+
105
+ # =============================================================================
106
+ # 3. MODEL
107
+ # =============================================================================
108
+
109
+ class TinyLlamaMLP(nn.Module):
110
+ """
111
+ Unified MLP block supporting:
112
+ - Standard GLU: down_proj( act(gate_proj(x)) * up_proj(x) )
113
+ - Standard MLP: down_proj( act(up_proj(x)) )
114
+ - Gated variants (situglu, waleed) with internal tanh scaling.
115
+ - waleed10 / silu-waleed10 with post‑down‑proj clipping.
116
+
117
+ All projections are always named the same way, ensuring consistent
118
+ tensor logging regardless of activation.
119
+ """
120
+ def __init__(self, config: TinyLlamaConfig):
121
+ super().__init__()
122
+ self.hidden_size = config.hidden_size
123
+ self.intermediate_size = config.intermediate_size
124
+ self.mlp_type = config.mlp_type
125
+ self.activation_name = config.activation
126
+ self.waleed_beta = getattr(config, "waleed_beta", 10.0)
127
+
128
+ # Effective intermediate size (scaled for MLP)
129
+ if self.mlp_type == "glu":
130
+ effective_intermediate = self.intermediate_size
131
+ elif self.mlp_type == "mlp":
132
+ effective_intermediate = int(self.intermediate_size * 1.5)
133
+ print(f"[MLP] Auto‑scaled intermediate_size from {self.intermediate_size} to {effective_intermediate} for parameter parity.")
134
+ else:
135
+ raise ValueError(f"Unknown mlp_type: {self.mlp_type}")
136
+
137
+ self.effective_intermediate = effective_intermediate
138
+
139
+ # Always define the projections (names consistent across variants)
140
+ if self.mlp_type == "glu":
141
+ self.gate_proj = nn.Linear(self.hidden_size, effective_intermediate, bias=False)
142
+ self.up_proj = nn.Linear(self.hidden_size, effective_intermediate, bias=False)
143
+ else: # mlp
144
+ self.up_proj = nn.Linear(self.hidden_size, effective_intermediate, bias=False)
145
+
146
+ self.down_proj = nn.Linear(effective_intermediate, self.hidden_size, bias=False)
147
+
148
+ # Activation function (for standard variants)
149
+ # For gated variants (situglu, waleed) we handle them in forward, but we still need a placeholder.
150
+ # For waleed10/silu-waleed10 we need linear or silu.
151
+ if self.mlp_type == "glu":
152
+ if self.activation_name in ("situglu", "waleed", "situglu_low", "waleedglu_low"):
153
+ # These will be handled in forward; no act_fn needed.
154
+ self.act_fn = None
155
+ elif self.activation_name == "waleed10":
156
+ self.act_fn = GLUActivationRegistry.get("linear")
157
+ elif self.activation_name == "silu-waleed10":
158
+ self.act_fn = GLUActivationRegistry.get("silu")
159
+ else:
160
+ self.act_fn = GLUActivationRegistry.get(self.activation_name)
161
+ else: # mlp
162
+ if self.activation_name in ("situglu", "waleed", "situglu_low", "waleedglu_low"):
163
+ raise ValueError(
164
+ f"Activation '{self.activation_name}' requires a gated architecture (GLU). "
165
+ f"Please use mlp_type='glu'."
166
+ )
167
+ elif self.activation_name == "waleed10":
168
+ self.act_fn = GLUActivationRegistry.get("linear")
169
+ elif self.activation_name == "silu-waleed10":
170
+ self.act_fn = GLUActivationRegistry.get("silu")
171
+ else:
172
+ self.act_fn = GLUActivationRegistry.get(self.activation_name)
173
+
174
+ # Determine beta values for situglu/waleed variants
175
+ if self.activation_name in ("situglu_low", "waleedglu_low"):
176
+ self.beta1 = 2.5
177
+ self.beta2 = 4.0
178
+ else: # original situglu or waleed
179
+ self.beta1 = 4.0
180
+ self.beta2 = 25.0
181
+
182
+ # Flags for special handling
183
+ self.is_situglu = self.activation_name in ("situglu", "situglu_low")
184
+ self.is_waleed = self.activation_name in ("waleed", "waleedglu_low")
185
+ self.is_waleed10 = self.activation_name in ("waleed10", "silu-waleed10")
186
+ self.has_sigmoid_gate = self.activation_name.startswith("situglu") # sigmoid in gate
187
+
188
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
189
+ if self.mlp_type == "glu":
190
+ gate = self.gate_proj(x)
191
+ up = self.up_proj(x)
192
+
193
+ if self.is_situglu or self.is_waleed:
194
+ # Gated variants with tanh scaling
195
+ if self.has_sigmoid_gate:
196
+ gate = self.beta1 * torch.tanh(gate / self.beta1) * torch.sigmoid(gate)
197
+ else:
198
+ gate = self.beta1 * torch.tanh(gate / self.beta1)
199
+ up = self.beta2 * torch.tanh(up / self.beta2)
200
+ hidden = gate * up
201
+ else:
202
+ # Standard GLU (activation applied to gate)
203
+ hidden = self.act_fn(gate) * up
204
+
205
+ out = self.down_proj(hidden)
206
+
207
+ else: # mlp
208
+ hidden = self.act_fn(self.up_proj(x))
209
+ out = self.down_proj(hidden)
210
+
211
+ # Post‑clip for waleed10 variants
212
+ if self.is_waleed10:
213
+ out = self.waleed_beta * torch.tanh(out / self.waleed_beta)
214
+
215
+ return out
216
+
217
+
218
+ class TinyLlamaDecoderLayer(nn.Module):
219
+ def __init__(self, config: TinyLlamaConfig, layer_idx: int):
220
+ super().__init__()
221
+ self.hidden_size = config.hidden_size
222
+ self.self_attn = LlamaAttention(config=config, layer_idx=layer_idx)
223
+ self.mlp = TinyLlamaMLP(config)
224
+ self.input_layernorm = LlamaRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
225
+ self.post_attention_layernorm = LlamaRMSNorm(
226
+ config.hidden_size, eps=config.rms_norm_eps
227
+ )
228
+ # ---------------------------------------------------------------------
229
+ # NEW: zero-parameter Identity gateways for residual-stream logging.
230
+ # These expose the residual tensor as named modules so the hook
231
+ # registry can capture them with pattern ".*residual.*".
232
+ # ---------------------------------------------------------------------
233
+ self.residual_pre_attn = nn.Identity()
234
+ self.residual_post_attn = nn.Identity()
235
+ self.residual_post_mlp = nn.Identity()
236
+
237
+ def forward(
238
+ self,
239
+ hidden_states: torch.Tensor,
240
+ attention_mask: Optional[torch.Tensor] = None,
241
+ position_ids: Optional[torch.LongTensor] = None,
242
+ position_embeddings: Optional[Tuple[torch.Tensor, torch.Tensor]] = None,
243
+ **kwargs,
244
+ ):
245
+ # --- Attention sub-layer ---
246
+ residual = hidden_states
247
+ hidden_states = self.residual_pre_attn(hidden_states)
248
+ hidden_states = self.input_layernorm(hidden_states)
249
+ attn_out = self.self_attn(
250
+ hidden_states=hidden_states,
251
+ attention_mask=attention_mask,
252
+ position_ids=position_ids,
253
+ position_embeddings=position_embeddings,
254
+ )[0]
255
+ hidden_states = residual + attn_out
256
+ hidden_states = self.residual_post_attn(hidden_states)
257
+
258
+ # --- MLP sub-layer ---
259
+ residual = hidden_states
260
+ hidden_states = self.post_attention_layernorm(hidden_states)
261
+ hidden_states = self.mlp(hidden_states)
262
+ hidden_states = residual + hidden_states
263
+ hidden_states = self.residual_post_mlp(hidden_states)
264
+ return (hidden_states,)
265
+
266
+
267
+ # ----------------------------------------------------------------------------
268
+ # ATTENTION MASK – float mask with 0.0 / -inf (works with all backends)
269
+ # ----------------------------------------------------------------------------
270
+ def _build_causal_mask(
271
+ attention_mask: Optional[torch.Tensor],
272
+ seq_len: int,
273
+ dtype: torch.dtype,
274
+ device: torch.device,
275
+ ) -> torch.Tensor:
276
+ """
277
+ Build a 4D float attention mask for scaled_dot_product_attention.
278
+ - 0.0 where attention is allowed
279
+ - -inf where it is masked (causal future + padding)
280
+ """
281
+ min_value = torch.finfo(dtype).min
282
+
283
+ # Causal mask: upper triangle (future) = -inf
284
+ causal = torch.full((seq_len, seq_len), fill_value=min_value, dtype=dtype, device=device)
285
+ causal = torch.triu(causal, diagonal=1)
286
+ causal = causal[None, None, :, :] # (1, 1, seq_len, seq_len)
287
+
288
+ if attention_mask is None:
289
+ batch_size = 1
290
+ return causal.expand(batch_size, 1, seq_len, seq_len)
291
+
292
+ batch_size = attention_mask.shape[0]
293
+ causal = causal.expand(batch_size, 1, seq_len, seq_len).clone()
294
+
295
+ # Padding: where attention_mask == 0, set to -inf
296
+ padding = attention_mask[:, None, None, :].to(device) == 0 # (batch, 1, 1, seq_len)
297
+ causal = causal.masked_fill(padding, min_value)
298
+
299
+ return causal
300
+
301
+
302
+ # Global flag to print mask message only once
303
+ _MASK_PRINTED = False
304
+
305
+
306
+ class TinyLlamaModel(LlamaPreTrainedModel):
307
+ config_class = TinyLlamaConfig
308
+
309
+ def __init__(self, config: TinyLlamaConfig):
310
+ super().__init__(config)
311
+ self.padding_idx = config.pad_token_id
312
+ self.vocab_size = config.vocab_size
313
+ self.embed_tokens = nn.Embedding(
314
+ config.vocab_size, config.hidden_size, self.padding_idx
315
+ )
316
+ self.layers = nn.ModuleList(
317
+ [TinyLlamaDecoderLayer(config, i) for i in range(config.num_hidden_layers)]
318
+ )
319
+ self.norm = LlamaRMSNorm(config.hidden_size, eps=config.rms_norm_eps)
320
+ self.rotary_emb = LlamaRotaryEmbedding(config=config)
321
+ self.post_init()
322
+
323
+ def forward(
324
+ self,
325
+ input_ids: Optional[torch.LongTensor] = None,
326
+ attention_mask: Optional[torch.Tensor] = None,
327
+ position_ids: Optional[torch.LongTensor] = None,
328
+ inputs_embeds: Optional[torch.FloatTensor] = None,
329
+ return_dict: Optional[bool] = None,
330
+ **kwargs,
331
+ ):
332
+ global _MASK_PRINTED
333
+
334
+ return_dict = (
335
+ return_dict if return_dict is not None else self.config.use_return_dict
336
+ )
337
+ if inputs_embeds is None:
338
+ inputs_embeds = self.embed_tokens(input_ids)
339
+
340
+ if position_ids is None:
341
+ seq_len = inputs_embeds.shape[1]
342
+ position_ids = torch.arange(
343
+ seq_len, device=inputs_embeds.device
344
+ ).unsqueeze(0).expand(inputs_embeds.shape[0], -1)
345
+
346
+ hidden_states = inputs_embeds
347
+ position_embeddings = self.rotary_emb(hidden_states, position_ids)
348
+
349
+ # Build float causal + padding mask (print only once)
350
+ seq_len = hidden_states.shape[1]
351
+ causal_mask = _build_causal_mask(
352
+ attention_mask, seq_len, hidden_states.dtype, hidden_states.device
353
+ )
354
+
355
+ if not _MASK_PRINTED:
356
+ print("[INFO] Causal mask (float with -inf) applied to all attention layers.")
357
+ _MASK_PRINTED = True
358
+
359
+ for decoder_layer in self.layers:
360
+ layer_outputs = decoder_layer(
361
+ hidden_states,
362
+ attention_mask=causal_mask,
363
+ position_ids=position_ids,
364
+ position_embeddings=position_embeddings,
365
+ )
366
+ hidden_states = layer_outputs[0]
367
+
368
+ hidden_states = self.norm(hidden_states)
369
+ if not return_dict:
370
+ return (hidden_states,)
371
+ return {"last_hidden_state": hidden_states, "hidden_states": None, "attentions": None}
372
+
373
+
374
+ class TinyLlamaForCausalLM(LlamaPreTrainedModel):
375
+ config_class = TinyLlamaConfig
376
+ _tied_weights_keys = {"lm_head.weight": "model.embed_tokens.weight"}
377
+
378
+ def __init__(self, config: TinyLlamaConfig):
379
+ super().__init__(config)
380
+ self.model = TinyLlamaModel(config)
381
+ self.lm_head = nn.Linear(config.hidden_size, config.vocab_size, bias=False)
382
+ if config.tie_word_embeddings:
383
+ self.lm_head.weight = self.model.embed_tokens.weight
384
+ self.post_init()
385
+
386
+ def get_input_embeddings(self):
387
+ return self.model.embed_tokens
388
+
389
+ def set_input_embeddings(self, value):
390
+ self.model.embed_tokens = value
391
+
392
+ def get_output_embeddings(self):
393
+ return self.lm_head
394
+
395
+ def forward(
396
+ self,
397
+ input_ids: Optional[torch.LongTensor] = None,
398
+ attention_mask: Optional[torch.Tensor] = None,
399
+ position_ids: Optional[torch.LongTensor] = None,
400
+ inputs_embeds: Optional[torch.FloatTensor] = None,
401
+ labels: Optional[torch.LongTensor] = None,
402
+ return_dict: Optional[bool] = None,
403
+ **kwargs,
404
+ ):
405
+ return_dict = (
406
+ return_dict if return_dict is not None else self.config.use_return_dict
407
+ )
408
+ outputs = self.model(
409
+ input_ids=input_ids,
410
+ attention_mask=attention_mask,
411
+ position_ids=position_ids,
412
+ inputs_embeds=inputs_embeds,
413
+ return_dict=return_dict,
414
+ )
415
+ hidden_states = outputs["last_hidden_state"] if return_dict else outputs[0]
416
+ logits = self.lm_head(hidden_states)
417
+
418
+ loss = None
419
+ if labels is not None:
420
+ shift_logits = logits[..., :-1, :].contiguous()
421
+ shift_labels = labels[..., 1:].contiguous()
422
+ loss_fct = nn.CrossEntropyLoss()
423
+ loss = loss_fct(
424
+ shift_logits.view(-1, self.config.vocab_size), shift_labels.view(-1)
425
+ )
426
+
427
+ if not return_dict:
428
+ output = (logits,) + outputs[1:]
429
+ return (loss,) + output if loss is not None else output
430
+ return CausalLMOutputWithPast(
431
+ loss=loss,
432
+ logits=logits,
433
+ past_key_values=None,
434
+ hidden_states=None,
435
+ attentions=None,
436
+ )
437
+
438
+ def prepare_inputs_for_generation(
439
+ self, input_ids, past_key_values=None, attention_mask=None, **kwargs
440
+ ):
441
+ if past_key_values:
442
+ input_ids = input_ids[:, -1:]
443
+ position_ids = kwargs.get("position_ids")
444
+ if attention_mask is not None and position_ids is None:
445
+ position_ids = attention_mask.long().cumsum(-1) - 1
446
+ position_ids.masked_fill_(attention_mask == 0, 1)
447
+ if past_key_values:
448
+ position_ids = position_ids[:, -1].unsqueeze(-1)
449
+ return {
450
+ "input_ids": input_ids,
451
+ "position_ids": position_ids,
452
+ "past_key_values": past_key_values,
453
+ "attention_mask": attention_mask,
454
+ }
455
+
456
+
457
+ # =============================================================================
458
+ # 4. MONITORING ENGINE
459
+ # =============================================================================
460
+
461
+ class StatsEngine:
462
+ """Compute the unified signature for any tensor (now with range + percentiles)."""
463
+
464
+ @staticmethod
465
+ def compute(
466
+ tensor: torch.Tensor, user_limit: float, dtype_ratio: float
467
+ ) -> Dict[str, float]:
468
+ with torch.no_grad():
469
+ abs_t = tensor.abs()
470
+ dtype_info = torch.finfo(tensor.dtype)
471
+ dtype_limit = (
472
+ dtype_ratio * dtype_info.max
473
+ if not torch.isinf(torch.tensor(dtype_info.max))
474
+ else float("inf")
475
+ )
476
+
477
+ # --- Base statistics ---
478
+ norm = tensor.norm(2).item()
479
+ mean = tensor.mean().item()
480
+ std = tensor.std().item()
481
+ max_abs = abs_t.max().item()
482
+
483
+ # --- Exact min / max / range ---
484
+ t_min = tensor.min().item()
485
+ t_max = tensor.max().item()
486
+ t_range = t_max - t_min
487
+
488
+ # --- Exact percentiles (float32 CPU for dtype safety) ---
489
+ p01 = p25 = p50 = p75 = p90 = p95 = p99 = 0.0
490
+ try:
491
+ flat_f32 = tensor.detach().reshape(-1).to(torch.float32).cpu()
492
+ if flat_f32.numel() > 0:
493
+ q_vals = torch.quantile(
494
+ flat_f32,
495
+ torch.tensor(
496
+ [0.01, 0.25, 0.5, 0.75, 0.90, 0.95, 0.99],
497
+ dtype=torch.float32,
498
+ ),
499
+ )
500
+ p01, p25, p50, p75, p90, p95, p99 = (v.item() for v in q_vals)
501
+ except Exception:
502
+ pass # If quantile fails (very unlikely), leave as 0.0
503
+
504
+ return {
505
+ "norm": norm,
506
+ "mean": mean,
507
+ "std": std,
508
+ "max_abs": max_abs,
509
+ "frac_near_dtype_limit": (
510
+ (abs_t > dtype_limit).float().mean().item()
511
+ if not math.isinf(dtype_limit)
512
+ else 0.0
513
+ ),
514
+ "frac_near_user_limit": (abs_t > user_limit).float().mean().item(),
515
+ # --- NEW: distributional tail metrics (exact per-tensor) ---
516
+ "min": t_min,
517
+ "max": t_max,
518
+ "range": t_range,
519
+ "p01": p01,
520
+ "p25": p25,
521
+ "p50": p50,
522
+ "p75": p75,
523
+ "p90": p90,
524
+ "p95": p95,
525
+ "p99": p99,
526
+ }
527
+
528
+
529
+ class StepAccumulator:
530
+ """
531
+ Stores per-tensor entries, then aggregates to layer-scope or global-scope
532
+ using exact population formulas (no tensor retention).
533
+ """
534
+
535
+ def __init__(self):
536
+ # name -> {numel, norm, mean, std, max_abs, frac_near_dtype_limit, frac_near_user_limit, min, max, range, p01..p99}
537
+ self.tensors: Dict[str, Dict[str, float]] = {}
538
+
539
+ def add(self, name: str, numel: int, stats: Dict[str, float]):
540
+ new_entry = {"numel": numel, **stats}
541
+ existing = self.tensors.get(name)
542
+ self.tensors[name] = (
543
+ new_entry if existing is None else self._merge_entry(existing, new_entry)
544
+ )
545
+
546
+ @staticmethod
547
+ def _merge_entry(a: Dict[str, float], b: Dict[str, float]) -> Dict[str, float]:
548
+ total_n = a["numel"] + b["numel"]
549
+ if total_n == 0:
550
+ return a
551
+ norm = math.sqrt(a["norm"] ** 2 + b["norm"] ** 2)
552
+ max_abs = max(a["max_abs"], b["max_abs"])
553
+ mean = (a["mean"] * a["numel"] + b["mean"] * b["numel"]) / total_n
554
+ ex2 = (
555
+ a["numel"] * (a["std"] ** 2 + a["mean"] ** 2)
556
+ + b["numel"] * (b["std"] ** 2 + b["mean"] ** 2)
557
+ ) / total_n
558
+ std = math.sqrt(max(0.0, ex2 - mean ** 2))
559
+ frac_dtype = (
560
+ a["frac_near_dtype_limit"] * a["numel"] + b["frac_near_dtype_limit"] * b["numel"]
561
+ ) / total_n
562
+ frac_user = (
563
+ a["frac_near_user_limit"] * a["numel"] + b["frac_near_user_limit"] * b["numel"]
564
+ ) / total_n
565
+
566
+ # Exact min/max across micro-batches (gradient accumulation)
567
+ t_min = min(a.get("min", float("inf")), b.get("min", float("inf")))
568
+ t_max = max(a.get("max", float("-inf")), b.get("max", float("-inf")))
569
+ t_range = t_max - t_min
570
+
571
+ # Percentiles: weighted average across micro-batches (best effort)
572
+ def _wpct(key: str) -> float:
573
+ av = a.get(key, 0.0)
574
+ bv = b.get(key, 0.0)
575
+ if av == 0.0 and bv == 0.0:
576
+ return 0.0
577
+ return (av * a["numel"] + bv * b["numel"]) / total_n
578
+
579
+ return {
580
+ "numel": total_n,
581
+ "norm": norm,
582
+ "mean": mean,
583
+ "std": std,
584
+ "max_abs": max_abs,
585
+ "frac_near_dtype_limit": frac_dtype,
586
+ "frac_near_user_limit": frac_user,
587
+ "min": t_min,
588
+ "max": t_max,
589
+ "range": t_range,
590
+ "p01": _wpct("p01"),
591
+ "p25": _wpct("p25"),
592
+ "p50": _wpct("p50"),
593
+ "p75": _wpct("p75"),
594
+ "p90": _wpct("p90"),
595
+ "p95": _wpct("p95"),
596
+ "p99": _wpct("p99"),
597
+ }
598
+
599
+ def clear(self):
600
+ self.tensors.clear()
601
+
602
+ def _aggregate(self, entries: Dict[str, Dict[str, float]]) -> Dict[str, float]:
603
+ if not entries:
604
+ return {}
605
+ numels = [e["numel"] for e in entries.values()]
606
+ total_n = sum(numels)
607
+
608
+ # L2 norm
609
+ norm = math.sqrt(sum(e["norm"] ** 2 for e in entries.values()))
610
+ # Max abs
611
+ max_abs = max(e["max_abs"] for e in entries.values())
612
+ # Weighted mean
613
+ mean = sum(e["mean"] * e["numel"] for e in entries.values()) / total_n
614
+ # Pooled std: sqrt( E[σ² + μ²] - μ_global² )
615
+ ex2 = (
616
+ sum(e["numel"] * (e["std"] ** 2 + e["mean"] ** 2) for e in entries.values())
617
+ / total_n
618
+ )
619
+ std = math.sqrt(max(0.0, ex2 - mean ** 2))
620
+ # Weighted fractions
621
+ frac_dtype = (
622
+ sum(e["frac_near_dtype_limit"] * e["numel"] for e in entries.values())
623
+ / total_n
624
+ )
625
+ frac_user = (
626
+ sum(e["frac_near_user_limit"] * e["numel"] for e in entries.values())
627
+ / total_n
628
+ )
629
+
630
+ # Exact bounds across all tensors in this scope
631
+ t_min = min(e.get("min", float("inf")) for e in entries.values())
632
+ t_max = max(e.get("max", float("-inf")) for e in entries.values())
633
+ t_range = t_max - t_min
634
+
635
+ return {
636
+ "norm": norm,
637
+ "mean": mean,
638
+ "std": std,
639
+ "max_abs": max_abs,
640
+ "frac_near_dtype_limit": frac_dtype,
641
+ "frac_near_user_limit": frac_user,
642
+ "min": t_min,
643
+ "max": t_max,
644
+ "range": t_range,
645
+ # NOTE: percentiles intentionally omitted from aggregated scopes.
646
+ # They are only meaningful at per-tensor scope.
647
+ }
648
+
649
+ def get_global_stats(self) -> Dict[str, float]:
650
+ return self._aggregate(self.tensors)
651
+
652
+ def get_layer_stats(self, layer_prefix: str) -> Dict[str, float]:
653
+ entries = {
654
+ k: v for k, v in self.tensors.items() if k.startswith(layer_prefix + ".")
655
+ }
656
+ return self._aggregate(entries)
657
+
658
+
659
+ class HookRegistry:
660
+ """Attach and throttle forward/backward hooks."""
661
+
662
+ def __init__(self, model: nn.Module):
663
+ self.model = model
664
+ self.handles: List[torch.utils.hooks.RemovableHandle] = []
665
+ self.active = False
666
+
667
+ def attach_forward(
668
+ self,
669
+ module_patterns: List[str],
670
+ accumulator: StepAccumulator,
671
+ user_limit: float,
672
+ dtype_ratio: float,
673
+ ):
674
+ for name, module in self.model.named_modules():
675
+ if any(re.search(p, name) for p in module_patterns):
676
+ h = module.register_forward_hook(
677
+ self._make_forward_hook(name, accumulator, user_limit, dtype_ratio)
678
+ )
679
+ self.handles.append(h)
680
+
681
+ def attach_backward(
682
+ self, accumulator: StepAccumulator, user_limit: float, dtype_ratio: float
683
+ ):
684
+ for name, param in self.model.named_parameters():
685
+ if param.requires_grad:
686
+ h = param.register_hook(
687
+ self._make_backward_hook(
688
+ f"grad.{name}", accumulator, user_limit, dtype_ratio
689
+ )
690
+ )
691
+ self.handles.append(h)
692
+
693
+ def _make_forward_hook(
694
+ self, module_name: str, accumulator: StepAccumulator, user_limit: float, dtype_ratio: float
695
+ ):
696
+ def hook(module, inp, out):
697
+ if not self.active:
698
+ return
699
+
700
+ # Modules can return a tensor, a tuple (take first item), or a
701
+ # dict (e.g. TinyLlamaModel returns {"last_hidden_state": ...}).
702
+ # Pull out the first real tensor we find; skip cleanly if none.
703
+ if isinstance(out, dict):
704
+ out_dict = out
705
+ out = out_dict.get("last_hidden_state")
706
+ if out is None:
707
+ out = next(
708
+ (v for v in out_dict.values() if torch.is_tensor(v)), None
709
+ )
710
+ elif isinstance(out, (tuple, list)):
711
+ out = out[0] if len(out) > 0 else None
712
+
713
+ if not torch.is_tensor(out):
714
+ return
715
+
716
+ stats = StatsEngine.compute(out.detach(), user_limit, dtype_ratio)
717
+ accumulator.add(f"act.{module_name}", out.numel(), stats)
718
+
719
+ return hook
720
+
721
+ def _make_backward_hook(
722
+ self, param_name: str, accumulator: StepAccumulator, user_limit: float, dtype_ratio: float
723
+ ):
724
+ def hook(grad):
725
+ if not self.active:
726
+ return
727
+ stats = StatsEngine.compute(grad.detach(), user_limit, dtype_ratio)
728
+ accumulator.add(param_name, grad.numel(), stats)
729
+
730
+ return hook
731
+
732
+ def set_active(self, active: bool):
733
+ self.active = active
734
+
735
+ def clear(self):
736
+ for h in self.handles:
737
+ h.remove()
738
+ self.handles.clear()
739
+
740
+
741
+ class StabilityMonitorCallback(TrainerCallback):
742
+ """
743
+ Full stability instrumentation: grad / param / act statistics
744
+ at global, per-layer, and per-tensor scope.
745
+ """
746
+
747
+ def __init__(
748
+ self,
749
+ model: nn.Module,
750
+ monitor_every_n_steps: int = 10,
751
+ module_patterns: Optional[List[str]] = None,
752
+ user_limits: Optional[Dict[str, float]] = None,
753
+ dtype_proximity_ratio: float = 0.9,
754
+ log_scope: Optional[Dict[str, bool]] = None,
755
+ monitor_during_eval: bool = False,
756
+ ):
757
+ self.model = model
758
+ self.monitor_every_n_steps = monitor_every_n_steps
759
+ # NEW: default patterns now include residual gateways
760
+ self.module_patterns = module_patterns or [".*mlp.*", ".*self_attn.*", ".*residual.*"]
761
+ self.user_limits = user_limits or {"grad": 1.0, "param": 100.0, "act": 50.0}
762
+ self.dtype_ratio = dtype_proximity_ratio
763
+ self.log_scope = log_scope or {
764
+ "global": True,
765
+ "per_layer": True,
766
+ "per_tensor": False,
767
+ }
768
+ self.monitor_during_eval = monitor_during_eval
769
+
770
+ self.accumulator = StepAccumulator()
771
+ self.hooks = HookRegistry(model)
772
+ self.hooks.attach_forward(
773
+ self.module_patterns,
774
+ self.accumulator,
775
+ self.user_limits["act"],
776
+ self.dtype_ratio,
777
+ )
778
+ self.hooks.attach_backward(
779
+ self.accumulator, self.user_limits["grad"], self.dtype_ratio
780
+ )
781
+
782
+ self.pending_metrics: Optional[Dict[str, float]] = None
783
+
784
+ def _should_monitor(self, state) -> bool:
785
+ return state.global_step % self.monitor_every_n_steps == 0
786
+
787
+ def on_step_begin(self, args, state, control, **kwargs):
788
+ if self._should_monitor(state):
789
+ self.accumulator.clear()
790
+ self.hooks.set_active(True)
791
+
792
+ def on_step_end(self, args, state, control, **kwargs):
793
+ if not self.hooks.active:
794
+ return
795
+
796
+ # Parameter stats (post-optimizer step)
797
+ for name, param in self.model.named_parameters():
798
+ stats = StatsEngine.compute(
799
+ param.data, self.user_limits["param"], self.dtype_ratio
800
+ )
801
+ self.accumulator.add(f"param.{name}", param.numel(), stats)
802
+
803
+ self.hooks.set_active(False)
804
+ self.pending_metrics = self._build_metrics()
805
+
806
+ @staticmethod
807
+ def _kind_of(name: str) -> str:
808
+ """Classify a tensor key by its source: activation, gradient, or parameter."""
809
+ if name.startswith("act."):
810
+ return "act"
811
+ if name.startswith("grad."):
812
+ return "grad"
813
+ if name.startswith("param."):
814
+ return "param"
815
+ return "other"
816
+
817
+ @staticmethod
818
+ def _strip_kind(name: str) -> str:
819
+ if name.startswith("act."):
820
+ return name[4:]
821
+ if name.startswith(("grad.", "param.")):
822
+ return name[5:]
823
+ return name
824
+
825
+ def _build_metrics(self, scope: str = "train") -> Dict[str, float]:
826
+ metrics: Dict[str, float] = {}
827
+
828
+ # --- Global (split by kind: act / grad / param — never pooled together) ---
829
+ if self.log_scope.get("global", True):
830
+ by_kind: Dict[str, Dict[str, Dict[str, float]]] = {}
831
+ for k, v in self.accumulator.tensors.items():
832
+ by_kind.setdefault(self._kind_of(k), {})[k] = v
833
+
834
+ for kind, entries in by_kind.items():
835
+ stats = self.accumulator._aggregate(entries)
836
+ for kk, vv in stats.items():
837
+ metrics[f"{scope}/global/{kind}/{kk}"] = vv
838
+
839
+ # --- Per-layer (group by model.layers.{i}, split by kind) ---
840
+ if self.log_scope.get("per_layer", True):
841
+ layer_prefixes = set()
842
+ for name in self.accumulator.tensors:
843
+ clean = self._strip_kind(name)
844
+ parts = clean.split(".")
845
+ for i, p in enumerate(parts):
846
+ if p == "layers" and i + 1 < len(parts):
847
+ prefix = ".".join(parts[: i + 2])
848
+ layer_prefixes.add(prefix)
849
+
850
+ for prefix in layer_prefixes:
851
+ by_kind: Dict[str, Dict[str, Dict[str, float]]] = {}
852
+ for k, v in self.accumulator.tensors.items():
853
+ clean = self._strip_kind(k)
854
+ if clean.startswith(prefix + ".") or clean == prefix:
855
+ by_kind.setdefault(self._kind_of(k), {})[k] = v
856
+
857
+ safe = prefix.replace(".", "_")
858
+ for kind, entries in by_kind.items():
859
+ if not entries:
860
+ continue
861
+ stats = self.accumulator._aggregate(entries)
862
+ for kk, vv in stats.items():
863
+ metrics[f"{scope}/layer_{safe}/{kind}/{kk}"] = vv
864
+
865
+ # --- Per-tensor (exact percentiles live here) ---
866
+ if self.log_scope.get("per_tensor", False):
867
+ for name, stats in self.accumulator.tensors.items():
868
+ safe = name.replace(".", "_")
869
+ for kk, vv in stats.items():
870
+ if kk == "numel":
871
+ continue
872
+ metrics[f"{scope}/tensor_{safe}/{kk}"] = vv
873
+
874
+ return metrics
875
+
876
+ def on_log(self, args, state, control, logs=None, **kwargs):
877
+ if logs is not None and self.pending_metrics is not None:
878
+ logs.update(self.pending_metrics)
879
+ self.pending_metrics = None
880
+
881
+ def on_prediction_step(self, args, state, control, **kwargs):
882
+ """Fires once per eval/predict batch. Trainer.evaluate() calls this
883
+ for every batch in the eval loop, then calls self.log(output.metrics)
884
+ (which dispatches on_log to every callback, including the wandb/
885
+ tensorboard reporting callbacks) BEFORE on_evaluate() runs. So to get
886
+ eval-time stats into that same on_log dispatch, we have to build
887
+ pending_metrics here, not in on_evaluate — by the time on_evaluate
888
+ fires, self.log() has already happened and it's too late.
889
+ """
890
+ if not self.monitor_during_eval:
891
+ return
892
+ if not self.hooks.active:
893
+ # First batch of this eval pass: start a fresh accumulation and
894
+ # snapshot parameter stats once (they don't change during eval).
895
+ self.accumulator.clear()
896
+ self.hooks.set_active(True)
897
+ for name, param in self.model.named_parameters():
898
+ stats = StatsEngine.compute(
899
+ param.data, self.user_limits["param"], self.dtype_ratio
900
+ )
901
+ self.accumulator.add(f"param.{name}", param.numel(), stats)
902
+ self.pending_metrics = self._build_metrics(scope="eval")
903
+
904
+ def on_evaluate(self, args, state, control, metrics=None, **kwargs):
905
+ self.hooks.set_active(False)
906
+ self.accumulator.clear()
907
+
908
+
909
+ class TimeTrackerCallback(TrainerCallback):
910
+ """Precise training & eval timing with remaining-time estimates."""
911
+
912
+ def __init__(self):
913
+ self.step_start: Optional[float] = None
914
+ self.epoch_start: Optional[float] = None
915
+ self.total_train_time = 0.0
916
+ self.step_times: List[float] = []
917
+
918
+ def on_epoch_begin(self, args, state, control, **kwargs):
919
+ self.epoch_start = time.perf_counter()
920
+
921
+ def on_step_begin(self, args, state, control, **kwargs):
922
+ self.step_start = time.perf_counter()
923
+
924
+ def on_step_end(self, args, state, control, **kwargs):
925
+ if self.step_start is not None:
926
+ dt = time.perf_counter() - self.step_start
927
+ self.step_times.append(dt)
928
+ self.total_train_time += dt
929
+ self.step_start = None
930
+
931
+ def on_log(self, args, state, control, logs=None, **kwargs):
932
+ if logs is None:
933
+ return
934
+
935
+ logs["train/total_time_seconds"] = self.total_train_time
936
+
937
+ if self.step_times:
938
+ recent = self.step_times[-100:]
939
+ logs["train/time_per_step_avg"] = sum(recent) / len(recent)
940
+
941
+ if self.epoch_start is not None:
942
+ logs["train/epoch_time_elapsed"] = time.perf_counter() - self.epoch_start
943
+
944
+ if state.max_steps and state.global_step > 0:
945
+ avg = self.total_train_time / state.global_step
946
+ remaining = (state.max_steps - state.global_step) * avg
947
+ logs["train/estimated_remaining_minutes"] = remaining / 60.0
948
+
949
+ def on_evaluate(self, args, state, control, metrics=None, **kwargs):
950
+ pass
951
+
952
+
953
+ class MetricsLoggerCallback(TrainerCallback):
954
+ """Persist every logged dict as JSONL in the output dir."""
955
+
956
+ def __init__(self, output_dir: str):
957
+ self.output_dir = Path(output_dir)
958
+ self.output_dir.mkdir(parents=True, exist_ok=True)
959
+ self.log_file = self.output_dir / "training_log.jsonl"
960
+
961
+ def on_log(self, args, state, control, logs=None, **kwargs):
962
+ if logs is None:
963
+ return
964
+ entry = {
965
+ "step": state.global_step,
966
+ "epoch": state.epoch,
967
+ "timestamp": time.time(),
968
+ **logs,
969
+ }
970
+ with open(self.log_file, "a") as f:
971
+ f.write(json.dumps(entry, default=str) + "\n")
972
+
973
+
974
+ # =============================================================================
975
+ # NEW: CONTAMINATION CALLBACK
976
+ # =============================================================================
977
+
978
+ class ContaminationCallback(TrainerCallback):
979
+ """
980
+ Intentionally corrupt input_ids and labels for a window of steps,
981
+ causing a controlled loss spike. Supports two modes:
982
+ - "shift": every token ID is incremented by 1 (mod vocab_size)
983
+ - "random": token IDs are replaced with uniform random IDs
984
+ Fraction controls what proportion of tokens (per sequence) are corrupted.
985
+ """
986
+ def __init__(
987
+ self,
988
+ vocab_size: int,
989
+ enabled: bool = False,
990
+ start_step: int = 0,
991
+ duration_steps: int = 0,
992
+ mode: str = "shift",
993
+ fraction: float = 1.0,
994
+ seed: Optional[int] = None,
995
+ ):
996
+ self.vocab_size = vocab_size
997
+ self.enabled = enabled
998
+ self.start_step = start_step
999
+ self.duration_steps = duration_steps
1000
+ self.mode = mode
1001
+ self.fraction = fraction
1002
+ self.seed = seed
1003
+
1004
+ # Create a dedicated generator for reproducibility
1005
+ self.generator = torch.Generator()
1006
+ if seed is not None:
1007
+ self.generator.manual_seed(seed)
1008
+
1009
+ self._active = False
1010
+
1011
+ def _should_corrupt(self, state) -> bool:
1012
+ if not self.enabled:
1013
+ return False
1014
+ step = state.global_step
1015
+ return self.start_step <= step < self.start_step + self.duration_steps
1016
+
1017
+ def on_step_begin(self, args, state, control, **kwargs):
1018
+ if not self._should_corrupt(state):
1019
+ return
1020
+
1021
+ # The batch is passed in kwargs under key "inputs" (Trainer convention).
1022
+ # We also need to grab the model's device to generate tensors on the same device.
1023
+ batch = kwargs.get("inputs")
1024
+ if batch is None:
1025
+ return
1026
+
1027
+ # We need the device – get it from the model or from the input tensors.
1028
+ # We can access the model through the trainer? Not directly here.
1029
+ # But we can infer device from batch tensors.
1030
+ if not isinstance(batch, dict):
1031
+ return
1032
+
1033
+ input_ids = batch.get("input_ids")
1034
+ labels = batch.get("labels")
1035
+ attention_mask = batch.get("attention_mask")
1036
+
1037
+ if input_ids is None or labels is None:
1038
+ return
1039
+
1040
+ device = input_ids.device
1041
+ batch_size, seq_len = input_ids.shape
1042
+
1043
+ # Build mask of positions to corrupt (based on fraction)
1044
+ # We generate a mask of shape (batch_size, seq_len) with True for positions to corrupt.
1045
+ if self.fraction >= 1.0:
1046
+ corrupt_mask = torch.ones((batch_size, seq_len), dtype=torch.bool, device=device)
1047
+ elif self.fraction <= 0.0:
1048
+ return # nothing to corrupt
1049
+ else:
1050
+ # Generate random floats and threshold
1051
+ rand = torch.rand((batch_size, seq_len), generator=self.generator, device=device)
1052
+ corrupt_mask = rand < self.fraction
1053
+
1054
+ # If attention_mask is present, exclude padding positions from corruption
1055
+ if attention_mask is not None:
1056
+ # attention_mask is 1 for real tokens, 0 for padding
1057
+ padding_mask = attention_mask == 0
1058
+ corrupt_mask = corrupt_mask & (~padding_mask)
1059
+
1060
+ if not corrupt_mask.any():
1061
+ return
1062
+
1063
+ # Apply corruption
1064
+ if self.mode == "shift":
1065
+ # Increment by 1 modulo vocab_size
1066
+ # We need to handle vocab_size properly (IDs go 0..vocab_size-1)
1067
+ input_ids_corrupt = (input_ids + 1) % self.vocab_size
1068
+ labels_corrupt = (labels + 1) % self.vocab_size
1069
+ elif self.mode == "random":
1070
+ # Replace with uniform random IDs
1071
+ # Create random tensor of same shape
1072
+ random_ids = torch.randint(
1073
+ 0, self.vocab_size, input_ids.shape,
1074
+ generator=self.generator, device=device
1075
+ )
1076
+ input_ids_corrupt = random_ids
1077
+ labels_corrupt = random_ids
1078
+ else:
1079
+ raise ValueError(f"Unknown contamination mode: {self.mode}")
1080
+
1081
+ # Apply only where mask is True
1082
+ input_ids.masked_scatter_(corrupt_mask, input_ids_corrupt[corrupt_mask])
1083
+ labels.masked_scatter_(corrupt_mask, labels_corrupt[corrupt_mask])
1084
+
1085
+ # Reassign into batch (mutated in-place)
1086
+ batch["input_ids"] = input_ids
1087
+ batch["labels"] = labels
1088
+
1089
+ # Log a one‑time message when contamination starts
1090
+ if not self._active:
1091
+ print(f"[Contamination] Started at step {state.global_step} for {self.duration_steps} steps (mode={self.mode})")
1092
+ self._active = True
1093
+
1094
+ def on_step_end(self, args, state, control, **kwargs):
1095
+ # If we just passed the end of the window, de‑activate
1096
+ if self._active and state.global_step >= self.start_step + self.duration_steps:
1097
+ print(f"[Contamination] Ended at step {state.global_step}")
1098
+ self._active = False
1099
+
1100
+
1101
+ # =============================================================================
1102
+ # 5. DATA & TRAINER FACTORY
1103
+ # =============================================================================
1104
+
1105
+ def build_dataset(
1106
+ tokenizer,
1107
+ max_seq_len: int = 512,
1108
+ split: str = "train",
1109
+ dataset_name: str = "roneneldan/TinyStories",
1110
+ max_samples: Optional[int] = None,
1111
+ ):
1112
+ """Concatenate and chunk TinyStories for causal LM. Fast path with multiprocessing."""
1113
+ ds = load_dataset(dataset_name, split=split)
1114
+
1115
+ if max_samples is not None and split == "train":
1116
+ ds = ds.select(range(min(max_samples, len(ds))))
1117
+ print(f"[Dataset] Using first {len(ds)} samples for training (max_samples={max_samples})")
1118
+
1119
+ def tokenize(examples):
1120
+ out = tokenizer(examples["text"], add_special_tokens=False)
1121
+ eos_id = tokenizer.eos_token_id
1122
+ out["input_ids"] = [ids + [eos_id] for ids in out["input_ids"]]
1123
+ if "attention_mask" in out:
1124
+ out["attention_mask"] = [mask + [1] for mask in out["attention_mask"]]
1125
+ return out
1126
+
1127
+ tokenized = ds.map(
1128
+ tokenize,
1129
+ batched=True,
1130
+ num_proc=4,
1131
+ remove_columns=ds.column_names,
1132
+ desc=f"Tokenizing {split}",
1133
+ )
1134
+
1135
+ def group_texts(examples):
1136
+ concatenated = {
1137
+ k: list(chain.from_iterable(examples[k])) for k in examples.keys()
1138
+ }
1139
+ total_length = len(concatenated[list(examples.keys())[0]])
1140
+ total_length = (total_length // max_seq_len) * max_seq_len
1141
+ result = {
1142
+ k: [t[i : i + max_seq_len] for i in range(0, total_length, max_seq_len)]
1143
+ for k, t in concatenated.items()
1144
+ }
1145
+ result["labels"] = result["input_ids"].copy()
1146
+ return result
1147
+
1148
+ return tokenized.map(
1149
+ group_texts,
1150
+ batched=True,
1151
+ batch_size=10000,
1152
+ num_proc=4,
1153
+ desc=f"Chunking {split}",
1154
+ )
1155
+
1156
+
1157
+ def create_trainer(
1158
+ model,
1159
+ tokenizer,
1160
+ config: Dict[str, Any],
1161
+ train_dataset,
1162
+ eval_dataset=None,
1163
+ ):
1164
+ """Assemble HF Trainer with all custom callbacks."""
1165
+ tc = config.get("training", {})
1166
+ mc = config.get("monitor", {})
1167
+
1168
+ run_name = tc.get("run_name", None)
1169
+
1170
+ args = TrainingArguments(
1171
+ output_dir=tc.get("output_dir", "./out"),
1172
+ run_name=run_name,
1173
+ num_train_epochs=tc.get("num_train_epochs", 3),
1174
+ per_device_train_batch_size=tc.get("per_device_train_batch_size", 16),
1175
+ per_device_eval_batch_size=tc.get("per_device_eval_batch_size", 16),
1176
+ gradient_accumulation_steps=tc.get("gradient_accumulation_steps", 4),
1177
+ learning_rate=tc.get("learning_rate", 3e-4),
1178
+ weight_decay=tc.get("weight_decay", 0.0),
1179
+ max_grad_norm=tc.get("max_grad_norm", 1.0),
1180
+ optim=tc.get("optim", "adamw_torch"),
1181
+ warmup_steps=tc.get("warmup_steps", 0),
1182
+ lr_scheduler_type=tc.get("lr_scheduler_type", "cosine"),
1183
+ bf16=tc.get("bf16", True),
1184
+ logging_steps=tc.get("logging_steps", 10),
1185
+ eval_strategy=tc.get("eval_strategy", "steps"),
1186
+ eval_steps=tc.get("eval_steps", 500),
1187
+ save_strategy=tc.get("save_strategy", "steps"),
1188
+ save_steps=tc.get("save_steps", 1000),
1189
+ load_best_model_at_end=tc.get("load_best_model_at_end", False),
1190
+ report_to=tc.get("report_to", "tensorboard"),
1191
+ push_to_hub=tc.get("push_to_hub", False),
1192
+ hub_model_id=tc.get("hub_model_id", None),
1193
+ hub_token=tc.get("hub_token") or os.environ.get("HF_TOKEN"),
1194
+ max_steps=tc.get("max_steps", -1),
1195
+ seed=tc.get("seed", 42),
1196
+ data_seed=tc.get("data_seed", 42),
1197
+ remove_unused_columns=False,
1198
+ )
1199
+
1200
+ callbacks = [
1201
+ TimeTrackerCallback(),
1202
+ ]
1203
+
1204
+ # --- Contamination callback (optional) ---
1205
+ cc = config.get("contamination", {})
1206
+ if cc.get("enabled", False):
1207
+ vocab_size = model.config.vocab_size
1208
+ callbacks.append(
1209
+ ContaminationCallback(
1210
+ vocab_size=vocab_size,
1211
+ enabled=True,
1212
+ start_step=cc.get("start_step", 0),
1213
+ duration_steps=cc.get("duration_steps", 0),
1214
+ mode=cc.get("mode", "shift"),
1215
+ fraction=cc.get("fraction", 1.0),
1216
+ seed=cc.get("seed", None),
1217
+ )
1218
+ )
1219
+
1220
+ if mc.get("enabled", True):
1221
+ callbacks.append(
1222
+ StabilityMonitorCallback(
1223
+ model=model,
1224
+ monitor_every_n_steps=mc.get("monitor_every_n_steps", 10),
1225
+ module_patterns=mc.get("module_patterns", [".*mlp.*", ".*self_attn.*", ".*residual.*"]),
1226
+ user_limits=mc.get(
1227
+ "user_limits", {"grad": 1.0, "param": 100.0, "act": 50.0}
1228
+ ),
1229
+ dtype_proximity_ratio=mc.get("dtype_proximity_ratio", 0.9),
1230
+ log_scope=mc.get(
1231
+ "log_scope",
1232
+ {"global": True, "per_layer": True, "per_tensor": False},
1233
+ ),
1234
+ monitor_during_eval=mc.get("monitor_during_eval", False),
1235
+ )
1236
+ )
1237
+
1238
+ callbacks.append(MetricsLoggerCallback(args.output_dir))
1239
+
1240
+ collator = DataCollatorForLanguageModeling(tokenizer=tokenizer, mlm=False)
1241
+
1242
+ trainer = Trainer(
1243
+ model=model,
1244
+ args=args,
1245
+ train_dataset=train_dataset,
1246
+ eval_dataset=eval_dataset,
1247
+ data_collator=collator,
1248
+ callbacks=callbacks,
1249
+ )
1250
+
1251
+ # Move reporting integrations to the end
1252
+ try:
1253
+ from transformers.integrations import get_reporting_integration_callbacks
1254
+
1255
+ reporting_types = tuple(get_reporting_integration_callbacks(args.report_to))
1256
+ except Exception:
1257
+ reporting_types = ()
1258
+
1259
+ if reporting_types:
1260
+ handler = trainer.callback_handler
1261
+ reporting_cbs = [cb for cb in handler.callbacks if isinstance(cb, reporting_types)]
1262
+ other_cbs = [cb for cb in handler.callbacks if not isinstance(cb, reporting_types)]
1263
+ handler.callbacks = other_cbs + reporting_cbs
1264
+
1265
+ return trainer
zain/Activation/llm_analyzer_wandb.py ADDED
@@ -0,0 +1,570 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Multi-LLM Activation & Loss Analyzer with WandB Logging
3
+
4
+ Evaluates multiple language models on WikiText dataset,
5
+ computing per-tensor and global activation statistics (mean, max_abs, std, norm)
6
+ and logging to Weights & Biases with separate runs per model.
7
+
8
+ Requirements:
9
+ pip install transformers torch datasets wandb tqdm
10
+
11
+ Usage:
12
+ export WANDB_PROJECT="llm-activation-analysis"
13
+ export WANDB_API_KEY="your-key"
14
+ python llm_analyzer_wandb.py
15
+ """
16
+
17
+ import math
18
+ import torch
19
+ import torch.nn.functional as F
20
+ from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig
21
+ from datasets import load_dataset
22
+ from typing import List, Dict, Optional, Union, Tuple
23
+ from dataclasses import dataclass, asdict
24
+ from collections import defaultdict
25
+ import json
26
+ import warnings
27
+ import os
28
+ from tqdm import tqdm
29
+
30
+ import wandb
31
+
32
+ warnings.filterwarnings("ignore")
33
+
34
+
35
+ @dataclass
36
+ class TensorStats:
37
+ mean: float
38
+ max_abs: float
39
+ std: float
40
+ norm: float
41
+ numel: int
42
+
43
+
44
+ @dataclass
45
+ class ModelResult:
46
+ model_name: str
47
+ loss: float
48
+ perplexity: float
49
+ global_act: TensorStats
50
+ layer_acts: Dict[str, TensorStats]
51
+ num_tokens: int
52
+ num_layers: int
53
+ hidden_size: int
54
+ num_params: int
55
+
56
+
57
+ class ActivationHookManager:
58
+ """Manages forward hooks to capture activations from every tensor."""
59
+
60
+ def __init__(self):
61
+ self.activations = {}
62
+ self.hooks = []
63
+ # Set once per batch via set_attention_mask(); used to exclude
64
+ # padding-token positions from activation statistics.
65
+ self._attention_mask: Optional[torch.Tensor] = None
66
+
67
+ def set_attention_mask(self, attention_mask: Optional[torch.Tensor]):
68
+ """Call once per batch before the forward pass so hooks can mask
69
+ out padding positions when computing stats."""
70
+ self._attention_mask = (
71
+ attention_mask.detach().cpu() if attention_mask is not None else None
72
+ )
73
+
74
+ def _make_hook(self, name: str):
75
+ def hook(module, input, output):
76
+ # Handle different output types
77
+ if isinstance(output, torch.Tensor):
78
+ tensor = output
79
+ elif isinstance(output, tuple) and isinstance(output[0], torch.Tensor):
80
+ tensor = output[0]
81
+ else:
82
+ return
83
+
84
+ # Detach and move to CPU to avoid GPU memory blowup
85
+ self.activations[name] = tensor.detach().cpu().float()
86
+ return hook
87
+
88
+ def register_hooks(self, model: torch.nn.Module):
89
+ """Register hooks on all modules that produce activations."""
90
+ for name, module in model.named_modules():
91
+ # Skip trivial containers
92
+ if len(list(module.children())) == 0 and hasattr(module, 'forward'):
93
+ hook = module.register_forward_hook(self._make_hook(name))
94
+ self.hooks.append(hook)
95
+
96
+ def clear(self):
97
+ self.activations.clear()
98
+
99
+ def remove_hooks(self):
100
+ for hook in self.hooks:
101
+ hook.remove()
102
+ self.hooks.clear()
103
+
104
+ def _select_real_tokens(self, tensor: torch.Tensor) -> torch.Tensor:
105
+ """
106
+ BUG FIX: previously every captured tensor (including activations at
107
+ padding-token positions) was flattened and used as-is. With
108
+ padding_side="left" and a small batch_size, the padding fraction
109
+ varies a lot batch-to-batch, so padding-token activations (which
110
+ are real, non-zero values — not zeros) were silently mixed into
111
+ mean/std/max_abs/norm, biasing exactly the saturation signal this
112
+ script exists to measure.
113
+
114
+ Here we mask out padding positions whenever a tensor's shape is
115
+ consistent with (batch, seq_len, ...) against the stored
116
+ attention_mask (batch, seq_len). Tensors that don't match that
117
+ shape (e.g. a module operating on the pooled/final dimension only)
118
+ are left as-is rather than guessing.
119
+ """
120
+ mask = self._attention_mask
121
+ if mask is None or tensor.dim() < 2:
122
+ return tensor.reshape(-1)
123
+ if tensor.shape[0] != mask.shape[0] or tensor.shape[1] != mask.shape[1]:
124
+ return tensor.reshape(-1)
125
+
126
+ bool_mask = mask.bool()
127
+ # Expand mask across any trailing dims (e.g. hidden_size) and select.
128
+ expand_shape = bool_mask.shape + (1,) * (tensor.dim() - 2)
129
+ bool_mask = bool_mask.view(expand_shape).expand_as(tensor)
130
+ return tensor[bool_mask].reshape(-1)
131
+
132
+ def compute_stats(self) -> Dict[str, TensorStats]:
133
+ """Compute statistics for all captured activations, excluding
134
+ padding-token positions where identifiable."""
135
+ stats = {}
136
+ for name, tensor in self.activations.items():
137
+ if tensor.numel() == 0:
138
+ continue
139
+ flat = self._select_real_tokens(tensor)
140
+ if flat.numel() == 0:
141
+ continue
142
+ stats[name] = TensorStats(
143
+ mean=flat.mean().item(),
144
+ max_abs=flat.abs().max().item(),
145
+ std=flat.std().item(),
146
+ norm=flat.norm().item(),
147
+ numel=flat.numel()
148
+ )
149
+ return stats
150
+
151
+
152
+ class LLMAnalyzer:
153
+ def __init__(
154
+ self,
155
+ device: Optional[str] = None,
156
+ max_length: int = 512,
157
+ max_samples: int = 1000, # number of wikitext samples to eval
158
+ batch_size: int = 4,
159
+ dtype: torch.dtype = torch.float16,
160
+ wandb_project: Optional[str] = None,
161
+ ):
162
+ self.device = device or ("cuda" if torch.cuda.is_available() else "cpu")
163
+ self.max_length = max_length
164
+ self.max_samples = max_samples
165
+ self.batch_size = batch_size
166
+ self.dtype = dtype if self.device == "cuda" else torch.float32
167
+ self.wandb_project = wandb_project or os.environ.get("WANDB_PROJECT", "llm-activation-analysis")
168
+ self._cache = {}
169
+
170
+ def load_dataset(self, split: str = "test"):
171
+ """Load Salesforce/wikitext dataset."""
172
+ print(f"[Dataset] Loading Salesforce/wikitext ({split}) ...")
173
+ ds = load_dataset("Salesforce/wikitext", "wikitext-2-raw-v1", split=split)
174
+ # Filter out empty lines
175
+ texts = [t for t in ds["text"] if len(t.strip()) > 50]
176
+ print(f"[Dataset] Loaded {len(texts)} non-empty samples")
177
+ return texts[:self.max_samples]
178
+
179
+ def load_model(self, model_name: str):
180
+ """Load model and tokenizer with caching."""
181
+ if model_name in self._cache:
182
+ return self._cache[model_name]
183
+
184
+ print(f"[Loading] {model_name} ...")
185
+
186
+ tokenizer = AutoTokenizer.from_pretrained(
187
+ model_name,
188
+ trust_remote_code=True,
189
+ padding_side="left"
190
+ )
191
+ if tokenizer.pad_token is None:
192
+ tokenizer.pad_token = tokenizer.eos_token
193
+
194
+ config = AutoConfig.from_pretrained(model_name, trust_remote_code=True)
195
+
196
+ model = AutoModelForCausalLM.from_pretrained(
197
+ model_name,
198
+ config=config,
199
+ torch_dtype=self.dtype,
200
+ device_map="auto" if self.device == "cuda" else None,
201
+ trust_remote_code=True,
202
+ )
203
+
204
+ if self.device == "cpu":
205
+ model = model.to(self.device)
206
+
207
+ model.eval()
208
+
209
+ num_params = sum(p.numel() for p in model.parameters())
210
+
211
+ self._cache[model_name] = (tokenizer, model, config, num_params)
212
+ print(f"[Loaded] {model_name} | Params: {num_params/1e6:.1f}M | Layers: {config.num_hidden_layers} | Hidden: {config.hidden_size}")
213
+ return tokenizer, model, config, num_params
214
+
215
+ def compute(
216
+ self,
217
+ model_names: List[str],
218
+ ) -> List[ModelResult]:
219
+ """
220
+ Compute loss and per-tensor activation statistics for multiple models.
221
+ Logs each model as a separate WandB run.
222
+ """
223
+ texts = self.load_dataset()
224
+ results = []
225
+
226
+ for model_name in model_names:
227
+ try:
228
+ result = self._evaluate_model(model_name, texts)
229
+ results.append(result)
230
+ except Exception as e:
231
+ print(f"[Error] {model_name}: {e}")
232
+ import traceback
233
+ traceback.print_exc()
234
+ continue
235
+
236
+ return results
237
+
238
+ def _evaluate_model(
239
+ self,
240
+ model_name: str,
241
+ texts: List[str],
242
+ ) -> ModelResult:
243
+ tokenizer, model, config, num_params = self.load_model(model_name)
244
+
245
+ # Initialize WandB run for this model
246
+ run_name = model_name.replace("/", "-")
247
+ wandb.init(
248
+ project=self.wandb_project,
249
+ name=run_name,
250
+ config={
251
+ "model": model_name,
252
+ "max_length": self.max_length,
253
+ "max_samples": self.max_samples,
254
+ "batch_size": self.batch_size,
255
+ "dtype": str(self.dtype),
256
+ "num_params": num_params,
257
+ "num_layers": config.num_hidden_layers,
258
+ "hidden_size": config.hidden_size,
259
+ },
260
+ reinit=True
261
+ )
262
+
263
+ hook_mgr = ActivationHookManager()
264
+ hook_mgr.register_hooks(model)
265
+
266
+ total_loss = 0.0
267
+ total_tokens = 0
268
+
269
+ # Global activation accumulator
270
+ global_acts = []
271
+
272
+ # Per-layer activation accumulators
273
+ # We'll aggregate stats across batches, then compute final stats
274
+ layer_act_values = defaultdict(list)
275
+
276
+ num_batches = (len(texts) + self.batch_size - 1) // self.batch_size
277
+
278
+ for i in tqdm(range(0, len(texts), self.batch_size), desc=f"Eval {run_name}", total=num_batches):
279
+ batch_texts = texts[i:i + self.batch_size]
280
+
281
+ # Tokenize
282
+ inputs = tokenizer(
283
+ batch_texts,
284
+ return_tensors="pt",
285
+ truncation=True,
286
+ max_length=self.max_length,
287
+ padding=True
288
+ )
289
+
290
+ # Move to device
291
+ if self.device == "cuda" and hasattr(model, "device"):
292
+ # model is on auto device map
293
+ input_ids = inputs["input_ids"]
294
+ if hasattr(model, "device") and model.device != torch.device("meta"):
295
+ input_ids = input_ids.to(model.device)
296
+ attention_mask = inputs.get("attention_mask")
297
+ if attention_mask is not None:
298
+ attention_mask = attention_mask.to(input_ids.device)
299
+ else:
300
+ input_ids = inputs["input_ids"].to(self.device)
301
+ attention_mask = inputs.get("attention_mask")
302
+ if attention_mask is not None:
303
+ attention_mask = attention_mask.to(self.device)
304
+
305
+ labels = input_ids.clone()
306
+
307
+ # BUG FIX: with padding_side="left" and no explicit position_ids,
308
+ # HF's default `position_ids = arange(seq_len)` is applied
309
+ # identically to every row in the batch, regardless of how much
310
+ # left-padding precedes the real tokens in that row (verified
311
+ # against transformers' LlamaModel.forward / GPT2Model.forward
312
+ # source — neither adjusts for padding when position_ids=None).
313
+ # That means a real token's absolute position (and therefore its
314
+ # RoPE rotation / absolute position embedding) depends on how
315
+ # much padding happened to precede it in this particular batch,
316
+ # not on its logical position within its own sequence. This
317
+ # silently corrupts logits -> loss -> perplexity, with the
318
+ # amount of corruption varying batch-to-batch. Fix: derive
319
+ # position_ids from attention_mask so they restart at 0 for the
320
+ # first real token of every row, and are stable (0) on padding.
321
+ if attention_mask is not None:
322
+ position_ids = attention_mask.long().cumsum(-1) - 1
323
+ position_ids.masked_fill_(attention_mask == 0, 0)
324
+ else:
325
+ position_ids = None
326
+
327
+ hook_mgr.set_attention_mask(attention_mask)
328
+
329
+ with torch.no_grad():
330
+ outputs = model(
331
+ input_ids=input_ids,
332
+ attention_mask=attention_mask,
333
+ position_ids=position_ids,
334
+ labels=labels,
335
+ )
336
+
337
+ # --- Loss Computation ---
338
+ logits = outputs.logits
339
+ shift_logits = logits[..., :-1, :].contiguous()
340
+ shift_labels = labels[..., 1:].contiguous()
341
+ shift_mask = attention_mask[..., 1:].contiguous() if attention_mask is not None else None
342
+
343
+ loss_fct = torch.nn.CrossEntropyLoss(reduction="none")
344
+ token_losses = loss_fct(
345
+ shift_logits.view(-1, shift_logits.size(-1)),
346
+ shift_labels.view(-1)
347
+ )
348
+
349
+ if shift_mask is not None:
350
+ token_losses = token_losses * shift_mask.view(-1)
351
+ num_valid_tokens = shift_mask.sum().item()
352
+ else:
353
+ num_valid_tokens = token_losses.numel()
354
+
355
+ batch_loss = token_losses.sum().item()
356
+ total_loss += batch_loss
357
+ total_tokens += num_valid_tokens
358
+
359
+ # --- Activation Statistics ---
360
+ # Get activations captured by hooks
361
+ act_stats = hook_mgr.compute_stats()
362
+
363
+ for name, stats in act_stats.items():
364
+ # Skip dtype-limit fraction metrics entirely
365
+ # We only log mean, max_abs, std, norm
366
+
367
+ # For global: aggregate raw values
368
+ # We can't store all raw values due to memory, so we store running sums
369
+ # But for accurate std across all batches, we need a streaming algorithm
370
+ # For simplicity and correctness, we'll store per-batch stats and weight them
371
+ layer_act_values[name].append(asdict(stats))
372
+
373
+ hook_mgr.clear()
374
+
375
+ # Log per-batch metrics to wandb
376
+ if num_valid_tokens > 0:
377
+ batch_avg_loss = batch_loss / num_valid_tokens
378
+ wandb.log({
379
+ "batch_loss": batch_avg_loss,
380
+ "batch_perplexity": torch.exp(torch.tensor(batch_avg_loss)).item(),
381
+ "batch_tokens": num_valid_tokens,
382
+ "progress": i / len(texts)
383
+ }, step=i)
384
+
385
+ hook_mgr.remove_hooks()
386
+
387
+ # --- Final Aggregation ---
388
+ avg_loss = total_loss / max(total_tokens, 1)
389
+ perplexity = torch.exp(torch.tensor(avg_loss)).item()
390
+
391
+ # Aggregate per-tensor stats across all batches
392
+ # Weighted by numel for mean, max for max_abs, pooled std, pooled norm
393
+ final_layer_stats = {}
394
+
395
+ for name, batch_stats_list in layer_act_values.items():
396
+ total_numel = sum(s["numel"] for s in batch_stats_list)
397
+ if total_numel == 0:
398
+ continue
399
+
400
+ # Weighted mean
401
+ weighted_mean = sum(s["mean"] * s["numel"] for s in batch_stats_list) / total_numel
402
+
403
+ # Max abs across all batches
404
+ max_abs = max(s["max_abs"] for s in batch_stats_list)
405
+
406
+ # BUG FIX: the previous formula (weighted average of per-batch
407
+ # variances only) drops the between-batch term that accounts for
408
+ # per-batch means differing from the global mean. Whenever batch
409
+ # means differ (they will — different texts, different lengths),
410
+ # this systematically UNDERESTIMATES the true global std — in a
411
+ # quick numeric test with two batches of different means this was
412
+ # off by ~2.8x. Correct pooled-variance formula (population form,
413
+ # matches exp.py's StepAccumulator._merge_entry):
414
+ # E[X^2] = weighted_avg(var_i + mean_i^2)
415
+ # Var(X) = E[X^2] - mean_global^2
416
+ ex2 = sum(
417
+ s["numel"] * (s["std"] ** 2 + s["mean"] ** 2) for s in batch_stats_list
418
+ ) / total_numel
419
+ pooled_std = math.sqrt(max(0.0, ex2 - weighted_mean ** 2))
420
+
421
+ # Norm: sqrt(sum of squared norms / total_numel) * sqrt(total_numel)
422
+ # Actually norm^2 = sum(x_i^2), so pooled_norm = sqrt(sum(norm_i^2))
423
+ pooled_norm = (sum(s["norm"] ** 2 for s in batch_stats_list)) ** 0.5
424
+
425
+ final_layer_stats[name] = TensorStats(
426
+ mean=weighted_mean,
427
+ max_abs=max_abs,
428
+ std=pooled_std,
429
+ norm=pooled_norm,
430
+ numel=total_numel
431
+ )
432
+
433
+ # Compute global stats across all layers
434
+ if final_layer_stats:
435
+ all_numel = sum(s.numel for s in final_layer_stats.values())
436
+ global_mean = sum(s.mean * s.numel for s in final_layer_stats.values()) / all_numel
437
+ global_max_abs = max(s.max_abs for s in final_layer_stats.values())
438
+ # Same pooled-std correction as above — same bug was present here.
439
+ global_ex2 = sum(
440
+ s.numel * (s.std ** 2 + s.mean ** 2) for s in final_layer_stats.values()
441
+ ) / all_numel
442
+ global_std = math.sqrt(max(0.0, global_ex2 - global_mean ** 2))
443
+ global_norm = (sum(s.norm ** 2 for s in final_layer_stats.values())) ** 0.5
444
+
445
+ global_stats = TensorStats(
446
+ mean=global_mean,
447
+ max_abs=global_max_abs,
448
+ std=global_std,
449
+ norm=global_norm,
450
+ numel=all_numel
451
+ )
452
+ else:
453
+ global_stats = TensorStats(0.0, 0.0, 0.0, 0.0, 0)
454
+
455
+ result = ModelResult(
456
+ model_name=model_name,
457
+ loss=avg_loss,
458
+ perplexity=perplexity,
459
+ global_act=global_stats,
460
+ layer_acts=final_layer_stats,
461
+ num_tokens=total_tokens,
462
+ num_layers=config.num_hidden_layers,
463
+ hidden_size=config.hidden_size,
464
+ num_params=num_params
465
+ )
466
+
467
+ # --- WandB Logging ---
468
+ self._log_to_wandb(result)
469
+ wandb.finish()
470
+
471
+ return result
472
+
473
+ def _log_to_wandb(self, result: ModelResult):
474
+ """Log final metrics to WandB. No frac_near_dtype_limit."""
475
+
476
+ # Global metrics
477
+ wandb.log({
478
+ "final/loss": result.loss,
479
+ "final/perplexity": result.perplexity,
480
+ "final/num_tokens": result.num_tokens,
481
+
482
+ "train/global/act/mean": result.global_act.mean,
483
+ "train/global/act/max_abs": result.global_act.max_abs,
484
+ "train/global/act/std": result.global_act.std,
485
+ "train/global/act/norm": result.global_act.norm,
486
+ # Intentionally NOT logging frac_near_dtype_limit or frac_near_user_limit
487
+ })
488
+
489
+ # Per-tensor (per-layer) metrics
490
+ # Organize by layer for cleaner WandB UI
491
+ for tensor_name, stats in result.layer_acts.items():
492
+ # Clean name for wandb: replace dots with slashes
493
+ clean_name = tensor_name.replace(".", "/")
494
+
495
+ wandb.log({
496
+ f"train/{clean_name}/act/mean": stats.mean,
497
+ f"train/{clean_name}/act/max_abs": stats.max_abs,
498
+ f"train/{clean_name}/act/std": stats.std,
499
+ f"train/{clean_name}/act/norm": stats.norm,
500
+ # No frac_near_dtype_limit
501
+ })
502
+
503
+ # Also log as a wandb.Table for easy comparison
504
+ table_data = []
505
+ for tensor_name, stats in sorted(result.layer_acts.items()):
506
+ table_data.append([
507
+ tensor_name,
508
+ stats.mean,
509
+ stats.max_abs,
510
+ stats.std,
511
+ stats.norm,
512
+ stats.numel
513
+ ])
514
+
515
+ if table_data:
516
+ table = wandb.Table(
517
+ columns=["tensor_name", "mean", "max_abs", "std", "norm", "numel"],
518
+ data=table_data
519
+ )
520
+ wandb.log({"activation_table": table})
521
+
522
+ def print_report(self, results: List[ModelResult]):
523
+ """Pretty-print comparison report."""
524
+ print("\n" + "=" * 110)
525
+ print(f"{'Model':<35} {'Loss':>10} {'PPL':>10} {'ActMean':>12} {'ActMaxAbs':>12} {'ActStd':>12} {'Tokens':>8}")
526
+ print("-" * 110)
527
+
528
+ for r in results:
529
+ name = r.model_name.split("/")[-1][:33]
530
+ print(
531
+ f"{name:<35} "
532
+ f"{r.loss:>10.4f} "
533
+ f"{r.perplexity:>10.2f} "
534
+ f"{r.global_act.mean:>12.6f} "
535
+ f"{r.global_act.max_abs:>12.6f} "
536
+ f"{r.global_act.std:>12.6f} "
537
+ f"{r.num_tokens:>8}"
538
+ )
539
+
540
+ print("=" * 110)
541
+
542
+ # Print top 5 layers by max_abs for each model
543
+ print("\n[Per-Tensor Max Abs Top 5]")
544
+ for r in results:
545
+ name = r.model_name.split("/")[-1]
546
+ sorted_layers = sorted(r.layer_acts.items(), key=lambda x: x[1].max_abs, reverse=True)[:5]
547
+ print(f"\n {name}:")
548
+ for tensor_name, stats in sorted_layers:
549
+ print(f" {tensor_name:<50} max_abs={stats.max_abs:>10.4f} mean={stats.mean:>10.6f} std={stats.std:>10.4f}")
550
+
551
+ def export_json(self, results: List[ModelResult], path: str):
552
+ """Export results to JSON."""
553
+ data = []
554
+ for r in results:
555
+ entry = {
556
+ "model": r.model_name,
557
+ "loss": r.loss,
558
+ "perplexity": r.perplexity,
559
+ "num_tokens": r.num_tokens,
560
+ "num_layers": r.num_layers,
561
+ "hidden_size": r.hidden_size,
562
+ "num_params": r.num_params,
563
+ "global_act": asdict(r.global_act),
564
+ "layer_acts": {k: asdict(v) for k, v in r.layer_acts.items()}
565
+ }
566
+ data.append(entry)
567
+
568
+ with open(path, "w") as f:
569
+ json.dump(data, f, indent=2)
570
+ print(f"[Exported] Results saved to {path}")
zain/Activation/out/glu-gelu-150L_run/training_log.jsonl ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {"step": 20, "epoch": 0.0013481631277384564, "timestamp": 1786558895.6596417, "loss": 7.965690612792969, "grad_norm": 1.2578125, "learning_rate": 0.000475, "train/total_time_seconds": 7.616961658000946, "train/time_per_step_avg": 0.3808480829000473, "train/epoch_time_elapsed": 8.680427201092243, "train/estimated_remaining_minutes": 6.22051868736744}
2
+ {"step": 40, "epoch": 0.002696326255476913, "timestamp": 1786558903.827716, "loss": 6.832366943359375, "grad_norm": 0.87890625, "learning_rate": 0.0009750000000000001, "train/total_time_seconds": 14.811852153390646, "train/time_per_step_avg": 0.37029630383476614, "train/epoch_time_elapsed": 16.848502036184072, "train/estimated_remaining_minutes": 5.924740861356258}
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation": "relu",
3
+ "architectures": [
4
+ "TinyLlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "dtype": "bfloat16",
10
+ "eos_token_id": 2,
11
+ "head_dim": 32,
12
+ "hidden_act": "silu",
13
+ "hidden_size": 128,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 256,
16
+ "max_position_embeddings": 512,
17
+ "mlp_bias": false,
18
+ "mlp_type": "glu",
19
+ "model_type": "tiny_llama",
20
+ "num_attention_heads": 4,
21
+ "num_hidden_layers": 150,
22
+ "num_key_value_heads": 4,
23
+ "pad_token_id": 0,
24
+ "pretraining_tp": 1,
25
+ "rms_norm_eps": 1e-06,
26
+ "rope_parameters": {
27
+ "rope_theta": 10000.0,
28
+ "rope_type": "default"
29
+ },
30
+ "tie_word_embeddings": true,
31
+ "tokenizer_name": "w-ahmad/tiny-stories-tokenizer",
32
+ "transformers_version": "5.16.0.dev0",
33
+ "use_cache": false,
34
+ "vocab_size": 4096,
35
+ "waleed_beta": 10.0
36
+ }
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6035bf7964d463a92160083594168bbcb3e076204e33db15468d64c342a71de
3
+ size 50427120
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f67562164598b7aeee7d46073b48a5f0c40fceda81d57eeed56d688e85d04f99
3
+ size 101708778
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:645b71843375baf4cc10bc75a2f0f04e91b8e3f8e8929f518a87022898b3bc20
3
+ size 14244
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9db76f238494a413266398860b344c6c4c0f3a045ef78b23af1afac6775a12d1
3
+ size 1064
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "eos_token": "<|endoftext|>",
6
+ "errors": "replace",
7
+ "is_local": false,
8
+ "local_files_only": false,
9
+ "model_max_length": 1024,
10
+ "pad_token": "<|endoftext|>",
11
+ "tokenizer_class": "GPT2Tokenizer",
12
+ "unk_token": "<|endoftext|>"
13
+ }
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/trainer_state.json ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.06740815638692282,
6
+ "eval_steps": 50,
7
+ "global_step": 1000,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "epoch": 0.0013481631277384564,
14
+ "grad_norm": 1.296875,
15
+ "learning_rate": 0.000475,
16
+ "loss": 7.964384460449219,
17
+ "step": 20
18
+ },
19
+ {
20
+ "epoch": 0.002696326255476913,
21
+ "grad_norm": 0.8671875,
22
+ "learning_rate": 0.0009750000000000001,
23
+ "loss": 6.8277839660644535,
24
+ "step": 40
25
+ },
26
+ {
27
+ "epoch": 0.003370407819346141,
28
+ "eval_loss": 6.035980701446533,
29
+ "eval_runtime": 21.045,
30
+ "eval_samples_per_second": 452.697,
31
+ "eval_steps_per_second": 3.564,
32
+ "step": 50
33
+ },
34
+ {
35
+ "epoch": 0.004044489383215369,
36
+ "grad_norm": 0.20703125,
37
+ "learning_rate": 0.001475,
38
+ "loss": 6.076027679443359,
39
+ "step": 60
40
+ },
41
+ {
42
+ "epoch": 0.005392652510953826,
43
+ "grad_norm": 0.193359375,
44
+ "learning_rate": 0.001975,
45
+ "loss": 6.007006454467773,
46
+ "step": 80
47
+ },
48
+ {
49
+ "epoch": 0.006740815638692282,
50
+ "grad_norm": 0.79296875,
51
+ "learning_rate": 0.002475,
52
+ "loss": 5.9332275390625,
53
+ "step": 100
54
+ },
55
+ {
56
+ "epoch": 0.006740815638692282,
57
+ "eval_loss": 5.939233303070068,
58
+ "eval_runtime": 21.1007,
59
+ "eval_samples_per_second": 451.501,
60
+ "eval_steps_per_second": 3.554,
61
+ "step": 100
62
+ },
63
+ {
64
+ "epoch": 0.008088978766430738,
65
+ "grad_norm": 0.2255859375,
66
+ "learning_rate": 0.0029749999999999998,
67
+ "loss": 5.783406066894531,
68
+ "step": 120
69
+ },
70
+ {
71
+ "epoch": 0.009437141894169195,
72
+ "grad_norm": 0.703125,
73
+ "learning_rate": 0.003475,
74
+ "loss": 5.675531005859375,
75
+ "step": 140
76
+ },
77
+ {
78
+ "epoch": 0.010111223458038422,
79
+ "eval_loss": 5.526480674743652,
80
+ "eval_runtime": 21.379,
81
+ "eval_samples_per_second": 445.624,
82
+ "eval_steps_per_second": 3.508,
83
+ "step": 150
84
+ },
85
+ {
86
+ "epoch": 0.010785305021907651,
87
+ "grad_norm": 0.1943359375,
88
+ "learning_rate": 0.003975,
89
+ "loss": 5.528359603881836,
90
+ "step": 160
91
+ },
92
+ {
93
+ "epoch": 0.012133468149646108,
94
+ "grad_norm": 0.2392578125,
95
+ "learning_rate": 0.004475,
96
+ "loss": 5.462315368652344,
97
+ "step": 180
98
+ },
99
+ {
100
+ "epoch": 0.013481631277384564,
101
+ "grad_norm": 0.33203125,
102
+ "learning_rate": 0.004975,
103
+ "loss": 5.351004028320313,
104
+ "step": 200
105
+ },
106
+ {
107
+ "epoch": 0.013481631277384564,
108
+ "eval_loss": 5.25657844543457,
109
+ "eval_runtime": 21.2496,
110
+ "eval_samples_per_second": 448.338,
111
+ "eval_steps_per_second": 3.529,
112
+ "step": 200
113
+ },
114
+ {
115
+ "epoch": 0.01482979440512302,
116
+ "grad_norm": 1.3125,
117
+ "learning_rate": 0.005,
118
+ "loss": 5.367509841918945,
119
+ "step": 220
120
+ },
121
+ {
122
+ "epoch": 0.016177957532861477,
123
+ "grad_norm": 0.255859375,
124
+ "learning_rate": 0.005,
125
+ "loss": 5.376996994018555,
126
+ "step": 240
127
+ },
128
+ {
129
+ "epoch": 0.016852039096730706,
130
+ "eval_loss": 5.037845134735107,
131
+ "eval_runtime": 21.089,
132
+ "eval_samples_per_second": 451.753,
133
+ "eval_steps_per_second": 3.556,
134
+ "step": 250
135
+ },
136
+ {
137
+ "epoch": 0.01752612066059993,
138
+ "grad_norm": 0.298828125,
139
+ "learning_rate": 0.005,
140
+ "loss": 5.0486492156982425,
141
+ "step": 260
142
+ },
143
+ {
144
+ "epoch": 0.01887428378833839,
145
+ "grad_norm": 0.373046875,
146
+ "learning_rate": 0.005,
147
+ "loss": 4.887042999267578,
148
+ "step": 280
149
+ },
150
+ {
151
+ "epoch": 0.020222446916076844,
152
+ "grad_norm": 0.404296875,
153
+ "learning_rate": 0.005,
154
+ "loss": 4.7291618347167965,
155
+ "step": 300
156
+ },
157
+ {
158
+ "epoch": 0.020222446916076844,
159
+ "eval_loss": 4.651667594909668,
160
+ "eval_runtime": 21.1749,
161
+ "eval_samples_per_second": 449.919,
162
+ "eval_steps_per_second": 3.542,
163
+ "step": 300
164
+ },
165
+ {
166
+ "epoch": 0.021570610043815303,
167
+ "grad_norm": 0.416015625,
168
+ "learning_rate": 0.005,
169
+ "loss": 4.579043960571289,
170
+ "step": 320
171
+ },
172
+ {
173
+ "epoch": 0.022918773171553757,
174
+ "grad_norm": 0.37890625,
175
+ "learning_rate": 0.005,
176
+ "loss": 4.4609519958496096,
177
+ "step": 340
178
+ },
179
+ {
180
+ "epoch": 0.023592854735422986,
181
+ "eval_loss": 4.355501174926758,
182
+ "eval_runtime": 21.1941,
183
+ "eval_samples_per_second": 449.513,
184
+ "eval_steps_per_second": 3.539,
185
+ "step": 350
186
+ },
187
+ {
188
+ "epoch": 0.024266936299292215,
189
+ "grad_norm": 0.3984375,
190
+ "learning_rate": 0.005,
191
+ "loss": 4.370123672485351,
192
+ "step": 360
193
+ },
194
+ {
195
+ "epoch": 0.02561509942703067,
196
+ "grad_norm": 0.390625,
197
+ "learning_rate": 0.005,
198
+ "loss": 4.307046890258789,
199
+ "step": 380
200
+ },
201
+ {
202
+ "epoch": 0.026963262554769128,
203
+ "grad_norm": 0.447265625,
204
+ "learning_rate": 0.005,
205
+ "loss": 4.20123291015625,
206
+ "step": 400
207
+ },
208
+ {
209
+ "epoch": 0.026963262554769128,
210
+ "eval_loss": 4.166988372802734,
211
+ "eval_runtime": 21.125,
212
+ "eval_samples_per_second": 450.982,
213
+ "eval_steps_per_second": 3.55,
214
+ "step": 400
215
+ },
216
+ {
217
+ "epoch": 0.028311425682507583,
218
+ "grad_norm": 0.515625,
219
+ "learning_rate": 0.005,
220
+ "loss": 4.1340187072753904,
221
+ "step": 420
222
+ },
223
+ {
224
+ "epoch": 0.02965958881024604,
225
+ "grad_norm": 0.6875,
226
+ "learning_rate": 0.005,
227
+ "loss": 4.119440078735352,
228
+ "step": 440
229
+ },
230
+ {
231
+ "epoch": 0.030333670374115267,
232
+ "eval_loss": 4.067277431488037,
233
+ "eval_runtime": 21.0533,
234
+ "eval_samples_per_second": 452.519,
235
+ "eval_steps_per_second": 3.562,
236
+ "step": 450
237
+ },
238
+ {
239
+ "epoch": 0.031007751937984496,
240
+ "grad_norm": 0.62109375,
241
+ "learning_rate": 0.005,
242
+ "loss": 4.072461318969727,
243
+ "step": 460
244
+ },
245
+ {
246
+ "epoch": 0.032355915065722954,
247
+ "grad_norm": 1.4375,
248
+ "learning_rate": 0.005,
249
+ "loss": 4.022983551025391,
250
+ "step": 480
251
+ },
252
+ {
253
+ "epoch": 0.03370407819346141,
254
+ "grad_norm": 0.7890625,
255
+ "learning_rate": 0.005,
256
+ "loss": 4.041971969604492,
257
+ "step": 500
258
+ },
259
+ {
260
+ "epoch": 0.03370407819346141,
261
+ "eval_loss": 4.022434234619141,
262
+ "eval_runtime": 21.1962,
263
+ "eval_samples_per_second": 449.468,
264
+ "eval_steps_per_second": 3.538,
265
+ "step": 500
266
+ },
267
+ {
268
+ "epoch": 0.03505224132119986,
269
+ "grad_norm": 3.0,
270
+ "learning_rate": 0.005,
271
+ "loss": 4.0136863708496096,
272
+ "step": 520
273
+ },
274
+ {
275
+ "epoch": 0.03640040444893832,
276
+ "grad_norm": 0.46484375,
277
+ "learning_rate": 0.005,
278
+ "loss": 3.9774227142333984,
279
+ "step": 540
280
+ },
281
+ {
282
+ "epoch": 0.03707448601280755,
283
+ "eval_loss": 3.9099950790405273,
284
+ "eval_runtime": 21.1739,
285
+ "eval_samples_per_second": 449.94,
286
+ "eval_steps_per_second": 3.542,
287
+ "step": 550
288
+ },
289
+ {
290
+ "epoch": 0.03774856757667678,
291
+ "grad_norm": 0.435546875,
292
+ "learning_rate": 0.005,
293
+ "loss": 3.916512298583984,
294
+ "step": 560
295
+ },
296
+ {
297
+ "epoch": 0.03909673070441524,
298
+ "grad_norm": 0.5546875,
299
+ "learning_rate": 0.005,
300
+ "loss": 3.9239063262939453,
301
+ "step": 580
302
+ },
303
+ {
304
+ "epoch": 0.04044489383215369,
305
+ "grad_norm": 0.494140625,
306
+ "learning_rate": 0.005,
307
+ "loss": 3.886766052246094,
308
+ "step": 600
309
+ },
310
+ {
311
+ "epoch": 0.04044489383215369,
312
+ "eval_loss": 3.8580801486968994,
313
+ "eval_runtime": 21.3144,
314
+ "eval_samples_per_second": 446.975,
315
+ "eval_steps_per_second": 3.519,
316
+ "step": 600
317
+ },
318
+ {
319
+ "epoch": 0.04179305695989215,
320
+ "grad_norm": 0.78515625,
321
+ "learning_rate": 0.005,
322
+ "loss": 3.851901626586914,
323
+ "step": 620
324
+ },
325
+ {
326
+ "epoch": 0.043141220087630605,
327
+ "grad_norm": 0.51953125,
328
+ "learning_rate": 0.005,
329
+ "loss": 3.8467464447021484,
330
+ "step": 640
331
+ },
332
+ {
333
+ "epoch": 0.043815301651499834,
334
+ "eval_loss": 3.7791011333465576,
335
+ "eval_runtime": 21.1038,
336
+ "eval_samples_per_second": 451.436,
337
+ "eval_steps_per_second": 3.554,
338
+ "step": 650
339
+ },
340
+ {
341
+ "epoch": 0.044489383215369056,
342
+ "grad_norm": 0.5234375,
343
+ "learning_rate": 0.005,
344
+ "loss": 3.7780517578125,
345
+ "step": 660
346
+ },
347
+ {
348
+ "epoch": 0.045837546343107514,
349
+ "grad_norm": 0.462890625,
350
+ "learning_rate": 0.005,
351
+ "loss": 3.8014129638671874,
352
+ "step": 680
353
+ },
354
+ {
355
+ "epoch": 0.04718570947084597,
356
+ "grad_norm": 1.4375,
357
+ "learning_rate": 0.005,
358
+ "loss": 3.7913097381591796,
359
+ "step": 700
360
+ },
361
+ {
362
+ "epoch": 0.04718570947084597,
363
+ "eval_loss": 3.8076748847961426,
364
+ "eval_runtime": 21.2634,
365
+ "eval_samples_per_second": 448.047,
366
+ "eval_steps_per_second": 3.527,
367
+ "step": 700
368
+ },
369
+ {
370
+ "epoch": 0.04853387259858443,
371
+ "grad_norm": 0.455078125,
372
+ "learning_rate": 0.005,
373
+ "loss": 3.7911834716796875,
374
+ "step": 720
375
+ },
376
+ {
377
+ "epoch": 0.04988203572632288,
378
+ "grad_norm": 0.70703125,
379
+ "learning_rate": 0.005,
380
+ "loss": 3.786530303955078,
381
+ "step": 740
382
+ },
383
+ {
384
+ "epoch": 0.05055611729019211,
385
+ "eval_loss": 3.783113479614258,
386
+ "eval_runtime": 21.2307,
387
+ "eval_samples_per_second": 448.738,
388
+ "eval_steps_per_second": 3.533,
389
+ "step": 750
390
+ },
391
+ {
392
+ "epoch": 0.05123019885406134,
393
+ "grad_norm": 0.59765625,
394
+ "learning_rate": 0.005,
395
+ "loss": 3.766161346435547,
396
+ "step": 760
397
+ },
398
+ {
399
+ "epoch": 0.0525783619817998,
400
+ "grad_norm": 1.4921875,
401
+ "learning_rate": 0.005,
402
+ "loss": 3.8679542541503906,
403
+ "step": 780
404
+ },
405
+ {
406
+ "epoch": 0.053926525109538256,
407
+ "grad_norm": 1.140625,
408
+ "learning_rate": 0.005,
409
+ "loss": 3.820303726196289,
410
+ "step": 800
411
+ },
412
+ {
413
+ "epoch": 0.053926525109538256,
414
+ "eval_loss": 3.8336594104766846,
415
+ "eval_runtime": 21.0369,
416
+ "eval_samples_per_second": 452.871,
417
+ "eval_steps_per_second": 3.565,
418
+ "step": 800
419
+ },
420
+ {
421
+ "epoch": 0.05527468823727671,
422
+ "grad_norm": 3.078125,
423
+ "learning_rate": 0.005,
424
+ "loss": 3.9229141235351563,
425
+ "step": 820
426
+ },
427
+ {
428
+ "epoch": 0.056622851365015166,
429
+ "grad_norm": 0.8359375,
430
+ "learning_rate": 0.005,
431
+ "loss": 3.974406051635742,
432
+ "step": 840
433
+ },
434
+ {
435
+ "epoch": 0.057296932928884395,
436
+ "eval_loss": 4.010101318359375,
437
+ "eval_runtime": 21.2469,
438
+ "eval_samples_per_second": 448.394,
439
+ "eval_steps_per_second": 3.53,
440
+ "step": 850
441
+ },
442
+ {
443
+ "epoch": 0.057971014492753624,
444
+ "grad_norm": 1.3984375,
445
+ "learning_rate": 0.005,
446
+ "loss": 4.004122543334961,
447
+ "step": 860
448
+ },
449
+ {
450
+ "epoch": 0.05931917762049208,
451
+ "grad_norm": 1.46875,
452
+ "learning_rate": 0.005,
453
+ "loss": 4.010852432250976,
454
+ "step": 880
455
+ },
456
+ {
457
+ "epoch": 0.06066734074823053,
458
+ "grad_norm": 1.671875,
459
+ "learning_rate": 0.005,
460
+ "loss": 4.027272796630859,
461
+ "step": 900
462
+ },
463
+ {
464
+ "epoch": 0.06066734074823053,
465
+ "eval_loss": 4.2301554679870605,
466
+ "eval_runtime": 21.1781,
467
+ "eval_samples_per_second": 449.851,
468
+ "eval_steps_per_second": 3.541,
469
+ "step": 900
470
+ },
471
+ {
472
+ "epoch": 0.06201550387596899,
473
+ "grad_norm": 2.25,
474
+ "learning_rate": 0.005,
475
+ "loss": 4.1036529541015625,
476
+ "step": 920
477
+ },
478
+ {
479
+ "epoch": 0.06336366700370745,
480
+ "grad_norm": 1.6328125,
481
+ "learning_rate": 0.005,
482
+ "loss": 4.183735656738281,
483
+ "step": 940
484
+ },
485
+ {
486
+ "epoch": 0.06403774856757667,
487
+ "eval_loss": 4.2052483558654785,
488
+ "eval_runtime": 21.0112,
489
+ "eval_samples_per_second": 453.425,
490
+ "eval_steps_per_second": 3.57,
491
+ "step": 950
492
+ },
493
+ {
494
+ "epoch": 0.06471183013144591,
495
+ "grad_norm": 1.5078125,
496
+ "learning_rate": 0.005,
497
+ "loss": 4.163127899169922,
498
+ "step": 960
499
+ },
500
+ {
501
+ "epoch": 0.06605999325918437,
502
+ "grad_norm": 1.84375,
503
+ "learning_rate": 0.005,
504
+ "loss": 4.166858291625976,
505
+ "step": 980
506
+ },
507
+ {
508
+ "epoch": 0.06740815638692282,
509
+ "grad_norm": 1.4296875,
510
+ "learning_rate": 0.005,
511
+ "loss": 4.1427558898925785,
512
+ "step": 1000
513
+ },
514
+ {
515
+ "epoch": 0.06740815638692282,
516
+ "eval_loss": 4.123730659484863,
517
+ "eval_runtime": 21.1825,
518
+ "eval_samples_per_second": 449.759,
519
+ "eval_steps_per_second": 3.541,
520
+ "step": 1000
521
+ }
522
+ ],
523
+ "logging_steps": 20,
524
+ "max_steps": 1000,
525
+ "num_input_tokens_seen": 0,
526
+ "num_train_epochs": 1,
527
+ "save_steps": 1000,
528
+ "stateful_callbacks": {
529
+ "TrainerControl": {
530
+ "args": {
531
+ "should_epoch_stop": false,
532
+ "should_evaluate": false,
533
+ "should_log": false,
534
+ "should_save": true,
535
+ "should_training_stop": true
536
+ },
537
+ "attributes": {}
538
+ }
539
+ },
540
+ "total_flos": 4839413121024000.0,
541
+ "train_batch_size": 64,
542
+ "trial_name": null,
543
+ "trial_params": null
544
+ }
zain/Activation/out/glu-relu-150L_run/checkpoint-1000/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ce5601cb1d765f72452322314a16a412136c90a598f703356047035624bc3e5
3
+ size 4920
zain/Activation/out/glu-relu-150L_run/config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation": "relu",
3
+ "architectures": [
4
+ "TinyLlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "dtype": "bfloat16",
10
+ "eos_token_id": 2,
11
+ "head_dim": 32,
12
+ "hidden_act": "silu",
13
+ "hidden_size": 128,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 256,
16
+ "max_position_embeddings": 512,
17
+ "mlp_bias": false,
18
+ "mlp_type": "glu",
19
+ "model_type": "tiny_llama",
20
+ "num_attention_heads": 4,
21
+ "num_hidden_layers": 150,
22
+ "num_key_value_heads": 4,
23
+ "pad_token_id": 0,
24
+ "pretraining_tp": 1,
25
+ "rms_norm_eps": 1e-06,
26
+ "rope_parameters": {
27
+ "rope_theta": 10000.0,
28
+ "rope_type": "default"
29
+ },
30
+ "tie_word_embeddings": true,
31
+ "tokenizer_name": "w-ahmad/tiny-stories-tokenizer",
32
+ "transformers_version": "5.16.0.dev0",
33
+ "use_cache": false,
34
+ "vocab_size": 4096,
35
+ "waleed_beta": 10.0
36
+ }
zain/Activation/out/glu-relu-150L_run/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6035bf7964d463a92160083594168bbcb3e076204e33db15468d64c342a71de
3
+ size 50427120
zain/Activation/out/glu-relu-150L_run/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
zain/Activation/out/glu-relu-150L_run/tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "eos_token": "<|endoftext|>",
6
+ "errors": "replace",
7
+ "is_local": false,
8
+ "local_files_only": false,
9
+ "model_max_length": 1024,
10
+ "pad_token": "<|endoftext|>",
11
+ "tokenizer_class": "GPT2Tokenizer",
12
+ "unk_token": "<|endoftext|>"
13
+ }
zain/Activation/out/glu-relu-150L_run/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9ce5601cb1d765f72452322314a16a412136c90a598f703356047035624bc3e5
3
+ size 4920
zain/Activation/out/glu-relu-150L_run/training_log.jsonl ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"step": 20, "epoch": 0.0013481631277384564, "timestamp": 1786558042.565657, "loss": 7.964384460449219, "grad_norm": 1.296875, "learning_rate": 0.000475, "train/total_time_seconds": 7.479156076908112, "train/time_per_step_avg": 0.37395780384540556, "train/epoch_time_elapsed": 8.524832468479872, "train/estimated_remaining_minutes": 6.107977462808291}
2
+ {"step": 40, "epoch": 0.002696326255476913, "timestamp": 1786558050.5149207, "loss": 6.8277839660644535, "grad_norm": 0.8671875, "learning_rate": 0.0009750000000000001, "train/total_time_seconds": 14.462965689599514, "train/time_per_step_avg": 0.36157414223998785, "train/epoch_time_elapsed": 16.474097702652216, "train/estimated_remaining_minutes": 5.785186275839806}
3
+ {"step": 50, "epoch": 0.003370407819346141, "timestamp": 1786558075.5407507, "eval_loss": 6.035980701446533, "eval_runtime": 21.045, "eval_samples_per_second": 452.697, "eval_steps_per_second": 3.564, "train/total_time_seconds": 17.960122998803854, "train/time_per_step_avg": 0.3592024599760771, "train/epoch_time_elapsed": 41.49992706999183, "train/estimated_remaining_minutes": 5.687372282954554}
4
+ {"step": 60, "epoch": 0.004044489383215369, "timestamp": 1786558079.519231, "loss": 6.076027679443359, "grad_norm": 0.20703125, "learning_rate": 0.001475, "train/total_time_seconds": 21.45620109140873, "train/time_per_step_avg": 0.35760335152347883, "train/epoch_time_elapsed": 45.478407979011536, "train/estimated_remaining_minutes": 5.602452507201168}
5
+ {"step": 80, "epoch": 0.005392652510953826, "timestamp": 1786558087.4979699, "loss": 6.007006454467773, "grad_norm": 0.193359375, "learning_rate": 0.001975, "train/total_time_seconds": 28.471343249082565, "train/time_per_step_avg": 0.35589179061353204, "train/epoch_time_elapsed": 53.457146506756544, "train/estimated_remaining_minutes": 5.457007456074158}
6
+ {"step": 100, "epoch": 0.006740815638692282, "timestamp": 1786558095.48223, "loss": 5.9332275390625, "grad_norm": 0.79296875, "learning_rate": 0.002475, "train/total_time_seconds": 35.47478394955397, "train/time_per_step_avg": 0.3547478394955397, "train/epoch_time_elapsed": 61.44140635803342, "train/estimated_remaining_minutes": 5.321217592433095}
7
+ {"step": 100, "epoch": 0.006740815638692282, "timestamp": 1786558116.5845, "eval_loss": 5.939233303070068, "eval_runtime": 21.1007, "eval_samples_per_second": 451.501, "eval_steps_per_second": 3.554, "train/total_time_seconds": 35.47478394955397, "train/time_per_step_avg": 0.3547478394955397, "train/epoch_time_elapsed": 82.54367513209581, "train/estimated_remaining_minutes": 5.321217592433095}
8
+ {"step": 120, "epoch": 0.008088978766430738, "timestamp": 1786558124.596924, "loss": 5.783406066894531, "grad_norm": 0.2255859375, "learning_rate": 0.0029749999999999998, "train/total_time_seconds": 42.49194718524814, "train/time_per_step_avg": 0.35012791108340025, "train/epoch_time_elapsed": 90.55610039830208, "train/estimated_remaining_minutes": 5.193460211530327}
9
+ {"step": 140, "epoch": 0.009437141894169195, "timestamp": 1786558132.8711853, "loss": 5.675531005859375, "grad_norm": 0.703125, "learning_rate": 0.003475, "train/total_time_seconds": 49.799739610403776, "train/time_per_step_avg": 0.3533677392080426, "train/epoch_time_elapsed": 98.83036207780242, "train/estimated_remaining_minutes": 5.098544769636577}
10
+ {"step": 150, "epoch": 0.010111223458038422, "timestamp": 1786558158.2318413, "eval_loss": 5.526480674743652, "eval_runtime": 21.379, "eval_samples_per_second": 445.624, "eval_steps_per_second": 3.508, "train/total_time_seconds": 53.29423313960433, "train/time_per_step_avg": 0.3533411014080048, "train/epoch_time_elapsed": 124.1910157725215, "train/estimated_remaining_minutes": 5.033344240962632}
11
+ {"step": 160, "epoch": 0.010785305021907651, "timestamp": 1786558162.2187576, "loss": 5.528359603881836, "grad_norm": 0.1943359375, "learning_rate": 0.003975, "train/total_time_seconds": 56.78381925448775, "train/time_per_step_avg": 0.3532761816307902, "train/epoch_time_elapsed": 128.17793262004852, "train/estimated_remaining_minutes": 4.968584184767678}
12
+ {"step": 180, "epoch": 0.012133468149646108, "timestamp": 1786558170.192914, "loss": 5.462315368652344, "grad_norm": 0.2392578125, "learning_rate": 0.004475, "train/total_time_seconds": 63.79622644558549, "train/time_per_step_avg": 0.35324883196502926, "train/epoch_time_elapsed": 136.1520889699459, "train/estimated_remaining_minutes": 4.84378756346112}
13
+ {"step": 200, "epoch": 0.013481631277384564, "timestamp": 1786558178.19487, "loss": 5.351004028320313, "grad_norm": 0.33203125, "learning_rate": 0.004975, "train/total_time_seconds": 70.81487478688359, "train/time_per_step_avg": 0.35340090837329624, "train/epoch_time_elapsed": 144.15404615923762, "train/estimated_remaining_minutes": 4.720991652458906}
14
+ {"step": 200, "epoch": 0.013481631277384564, "timestamp": 1786558199.4460309, "eval_loss": 5.25657844543457, "eval_runtime": 21.2496, "eval_samples_per_second": 448.338, "eval_steps_per_second": 3.529, "train/total_time_seconds": 70.81487478688359, "train/time_per_step_avg": 0.35340090837329624, "train/epoch_time_elapsed": 165.40520602837205, "train/estimated_remaining_minutes": 4.720991652458906}
15
+ {"step": 220, "epoch": 0.01482979440512302, "timestamp": 1786558207.49547, "loss": 5.367509841918945, "grad_norm": 1.3125, "learning_rate": 0.005, "train/total_time_seconds": 77.85458770766854, "train/time_per_step_avg": 0.3536264052242041, "train/epoch_time_elapsed": 173.45464695617557, "train/estimated_remaining_minutes": 4.60049836454405}
16
+ {"step": 240, "epoch": 0.016177957532861477, "timestamp": 1786558215.5625825, "loss": 5.376996994018555, "grad_norm": 0.255859375, "learning_rate": 0.005, "train/total_time_seconds": 84.92369622737169, "train/time_per_step_avg": 0.35123956616967916, "train/epoch_time_elapsed": 181.5217593461275, "train/estimated_remaining_minutes": 4.482083967555728}
17
+ {"step": 250, "epoch": 0.016852039096730706, "timestamp": 1786558240.6273065, "eval_loss": 5.037845134735107, "eval_runtime": 21.089, "eval_samples_per_second": 451.753, "eval_steps_per_second": 3.556, "train/total_time_seconds": 88.41916769742966, "train/time_per_step_avg": 0.35124934557825327, "train/epoch_time_elapsed": 206.5864817649126, "train/estimated_remaining_minutes": 4.420958384871483}
18
+ {"step": 260, "epoch": 0.01752612066059993, "timestamp": 1786558244.673984, "loss": 5.0486492156982425, "grad_norm": 0.298828125, "learning_rate": 0.005, "train/total_time_seconds": 91.93673975765705, "train/time_per_step_avg": 0.351529205031693, "train/epoch_time_elapsed": 210.63316006585956, "train/estimated_remaining_minutes": 4.361101757735014}
19
+ {"step": 280, "epoch": 0.01887428378833839, "timestamp": 1786558252.9377697, "loss": 4.887042999267578, "grad_norm": 0.373046875, "learning_rate": 0.005, "train/total_time_seconds": 99.2333196401596, "train/time_per_step_avg": 0.35437093194574115, "train/epoch_time_elapsed": 218.89694626629353, "train/estimated_remaining_minutes": 4.25285655600684}
20
+ {"step": 300, "epoch": 0.020222446916076844, "timestamp": 1786558260.8977244, "loss": 4.7291618347167965, "grad_norm": 0.404296875, "learning_rate": 0.005, "train/total_time_seconds": 106.21757336333394, "train/time_per_step_avg": 0.3540269857645035, "train/epoch_time_elapsed": 226.85690063610673, "train/estimated_remaining_minutes": 4.1306834085740975}
21
+ {"step": 300, "epoch": 0.020222446916076844, "timestamp": 1786558282.0742264, "eval_loss": 4.651667594909668, "eval_runtime": 21.1749, "eval_samples_per_second": 449.919, "eval_steps_per_second": 3.542, "train/total_time_seconds": 106.21757336333394, "train/time_per_step_avg": 0.3540269857645035, "train/epoch_time_elapsed": 248.03340182080865, "train/estimated_remaining_minutes": 4.1306834085740975}
22
+ {"step": 320, "epoch": 0.021570610043815303, "timestamp": 1786558290.040653, "loss": 4.579043960571289, "grad_norm": 0.416015625, "learning_rate": 0.005, "train/total_time_seconds": 113.2087592817843, "train/time_per_step_avg": 0.35354171574115756, "train/epoch_time_elapsed": 255.99982998892665, "train/estimated_remaining_minutes": 4.009476891229861}
23
+ {"step": 340, "epoch": 0.022918773171553757, "timestamp": 1786558298.1039598, "loss": 4.4609519958496096, "grad_norm": 0.37890625, "learning_rate": 0.005, "train/total_time_seconds": 120.27493808791041, "train/time_per_step_avg": 0.35351241860538724, "train/epoch_time_elapsed": 264.0631362423301, "train/estimated_remaining_minutes": 3.8912479969618077}
24
+ {"step": 350, "epoch": 0.023592854735422986, "timestamp": 1786558323.2715254, "eval_loss": 4.355501174926758, "eval_runtime": 21.1941, "eval_samples_per_second": 449.513, "eval_steps_per_second": 3.539, "train/total_time_seconds": 123.76323676109314, "train/time_per_step_avg": 0.3534406906366348, "train/epoch_time_elapsed": 289.2306997999549, "train/estimated_remaining_minutes": 3.830766852129073}
25
+ {"step": 360, "epoch": 0.024266936299292215, "timestamp": 1786558327.2571225, "loss": 4.370123672485351, "grad_norm": 0.3984375, "learning_rate": 0.005, "train/total_time_seconds": 127.26498315483332, "train/time_per_step_avg": 0.3532824339717627, "train/epoch_time_elapsed": 293.2162990421057, "train/estimated_remaining_minutes": 3.770814315698765}
26
+ {"step": 380, "epoch": 0.02561509942703067, "timestamp": 1786558335.3185263, "loss": 4.307046890258789, "grad_norm": 0.390625, "learning_rate": 0.005, "train/total_time_seconds": 134.31174723431468, "train/time_per_step_avg": 0.3507842759415507, "train/epoch_time_elapsed": 301.27770306915045, "train/estimated_remaining_minutes": 3.6523369861962762}
27
+ {"step": 400, "epoch": 0.026963262554769128, "timestamp": 1786558343.6275973, "loss": 4.20123291015625, "grad_norm": 0.447265625, "learning_rate": 0.005, "train/total_time_seconds": 141.64740459993482, "train/time_per_step_avg": 0.3542983123660088, "train/epoch_time_elapsed": 309.58677385374904, "train/estimated_remaining_minutes": 3.5411851149983704}
28
+ {"step": 400, "epoch": 0.026963262554769128, "timestamp": 1786558364.7541769, "eval_loss": 4.166988372802734, "eval_runtime": 21.125, "eval_samples_per_second": 450.982, "eval_steps_per_second": 3.55, "train/total_time_seconds": 141.64740459993482, "train/time_per_step_avg": 0.3542983123660088, "train/epoch_time_elapsed": 330.71335170790553, "train/estimated_remaining_minutes": 3.5411851149983704}
29
+ {"step": 420, "epoch": 0.028311425682507583, "timestamp": 1786558372.7547848, "loss": 4.1340187072753904, "grad_norm": 0.515625, "learning_rate": 0.005, "train/total_time_seconds": 148.66470146924257, "train/time_per_step_avg": 0.3545594218745828, "train/epoch_time_elapsed": 338.7139613032341, "train/estimated_remaining_minutes": 3.421647890958758}
30
+ {"step": 440, "epoch": 0.02965958881024604, "timestamp": 1786558380.761076, "loss": 4.119440078735352, "grad_norm": 0.6875, "learning_rate": 0.005, "train/total_time_seconds": 155.69208113476634, "train/time_per_step_avg": 0.35417143046855926, "train/epoch_time_elapsed": 346.72025215625763, "train/estimated_remaining_minutes": 3.3025592967980737}
31
+ {"step": 450, "epoch": 0.030333670374115267, "timestamp": 1786558405.7770348, "eval_loss": 4.067277431488037, "eval_runtime": 21.0533, "eval_samples_per_second": 452.519, "eval_steps_per_second": 3.562, "train/total_time_seconds": 159.17676619067788, "train/time_per_step_avg": 0.3541352942958474, "train/epoch_time_elapsed": 371.73621083050966, "train/estimated_remaining_minutes": 3.242489681661957}
32
+ {"step": 460, "epoch": 0.031007751937984496, "timestamp": 1786558409.7575188, "loss": 4.072461318969727, "grad_norm": 0.62109375, "learning_rate": 0.005, "train/total_time_seconds": 162.67413600161672, "train/time_per_step_avg": 0.354091528467834, "train/epoch_time_elapsed": 375.7166953384876, "train/estimated_remaining_minutes": 3.18275483481424}
33
+ {"step": 480, "epoch": 0.032355915065722954, "timestamp": 1786558417.6906242, "loss": 4.022983551025391, "grad_norm": 1.4375, "learning_rate": 0.005, "train/total_time_seconds": 169.6476893760264, "train/time_per_step_avg": 0.3533594214171171, "train/epoch_time_elapsed": 383.6498010158539, "train/estimated_remaining_minutes": 3.0630832804004764}
34
+ {"step": 500, "epoch": 0.03370407819346141, "timestamp": 1786558425.6347263, "loss": 4.041971969604492, "grad_norm": 0.7890625, "learning_rate": 0.005, "train/total_time_seconds": 176.62393491342664, "train/time_per_step_avg": 0.3497653031349182, "train/epoch_time_elapsed": 391.59390341863036, "train/estimated_remaining_minutes": 2.9437322485571107}
35
+ {"step": 500, "epoch": 0.03370407819346141, "timestamp": 1786558446.8324366, "eval_loss": 4.022434234619141, "eval_runtime": 21.1962, "eval_samples_per_second": 449.468, "eval_steps_per_second": 3.538, "train/total_time_seconds": 176.62393491342664, "train/time_per_step_avg": 0.3497653031349182, "train/epoch_time_elapsed": 412.7916120700538, "train/estimated_remaining_minutes": 2.9437322485571107}
36
+ {"step": 520, "epoch": 0.03505224132119986, "timestamp": 1786558455.0041444, "loss": 4.0136863708496096, "grad_norm": 3.0, "learning_rate": 0.005, "train/total_time_seconds": 183.8067372404039, "train/time_per_step_avg": 0.3514203577116132, "train/epoch_time_elapsed": 420.963321775198, "train/estimated_remaining_minutes": 2.827795957544675}
37
+ {"step": 540, "epoch": 0.03640040444893832, "timestamp": 1786558463.4831052, "loss": 3.9774227142333984, "grad_norm": 0.46484375, "learning_rate": 0.005, "train/total_time_seconds": 191.26865224540234, "train/time_per_step_avg": 0.35576571110635996, "train/epoch_time_elapsed": 429.4422825425863, "train/estimated_remaining_minutes": 2.715542593607564}
38
+ {"step": 550, "epoch": 0.03707448601280755, "timestamp": 1786558488.7636483, "eval_loss": 3.9099950790405273, "eval_runtime": 21.1739, "eval_samples_per_second": 449.94, "eval_steps_per_second": 3.542, "train/total_time_seconds": 194.88533645495772, "train/time_per_step_avg": 0.35708570264279843, "train/epoch_time_elapsed": 454.72282434627414, "train/estimated_remaining_minutes": 2.657527315294878}
39
+ {"step": 560, "epoch": 0.03774856757667678, "timestamp": 1786558492.8987718, "loss": 3.916512298583984, "grad_norm": 0.435546875, "learning_rate": 0.005, "train/total_time_seconds": 198.52793854102492, "train/time_per_step_avg": 0.3585380253940821, "train/epoch_time_elapsed": 458.85794903337955, "train/estimated_remaining_minutes": 2.599770623751517}
40
+ {"step": 580, "epoch": 0.03909673070441524, "timestamp": 1786558501.1090071, "loss": 3.9239063262939453, "grad_norm": 0.5546875, "learning_rate": 0.005, "train/total_time_seconds": 205.76045013964176, "train/time_per_step_avg": 0.3611276076361537, "train/epoch_time_elapsed": 467.0681842379272, "train/estimated_remaining_minutes": 2.483315777547401}
41
+ {"step": 600, "epoch": 0.04044489383215369, "timestamp": 1786558509.3264072, "loss": 3.886766052246094, "grad_norm": 0.494140625, "learning_rate": 0.005, "train/total_time_seconds": 212.9962049201131, "train/time_per_step_avg": 0.36372270006686447, "train/epoch_time_elapsed": 475.2855847887695, "train/estimated_remaining_minutes": 2.3666244991123677}
42
+ {"step": 600, "epoch": 0.04044489383215369, "timestamp": 1786558530.642233, "eval_loss": 3.8580801486968994, "eval_runtime": 21.3144, "eval_samples_per_second": 446.975, "eval_steps_per_second": 3.519, "train/total_time_seconds": 212.9962049201131, "train/time_per_step_avg": 0.36372270006686447, "train/epoch_time_elapsed": 496.60140960663557, "train/estimated_remaining_minutes": 2.3666244991123677}
43
+ {"step": 620, "epoch": 0.04179305695989215, "timestamp": 1786558538.7886603, "loss": 3.851901626586914, "grad_norm": 0.78515625, "learning_rate": 0.005, "train/total_time_seconds": 220.16741828620434, "train/time_per_step_avg": 0.36360681045800447, "train/epoch_time_elapsed": 504.7478371486068, "train/estimated_remaining_minutes": 2.24902201475155}
44
+ {"step": 640, "epoch": 0.043141220087630605, "timestamp": 1786558546.9965365, "loss": 3.8467464447021484, "grad_norm": 0.51953125, "learning_rate": 0.005, "train/total_time_seconds": 227.3981082253158, "train/time_per_step_avg": 0.3612945597991347, "train/epoch_time_elapsed": 512.9557139910758, "train/estimated_remaining_minutes": 2.1318572646123357}
45
+ {"step": 650, "epoch": 0.043815301651499834, "timestamp": 1786558572.2321274, "eval_loss": 3.7791011333465576, "eval_runtime": 21.1038, "eval_samples_per_second": 451.436, "eval_steps_per_second": 3.554, "train/total_time_seconds": 231.0267353616655, "train/time_per_step_avg": 0.3614139890670776, "train/epoch_time_elapsed": 538.1913029253483, "train/estimated_remaining_minutes": 2.0733168558098187}
46
+ {"step": 660, "epoch": 0.044489383215369056, "timestamp": 1786558576.3355627, "loss": 3.7780517578125, "grad_norm": 0.5234375, "learning_rate": 0.005, "train/total_time_seconds": 234.64380882307887, "train/time_per_step_avg": 0.36115870282053947, "train/epoch_time_elapsed": 542.2947395294905, "train/estimated_remaining_minutes": 2.0146185606021922}
47
+ {"step": 680, "epoch": 0.045837546343107514, "timestamp": 1786558584.7434273, "loss": 3.8014129638671874, "grad_norm": 0.462890625, "learning_rate": 0.005, "train/total_time_seconds": 242.05922985076904, "train/time_per_step_avg": 0.3629877971112728, "train/epoch_time_elapsed": 550.702604662627, "train/estimated_remaining_minutes": 1.8985037635354436}
48
+ {"step": 700, "epoch": 0.04718570947084597, "timestamp": 1786558592.9433744, "loss": 3.7913097381591796, "grad_norm": 1.4375, "learning_rate": 0.005, "train/total_time_seconds": 249.2656230814755, "train/time_per_step_avg": 0.3626941816136241, "train/epoch_time_elapsed": 558.9025516286492, "train/estimated_remaining_minutes": 1.7804687362962535}
49
+ {"step": 700, "epoch": 0.04718570947084597, "timestamp": 1786558614.2083035, "eval_loss": 3.8076748847961426, "eval_runtime": 21.2634, "eval_samples_per_second": 448.047, "eval_steps_per_second": 3.527, "train/total_time_seconds": 249.2656230814755, "train/time_per_step_avg": 0.3626941816136241, "train/epoch_time_elapsed": 580.1674793735147, "train/estimated_remaining_minutes": 1.7804687362962535}
50
+ {"step": 720, "epoch": 0.04853387259858443, "timestamp": 1786558622.484525, "loss": 3.7911834716796875, "grad_norm": 0.455078125, "learning_rate": 0.005, "train/total_time_seconds": 256.5397740714252, "train/time_per_step_avg": 0.3637235578522086, "train/epoch_time_elapsed": 588.4437025524676, "train/estimated_remaining_minutes": 1.6627577949073855}
51
+ {"step": 740, "epoch": 0.04988203572632288, "timestamp": 1786558630.6349056, "loss": 3.786530303955078, "grad_norm": 0.70703125, "learning_rate": 0.005, "train/total_time_seconds": 263.719080761075, "train/time_per_step_avg": 0.3632097253575921, "train/epoch_time_elapsed": 596.5940828919411, "train/estimated_remaining_minutes": 1.5443009233756646}
52
+ {"step": 750, "epoch": 0.05055611729019211, "timestamp": 1786558655.9304035, "eval_loss": 3.783113479614258, "eval_runtime": 21.2307, "eval_samples_per_second": 448.738, "eval_steps_per_second": 3.533, "train/total_time_seconds": 267.30078534036875, "train/time_per_step_avg": 0.3627404997870326, "train/epoch_time_elapsed": 621.8895792737603, "train/estimated_remaining_minutes": 1.4850043630020484}
53
+ {"step": 760, "epoch": 0.05123019885406134, "timestamp": 1786558659.9095356, "loss": 3.766161346435547, "grad_norm": 0.59765625, "learning_rate": 0.005, "train/total_time_seconds": 270.7942376807332, "train/time_per_step_avg": 0.3615042885765433, "train/epoch_time_elapsed": 625.8687125109136, "train/estimated_remaining_minutes": 1.425232829898596}
54
+ {"step": 780, "epoch": 0.0525783619817998, "timestamp": 1786558667.869698, "loss": 3.8679542541503906, "grad_norm": 1.4921875, "learning_rate": 0.005, "train/total_time_seconds": 277.78589740768075, "train/time_per_step_avg": 0.35726667556911706, "train/epoch_time_elapsed": 633.8288739770651, "train/estimated_remaining_minutes": 1.3058311416600377}
55
+ {"step": 800, "epoch": 0.053926525109538256, "timestamp": 1786558675.8750415, "loss": 3.820303726196289, "grad_norm": 1.140625, "learning_rate": 0.005, "train/total_time_seconds": 284.8019813261926, "train/time_per_step_avg": 0.3553635824471712, "train/epoch_time_elapsed": 641.8342174440622, "train/estimated_remaining_minutes": 1.1866749221924693}
56
+ {"step": 800, "epoch": 0.053926525109538256, "timestamp": 1786558696.9135675, "eval_loss": 3.8336594104766846, "eval_runtime": 21.0369, "eval_samples_per_second": 452.871, "eval_steps_per_second": 3.565, "train/total_time_seconds": 284.8019813261926, "train/time_per_step_avg": 0.3553635824471712, "train/epoch_time_elapsed": 662.8727425672114, "train/estimated_remaining_minutes": 1.1866749221924693}
57
+ {"step": 820, "epoch": 0.05527468823727671, "timestamp": 1786558705.2758486, "loss": 3.9229141235351563, "grad_norm": 3.078125, "learning_rate": 0.005, "train/total_time_seconds": 292.17277770489454, "train/time_per_step_avg": 0.35633003633469346, "train/epoch_time_elapsed": 671.2350256331265, "train/estimated_remaining_minutes": 1.0689247964813215}
58
+ {"step": 840, "epoch": 0.056622851365015166, "timestamp": 1786558713.3453393, "loss": 3.974406051635742, "grad_norm": 0.8359375, "learning_rate": 0.005, "train/total_time_seconds": 299.2718831561506, "train/time_per_step_avg": 0.3555280239507556, "train/epoch_time_elapsed": 679.3045146428049, "train/estimated_remaining_minutes": 0.950069470336986}
59
+ {"step": 850, "epoch": 0.057296932928884395, "timestamp": 1786558738.5791726, "eval_loss": 4.010101318359375, "eval_runtime": 21.2469, "eval_samples_per_second": 448.394, "eval_steps_per_second": 3.53, "train/total_time_seconds": 302.77213901653886, "train/time_per_step_avg": 0.3547135367617011, "train/epoch_time_elapsed": 704.5383482053876, "train/estimated_remaining_minutes": 0.8905062912251142}
60
+ {"step": 860, "epoch": 0.057971014492753624, "timestamp": 1786558742.6643817, "loss": 4.004122543334961, "grad_norm": 1.3984375, "learning_rate": 0.005, "train/total_time_seconds": 306.37070309743285, "train/time_per_step_avg": 0.3557646541669965, "train/epoch_time_elapsed": 708.6235591545701, "train/estimated_remaining_minutes": 0.8312383417372209}
61
+ {"step": 880, "epoch": 0.05931917762049208, "timestamp": 1786558750.841112, "loss": 4.010852432250976, "grad_norm": 1.46875, "learning_rate": 0.005, "train/total_time_seconds": 313.57940961420536, "train/time_per_step_avg": 0.3579351220652461, "train/epoch_time_elapsed": 716.8002890385687, "train/estimated_remaining_minutes": 0.7126804763959212}
62
+ {"step": 900, "epoch": 0.06066734074823053, "timestamp": 1786558759.0011556, "loss": 4.027272796630859, "grad_norm": 1.671875, "learning_rate": 0.005, "train/total_time_seconds": 320.76208513975143, "train/time_per_step_avg": 0.3596010381355882, "train/epoch_time_elapsed": 724.9603324122727, "train/estimated_remaining_minutes": 0.59400386136991}
63
+ {"step": 900, "epoch": 0.06066734074823053, "timestamp": 1786558780.1807094, "eval_loss": 4.2301554679870605, "eval_runtime": 21.1781, "eval_samples_per_second": 449.851, "eval_steps_per_second": 3.541, "train/total_time_seconds": 320.76208513975143, "train/time_per_step_avg": 0.3596010381355882, "train/epoch_time_elapsed": 746.1398853138089, "train/estimated_remaining_minutes": 0.59400386136991}
64
+ {"step": 920, "epoch": 0.06201550387596899, "timestamp": 1786558788.2090843, "loss": 4.1036529541015625, "grad_norm": 2.25, "learning_rate": 0.005, "train/total_time_seconds": 327.8070343770087, "train/time_per_step_avg": 0.35634256672114134, "train/epoch_time_elapsed": 754.1682606600225, "train/estimated_remaining_minutes": 0.4750826585174039}
65
+ {"step": 940, "epoch": 0.06336366700370745, "timestamp": 1786558796.2388895, "loss": 4.183735656738281, "grad_norm": 1.6328125, "learning_rate": 0.005, "train/total_time_seconds": 334.84725157916546, "train/time_per_step_avg": 0.3557536842301488, "train/epoch_time_elapsed": 762.1980660632253, "train/estimated_remaining_minutes": 0.3562204804033675}
66
+ {"step": 950, "epoch": 0.06403774856757667, "timestamp": 1786558821.6363292, "eval_loss": 4.2052483558654785, "eval_runtime": 21.0112, "eval_samples_per_second": 453.425, "eval_steps_per_second": 3.57, "train/total_time_seconds": 338.7223717160523, "train/time_per_step_avg": 0.35950232699513435, "train/epoch_time_elapsed": 787.5955048166215, "train/estimated_remaining_minutes": 0.29712488747022126}
67
+ {"step": 960, "epoch": 0.06471183013144591, "timestamp": 1786558825.6111045, "loss": 4.163127899169922, "grad_norm": 1.5078125, "learning_rate": 0.005, "train/total_time_seconds": 342.21410282701254, "train/time_per_step_avg": 0.3584339972957969, "train/epoch_time_elapsed": 791.570281419903, "train/estimated_remaining_minutes": 0.23764868251875867}
68
+ {"step": 980, "epoch": 0.06605999325918437, "timestamp": 1786558833.5979323, "loss": 4.166858291625976, "grad_norm": 1.84375, "learning_rate": 0.005, "train/total_time_seconds": 349.22664188221097, "train/time_per_step_avg": 0.3564723226800561, "train/epoch_time_elapsed": 799.5571090690792, "train/estimated_remaining_minutes": 0.11878457206877924}
69
+ {"step": 1000, "epoch": 0.06740815638692282, "timestamp": 1786558841.5874877, "loss": 4.1427558898925785, "grad_norm": 1.4296875, "learning_rate": 0.005, "train/total_time_seconds": 356.23444191366434, "train/time_per_step_avg": 0.35472356773912905, "train/epoch_time_elapsed": 807.5466644875705, "train/estimated_remaining_minutes": 0.0}
70
+ {"step": 1000, "epoch": 0.06740815638692282, "timestamp": 1786558862.7715588, "eval_loss": 4.123730659484863, "eval_runtime": 21.1825, "eval_samples_per_second": 449.759, "eval_steps_per_second": 3.541, "train/total_time_seconds": 356.23444191366434, "train/time_per_step_avg": 0.35472356773912905, "train/epoch_time_elapsed": 828.7307346388698, "train/estimated_remaining_minutes": 0.0}
71
+ {"step": 1000, "epoch": 0.06740815638692282, "timestamp": 1786558863.2290063, "train_runtime": 829.8809, "train_samples_per_second": 77.12, "train_steps_per_second": 1.205, "total_flos": 4839413121024000.0, "train_loss": 4.536944602966309, "train/total_time_seconds": 356.23444191366434, "train/time_per_step_avg": 0.35472356773912905, "train/epoch_time_elapsed": 829.1881820075214, "train/estimated_remaining_minutes": 0.0}
72
+ {"step": 1000, "epoch": 0.06740815638692282, "timestamp": 1786558884.299808, "eval_loss": 4.123730659484863, "eval_runtime": 21.0674, "eval_samples_per_second": 452.215, "eval_steps_per_second": 3.56, "train/total_time_seconds": 356.23444191366434, "train/time_per_step_avg": 0.35472356773912905, "train/epoch_time_elapsed": 850.2589839994907, "train/estimated_remaining_minutes": 0.0}
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation": "silu",
3
+ "architectures": [
4
+ "TinyLlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "dtype": "bfloat16",
10
+ "eos_token_id": 2,
11
+ "head_dim": 32,
12
+ "hidden_act": "silu",
13
+ "hidden_size": 128,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 256,
16
+ "max_position_embeddings": 512,
17
+ "mlp_bias": false,
18
+ "mlp_type": "glu",
19
+ "model_type": "tiny_llama",
20
+ "num_attention_heads": 4,
21
+ "num_hidden_layers": 150,
22
+ "num_key_value_heads": 4,
23
+ "pad_token_id": 0,
24
+ "pretraining_tp": 1,
25
+ "rms_norm_eps": 1e-06,
26
+ "rope_parameters": {
27
+ "rope_theta": 10000.0,
28
+ "rope_type": "default"
29
+ },
30
+ "tie_word_embeddings": true,
31
+ "tokenizer_name": "w-ahmad/tiny-stories-tokenizer",
32
+ "transformers_version": "5.16.0.dev0",
33
+ "use_cache": false,
34
+ "vocab_size": 4096,
35
+ "waleed_beta": 10.0
36
+ }
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c19d4f22bca1d6c50b4226f59e84e12d53357840e7cb70cf90784aefb45a5314
3
+ size 50427120
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57d2993745383b14d2c6ad536a710652d576adb850224cf1ab05fa0a97b04c9c
3
+ size 101708778
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:645b71843375baf4cc10bc75a2f0f04e91b8e3f8e8929f518a87022898b3bc20
3
+ size 14244
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9db76f238494a413266398860b344c6c4c0f3a045ef78b23af1afac6775a12d1
3
+ size 1064
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "eos_token": "<|endoftext|>",
6
+ "errors": "replace",
7
+ "is_local": false,
8
+ "local_files_only": false,
9
+ "model_max_length": 1024,
10
+ "pad_token": "<|endoftext|>",
11
+ "tokenizer_class": "GPT2Tokenizer",
12
+ "unk_token": "<|endoftext|>"
13
+ }
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/trainer_state.json ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 0.06740815638692282,
6
+ "eval_steps": 50,
7
+ "global_step": 1000,
8
+ "is_hyper_param_search": false,
9
+ "is_local_process_zero": true,
10
+ "is_world_process_zero": true,
11
+ "log_history": [
12
+ {
13
+ "epoch": 0.0013481631277384564,
14
+ "grad_norm": 1.2578125,
15
+ "learning_rate": 0.000475,
16
+ "loss": 7.965912628173828,
17
+ "step": 20
18
+ },
19
+ {
20
+ "epoch": 0.002696326255476913,
21
+ "grad_norm": 0.875,
22
+ "learning_rate": 0.0009750000000000001,
23
+ "loss": 6.833769226074219,
24
+ "step": 40
25
+ },
26
+ {
27
+ "epoch": 0.003370407819346141,
28
+ "eval_loss": 6.036951541900635,
29
+ "eval_runtime": 20.9461,
30
+ "eval_samples_per_second": 454.833,
31
+ "eval_steps_per_second": 3.581,
32
+ "step": 50
33
+ },
34
+ {
35
+ "epoch": 0.004044489383215369,
36
+ "grad_norm": 0.23046875,
37
+ "learning_rate": 0.001475,
38
+ "loss": 6.078617095947266,
39
+ "step": 60
40
+ },
41
+ {
42
+ "epoch": 0.005392652510953826,
43
+ "grad_norm": 0.1201171875,
44
+ "learning_rate": 0.001975,
45
+ "loss": 6.011257553100586,
46
+ "step": 80
47
+ },
48
+ {
49
+ "epoch": 0.006740815638692282,
50
+ "grad_norm": 0.53125,
51
+ "learning_rate": 0.002475,
52
+ "loss": 5.894095993041992,
53
+ "step": 100
54
+ },
55
+ {
56
+ "epoch": 0.006740815638692282,
57
+ "eval_loss": 5.803377628326416,
58
+ "eval_runtime": 21.0013,
59
+ "eval_samples_per_second": 453.638,
60
+ "eval_steps_per_second": 3.571,
61
+ "step": 100
62
+ },
63
+ {
64
+ "epoch": 0.008088978766430738,
65
+ "grad_norm": 0.318359375,
66
+ "learning_rate": 0.0029749999999999998,
67
+ "loss": 5.779674911499024,
68
+ "step": 120
69
+ },
70
+ {
71
+ "epoch": 0.009437141894169195,
72
+ "grad_norm": 0.201171875,
73
+ "learning_rate": 0.003475,
74
+ "loss": 5.59539680480957,
75
+ "step": 140
76
+ },
77
+ {
78
+ "epoch": 0.010111223458038422,
79
+ "eval_loss": 5.564068794250488,
80
+ "eval_runtime": 21.0632,
81
+ "eval_samples_per_second": 452.304,
82
+ "eval_steps_per_second": 3.561,
83
+ "step": 150
84
+ },
85
+ {
86
+ "epoch": 0.010785305021907651,
87
+ "grad_norm": 0.23828125,
88
+ "learning_rate": 0.003975,
89
+ "loss": 5.553666305541992,
90
+ "step": 160
91
+ },
92
+ {
93
+ "epoch": 0.012133468149646108,
94
+ "grad_norm": 0.3046875,
95
+ "learning_rate": 0.004475,
96
+ "loss": 5.471728897094726,
97
+ "step": 180
98
+ },
99
+ {
100
+ "epoch": 0.013481631277384564,
101
+ "grad_norm": 0.2109375,
102
+ "learning_rate": 0.004975,
103
+ "loss": 5.362456512451172,
104
+ "step": 200
105
+ },
106
+ {
107
+ "epoch": 0.013481631277384564,
108
+ "eval_loss": 5.277792930603027,
109
+ "eval_runtime": 21.0307,
110
+ "eval_samples_per_second": 453.004,
111
+ "eval_steps_per_second": 3.566,
112
+ "step": 200
113
+ },
114
+ {
115
+ "epoch": 0.01482979440512302,
116
+ "grad_norm": 0.39453125,
117
+ "learning_rate": 0.005,
118
+ "loss": 5.181310653686523,
119
+ "step": 220
120
+ },
121
+ {
122
+ "epoch": 0.016177957532861477,
123
+ "grad_norm": 0.275390625,
124
+ "learning_rate": 0.005,
125
+ "loss": 5.013983917236328,
126
+ "step": 240
127
+ },
128
+ {
129
+ "epoch": 0.016852039096730706,
130
+ "eval_loss": 4.766153335571289,
131
+ "eval_runtime": 20.9959,
132
+ "eval_samples_per_second": 453.755,
133
+ "eval_steps_per_second": 3.572,
134
+ "step": 250
135
+ },
136
+ {
137
+ "epoch": 0.01752612066059993,
138
+ "grad_norm": 0.7578125,
139
+ "learning_rate": 0.005,
140
+ "loss": 4.779726028442383,
141
+ "step": 260
142
+ },
143
+ {
144
+ "epoch": 0.01887428378833839,
145
+ "grad_norm": 0.30859375,
146
+ "learning_rate": 0.005,
147
+ "loss": 4.661225128173828,
148
+ "step": 280
149
+ },
150
+ {
151
+ "epoch": 0.020222446916076844,
152
+ "grad_norm": 0.65625,
153
+ "learning_rate": 0.005,
154
+ "loss": 4.492392349243164,
155
+ "step": 300
156
+ },
157
+ {
158
+ "epoch": 0.020222446916076844,
159
+ "eval_loss": 4.413177490234375,
160
+ "eval_runtime": 21.1373,
161
+ "eval_samples_per_second": 450.72,
162
+ "eval_steps_per_second": 3.548,
163
+ "step": 300
164
+ },
165
+ {
166
+ "epoch": 0.021570610043815303,
167
+ "grad_norm": 0.330078125,
168
+ "learning_rate": 0.005,
169
+ "loss": 4.334686660766602,
170
+ "step": 320
171
+ },
172
+ {
173
+ "epoch": 0.022918773171553757,
174
+ "grad_norm": 0.8984375,
175
+ "learning_rate": 0.005,
176
+ "loss": 4.257295989990235,
177
+ "step": 340
178
+ },
179
+ {
180
+ "epoch": 0.023592854735422986,
181
+ "eval_loss": 4.175577640533447,
182
+ "eval_runtime": 21.1704,
183
+ "eval_samples_per_second": 450.016,
184
+ "eval_steps_per_second": 3.543,
185
+ "step": 350
186
+ },
187
+ {
188
+ "epoch": 0.024266936299292215,
189
+ "grad_norm": 0.2890625,
190
+ "learning_rate": 0.005,
191
+ "loss": 4.192065048217773,
192
+ "step": 360
193
+ },
194
+ {
195
+ "epoch": 0.02561509942703067,
196
+ "grad_norm": 0.71875,
197
+ "learning_rate": 0.005,
198
+ "loss": 4.055378341674805,
199
+ "step": 380
200
+ },
201
+ {
202
+ "epoch": 0.026963262554769128,
203
+ "grad_norm": 0.63671875,
204
+ "learning_rate": 0.005,
205
+ "loss": 4.114184951782226,
206
+ "step": 400
207
+ },
208
+ {
209
+ "epoch": 0.026963262554769128,
210
+ "eval_loss": 4.11501932144165,
211
+ "eval_runtime": 21.0092,
212
+ "eval_samples_per_second": 453.468,
213
+ "eval_steps_per_second": 3.57,
214
+ "step": 400
215
+ },
216
+ {
217
+ "epoch": 0.028311425682507583,
218
+ "grad_norm": 0.322265625,
219
+ "learning_rate": 0.005,
220
+ "loss": 4.029239654541016,
221
+ "step": 420
222
+ },
223
+ {
224
+ "epoch": 0.02965958881024604,
225
+ "grad_norm": 0.2412109375,
226
+ "learning_rate": 0.005,
227
+ "loss": 3.9297679901123046,
228
+ "step": 440
229
+ },
230
+ {
231
+ "epoch": 0.030333670374115267,
232
+ "eval_loss": 3.826937675476074,
233
+ "eval_runtime": 20.9765,
234
+ "eval_samples_per_second": 454.175,
235
+ "eval_steps_per_second": 3.575,
236
+ "step": 450
237
+ },
238
+ {
239
+ "epoch": 0.031007751937984496,
240
+ "grad_norm": 0.248046875,
241
+ "learning_rate": 0.005,
242
+ "loss": 3.8271865844726562,
243
+ "step": 460
244
+ },
245
+ {
246
+ "epoch": 0.032355915065722954,
247
+ "grad_norm": 0.251953125,
248
+ "learning_rate": 0.005,
249
+ "loss": 3.766727828979492,
250
+ "step": 480
251
+ },
252
+ {
253
+ "epoch": 0.03370407819346141,
254
+ "grad_norm": 0.41796875,
255
+ "learning_rate": 0.005,
256
+ "loss": 3.703250503540039,
257
+ "step": 500
258
+ },
259
+ {
260
+ "epoch": 0.03370407819346141,
261
+ "eval_loss": 3.6817057132720947,
262
+ "eval_runtime": 21.0653,
263
+ "eval_samples_per_second": 452.261,
264
+ "eval_steps_per_second": 3.56,
265
+ "step": 500
266
+ },
267
+ {
268
+ "epoch": 0.03505224132119986,
269
+ "grad_norm": 0.30078125,
270
+ "learning_rate": 0.005,
271
+ "loss": 3.661212921142578,
272
+ "step": 520
273
+ },
274
+ {
275
+ "epoch": 0.03640040444893832,
276
+ "grad_norm": 0.3203125,
277
+ "learning_rate": 0.005,
278
+ "loss": 3.599516677856445,
279
+ "step": 540
280
+ },
281
+ {
282
+ "epoch": 0.03707448601280755,
283
+ "eval_loss": 3.577031135559082,
284
+ "eval_runtime": 21.0122,
285
+ "eval_samples_per_second": 453.404,
286
+ "eval_steps_per_second": 3.569,
287
+ "step": 550
288
+ },
289
+ {
290
+ "epoch": 0.03774856757667678,
291
+ "grad_norm": 0.38671875,
292
+ "learning_rate": 0.005,
293
+ "loss": 3.5561344146728517,
294
+ "step": 560
295
+ },
296
+ {
297
+ "epoch": 0.03909673070441524,
298
+ "grad_norm": 0.71484375,
299
+ "learning_rate": 0.005,
300
+ "loss": 3.6597225189208986,
301
+ "step": 580
302
+ },
303
+ {
304
+ "epoch": 0.04044489383215369,
305
+ "grad_norm": 0.27734375,
306
+ "learning_rate": 0.005,
307
+ "loss": 3.642597961425781,
308
+ "step": 600
309
+ },
310
+ {
311
+ "epoch": 0.04044489383215369,
312
+ "eval_loss": 3.569218635559082,
313
+ "eval_runtime": 21.0663,
314
+ "eval_samples_per_second": 452.239,
315
+ "eval_steps_per_second": 3.56,
316
+ "step": 600
317
+ },
318
+ {
319
+ "epoch": 0.04179305695989215,
320
+ "grad_norm": 0.28125,
321
+ "learning_rate": 0.005,
322
+ "loss": 3.522428512573242,
323
+ "step": 620
324
+ },
325
+ {
326
+ "epoch": 0.043141220087630605,
327
+ "grad_norm": 0.5,
328
+ "learning_rate": 0.005,
329
+ "loss": 3.4951053619384767,
330
+ "step": 640
331
+ },
332
+ {
333
+ "epoch": 0.043815301651499834,
334
+ "eval_loss": 3.4496421813964844,
335
+ "eval_runtime": 21.0478,
336
+ "eval_samples_per_second": 452.637,
337
+ "eval_steps_per_second": 3.563,
338
+ "step": 650
339
+ },
340
+ {
341
+ "epoch": 0.044489383215369056,
342
+ "grad_norm": 0.423828125,
343
+ "learning_rate": 0.005,
344
+ "loss": 3.4415531158447266,
345
+ "step": 660
346
+ },
347
+ {
348
+ "epoch": 0.045837546343107514,
349
+ "grad_norm": 0.28125,
350
+ "learning_rate": 0.005,
351
+ "loss": 3.430613708496094,
352
+ "step": 680
353
+ },
354
+ {
355
+ "epoch": 0.04718570947084597,
356
+ "grad_norm": 0.296875,
357
+ "learning_rate": 0.005,
358
+ "loss": 3.3803379058837892,
359
+ "step": 700
360
+ },
361
+ {
362
+ "epoch": 0.04718570947084597,
363
+ "eval_loss": 3.3822414875030518,
364
+ "eval_runtime": 21.146,
365
+ "eval_samples_per_second": 450.535,
366
+ "eval_steps_per_second": 3.547,
367
+ "step": 700
368
+ },
369
+ {
370
+ "epoch": 0.04853387259858443,
371
+ "grad_norm": 0.451171875,
372
+ "learning_rate": 0.005,
373
+ "loss": 3.3574844360351563,
374
+ "step": 720
375
+ },
376
+ {
377
+ "epoch": 0.04988203572632288,
378
+ "grad_norm": 0.314453125,
379
+ "learning_rate": 0.005,
380
+ "loss": 3.3271942138671875,
381
+ "step": 740
382
+ },
383
+ {
384
+ "epoch": 0.05055611729019211,
385
+ "eval_loss": 3.326965570449829,
386
+ "eval_runtime": 21.0998,
387
+ "eval_samples_per_second": 451.52,
388
+ "eval_steps_per_second": 3.555,
389
+ "step": 750
390
+ },
391
+ {
392
+ "epoch": 0.05123019885406134,
393
+ "grad_norm": 0.337890625,
394
+ "learning_rate": 0.005,
395
+ "loss": 3.3225662231445314,
396
+ "step": 760
397
+ },
398
+ {
399
+ "epoch": 0.0525783619817998,
400
+ "grad_norm": 0.328125,
401
+ "learning_rate": 0.005,
402
+ "loss": 3.3127796173095705,
403
+ "step": 780
404
+ },
405
+ {
406
+ "epoch": 0.053926525109538256,
407
+ "grad_norm": 0.31640625,
408
+ "learning_rate": 0.005,
409
+ "loss": 3.2805011749267576,
410
+ "step": 800
411
+ },
412
+ {
413
+ "epoch": 0.053926525109538256,
414
+ "eval_loss": 3.279794454574585,
415
+ "eval_runtime": 21.1218,
416
+ "eval_samples_per_second": 451.051,
417
+ "eval_steps_per_second": 3.551,
418
+ "step": 800
419
+ },
420
+ {
421
+ "epoch": 0.05527468823727671,
422
+ "grad_norm": 0.76171875,
423
+ "learning_rate": 0.005,
424
+ "loss": 3.288113021850586,
425
+ "step": 820
426
+ },
427
+ {
428
+ "epoch": 0.056622851365015166,
429
+ "grad_norm": 0.2890625,
430
+ "learning_rate": 0.005,
431
+ "loss": 3.2744274139404297,
432
+ "step": 840
433
+ },
434
+ {
435
+ "epoch": 0.057296932928884395,
436
+ "eval_loss": 3.242783784866333,
437
+ "eval_runtime": 21.0246,
438
+ "eval_samples_per_second": 453.135,
439
+ "eval_steps_per_second": 3.567,
440
+ "step": 850
441
+ },
442
+ {
443
+ "epoch": 0.057971014492753624,
444
+ "grad_norm": 0.30078125,
445
+ "learning_rate": 0.005,
446
+ "loss": 3.2257854461669924,
447
+ "step": 860
448
+ },
449
+ {
450
+ "epoch": 0.05931917762049208,
451
+ "grad_norm": 0.7734375,
452
+ "learning_rate": 0.005,
453
+ "loss": 3.2115924835205076,
454
+ "step": 880
455
+ },
456
+ {
457
+ "epoch": 0.06066734074823053,
458
+ "grad_norm": 0.4453125,
459
+ "learning_rate": 0.005,
460
+ "loss": 3.215483856201172,
461
+ "step": 900
462
+ },
463
+ {
464
+ "epoch": 0.06066734074823053,
465
+ "eval_loss": 3.204148292541504,
466
+ "eval_runtime": 21.0862,
467
+ "eval_samples_per_second": 451.812,
468
+ "eval_steps_per_second": 3.557,
469
+ "step": 900
470
+ },
471
+ {
472
+ "epoch": 0.06201550387596899,
473
+ "grad_norm": 0.4296875,
474
+ "learning_rate": 0.005,
475
+ "loss": 3.200112533569336,
476
+ "step": 920
477
+ },
478
+ {
479
+ "epoch": 0.06336366700370745,
480
+ "grad_norm": 0.26953125,
481
+ "learning_rate": 0.005,
482
+ "loss": 3.1862085342407225,
483
+ "step": 940
484
+ },
485
+ {
486
+ "epoch": 0.06403774856757667,
487
+ "eval_loss": 3.176638126373291,
488
+ "eval_runtime": 21.3796,
489
+ "eval_samples_per_second": 445.612,
490
+ "eval_steps_per_second": 3.508,
491
+ "step": 950
492
+ },
493
+ {
494
+ "epoch": 0.06471183013144591,
495
+ "grad_norm": 0.400390625,
496
+ "learning_rate": 0.005,
497
+ "loss": 3.1680328369140627,
498
+ "step": 960
499
+ },
500
+ {
501
+ "epoch": 0.06605999325918437,
502
+ "grad_norm": 0.494140625,
503
+ "learning_rate": 0.005,
504
+ "loss": 3.1643564224243166,
505
+ "step": 980
506
+ },
507
+ {
508
+ "epoch": 0.06740815638692282,
509
+ "grad_norm": 0.60546875,
510
+ "learning_rate": 0.005,
511
+ "loss": 3.1570945739746095,
512
+ "step": 1000
513
+ },
514
+ {
515
+ "epoch": 0.06740815638692282,
516
+ "eval_loss": 3.1693739891052246,
517
+ "eval_runtime": 20.9569,
518
+ "eval_samples_per_second": 454.599,
519
+ "eval_steps_per_second": 3.579,
520
+ "step": 1000
521
+ }
522
+ ],
523
+ "logging_steps": 20,
524
+ "max_steps": 1000,
525
+ "num_input_tokens_seen": 0,
526
+ "num_train_epochs": 1,
527
+ "save_steps": 1000,
528
+ "stateful_callbacks": {
529
+ "TrainerControl": {
530
+ "args": {
531
+ "should_epoch_stop": false,
532
+ "should_evaluate": false,
533
+ "should_log": false,
534
+ "should_save": true,
535
+ "should_training_stop": true
536
+ },
537
+ "attributes": {}
538
+ }
539
+ },
540
+ "total_flos": 4839413121024000.0,
541
+ "train_batch_size": 64,
542
+ "trial_name": null,
543
+ "trial_params": null
544
+ }
zain/Activation/out/glu-silu-150L_run/checkpoint-1000/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dbc5a45fe51c91ab1923ef9841ab866304e4eb043fc0626e0bd4311795fca98
3
+ size 4920
zain/Activation/out/glu-silu-150L_run/config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation": "silu",
3
+ "architectures": [
4
+ "TinyLlamaForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "bos_token_id": 1,
9
+ "dtype": "bfloat16",
10
+ "eos_token_id": 2,
11
+ "head_dim": 32,
12
+ "hidden_act": "silu",
13
+ "hidden_size": 128,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 256,
16
+ "max_position_embeddings": 512,
17
+ "mlp_bias": false,
18
+ "mlp_type": "glu",
19
+ "model_type": "tiny_llama",
20
+ "num_attention_heads": 4,
21
+ "num_hidden_layers": 150,
22
+ "num_key_value_heads": 4,
23
+ "pad_token_id": 0,
24
+ "pretraining_tp": 1,
25
+ "rms_norm_eps": 1e-06,
26
+ "rope_parameters": {
27
+ "rope_theta": 10000.0,
28
+ "rope_type": "default"
29
+ },
30
+ "tie_word_embeddings": true,
31
+ "tokenizer_name": "w-ahmad/tiny-stories-tokenizer",
32
+ "transformers_version": "5.16.0.dev0",
33
+ "use_cache": false,
34
+ "vocab_size": 4096,
35
+ "waleed_beta": 10.0
36
+ }
zain/Activation/out/glu-silu-150L_run/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c19d4f22bca1d6c50b4226f59e84e12d53357840e7cb70cf90784aefb45a5314
3
+ size 50427120
zain/Activation/out/glu-silu-150L_run/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
zain/Activation/out/glu-silu-150L_run/tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|endoftext|>",
5
+ "eos_token": "<|endoftext|>",
6
+ "errors": "replace",
7
+ "is_local": false,
8
+ "local_files_only": false,
9
+ "model_max_length": 1024,
10
+ "pad_token": "<|endoftext|>",
11
+ "tokenizer_class": "GPT2Tokenizer",
12
+ "unk_token": "<|endoftext|>"
13
+ }
zain/Activation/out/glu-silu-150L_run/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dbc5a45fe51c91ab1923ef9841ab866304e4eb043fc0626e0bd4311795fca98
3
+ size 4920
zain/Activation/out/glu-silu-150L_run/training_log.jsonl ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"step": 20, "epoch": 0.0013481631277384564, "timestamp": 1786557193.6174574, "loss": 7.965912628173828, "grad_norm": 1.2578125, "learning_rate": 0.000475, "train/total_time_seconds": 7.7677748911082745, "train/time_per_step_avg": 0.3883887445554137, "train/epoch_time_elapsed": 8.869889877736568, "train/estimated_remaining_minutes": 6.343682827738424}
2
+ {"step": 40, "epoch": 0.002696326255476913, "timestamp": 1786557201.5156848, "loss": 6.833769226074219, "grad_norm": 0.875, "learning_rate": 0.0009750000000000001, "train/total_time_seconds": 14.692789886146784, "train/time_per_step_avg": 0.3673197471536696, "train/epoch_time_elapsed": 16.76811734586954, "train/estimated_remaining_minutes": 5.877115954458714}
3
+ {"step": 50, "epoch": 0.003370407819346141, "timestamp": 1786557226.4327006, "eval_loss": 6.036951541900635, "eval_runtime": 20.9461, "eval_samples_per_second": 454.833, "eval_steps_per_second": 3.581, "train/total_time_seconds": 18.16822624206543, "train/time_per_step_avg": 0.3633645248413086, "train/epoch_time_elapsed": 41.68513401597738, "train/estimated_remaining_minutes": 5.753271643320719}
4
+ {"step": 60, "epoch": 0.004044489383215369, "timestamp": 1786557230.3814466, "loss": 6.078617095947266, "grad_norm": 0.23046875, "learning_rate": 0.001475, "train/total_time_seconds": 21.630605444312096, "train/time_per_step_avg": 0.3605100907385349, "train/epoch_time_elapsed": 45.63387914374471, "train/estimated_remaining_minutes": 5.647991421570381}
5
+ {"step": 80, "epoch": 0.005392652510953826, "timestamp": 1786557238.3316472, "loss": 6.011257553100586, "grad_norm": 0.1201171875, "learning_rate": 0.001975, "train/total_time_seconds": 28.592904217541218, "train/time_per_step_avg": 0.35741130271926524, "train/epoch_time_elapsed": 53.58407938852906, "train/estimated_remaining_minutes": 5.4803066416954005}
6
+ {"step": 100, "epoch": 0.006740815638692282, "timestamp": 1786557246.2685323, "loss": 5.894095993041992, "grad_norm": 0.53125, "learning_rate": 0.002475, "train/total_time_seconds": 35.53966587409377, "train/time_per_step_avg": 0.35539665874093773, "train/epoch_time_elapsed": 61.52096566557884, "train/estimated_remaining_minutes": 5.330949881114066}
7
+ {"step": 100, "epoch": 0.006740815638692282, "timestamp": 1786557267.2714484, "eval_loss": 5.803377628326416, "eval_runtime": 21.0013, "eval_samples_per_second": 453.638, "eval_steps_per_second": 3.571, "train/total_time_seconds": 35.53966587409377, "train/time_per_step_avg": 0.35539665874093773, "train/epoch_time_elapsed": 82.52388128265738, "train/estimated_remaining_minutes": 5.330949881114066}
8
+ {"step": 120, "epoch": 0.008088978766430738, "timestamp": 1786557275.2251031, "loss": 5.779674911499024, "grad_norm": 0.318359375, "learning_rate": 0.0029749999999999998, "train/total_time_seconds": 42.507759012281895, "train/time_per_step_avg": 0.3473998412117362, "train/epoch_time_elapsed": 90.47753590345383, "train/estimated_remaining_minutes": 5.195392768167787}
9
+ {"step": 140, "epoch": 0.009437141894169195, "timestamp": 1786557283.4390974, "loss": 5.59539680480957, "grad_norm": 0.201171875, "learning_rate": 0.003475, "train/total_time_seconds": 49.740279983729124, "train/time_per_step_avg": 0.3504749009758234, "train/epoch_time_elapsed": 98.6915314309299, "train/estimated_remaining_minutes": 5.09245723642941}
10
+ {"step": 150, "epoch": 0.010111223458038422, "timestamp": 1786557308.5183148, "eval_loss": 5.564068794250488, "eval_runtime": 21.0632, "eval_samples_per_second": 452.304, "eval_steps_per_second": 3.561, "train/total_time_seconds": 53.26917500048876, "train/time_per_step_avg": 0.3510094875842333, "train/epoch_time_elapsed": 123.77074796706438, "train/estimated_remaining_minutes": 5.03097763893505}
11
+ {"step": 160, "epoch": 0.010785305021907651, "timestamp": 1786557312.4706361, "loss": 5.553666305541992, "grad_norm": 0.23828125, "learning_rate": 0.003975, "train/total_time_seconds": 56.731630615890026, "train/time_per_step_avg": 0.3510102517157793, "train/epoch_time_elapsed": 127.72306951135397, "train/estimated_remaining_minutes": 4.964017678890377}
12
+ {"step": 180, "epoch": 0.012133468149646108, "timestamp": 1786557320.358641, "loss": 5.471728897094726, "grad_norm": 0.3046875, "learning_rate": 0.004475, "train/total_time_seconds": 63.65416628494859, "train/time_per_step_avg": 0.35061262067407367, "train/epoch_time_elapsed": 135.61107504740357, "train/estimated_remaining_minutes": 4.833001514227577}
13
+ {"step": 200, "epoch": 0.013481631277384564, "timestamp": 1786557328.2829368, "loss": 5.362456512451172, "grad_norm": 0.2109375, "learning_rate": 0.004975, "train/total_time_seconds": 70.61671846732497, "train/time_per_step_avg": 0.350770525932312, "train/epoch_time_elapsed": 143.53537099063396, "train/estimated_remaining_minutes": 4.707781231154998}
14
+ {"step": 200, "epoch": 0.013481631277384564, "timestamp": 1786557349.3152652, "eval_loss": 5.277792930603027, "eval_runtime": 21.0307, "eval_samples_per_second": 453.004, "eval_steps_per_second": 3.566, "train/total_time_seconds": 70.61671846732497, "train/time_per_step_avg": 0.350770525932312, "train/epoch_time_elapsed": 164.56769954413176, "train/estimated_remaining_minutes": 4.707781231154998}
15
+ {"step": 220, "epoch": 0.01482979440512302, "timestamp": 1786557357.3834257, "loss": 5.181310653686523, "grad_norm": 0.39453125, "learning_rate": 0.005, "train/total_time_seconds": 77.70512066781521, "train/time_per_step_avg": 0.35197361655533316, "train/epoch_time_elapsed": 172.6358605362475, "train/estimated_remaining_minutes": 4.59166622127999}
16
+ {"step": 240, "epoch": 0.016177957532861477, "timestamp": 1786557365.4349813, "loss": 5.013983917236328, "grad_norm": 0.275390625, "learning_rate": 0.005, "train/total_time_seconds": 84.76927033439279, "train/time_per_step_avg": 0.35028990350663664, "train/epoch_time_elapsed": 180.68741608783603, "train/estimated_remaining_minutes": 4.473933712092953}
17
+ {"step": 250, "epoch": 0.016852039096730706, "timestamp": 1786557390.490584, "eval_loss": 4.766153335571289, "eval_runtime": 20.9959, "eval_samples_per_second": 453.755, "eval_steps_per_second": 3.572, "train/total_time_seconds": 88.30736941099167, "train/time_per_step_avg": 0.3503819441050291, "train/epoch_time_elapsed": 205.74301797151566, "train/estimated_remaining_minutes": 4.415368470549583}
18
+ {"step": 260, "epoch": 0.01752612066059993, "timestamp": 1786557394.7535915, "loss": 4.779726028442383, "grad_norm": 0.7578125, "learning_rate": 0.005, "train/total_time_seconds": 92.07968695834279, "train/time_per_step_avg": 0.35348056342452766, "train/epoch_time_elapsed": 210.00602655112743, "train/estimated_remaining_minutes": 4.367882586485491}
19
+ {"step": 280, "epoch": 0.01887428378833839, "timestamp": 1786557402.8140562, "loss": 4.661225128173828, "grad_norm": 0.30859375, "learning_rate": 0.005, "train/total_time_seconds": 99.15521595999599, "train/time_per_step_avg": 0.35501049675047397, "train/epoch_time_elapsed": 218.06649118289351, "train/estimated_remaining_minutes": 4.249509255428399}
20
+ {"step": 300, "epoch": 0.020222446916076844, "timestamp": 1786557410.8971837, "loss": 4.492392349243164, "grad_norm": 0.65625, "learning_rate": 0.005, "train/total_time_seconds": 106.24776089936495, "train/time_per_step_avg": 0.3563104243203998, "train/epoch_time_elapsed": 226.14961894974113, "train/estimated_remaining_minutes": 4.131857368308637}
21
+ {"step": 300, "epoch": 0.020222446916076844, "timestamp": 1786557432.0359025, "eval_loss": 4.413177490234375, "eval_runtime": 21.1373, "eval_samples_per_second": 450.72, "eval_steps_per_second": 3.548, "train/total_time_seconds": 106.24776089936495, "train/time_per_step_avg": 0.3563104243203998, "train/epoch_time_elapsed": 247.2883375324309, "train/estimated_remaining_minutes": 4.131857368308637}
22
+ {"step": 320, "epoch": 0.021570610043815303, "timestamp": 1786557440.0632358, "loss": 4.334686660766602, "grad_norm": 0.330078125, "learning_rate": 0.005, "train/total_time_seconds": 113.29175987839699, "train/time_per_step_avg": 0.3558663921058178, "train/epoch_time_elapsed": 255.31567088514566, "train/estimated_remaining_minutes": 4.012416495693227}
23
+ {"step": 340, "epoch": 0.022918773171553757, "timestamp": 1786557448.0978491, "loss": 4.257295989990235, "grad_norm": 0.8984375, "learning_rate": 0.005, "train/total_time_seconds": 120.34191355109215, "train/time_per_step_avg": 0.3557264321669936, "train/epoch_time_elapsed": 263.3502836711705, "train/estimated_remaining_minutes": 3.8934148501823933}
24
+ {"step": 350, "epoch": 0.023592854735422986, "timestamp": 1786557473.2799585, "eval_loss": 4.175577640533447, "eval_runtime": 21.1704, "eval_samples_per_second": 450.016, "eval_steps_per_second": 3.543, "train/total_time_seconds": 123.86411083117127, "train/time_per_step_avg": 0.35556741420179605, "train/epoch_time_elapsed": 288.5323930978775, "train/estimated_remaining_minutes": 3.8338891447743486}
25
+ {"step": 360, "epoch": 0.024266936299292215, "timestamp": 1786557477.329923, "loss": 4.192065048217773, "grad_norm": 0.2890625, "learning_rate": 0.005, "train/total_time_seconds": 127.41973203793168, "train/time_per_step_avg": 0.3534004507958889, "train/epoch_time_elapsed": 292.58235804736614, "train/estimated_remaining_minutes": 3.7753994677905687}
26
+ {"step": 380, "epoch": 0.02561509942703067, "timestamp": 1786557485.3714654, "loss": 4.055378341674805, "grad_norm": 0.71875, "learning_rate": 0.005, "train/total_time_seconds": 134.47621612250805, "train/time_per_step_avg": 0.3532100016251206, "train/epoch_time_elapsed": 300.6239004135132, "train/estimated_remaining_minutes": 3.6568093857874997}
27
+ {"step": 400, "epoch": 0.026963262554769128, "timestamp": 1786557493.636982, "loss": 4.114184951782226, "grad_norm": 0.63671875, "learning_rate": 0.005, "train/total_time_seconds": 141.75298693031073, "train/time_per_step_avg": 0.3550522603094578, "train/epoch_time_elapsed": 308.8894155956805, "train/estimated_remaining_minutes": 3.543824673257768}
28
+ {"step": 400, "epoch": 0.026963262554769128, "timestamp": 1786557514.6479268, "eval_loss": 4.11501932144165, "eval_runtime": 21.0092, "eval_samples_per_second": 453.468, "eval_steps_per_second": 3.57, "train/total_time_seconds": 141.75298693031073, "train/time_per_step_avg": 0.3550522603094578, "train/epoch_time_elapsed": 329.900360442698, "train/estimated_remaining_minutes": 3.543824673257768}
29
+ {"step": 420, "epoch": 0.028311425682507583, "timestamp": 1786557522.5884686, "loss": 4.029239654541016, "grad_norm": 0.322265625, "learning_rate": 0.005, "train/total_time_seconds": 148.7272277995944, "train/time_per_step_avg": 0.35435467921197417, "train/epoch_time_elapsed": 337.8409028239548, "train/estimated_remaining_minutes": 3.423086989038284}
30
+ {"step": 440, "epoch": 0.02965958881024604, "timestamp": 1786557530.4966893, "loss": 3.9297679901123046, "grad_norm": 0.2412109375, "learning_rate": 0.005, "train/total_time_seconds": 155.6698176935315, "train/time_per_step_avg": 0.35327904142439365, "train/epoch_time_elapsed": 345.74912352859974, "train/estimated_remaining_minutes": 3.302087041984002}
31
+ {"step": 450, "epoch": 0.030333670374115267, "timestamp": 1786557555.4244235, "eval_loss": 3.826937675476074, "eval_runtime": 20.9765, "eval_samples_per_second": 454.175, "eval_steps_per_second": 3.575, "train/total_time_seconds": 159.13453048840165, "train/time_per_step_avg": 0.3527041965723038, "train/epoch_time_elapsed": 370.6768567673862, "train/estimated_remaining_minutes": 3.2416293247637373}
32
+ {"step": 460, "epoch": 0.031007751937984496, "timestamp": 1786557559.4379292, "loss": 3.8271865844726562, "grad_norm": 0.248046875, "learning_rate": 0.005, "train/total_time_seconds": 162.65948490053415, "train/time_per_step_avg": 0.35239752862602475, "train/epoch_time_elapsed": 374.69036443531513, "train/estimated_remaining_minutes": 3.182468182836538}
33
+ {"step": 480, "epoch": 0.032355915065722954, "timestamp": 1786557567.5498652, "loss": 3.766727828979492, "grad_norm": 0.251953125, "learning_rate": 0.005, "train/total_time_seconds": 169.77665081992745, "train/time_per_step_avg": 0.353004346974194, "train/epoch_time_elapsed": 382.80230047926307, "train/estimated_remaining_minutes": 3.065411750915357}
34
+ {"step": 500, "epoch": 0.03370407819346141, "timestamp": 1786557575.617877, "loss": 3.703250503540039, "grad_norm": 0.41796875, "learning_rate": 0.005, "train/total_time_seconds": 176.84840467572212, "train/time_per_step_avg": 0.35095417745411395, "train/epoch_time_elapsed": 390.87031165137887, "train/estimated_remaining_minutes": 2.9474734112620355}
35
+ {"step": 500, "epoch": 0.03370407819346141, "timestamp": 1786557596.684591, "eval_loss": 3.6817057132720947, "eval_runtime": 21.0653, "eval_samples_per_second": 452.261, "eval_steps_per_second": 3.56, "train/total_time_seconds": 176.84840467572212, "train/time_per_step_avg": 0.35095417745411395, "train/epoch_time_elapsed": 411.9370235167444, "train/estimated_remaining_minutes": 2.9474734112620355}
36
+ {"step": 520, "epoch": 0.03505224132119986, "timestamp": 1786557604.6020725, "loss": 3.661212921142578, "grad_norm": 0.30078125, "learning_rate": 0.005, "train/total_time_seconds": 183.79093367606401, "train/time_per_step_avg": 0.35063705876469614, "train/epoch_time_elapsed": 419.85450745746493, "train/estimated_remaining_minutes": 2.8275528257856}
37
+ {"step": 540, "epoch": 0.03640040444893832, "timestamp": 1786557612.8317752, "loss": 3.599516677856445, "grad_norm": 0.3203125, "learning_rate": 0.005, "train/total_time_seconds": 191.0475917197764, "train/time_per_step_avg": 0.3537777402624488, "train/epoch_time_elapsed": 428.0842099711299, "train/estimated_remaining_minutes": 2.7124040799721336}
38
+ {"step": 550, "epoch": 0.03707448601280755, "timestamp": 1786557637.8027244, "eval_loss": 3.577031135559082, "eval_runtime": 21.0122, "eval_samples_per_second": 453.404, "eval_steps_per_second": 3.569, "train/total_time_seconds": 194.519395314157, "train/time_per_step_avg": 0.3538486482575536, "train/epoch_time_elapsed": 453.05515737086535, "train/estimated_remaining_minutes": 2.6525372088294135}
39
+ {"step": 560, "epoch": 0.03774856757667678, "timestamp": 1786557641.7856886, "loss": 3.5561344146728517, "grad_norm": 0.38671875, "learning_rate": 0.005, "train/total_time_seconds": 197.99239484220743, "train/time_per_step_avg": 0.3533290994167328, "train/epoch_time_elapsed": 457.03812321648, "train/estimated_remaining_minutes": 2.5927575515050973}
40
+ {"step": 580, "epoch": 0.03909673070441524, "timestamp": 1786557649.796253, "loss": 3.6597225189208986, "grad_norm": 0.71484375, "learning_rate": 0.005, "train/total_time_seconds": 204.98366295918822, "train/time_per_step_avg": 0.3520701213926077, "train/epoch_time_elapsed": 465.04868764802814, "train/estimated_remaining_minutes": 2.4739407598522716}
41
+ {"step": 600, "epoch": 0.04044489383215369, "timestamp": 1786557657.7552896, "loss": 3.642597961425781, "grad_norm": 0.27734375, "learning_rate": 0.005, "train/total_time_seconds": 211.96490164473653, "train/time_per_step_avg": 0.35116496969014405, "train/epoch_time_elapsed": 473.0077244900167, "train/estimated_remaining_minutes": 2.355165573830406}
42
+ {"step": 600, "epoch": 0.04044489383215369, "timestamp": 1786557678.8231282, "eval_loss": 3.569218635559082, "eval_runtime": 21.0663, "eval_samples_per_second": 452.239, "eval_steps_per_second": 3.56, "train/total_time_seconds": 211.96490164473653, "train/time_per_step_avg": 0.35116496969014405, "train/epoch_time_elapsed": 494.07556308060884, "train/estimated_remaining_minutes": 2.355165573830406}
43
+ {"step": 620, "epoch": 0.04179305695989215, "timestamp": 1786557686.9847145, "loss": 3.522428512573242, "grad_norm": 0.28125, "learning_rate": 0.005, "train/total_time_seconds": 219.13101323321462, "train/time_per_step_avg": 0.353400795571506, "train/epoch_time_elapsed": 502.23714938387275, "train/estimated_remaining_minutes": 2.2384350814145577}
44
+ {"step": 640, "epoch": 0.043141220087630605, "timestamp": 1786557695.0759084, "loss": 3.4951053619384767, "grad_norm": 0.5, "learning_rate": 0.005, "train/total_time_seconds": 226.23501834645867, "train/time_per_step_avg": 0.35187426626682283, "train/epoch_time_elapsed": 510.3283435218036, "train/estimated_remaining_minutes": 2.1209532969980502}
45
+ {"step": 650, "epoch": 0.043815301651499834, "timestamp": 1786557720.1554163, "eval_loss": 3.4496421813964844, "eval_runtime": 21.0478, "eval_samples_per_second": 452.637, "eval_steps_per_second": 3.563, "train/total_time_seconds": 229.77535781264305, "train/time_per_step_avg": 0.35255962498486043, "train/epoch_time_elapsed": 535.4078501574695, "train/estimated_remaining_minutes": 2.0620865444724377}
46
+ {"step": 660, "epoch": 0.044489383215369056, "timestamp": 1786557724.1980085, "loss": 3.4415531158447266, "grad_norm": 0.423828125, "learning_rate": 0.005, "train/total_time_seconds": 233.32044852897525, "train/time_per_step_avg": 0.3532805368676782, "train/epoch_time_elapsed": 539.4504432417452, "train/estimated_remaining_minutes": 2.003256376258878}
47
+ {"step": 680, "epoch": 0.045837546343107514, "timestamp": 1786557732.4899755, "loss": 3.430613708496094, "grad_norm": 0.28125, "learning_rate": 0.005, "train/total_time_seconds": 240.63763910531998, "train/time_per_step_avg": 0.35653976146131755, "train/epoch_time_elapsed": 547.7424106113613, "train/estimated_remaining_minutes": 1.887354032198588}
48
+ {"step": 700, "epoch": 0.04718570947084597, "timestamp": 1786557740.6322117, "loss": 3.3803379058837892, "grad_norm": 0.296875, "learning_rate": 0.005, "train/total_time_seconds": 247.7928595095873, "train/time_per_step_avg": 0.35827957864850757, "train/epoch_time_elapsed": 555.8846466131508, "train/estimated_remaining_minutes": 1.7699489964970523}
49
+ {"step": 700, "epoch": 0.04718570947084597, "timestamp": 1786557761.7795937, "eval_loss": 3.3822414875030518, "eval_runtime": 21.146, "eval_samples_per_second": 450.535, "eval_steps_per_second": 3.547, "train/total_time_seconds": 247.7928595095873, "train/time_per_step_avg": 0.35827957864850757, "train/epoch_time_elapsed": 577.0320283398032, "train/estimated_remaining_minutes": 1.7699489964970523}
50
+ {"step": 720, "epoch": 0.04853387259858443, "timestamp": 1786557769.8749285, "loss": 3.3574844360351563, "grad_norm": 0.451171875, "learning_rate": 0.005, "train/total_time_seconds": 254.90526371449232, "train/time_per_step_avg": 0.35774250481277703, "train/epoch_time_elapsed": 585.127363409847, "train/estimated_remaining_minutes": 1.6521637462976353}
51
+ {"step": 740, "epoch": 0.04988203572632288, "timestamp": 1786557778.1536245, "loss": 3.3271942138671875, "grad_norm": 0.314453125, "learning_rate": 0.005, "train/total_time_seconds": 262.1181674040854, "train/time_per_step_avg": 0.35883149057626723, "train/epoch_time_elapsed": 593.4060596898198, "train/estimated_remaining_minutes": 1.534926205519419}
52
+ {"step": 750, "epoch": 0.05055611729019211, "timestamp": 1786557803.2730293, "eval_loss": 3.326965570449829, "eval_runtime": 21.0998, "eval_samples_per_second": 451.52, "eval_steps_per_second": 3.555, "train/total_time_seconds": 265.6501111611724, "train/time_per_step_avg": 0.35874753348529337, "train/epoch_time_elapsed": 618.5254634954035, "train/estimated_remaining_minutes": 1.4758339508954024}
53
+ {"step": 760, "epoch": 0.05123019885406134, "timestamp": 1786557807.5223897, "loss": 3.3225662231445314, "grad_norm": 0.337890625, "learning_rate": 0.005, "train/total_time_seconds": 269.36594320461154, "train/time_per_step_avg": 0.3604549467563629, "train/epoch_time_elapsed": 622.774824872613, "train/estimated_remaining_minutes": 1.417715490550587}
54
+ {"step": 780, "epoch": 0.0525783619817998, "timestamp": 1786557815.562599, "loss": 3.3127796173095705, "grad_norm": 0.328125, "learning_rate": 0.005, "train/total_time_seconds": 276.4333055205643, "train/time_per_step_avg": 0.3579566641524434, "train/epoch_time_elapsed": 630.815034121275, "train/estimated_remaining_minutes": 1.2994728037291485}
55
+ {"step": 800, "epoch": 0.053926525109538256, "timestamp": 1786557823.6051483, "loss": 3.2805011749267576, "grad_norm": 0.31640625, "learning_rate": 0.005, "train/total_time_seconds": 283.50869573652744, "train/time_per_step_avg": 0.35715836226940156, "train/epoch_time_elapsed": 638.8575837723911, "train/estimated_remaining_minutes": 1.181286232235531}
56
+ {"step": 800, "epoch": 0.053926525109538256, "timestamp": 1786557844.7283092, "eval_loss": 3.279794454574585, "eval_runtime": 21.1218, "eval_samples_per_second": 451.051, "eval_steps_per_second": 3.551, "train/total_time_seconds": 283.50869573652744, "train/time_per_step_avg": 0.35715836226940156, "train/epoch_time_elapsed": 659.9807434231043, "train/estimated_remaining_minutes": 1.181286232235531}
57
+ {"step": 820, "epoch": 0.05527468823727671, "timestamp": 1786557852.9730716, "loss": 3.288113021850586, "grad_norm": 0.76171875, "learning_rate": 0.005, "train/total_time_seconds": 290.78088065981865, "train/time_per_step_avg": 0.3587561694532633, "train/epoch_time_elapsed": 668.2255069240928, "train/estimated_remaining_minutes": 1.0638324902188487}
58
+ {"step": 840, "epoch": 0.056622851365015166, "timestamp": 1786557861.1435368, "loss": 3.2744274139404297, "grad_norm": 0.2890625, "learning_rate": 0.005, "train/total_time_seconds": 297.97745206579566, "train/time_per_step_avg": 0.3585928466171026, "train/epoch_time_elapsed": 676.3959720656276, "train/estimated_remaining_minutes": 0.9459601652882401}
59
+ {"step": 850, "epoch": 0.057296932928884395, "timestamp": 1786557886.2209425, "eval_loss": 3.242783784866333, "eval_runtime": 21.0246, "eval_samples_per_second": 453.135, "eval_steps_per_second": 3.567, "train/total_time_seconds": 301.53453793376684, "train/time_per_step_avg": 0.3588442677259445, "train/epoch_time_elapsed": 701.4733771942556, "train/estimated_remaining_minutes": 0.8868662880404906}
60
+ {"step": 860, "epoch": 0.057971014492753624, "timestamp": 1786557890.2724154, "loss": 3.2257854461669924, "grad_norm": 0.30078125, "learning_rate": 0.005, "train/total_time_seconds": 305.0943289361894, "train/time_per_step_avg": 0.3572838573157787, "train/epoch_time_elapsed": 705.5248506069183, "train/estimated_remaining_minutes": 0.8277753110671805}
61
+ {"step": 880, "epoch": 0.05931917762049208, "timestamp": 1786557898.407817, "loss": 3.2115924835205076, "grad_norm": 0.7734375, "learning_rate": 0.005, "train/total_time_seconds": 312.24482537060976, "train/time_per_step_avg": 0.3581151985004544, "train/epoch_time_elapsed": 713.6602519154549, "train/estimated_remaining_minutes": 0.7096473303877494}
62
+ {"step": 900, "epoch": 0.06066734074823053, "timestamp": 1786557906.474679, "loss": 3.215483856201172, "grad_norm": 0.4453125, "learning_rate": 0.005, "train/total_time_seconds": 319.3302355930209, "train/time_per_step_avg": 0.35821539856493473, "train/epoch_time_elapsed": 721.7271142341197, "train/estimated_remaining_minutes": 0.591352288135224}
63
+ {"step": 900, "epoch": 0.06066734074823053, "timestamp": 1786557927.562245, "eval_loss": 3.204148292541504, "eval_runtime": 21.0862, "eval_samples_per_second": 451.812, "eval_steps_per_second": 3.557, "train/total_time_seconds": 319.3302355930209, "train/time_per_step_avg": 0.35821539856493473, "train/epoch_time_elapsed": 742.8146789930761, "train/estimated_remaining_minutes": 0.591352288135224}
64
+ {"step": 920, "epoch": 0.06201550387596899, "timestamp": 1786557935.6161351, "loss": 3.200112533569336, "grad_norm": 0.4296875, "learning_rate": 0.005, "train/total_time_seconds": 326.4064021706581, "train/time_per_step_avg": 0.35625521510839464, "train/epoch_time_elapsed": 750.8685701228678, "train/estimated_remaining_minutes": 0.4730527567690697}
65
+ {"step": 940, "epoch": 0.06336366700370745, "timestamp": 1786557943.8464644, "loss": 3.1862085342407225, "grad_norm": 0.26953125, "learning_rate": 0.005, "train/total_time_seconds": 333.6590396165848, "train/time_per_step_avg": 0.3568158755078912, "train/epoch_time_elapsed": 759.0988992676139, "train/estimated_remaining_minutes": 0.35495642512402636}
66
+ {"step": 950, "epoch": 0.06403774856757667, "timestamp": 1786557969.2524087, "eval_loss": 3.176638126373291, "eval_runtime": 21.3796, "eval_samples_per_second": 445.612, "eval_steps_per_second": 3.508, "train/total_time_seconds": 337.19563449174166, "train/time_per_step_avg": 0.35661096557974814, "train/epoch_time_elapsed": 784.5048425756395, "train/estimated_remaining_minutes": 0.29578564429100146}
67
+ {"step": 960, "epoch": 0.06471183013144591, "timestamp": 1786557973.2440467, "loss": 3.1680328369140627, "grad_norm": 0.400390625, "learning_rate": 0.005, "train/total_time_seconds": 340.68483125418425, "train/time_per_step_avg": 0.3559050231799483, "train/epoch_time_elapsed": 788.496480870992, "train/estimated_remaining_minutes": 0.23658668837096125}
68
+ {"step": 980, "epoch": 0.06605999325918437, "timestamp": 1786557981.187124, "loss": 3.1643564224243166, "grad_norm": 0.494140625, "learning_rate": 0.005, "train/total_time_seconds": 347.66380301490426, "train/time_per_step_avg": 0.354189776442945, "train/epoch_time_elapsed": 796.4395584575832, "train/estimated_remaining_minutes": 0.11825299422275656}
69
+ {"step": 1000, "epoch": 0.06740815638692282, "timestamp": 1786557989.1446016, "loss": 3.1570945739746095, "grad_norm": 0.60546875, "learning_rate": 0.005, "train/total_time_seconds": 354.6520741917193, "train/time_per_step_avg": 0.3532183859869838, "train/epoch_time_elapsed": 804.3970361538231, "train/estimated_remaining_minutes": 0.0}
70
+ {"step": 1000, "epoch": 0.06740815638692282, "timestamp": 1786558010.1032054, "eval_loss": 3.1693739891052246, "eval_runtime": 20.9569, "eval_samples_per_second": 454.599, "eval_steps_per_second": 3.579, "train/total_time_seconds": 354.6520741917193, "train/time_per_step_avg": 0.3532183859869838, "train/epoch_time_elapsed": 825.3556394092739, "train/estimated_remaining_minutes": 0.0}
71
+ {"step": 1000, "epoch": 0.06740815638692282, "timestamp": 1786558010.52342, "train_runtime": 826.5493, "train_samples_per_second": 77.43, "train_steps_per_second": 1.21, "total_flos": 4839413121024000.0, "train_loss": 4.179319068908692, "train/total_time_seconds": 354.6520741917193, "train/time_per_step_avg": 0.3532183859869838, "train/epoch_time_elapsed": 825.7758530080318, "train/estimated_remaining_minutes": 0.0}
72
+ {"step": 1000, "epoch": 0.06740815638692282, "timestamp": 1786558031.5403202, "eval_loss": 3.1693739891052246, "eval_runtime": 21.013, "eval_samples_per_second": 453.385, "eval_steps_per_second": 3.569, "train/total_time_seconds": 354.6520741917193, "train/time_per_step_avg": 0.3532183859869838, "train/epoch_time_elapsed": 846.7927529215813, "train/estimated_remaining_minutes": 0.0}
zain/Activation/sweep.py ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Sweep explicit GLU / MLP variants with identical data and hyperparameters."""
3
+ import argparse
4
+ import copy
5
+ import json
6
+ import re
7
+ import time
8
+ import os
9
+ from pathlib import Path
10
+
11
+ import yaml
12
+ import wandb
13
+ import torch
14
+ from transformers import AutoTokenizer, set_seed
15
+ from exp import TinyLlamaConfig, TinyLlamaForCausalLM, build_dataset, create_trainer
16
+
17
+
18
+ def format_param_count(total_params: int) -> str:
19
+ """Return human‑readable string with M or B suffix, 1 decimal."""
20
+ if total_params >= 1e9:
21
+ return f"{total_params / 1e9:.1f}B"
22
+ else:
23
+ return f"{total_params / 1e6:.1f}M"
24
+
25
+
26
+ def parse_variant(variant: str):
27
+ """
28
+ Parse variant string into (prefix, activation, layers).
29
+ Supports:
30
+ glu-silu-waleed10
31
+ glu-situglu_low-10L
32
+ mlp-waleed10
33
+ """
34
+ parts = variant.split('-')
35
+ if len(parts) < 2:
36
+ raise ValueError(f"Invalid variant format: '{variant}'. Expected: <glu|mlp>-<activation>[-<layers>L]")
37
+
38
+ prefix = parts[0]
39
+ if prefix not in ('glu', 'mlp'):
40
+ raise ValueError(f"Invalid prefix: '{prefix}'. Must be 'glu' or 'mlp'.")
41
+
42
+ # The last part might be layers like "10L"
43
+ last = parts[-1]
44
+ if last.endswith('L') and last[:-1].isdigit():
45
+ layers = int(last[:-1])
46
+ activation = '-'.join(parts[1:-1]) # everything between prefix and layers
47
+ else:
48
+ layers = None
49
+ activation = '-'.join(parts[1:]) # everything after prefix
50
+
51
+ if not activation:
52
+ raise ValueError(f"Missing activation name in variant: '{variant}'")
53
+
54
+ return prefix, activation, layers
55
+
56
+
57
+ def main():
58
+ parser = argparse.ArgumentParser()
59
+ parser.add_argument("--config", required=True, help="Base YAML config")
60
+ parser.add_argument(
61
+ "--variants",
62
+ nargs="+",
63
+ required=True,
64
+ help="List of variants: e.g. glu-silu-10L mlp-relu-8L"
65
+ )
66
+ parser.add_argument("--push", action="store_true")
67
+ args = parser.parse_args()
68
+
69
+ with open(args.config) as f:
70
+ base = yaml.safe_load(f)
71
+
72
+ seed = base.get("training", {}).get("seed", 42)
73
+ set_seed(seed)
74
+
75
+ # Force all runs into a specific WandB project (read from config)
76
+ wandb_project = base.get("training", {}).get("wandb_project")
77
+ if wandb_project:
78
+ os.environ["WANDB_PROJECT"] = wandb_project
79
+ print(f"[WandB] Project locked to: {wandb_project}")
80
+
81
+ tok_name = base["model"].get("tokenizer_name", "meta-llama/Llama-2-7b-hf")
82
+ tokenizer = AutoTokenizer.from_pretrained(tok_name)
83
+ if tokenizer.pad_token is None:
84
+ tokenizer.pad_token = tokenizer.eos_token
85
+
86
+ msl = base["model"].get("max_position_embeddings", 512)
87
+ train_ds = build_dataset(
88
+ tokenizer,
89
+ max_seq_len=msl,
90
+ split="train",
91
+ max_samples=None
92
+ )
93
+ eval_ds = build_dataset(
94
+ tokenizer,
95
+ max_seq_len=msl,
96
+ split="validation",
97
+ max_samples=None
98
+ )
99
+
100
+ results = []
101
+
102
+ for variant in args.variants:
103
+ prefix, act, layers = parse_variant(variant)
104
+
105
+ # Validation: mlp-situglu and mlp-waleed are banned
106
+ if prefix == "mlp" and act in ("situglu", "waleed", "situglu_low", "waleedglu_low"):
107
+ raise ValueError(
108
+ f"Activation '{act}' requires a gated architecture (GLU). "
109
+ f"Please use 'glu-{act}' instead."
110
+ )
111
+
112
+ # Build config overrides
113
+ cfg = copy.deepcopy(base)
114
+ cfg["model"]["mlp_type"] = prefix
115
+ cfg["model"]["activation"] = act
116
+ if layers is not None:
117
+ cfg["model"]["num_hidden_layers"] = layers
118
+
119
+ # --------------------------------------------------------------
120
+ # ENSURE LAYER COUNT IS ALWAYS INCLUDED IN ALL NAMES
121
+ # Read the final layer count from the config after any override.
122
+ # --------------------------------------------------------------
123
+ actual_layers = cfg["model"]["num_hidden_layers"]
124
+ variant_label = f"{prefix}-{act}-{actual_layers}L"
125
+
126
+ # Unique output directory
127
+ out_dir = Path(cfg["training"]["output_dir"]).parent / f"{variant_label}_run"
128
+ cfg["training"]["output_dir"] = str(out_dir)
129
+
130
+ # Re-seed for reproducibility across variants
131
+ set_seed(seed)
132
+
133
+ print(f"\n{'='*60}\n>>> Variant: {variant_label} | Out: {out_dir}\n{'='*60}")
134
+
135
+ # Instantiate model
136
+ config = TinyLlamaConfig(**cfg["model"])
137
+ model = TinyLlamaForCausalLM(config)
138
+ model = model.to(torch.bfloat16)
139
+
140
+ total_params = sum(p.numel() for p in model.parameters())
141
+ param_str = format_param_count(total_params)
142
+ timestamp = time.strftime("%Y%m%d-%H%M%S")
143
+ run_name = f"LM-{variant_label}-{param_str}-{timestamp}"
144
+ cfg["training"]["run_name"] = run_name
145
+
146
+ # Also update hub_model_id to include variant and layer count
147
+ hub_id_base = cfg["training"].get("hub_model_id", "tiny-llama-lab")
148
+ cfg["training"]["hub_model_id"] = f"{hub_id_base}-{variant_label}"
149
+
150
+ # Ensure a fresh WandB run – remove any global WANDB_RUN_ID
151
+ os.environ.pop("WANDB_RUN_ID", None)
152
+
153
+ trainer = create_trainer(model, tokenizer, cfg, train_ds, eval_ds)
154
+
155
+ try:
156
+ trainer.train()
157
+ metrics = trainer.evaluate()
158
+ results.append({
159
+ "variant": variant_label, # now always includes layer count
160
+ "eval_loss": metrics.get("eval_loss"),
161
+ "out": str(out_dir),
162
+ "run_name": run_name,
163
+ })
164
+ trainer.save_model(str(out_dir))
165
+ if args.push or cfg["training"].get("push_to_hub", False):
166
+ trainer.push_to_hub()
167
+ finally:
168
+ # Explicitly finish WandB run to avoid re‑using the same run
169
+ wandb.finish()
170
+
171
+ # Save summary
172
+ summary = Path(base["training"]["output_dir"]).parent / "sweep_summary.json"
173
+ summary.write_text(json.dumps(results, indent=2))
174
+ print("\nSweep complete:")
175
+ for r in results:
176
+ print(f" {r['variant']:20s} eval_loss={r['eval_loss']:.4f}")
177
+
178
+
179
+ if __name__ == "__main__":
180
+ main()
zain/Activation/train.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Train one TinyLlama variant from a YAML config."""
3
+ import argparse
4
+ import yaml
5
+ import os
6
+ import torch
7
+
8
+ from transformers import AutoTokenizer, set_seed
9
+ from exp import TinyLlamaConfig, TinyLlamaForCausalLM, build_dataset, create_trainer
10
+
11
+
12
+ def main():
13
+ parser = argparse.ArgumentParser()
14
+ parser.add_argument("--config", required=True, help="Path to YAML config")
15
+ parser.add_argument("--push", action="store_true", help="Push final model to HF Hub")
16
+ args = parser.parse_args()
17
+
18
+ with open(args.config) as f:
19
+ cfg = yaml.safe_load(f)
20
+
21
+ # Explicit seed before any randomness
22
+ seed = cfg.get("training", {}).get("seed", 42)
23
+ set_seed(seed)
24
+
25
+ # -------------------------------------------------------------------------
26
+ # NEW: Force run into a specific WandB project (read from config).
27
+ # -------------------------------------------------------------------------
28
+ wandb_project = cfg.get("training", {}).get("wandb_project")
29
+ if wandb_project:
30
+ os.environ["WANDB_PROJECT"] = wandb_project
31
+ print(f"[WandB] Project locked to: {wandb_project}")
32
+ # -------------------------------------------------------------------------
33
+
34
+ model_cfg = cfg["model"]
35
+ train_cfg = cfg.get("training", {})
36
+
37
+ # Tokenizer
38
+ tok_name = model_cfg.pop("tokenizer_name", "meta-llama/Llama-2-7b-hf")
39
+ tokenizer = AutoTokenizer.from_pretrained(tok_name)
40
+ if tokenizer.pad_token is None:
41
+ tokenizer.pad_token = tokenizer.eos_token
42
+
43
+ # Model
44
+ tiny_config = TinyLlamaConfig(**model_cfg)
45
+ model = TinyLlamaForCausalLM(tiny_config)
46
+ model = model.to(torch.bfloat16)
47
+
48
+ n_params = sum(p.numel() for p in model.parameters()) / 1e6
49
+ print(f"Model: {n_params:.2f}M params | MLP type: {tiny_config.mlp_type} | Activation: {tiny_config.activation}")
50
+
51
+ # Data
52
+ msl = model_cfg.get("max_position_embeddings", 512)
53
+ train_ds = build_dataset(
54
+ tokenizer,
55
+ max_seq_len=msl,
56
+ split="train",
57
+ max_samples=None
58
+ )
59
+ eval_ds = build_dataset(
60
+ tokenizer,
61
+ max_seq_len=msl,
62
+ split="validation",
63
+ max_samples=None
64
+ )
65
+
66
+ # Train
67
+ trainer = create_trainer(model, tokenizer, cfg, train_ds, eval_ds)
68
+ trainer.train()
69
+
70
+ # Save & push
71
+ out = train_cfg.get("output_dir", "./out")
72
+ trainer.save_model(out)
73
+ if args.push or train_cfg.get("push_to_hub", False):
74
+ trainer.push_to_hub()
75
+ print(f"Done. Artifacts in {out}")
76
+
77
+
78
+ if __name__ == "__main__":
79
+ main()
zain/Activation/wandb/debug-internal.log ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"time":"2026-08-12T18:21:26.321661629Z","level":"INFO","msg":"wandb-core"}
2
+ {"time":"2026-08-12T18:21:26.321798801Z","level":"INFO","msg":"stream: starting","core version":"0.28.1"}
3
+ {"time":"2026-08-12T18:21:26.578546502Z","level":"INFO","msg":"stream: created new stream","id":"vyycsg6r"}
4
+ {"time":"2026-08-12T18:21:26.578636888Z","level":"INFO","msg":"handler: started"}
5
+ {"time":"2026-08-12T18:21:26.578724462Z","level":"INFO","msg":"stream: started"}
6
+ {"time":"2026-08-12T18:21:26.578734628Z","level":"INFO","msg":"writer: started","stream_id":"vyycsg6r"}
7
+ {"time":"2026-08-12T18:21:26.578760021Z","level":"INFO","msg":"sender: started"}
8
+ {"time":"2026-08-12T18:21:27.883572309Z","level":"INFO","msg":"filestream: sending request","total_files":1,"console_offset":0,"console_lines":1}
9
+ {"time":"2026-08-12T18:21:27.993870368Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
10
+ {"time":"2026-08-12T18:21:42.884685513Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":0,"history_lines":1,"events_offset":0,"events_lines":2,"console_offset":0,"console_lines":2,"uploaded_len":2}
11
+ {"time":"2026-08-12T18:21:43.002439917Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
12
+ {"time":"2026-08-12T18:21:57.884556428Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":1,"history_lines":1,"events_offset":2,"events_lines":2,"console_offset":0,"console_lines":1}
13
+ {"time":"2026-08-12T18:21:58.005057203Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
zain/Activation/wandb/debug.log ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-08-12 18:21:26,320 INFO MainThread:1371664 [wandb_init.py:setup_run_log_directory():729] Logging user logs to /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/wandb/run-20260812_182126-vyycsg6r/logs/debug.log
2
+ 2026-08-12 18:21:26,320 INFO MainThread:1371664 [wandb_init.py:setup_run_log_directory():730] Logging internal logs to /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/wandb/run-20260812_182126-vyycsg6r/logs/debug-internal.log
3
+ 2026-08-12 18:21:26,320 INFO MainThread:1371664 [wandb_init.py:init():772] calling init triggers
4
+ 2026-08-12 18:21:26,320 INFO MainThread:1371664 [wandb_init.py:init():777] wandb.init called with sweep_config: {}
5
+ config: {'_wandb': {}}
6
+ 2026-08-12 18:21:26,320 INFO MainThread:1371664 [wandb_init.py:init():820] starting backend
7
+ 2026-08-12 18:21:26,320 INFO MainThread:1371664 [wandb_init.py:init():826] Connected to an existing wandb-core service via WANDB_SERVICE
8
+ 2026-08-12 18:21:26,320 INFO MainThread:1371664 [wandb_init.py:init():835] sending inform_init request
9
+ 2026-08-12 18:21:26,579 INFO MainThread:1371664 [wandb_init.py:init():840] backend started and connected
10
+ 2026-08-12 18:21:26,580 INFO MainThread:1371664 [wandb_init.py:init():910] updated telemetry
11
+ 2026-08-12 18:21:26,586 INFO MainThread:1371664 [wandb_init.py:init():933] communicating run to backend with 90.0 second timeout
12
+ 2026-08-12 18:21:26,892 INFO MainThread:1371664 [wandb_init.py:init():978] starting run threads in backend
13
+ 2026-08-12 18:21:26,969 INFO MainThread:1371664 [wandb_run.py:_console_start():2621] atexit reg
14
+ 2026-08-12 18:21:26,969 INFO MainThread:1371664 [wandb_run.py:_redirect():2471] redirect: wrap_raw
15
+ 2026-08-12 18:21:26,969 INFO MainThread:1371664 [wandb_run.py:_redirect():2540] Wrapping output streams.
16
+ 2026-08-12 18:21:26,969 INFO MainThread:1371664 [wandb_run.py:_redirect():2563] Redirects installed.
17
+ 2026-08-12 18:21:26,970 INFO MainThread:1371664 [wandb_init.py:init():1016] run started, returning control to user process
18
+ 2026-08-12 18:21:26,971 INFO MainThread:1371664 [wandb_run.py:_config_callback():1346] config_cb None None {'transformers_version': '5.16.0.dev0', 'architectures': None, 'output_hidden_states': False, 'return_dict': True, 'dtype': None, 'chunk_size_feed_forward': 0, 'is_encoder_decoder': False, 'id2label': {0: 'LABEL_0', 1: 'LABEL_1'}, 'label2id': {'LABEL_0': 0, 'LABEL_1': 1}, 'problem_type': None, 'vocab_size': 4096, 'hidden_size': 128, 'intermediate_size': 256, 'num_hidden_layers': 150, 'num_attention_heads': 4, 'num_key_value_heads': 4, 'hidden_act': 'silu', 'max_position_embeddings': 512, 'initializer_range': 0.02, 'rms_norm_eps': 1e-06, 'use_cache': False, 'pad_token_id': 0, 'bos_token_id': 1, 'eos_token_id': 2, 'pretraining_tp': 1, 'tie_word_embeddings': True, 'rope_parameters': {'rope_theta': 10000.0, 'rope_type': 'default'}, 'attention_bias': False, 'attention_dropout': 0.0, 'mlp_bias': False, 'head_dim': 32, '_name_or_path': '', 'tokenizer_name': 'w-ahmad/tiny-stories-tokenizer', 'mlp_type': 'glu', 'activation': 'gelu', 'waleed_beta': 10.0, 'model_type': 'tiny_llama', 'output_attentions': False, 'output_dir': 'out/glu-gelu-150L_run', 'per_device_train_batch_size': 64, 'num_train_epochs': 1, 'max_steps': 1000, 'learning_rate': 0.005, 'lr_scheduler_type': 'constant_with_warmup', 'lr_scheduler_kwargs': None, 'warmup_steps': 200, 'optim': 'adamw_torch_fused', 'optim_args': None, 'weight_decay': 0.0, 'adam_beta1': 0.9, 'adam_beta2': 0.999, 'adam_epsilon': 1e-08, 'optim_target_modules': None, 'gradient_accumulation_steps': 1, 'average_tokens_across_devices': True, 'max_grad_norm': 0.0, 'label_smoothing_factor': 0.0, 'bf16': True, 'fp16': False, 'bf16_full_eval': False, 'fp16_full_eval': False, 'tf32': None, 'gradient_checkpointing': False, 'gradient_checkpointing_kwargs': None, 'torch_compile': False, 'torch_compile_backend': None, 'torch_compile_mode': None, 'use_liger_kernel': False, 'liger_kernel_config': None, 'neftune_noise_alpha': None, 'torch_empty_cache_steps': None, 'auto_find_batch_size': False, 'logging_strategy': 'steps', 'logging_steps': 20, 'logging_first_step': False, 'log_on_each_node': True, 'logging_nan_inf_filter': True, 'include_num_input_tokens_seen': 'no', 'log_level': 'passive', 'log_level_replica': 'warning', 'disable_tqdm': False, 'report_to': ['wandb'], 'run_name': 'LM-glu-gelu-150L-25.1M-20260812-182125', 'project': 'huggingface', 'trackio_space_id': None, 'trackio_bucket_id': None, 'trackio_static_space_id': None, 'eval_strategy': 'steps', 'eval_steps': 50, 'eval_delay': 0, 'per_device_eval_batch_size': 128, 'prediction_loss_only': False, 'eval_on_start': False, 'eval_do_concat_batches': True, 'eval_use_gather_object': False, 'eval_accumulation_steps': None, 'include_for_metrics': [], 'batch_eval_metrics': False, 'save_only_model': False, 'save_strategy': 'steps', 'save_steps': 1000, 'save_on_each_node': False, 'save_total_limit': None, 'enable_jit_checkpoint': False, 'push_to_hub': False, 'hub_token': '<HUB_TOKEN>', 'hub_private_repo': None, 'hub_model_id': 'w-ahmad/6L-glu-gelu-150L', 'hub_strategy': 'every_save', 'hub_always_push': False, 'hub_revision': None, 'load_best_model_at_end': False, 'metric_for_best_model': None, 'greater_is_better': None, 'ignore_data_skip': False, 'restore_callback_states_from_checkpoint': False, 'full_determinism': False, 'seed': 42, 'data_seed': 42, 'use_cpu': False, 'accelerator_config': {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}, 'parallelism_config': None, 'dataloader_drop_last': False, 'dataloader_num_workers': 0, 'dataloader_pin_memory': True, 'dataloader_persistent_workers': False, 'dataloader_prefetch_factor': None, 'dataloader_multiprocessing_context': None, 'dataloader_in_order': True, 'remove_unused_columns': False, 'label_names': None, 'train_sampling_strategy': 'random', 'length_column_name': 'length', 'ddp_find_unused_parameters': None, 'ddp_bucket_cap_mb': None, 'ddp_broadcast_buffers': None, 'ddp_static_graph': None, 'ddp_backend': None, 'ddp_timeout': 1800, 'fsdp': None, 'fsdp_config': None, 'deepspeed': None, 'debug': [], 'skip_memory_metrics': True, 'do_train': False, 'do_eval': True, 'do_predict': False, 'resume_from_checkpoint': None, 'local_rank': -1}
19
+ 2026-08-12 18:21:26,978 INFO MainThread:1371664 [wandb_config.py:__setitem__():155] [no run ID] config set model/num_parameters = 25138816 - <bound method Run._config_callback of <wandb.sdk.wandb_run.Run object at 0x14c5efbb9090>>
20
+ 2026-08-12 18:21:26,979 INFO MainThread:1371664 [wandb_run.py:_config_callback():1346] config_cb model/num_parameters 25138816 None
zain/Activation/wandb/run-20260812_175304-hrggki9k/files/config.yaml ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _name_or_path:
2
+ value: ""
3
+ _wandb:
4
+ value:
5
+ cli_version: 0.28.1
6
+ e:
7
+ nyupeef48exzv166j8gx7nmchredluzy:
8
+ args:
9
+ - --config
10
+ - /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/configs/baseline150L.yaml
11
+ - --variants
12
+ - glu-silu
13
+ - glu-relu
14
+ - glu-gelu
15
+ - glu-sigmoid
16
+ - glu-linear
17
+ - glu-waleed10
18
+ - mlp-waleed10
19
+ - glu-silu-waleed10
20
+ - mlp-silu-waleed10
21
+ - glu-situglu
22
+ - glu-waleed
23
+ - glu-situglu_low
24
+ - glu-waleedglu_low
25
+ codePath: sweep.py
26
+ codePathLocal: sweep.py
27
+ cpu_count: 112
28
+ cpu_count_logical: 224
29
+ cudaVersion: "12.4"
30
+ disk:
31
+ /:
32
+ total: "1560765693952"
33
+ used: "716176670720"
34
+ email: deepnevro@gmail.com
35
+ executable: /mnt/data/zainulabideen/zain-exp/notebooks/my_env/bin/python
36
+ git:
37
+ commit: c53713bcba08d1849136dad91288c4b82040634e
38
+ remote: https://github.com/w-ahmad1a10/Activation.git
39
+ gpu: NVIDIA H100 80GB HBM3
40
+ gpu_count: 8
41
+ gpu_nvidia:
42
+ - architecture: Hopper
43
+ cudaCores: 16896
44
+ memoryTotal: "85520809984"
45
+ name: NVIDIA H100 80GB HBM3
46
+ uuid: GPU-39c684a5-fde6-83d7-1663-0859795881ae
47
+ - architecture: Hopper
48
+ cudaCores: 16896
49
+ memoryTotal: "85520809984"
50
+ name: NVIDIA H100 80GB HBM3
51
+ uuid: GPU-68012e5a-38b6-b643-0ca6-62fb66720bf3
52
+ - architecture: Hopper
53
+ cudaCores: 16896
54
+ memoryTotal: "85520809984"
55
+ name: NVIDIA H100 80GB HBM3
56
+ uuid: GPU-132944c4-b689-2b5f-89a4-d730401677ab
57
+ - architecture: Hopper
58
+ cudaCores: 16896
59
+ memoryTotal: "85520809984"
60
+ name: NVIDIA H100 80GB HBM3
61
+ uuid: GPU-2df386cc-6d26-d0e2-7a2d-a057b0d95864
62
+ - architecture: Hopper
63
+ cudaCores: 16896
64
+ memoryTotal: "85520809984"
65
+ name: NVIDIA H100 80GB HBM3
66
+ uuid: GPU-bfa16575-1d94-1aa2-4537-2c93433f42ef
67
+ - architecture: Hopper
68
+ cudaCores: 16896
69
+ memoryTotal: "85520809984"
70
+ name: NVIDIA H100 80GB HBM3
71
+ uuid: GPU-bc6c3e3c-9b90-09ca-c034-774961847c54
72
+ - architecture: Hopper
73
+ cudaCores: 16896
74
+ memoryTotal: "85520809984"
75
+ name: NVIDIA H100 80GB HBM3
76
+ uuid: GPU-00a441e1-7c95-e7d6-4c35-43d6b291aea9
77
+ - architecture: Hopper
78
+ cudaCores: 16896
79
+ memoryTotal: "85520809984"
80
+ name: NVIDIA H100 80GB HBM3
81
+ uuid: GPU-1c4d29a2-4647-6fce-d8fc-0c5ecfbbd6ea
82
+ host: deeplens-k3s-node1
83
+ memory:
84
+ total: "2164089937920"
85
+ os: Linux-5.15.0-126-generic-x86_64-with-glibc2.35
86
+ program: /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/sweep.py
87
+ python: CPython 3.11.15
88
+ root: /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation
89
+ startedAt: "2026-08-12T17:53:04.074150Z"
90
+ writerId: nyupeef48exzv166j8gx7nmchredluzy
91
+ m:
92
+ - "1": train/global_step
93
+ "6":
94
+ - 3
95
+ "7": []
96
+ - "2": '*'
97
+ "5": 1
98
+ "6":
99
+ - 1
100
+ "7": []
101
+ python_version: 3.11.15
102
+ t:
103
+ "1":
104
+ - 1
105
+ - 5
106
+ - 11
107
+ - 41
108
+ - 49
109
+ - 51
110
+ - 53
111
+ - 71
112
+ "2":
113
+ - 1
114
+ - 5
115
+ - 11
116
+ - 41
117
+ - 49
118
+ - 51
119
+ - 53
120
+ - 71
121
+ "3":
122
+ - 2
123
+ - 7
124
+ - 13
125
+ - 19
126
+ - 62
127
+ - 66
128
+ "4": 3.11.15
129
+ "5": 0.28.1
130
+ "6": 5.16.0.dev0
131
+ "9":
132
+ "1": transformers_trainer
133
+ "12": 0.28.1
134
+ "13": linux-x86_64
135
+ accelerator_config:
136
+ value:
137
+ dispatch_batches: null
138
+ even_batches: true
139
+ gradient_accumulation_kwargs: null
140
+ non_blocking: false
141
+ split_batches: false
142
+ use_seedable_sampler: true
143
+ activation:
144
+ value: silu
145
+ adam_beta1:
146
+ value: 0.9
147
+ adam_beta2:
148
+ value: 0.999
149
+ adam_epsilon:
150
+ value: 1e-08
151
+ architectures:
152
+ value: null
153
+ attention_bias:
154
+ value: false
155
+ attention_dropout:
156
+ value: 0
157
+ auto_find_batch_size:
158
+ value: false
159
+ average_tokens_across_devices:
160
+ value: true
161
+ batch_eval_metrics:
162
+ value: false
163
+ bf16:
164
+ value: true
165
+ bf16_full_eval:
166
+ value: false
167
+ bos_token_id:
168
+ value: 1
169
+ chunk_size_feed_forward:
170
+ value: 0
171
+ data_seed:
172
+ value: 42
173
+ dataloader_drop_last:
174
+ value: false
175
+ dataloader_in_order:
176
+ value: true
177
+ dataloader_multiprocessing_context:
178
+ value: null
179
+ dataloader_num_workers:
180
+ value: 0
181
+ dataloader_persistent_workers:
182
+ value: false
183
+ dataloader_pin_memory:
184
+ value: true
185
+ dataloader_prefetch_factor:
186
+ value: null
187
+ ddp_backend:
188
+ value: null
189
+ ddp_broadcast_buffers:
190
+ value: null
191
+ ddp_bucket_cap_mb:
192
+ value: null
193
+ ddp_find_unused_parameters:
194
+ value: null
195
+ ddp_static_graph:
196
+ value: null
197
+ ddp_timeout:
198
+ value: 1800
199
+ debug:
200
+ value: []
201
+ deepspeed:
202
+ value: null
203
+ disable_tqdm:
204
+ value: false
205
+ do_eval:
206
+ value: true
207
+ do_predict:
208
+ value: false
209
+ do_train:
210
+ value: false
211
+ dtype:
212
+ value: null
213
+ enable_jit_checkpoint:
214
+ value: false
215
+ eos_token_id:
216
+ value: 2
217
+ eval_accumulation_steps:
218
+ value: null
219
+ eval_delay:
220
+ value: 0
221
+ eval_do_concat_batches:
222
+ value: true
223
+ eval_on_start:
224
+ value: false
225
+ eval_steps:
226
+ value: 50
227
+ eval_strategy:
228
+ value: steps
229
+ eval_use_gather_object:
230
+ value: false
231
+ fp16:
232
+ value: false
233
+ fp16_full_eval:
234
+ value: false
235
+ fsdp:
236
+ value: null
237
+ fsdp_config:
238
+ value: null
239
+ full_determinism:
240
+ value: false
241
+ gradient_accumulation_steps:
242
+ value: 1
243
+ gradient_checkpointing:
244
+ value: false
245
+ gradient_checkpointing_kwargs:
246
+ value: null
247
+ greater_is_better:
248
+ value: null
249
+ head_dim:
250
+ value: 32
251
+ hidden_act:
252
+ value: silu
253
+ hidden_size:
254
+ value: 128
255
+ hub_always_push:
256
+ value: false
257
+ hub_model_id:
258
+ value: w-ahmad/6L-glu-silu-150L
259
+ hub_private_repo:
260
+ value: null
261
+ hub_revision:
262
+ value: null
263
+ hub_strategy:
264
+ value: every_save
265
+ hub_token:
266
+ value: <HUB_TOKEN>
267
+ id2label:
268
+ value:
269
+ "0": LABEL_0
270
+ "1": LABEL_1
271
+ ignore_data_skip:
272
+ value: false
273
+ include_for_metrics:
274
+ value: []
275
+ include_num_input_tokens_seen:
276
+ value: "no"
277
+ initializer_range:
278
+ value: 0.02
279
+ intermediate_size:
280
+ value: 256
281
+ is_encoder_decoder:
282
+ value: false
283
+ label_names:
284
+ value: null
285
+ label_smoothing_factor:
286
+ value: 0
287
+ label2id:
288
+ value:
289
+ LABEL_0: 0
290
+ LABEL_1: 1
291
+ learning_rate:
292
+ value: 0.005
293
+ length_column_name:
294
+ value: length
295
+ liger_kernel_config:
296
+ value: null
297
+ load_best_model_at_end:
298
+ value: false
299
+ local_rank:
300
+ value: -1
301
+ log_level:
302
+ value: passive
303
+ log_level_replica:
304
+ value: warning
305
+ log_on_each_node:
306
+ value: true
307
+ logging_first_step:
308
+ value: false
309
+ logging_nan_inf_filter:
310
+ value: true
311
+ logging_steps:
312
+ value: 20
313
+ logging_strategy:
314
+ value: steps
315
+ lr_scheduler_kwargs:
316
+ value: null
317
+ lr_scheduler_type:
318
+ value: constant_with_warmup
319
+ max_grad_norm:
320
+ value: 0
321
+ max_position_embeddings:
322
+ value: 512
323
+ max_steps:
324
+ value: 1000
325
+ metric_for_best_model:
326
+ value: null
327
+ mlp_bias:
328
+ value: false
329
+ mlp_type:
330
+ value: glu
331
+ model/num_parameters:
332
+ value: 25138816
333
+ model_type:
334
+ value: tiny_llama
335
+ neftune_noise_alpha:
336
+ value: null
337
+ num_attention_heads:
338
+ value: 4
339
+ num_hidden_layers:
340
+ value: 150
341
+ num_key_value_heads:
342
+ value: 4
343
+ num_train_epochs:
344
+ value: 1
345
+ optim:
346
+ value: adamw_torch_fused
347
+ optim_args:
348
+ value: null
349
+ optim_target_modules:
350
+ value: null
351
+ output_attentions:
352
+ value: false
353
+ output_dir:
354
+ value: out/glu-silu-150L_run
355
+ output_hidden_states:
356
+ value: false
357
+ pad_token_id:
358
+ value: 0
359
+ parallelism_config:
360
+ value: null
361
+ per_device_eval_batch_size:
362
+ value: 128
363
+ per_device_train_batch_size:
364
+ value: 64
365
+ prediction_loss_only:
366
+ value: false
367
+ pretraining_tp:
368
+ value: 1
369
+ problem_type:
370
+ value: null
371
+ project:
372
+ value: huggingface
373
+ push_to_hub:
374
+ value: false
375
+ remove_unused_columns:
376
+ value: false
377
+ report_to:
378
+ value:
379
+ - wandb
380
+ restore_callback_states_from_checkpoint:
381
+ value: false
382
+ resume_from_checkpoint:
383
+ value: null
384
+ return_dict:
385
+ value: true
386
+ rms_norm_eps:
387
+ value: 1e-06
388
+ rope_parameters:
389
+ value:
390
+ rope_theta: 10000
391
+ rope_type: default
392
+ run_name:
393
+ value: LM-glu-silu-150L-25.1M-20260812-175302
394
+ save_on_each_node:
395
+ value: false
396
+ save_only_model:
397
+ value: false
398
+ save_steps:
399
+ value: 1000
400
+ save_strategy:
401
+ value: steps
402
+ save_total_limit:
403
+ value: null
404
+ seed:
405
+ value: 42
406
+ skip_memory_metrics:
407
+ value: true
408
+ tf32:
409
+ value: null
410
+ tie_word_embeddings:
411
+ value: true
412
+ tokenizer_name:
413
+ value: w-ahmad/tiny-stories-tokenizer
414
+ torch_compile:
415
+ value: false
416
+ torch_compile_backend:
417
+ value: null
418
+ torch_compile_mode:
419
+ value: null
420
+ torch_empty_cache_steps:
421
+ value: null
422
+ trackio_bucket_id:
423
+ value: null
424
+ trackio_space_id:
425
+ value: null
426
+ trackio_static_space_id:
427
+ value: null
428
+ train_sampling_strategy:
429
+ value: random
430
+ transformers_version:
431
+ value: 5.16.0.dev0
432
+ use_cache:
433
+ value: false
434
+ use_cpu:
435
+ value: false
436
+ use_liger_kernel:
437
+ value: false
438
+ vocab_size:
439
+ value: 4096
440
+ waleed_beta:
441
+ value: 10
442
+ warmup_steps:
443
+ value: 200
444
+ weight_decay:
445
+ value: 0
zain/Activation/wandb/run-20260812_175304-hrggki9k/files/output.log ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [transformers] `use_return_dict` is deprecated! Use `return_dict` instead!
2
+ [INFO] Causal mask (float with -inf) applied to all attention layers.
3
+
4
+ {'loss': '7.966', 'grad_norm': '1.258', 'learning_rate': '0.000475', 'epoch': '0.001348', 'train/total_time_seconds': '7.768', 'train/time_per_step_avg': '0.3884', 'train/epoch_time_elapsed': '8.87', 'train/estimated_remaining_minutes': '6.344'}
5
+ {'loss': '6.834', 'grad_norm': '0.875', 'learning_rate': '0.000975', 'epoch': '0.002696', 'train/total_time_seconds': '14.69', 'train/time_per_step_avg': '0.3673', 'train/epoch_time_elapsed': '16.77', 'train/estimated_remaining_minutes': '5.877'}
6
+
7
+ {'eval_loss': '6.037', 'eval_runtime': '20.95', 'eval_samples_per_second': '454.8', 'eval_steps_per_second': '3.581', 'epoch': '0.00337', 'train/total_time_seconds': '18.17', 'train/time_per_step_avg': '0.3634', 'train/epoch_time_elapsed': '41.69', 'train/estimated_remaining_minutes': '5.753'}
8
+ {'loss': '6.079', 'grad_norm': '0.2305', 'learning_rate': '0.001475', 'epoch': '0.004044', 'train/total_time_seconds': '21.63', 'train/time_per_step_avg': '0.3605', 'train/epoch_time_elapsed': '45.63', 'train/estimated_remaining_minutes': '5.648'}
9
+ {'loss': '6.011', 'grad_norm': '0.1201', 'learning_rate': '0.001975', 'epoch': '0.005393', 'train/total_time_seconds': '28.59', 'train/time_per_step_avg': '0.3574', 'train/epoch_time_elapsed': '53.58', 'train/estimated_remaining_minutes': '5.48'}
10
+ {'loss': '5.894', 'grad_norm': '0.5312', 'learning_rate': '0.002475', 'epoch': '0.006741', 'train/total_time_seconds': '35.54', 'train/time_per_step_avg': '0.3554', 'train/epoch_time_elapsed': '61.52', 'train/estimated_remaining_minutes': '5.331'}
11
+ {'eval_loss': '5.803', 'eval_runtime': '21', 'eval_samples_per_second': '453.6', 'eval_steps_per_second': '3.571', 'epoch': '0.006741', 'train/total_time_seconds': '35.54', 'train/time_per_step_avg': '0.3554', 'train/epoch_time_elapsed': '82.52', 'train/estimated_remaining_minutes': '5.331'}
12
+ {'loss': '5.78', 'grad_norm': '0.3184', 'learning_rate': '0.002975', 'epoch': '0.008089', 'train/total_time_seconds': '42.51', 'train/time_per_step_avg': '0.3474', 'train/epoch_time_elapsed': '90.48', 'train/estimated_remaining_minutes': '5.195'}
13
+ {'loss': '5.595', 'grad_norm': '0.2012', 'learning_rate': '0.003475', 'epoch': '0.009437', 'train/total_time_seconds': '49.74', 'train/time_per_step_avg': '0.3505', 'train/epoch_time_elapsed': '98.69', 'train/estimated_remaining_minutes': '5.092'}
14
+ {'eval_loss': '5.564', 'eval_runtime': '21.06', 'eval_samples_per_second': '452.3', 'eval_steps_per_second': '3.561', 'epoch': '0.01011', 'train/total_time_seconds': '53.27', 'train/time_per_step_avg': '0.351', 'train/epoch_time_elapsed': '123.8', 'train/estimated_remaining_minutes': '5.031'}
15
+ {'loss': '5.554', 'grad_norm': '0.2383', 'learning_rate': '0.003975', 'epoch': '0.01079', 'train/total_time_seconds': '56.73', 'train/time_per_step_avg': '0.351', 'train/epoch_time_elapsed': '127.7', 'train/estimated_remaining_minutes': '4.964'}
16
+ {'loss': '5.472', 'grad_norm': '0.3047', 'learning_rate': '0.004475', 'epoch': '0.01213', 'train/total_time_seconds': '63.65', 'train/time_per_step_avg': '0.3506', 'train/epoch_time_elapsed': '135.6', 'train/estimated_remaining_minutes': '4.833'}
17
+ {'loss': '5.362', 'grad_norm': '0.2109', 'learning_rate': '0.004975', 'epoch': '0.01348', 'train/total_time_seconds': '70.62', 'train/time_per_step_avg': '0.3508', 'train/epoch_time_elapsed': '143.5', 'train/estimated_remaining_minutes': '4.708'}
18
+ {'eval_loss': '5.278', 'eval_runtime': '21.03', 'eval_samples_per_second': '453', 'eval_steps_per_second': '3.566', 'epoch': '0.01348', 'train/total_time_seconds': '70.62', 'train/time_per_step_avg': '0.3508', 'train/epoch_time_elapsed': '164.6', 'train/estimated_remaining_minutes': '4.708'}
19
+ {'loss': '5.181', 'grad_norm': '0.3945', 'learning_rate': '0.005', 'epoch': '0.01483', 'train/total_time_seconds': '77.71', 'train/time_per_step_avg': '0.352', 'train/epoch_time_elapsed': '172.6', 'train/estimated_remaining_minutes': '4.592'}
20
+ {'loss': '5.014', 'grad_norm': '0.2754', 'learning_rate': '0.005', 'epoch': '0.01618', 'train/total_time_seconds': '84.77', 'train/time_per_step_avg': '0.3503', 'train/epoch_time_elapsed': '180.7', 'train/estimated_remaining_minutes': '4.474'}
21
+ {'eval_loss': '4.766', 'eval_runtime': '21', 'eval_samples_per_second': '453.8', 'eval_steps_per_second': '3.572', 'epoch': '0.01685', 'train/total_time_seconds': '88.31', 'train/time_per_step_avg': '0.3504', 'train/epoch_time_elapsed': '205.7', 'train/estimated_remaining_minutes': '4.415'}
22
+ {'loss': '4.78', 'grad_norm': '0.7578', 'learning_rate': '0.005', 'epoch': '0.01753', 'train/total_time_seconds': '92.08', 'train/time_per_step_avg': '0.3535', 'train/epoch_time_elapsed': '210', 'train/estimated_remaining_minutes': '4.368'}
23
+ {'loss': '4.661', 'grad_norm': '0.3086', 'learning_rate': '0.005', 'epoch': '0.01887', 'train/total_time_seconds': '99.16', 'train/time_per_step_avg': '0.355', 'train/epoch_time_elapsed': '218.1', 'train/estimated_remaining_minutes': '4.25'}
24
+ {'loss': '4.492', 'grad_norm': '0.6562', 'learning_rate': '0.005', 'epoch': '0.02022', 'train/total_time_seconds': '106.2', 'train/time_per_step_avg': '0.3563', 'train/epoch_time_elapsed': '226.1', 'train/estimated_remaining_minutes': '4.132'}
25
+ {'eval_loss': '4.413', 'eval_runtime': '21.14', 'eval_samples_per_second': '450.7', 'eval_steps_per_second': '3.548', 'epoch': '0.02022', 'train/total_time_seconds': '106.2', 'train/time_per_step_avg': '0.3563', 'train/epoch_time_elapsed': '247.3', 'train/estimated_remaining_minutes': '4.132'}
26
+ {'loss': '4.335', 'grad_norm': '0.3301', 'learning_rate': '0.005', 'epoch': '0.02157', 'train/total_time_seconds': '113.3', 'train/time_per_step_avg': '0.3559', 'train/epoch_time_elapsed': '255.3', 'train/estimated_remaining_minutes': '4.012'}
27
+ {'loss': '4.257', 'grad_norm': '0.8984', 'learning_rate': '0.005', 'epoch': '0.02292', 'train/total_time_seconds': '120.3', 'train/time_per_step_avg': '0.3557', 'train/epoch_time_elapsed': '263.4', 'train/estimated_remaining_minutes': '3.893'}
28
+ {'eval_loss': '4.176', 'eval_runtime': '21.17', 'eval_samples_per_second': '450', 'eval_steps_per_second': '3.543', 'epoch': '0.02359', 'train/total_time_seconds': '123.9', 'train/time_per_step_avg': '0.3556', 'train/epoch_time_elapsed': '288.5', 'train/estimated_remaining_minutes': '3.834'}
29
+ {'loss': '4.192', 'grad_norm': '0.2891', 'learning_rate': '0.005', 'epoch': '0.02427', 'train/total_time_seconds': '127.4', 'train/time_per_step_avg': '0.3534', 'train/epoch_time_elapsed': '292.6', 'train/estimated_remaining_minutes': '3.775'}
30
+ {'loss': '4.055', 'grad_norm': '0.7188', 'learning_rate': '0.005', 'epoch': '0.02562', 'train/total_time_seconds': '134.5', 'train/time_per_step_avg': '0.3532', 'train/epoch_time_elapsed': '300.6', 'train/estimated_remaining_minutes': '3.657'}
31
+ {'loss': '4.114', 'grad_norm': '0.6367', 'learning_rate': '0.005', 'epoch': '0.02696', 'train/total_time_seconds': '141.8', 'train/time_per_step_avg': '0.3551', 'train/epoch_time_elapsed': '308.9', 'train/estimated_remaining_minutes': '3.544'}
32
+ {'eval_loss': '4.115', 'eval_runtime': '21.01', 'eval_samples_per_second': '453.5', 'eval_steps_per_second': '3.57', 'epoch': '0.02696', 'train/total_time_seconds': '141.8', 'train/time_per_step_avg': '0.3551', 'train/epoch_time_elapsed': '329.9', 'train/estimated_remaining_minutes': '3.544'}
33
+ {'loss': '4.029', 'grad_norm': '0.3223', 'learning_rate': '0.005', 'epoch': '0.02831', 'train/total_time_seconds': '148.7', 'train/time_per_step_avg': '0.3544', 'train/epoch_time_elapsed': '337.8', 'train/estimated_remaining_minutes': '3.423'}
34
+ {'loss': '3.93', 'grad_norm': '0.2412', 'learning_rate': '0.005', 'epoch': '0.02966', 'train/total_time_seconds': '155.7', 'train/time_per_step_avg': '0.3533', 'train/epoch_time_elapsed': '345.7', 'train/estimated_remaining_minutes': '3.302'}
35
+ {'eval_loss': '3.827', 'eval_runtime': '20.98', 'eval_samples_per_second': '454.2', 'eval_steps_per_second': '3.575', 'epoch': '0.03033', 'train/total_time_seconds': '159.1', 'train/time_per_step_avg': '0.3527', 'train/epoch_time_elapsed': '370.7', 'train/estimated_remaining_minutes': '3.242'}
36
+ {'loss': '3.827', 'grad_norm': '0.248', 'learning_rate': '0.005', 'epoch': '0.03101', 'train/total_time_seconds': '162.7', 'train/time_per_step_avg': '0.3524', 'train/epoch_time_elapsed': '374.7', 'train/estimated_remaining_minutes': '3.182'}
37
+ {'loss': '3.767', 'grad_norm': '0.252', 'learning_rate': '0.005', 'epoch': '0.03236', 'train/total_time_seconds': '169.8', 'train/time_per_step_avg': '0.353', 'train/epoch_time_elapsed': '382.8', 'train/estimated_remaining_minutes': '3.065'}
38
+ {'loss': '3.703', 'grad_norm': '0.418', 'learning_rate': '0.005', 'epoch': '0.0337', 'train/total_time_seconds': '176.8', 'train/time_per_step_avg': '0.351', 'train/epoch_time_elapsed': '390.9', 'train/estimated_remaining_minutes': '2.947'}
39
+ {'eval_loss': '3.682', 'eval_runtime': '21.07', 'eval_samples_per_second': '452.3', 'eval_steps_per_second': '3.56', 'epoch': '0.0337', 'train/total_time_seconds': '176.8', 'train/time_per_step_avg': '0.351', 'train/epoch_time_elapsed': '411.9', 'train/estimated_remaining_minutes': '2.947'}
40
+ {'loss': '3.661', 'grad_norm': '0.3008', 'learning_rate': '0.005', 'epoch': '0.03505', 'train/total_time_seconds': '183.8', 'train/time_per_step_avg': '0.3506', 'train/epoch_time_elapsed': '419.9', 'train/estimated_remaining_minutes': '2.828'}
41
+ {'loss': '3.6', 'grad_norm': '0.3203', 'learning_rate': '0.005', 'epoch': '0.0364', 'train/total_time_seconds': '191', 'train/time_per_step_avg': '0.3538', 'train/epoch_time_elapsed': '428.1', 'train/estimated_remaining_minutes': '2.712'}
42
+ {'eval_loss': '3.577', 'eval_runtime': '21.01', 'eval_samples_per_second': '453.4', 'eval_steps_per_second': '3.569', 'epoch': '0.03707', 'train/total_time_seconds': '194.5', 'train/time_per_step_avg': '0.3538', 'train/epoch_time_elapsed': '453.1', 'train/estimated_remaining_minutes': '2.653'}
43
+ {'loss': '3.556', 'grad_norm': '0.3867', 'learning_rate': '0.005', 'epoch': '0.03775', 'train/total_time_seconds': '198', 'train/time_per_step_avg': '0.3533', 'train/epoch_time_elapsed': '457', 'train/estimated_remaining_minutes': '2.593'}
44
+ {'loss': '3.66', 'grad_norm': '0.7148', 'learning_rate': '0.005', 'epoch': '0.0391', 'train/total_time_seconds': '205', 'train/time_per_step_avg': '0.3521', 'train/epoch_time_elapsed': '465', 'train/estimated_remaining_minutes': '2.474'}
45
+ {'loss': '3.643', 'grad_norm': '0.2773', 'learning_rate': '0.005', 'epoch': '0.04044', 'train/total_time_seconds': '212', 'train/time_per_step_avg': '0.3512', 'train/epoch_time_elapsed': '473', 'train/estimated_remaining_minutes': '2.355'}
46
+ {'eval_loss': '3.569', 'eval_runtime': '21.07', 'eval_samples_per_second': '452.2', 'eval_steps_per_second': '3.56', 'epoch': '0.04044', 'train/total_time_seconds': '212', 'train/time_per_step_avg': '0.3512', 'train/epoch_time_elapsed': '494.1', 'train/estimated_remaining_minutes': '2.355'}
47
+ {'loss': '3.522', 'grad_norm': '0.2812', 'learning_rate': '0.005', 'epoch': '0.04179', 'train/total_time_seconds': '219.1', 'train/time_per_step_avg': '0.3534', 'train/epoch_time_elapsed': '502.2', 'train/estimated_remaining_minutes': '2.238'}
48
+ {'loss': '3.495', 'grad_norm': '0.5', 'learning_rate': '0.005', 'epoch': '0.04314', 'train/total_time_seconds': '226.2', 'train/time_per_step_avg': '0.3519', 'train/epoch_time_elapsed': '510.3', 'train/estimated_remaining_minutes': '2.121'}
49
+ {'eval_loss': '3.45', 'eval_runtime': '21.05', 'eval_samples_per_second': '452.6', 'eval_steps_per_second': '3.563', 'epoch': '0.04382', 'train/total_time_seconds': '229.8', 'train/time_per_step_avg': '0.3526', 'train/epoch_time_elapsed': '535.4', 'train/estimated_remaining_minutes': '2.062'}
50
+ {'loss': '3.442', 'grad_norm': '0.4238', 'learning_rate': '0.005', 'epoch': '0.04449', 'train/total_time_seconds': '233.3', 'train/time_per_step_avg': '0.3533', 'train/epoch_time_elapsed': '539.5', 'train/estimated_remaining_minutes': '2.003'}
51
+ {'loss': '3.431', 'grad_norm': '0.2812', 'learning_rate': '0.005', 'epoch': '0.04584', 'train/total_time_seconds': '240.6', 'train/time_per_step_avg': '0.3565', 'train/epoch_time_elapsed': '547.7', 'train/estimated_remaining_minutes': '1.887'}
52
+ {'loss': '3.38', 'grad_norm': '0.2969', 'learning_rate': '0.005', 'epoch': '0.04719', 'train/total_time_seconds': '247.8', 'train/time_per_step_avg': '0.3583', 'train/epoch_time_elapsed': '555.9', 'train/estimated_remaining_minutes': '1.77'}
53
+ {'eval_loss': '3.382', 'eval_runtime': '21.15', 'eval_samples_per_second': '450.5', 'eval_steps_per_second': '3.547', 'epoch': '0.04719', 'train/total_time_seconds': '247.8', 'train/time_per_step_avg': '0.3583', 'train/epoch_time_elapsed': '577', 'train/estimated_remaining_minutes': '1.77'}
54
+ {'loss': '3.357', 'grad_norm': '0.4512', 'learning_rate': '0.005', 'epoch': '0.04853', 'train/total_time_seconds': '254.9', 'train/time_per_step_avg': '0.3577', 'train/epoch_time_elapsed': '585.1', 'train/estimated_remaining_minutes': '1.652'}
55
+ {'loss': '3.327', 'grad_norm': '0.3145', 'learning_rate': '0.005', 'epoch': '0.04988', 'train/total_time_seconds': '262.1', 'train/time_per_step_avg': '0.3588', 'train/epoch_time_elapsed': '593.4', 'train/estimated_remaining_minutes': '1.535'}
56
+ {'eval_loss': '3.327', 'eval_runtime': '21.1', 'eval_samples_per_second': '451.5', 'eval_steps_per_second': '3.555', 'epoch': '0.05056', 'train/total_time_seconds': '265.7', 'train/time_per_step_avg': '0.3587', 'train/epoch_time_elapsed': '618.5', 'train/estimated_remaining_minutes': '1.476'}
57
+ {'loss': '3.323', 'grad_norm': '0.3379', 'learning_rate': '0.005', 'epoch': '0.05123', 'train/total_time_seconds': '269.4', 'train/time_per_step_avg': '0.3605', 'train/epoch_time_elapsed': '622.8', 'train/estimated_remaining_minutes': '1.418'}
58
+ {'loss': '3.313', 'grad_norm': '0.3281', 'learning_rate': '0.005', 'epoch': '0.05258', 'train/total_time_seconds': '276.4', 'train/time_per_step_avg': '0.358', 'train/epoch_time_elapsed': '630.8', 'train/estimated_remaining_minutes': '1.299'}
59
+ {'loss': '3.281', 'grad_norm': '0.3164', 'learning_rate': '0.005', 'epoch': '0.05393', 'train/total_time_seconds': '283.5', 'train/time_per_step_avg': '0.3572', 'train/epoch_time_elapsed': '638.9', 'train/estimated_remaining_minutes': '1.181'}
60
+ {'eval_loss': '3.28', 'eval_runtime': '21.12', 'eval_samples_per_second': '451.1', 'eval_steps_per_second': '3.551', 'epoch': '0.05393', 'train/total_time_seconds': '283.5', 'train/time_per_step_avg': '0.3572', 'train/epoch_time_elapsed': '660', 'train/estimated_remaining_minutes': '1.181'}
61
+ {'loss': '3.288', 'grad_norm': '0.7617', 'learning_rate': '0.005', 'epoch': '0.05527', 'train/total_time_seconds': '290.8', 'train/time_per_step_avg': '0.3588', 'train/epoch_time_elapsed': '668.2', 'train/estimated_remaining_minutes': '1.064'}
62
+ {'loss': '3.274', 'grad_norm': '0.2891', 'learning_rate': '0.005', 'epoch': '0.05662', 'train/total_time_seconds': '298', 'train/time_per_step_avg': '0.3586', 'train/epoch_time_elapsed': '676.4', 'train/estimated_remaining_minutes': '0.946'}
63
+ {'eval_loss': '3.243', 'eval_runtime': '21.02', 'eval_samples_per_second': '453.1', 'eval_steps_per_second': '3.567', 'epoch': '0.0573', 'train/total_time_seconds': '301.5', 'train/time_per_step_avg': '0.3588', 'train/epoch_time_elapsed': '701.5', 'train/estimated_remaining_minutes': '0.8869'}
64
+ {'loss': '3.226', 'grad_norm': '0.3008', 'learning_rate': '0.005', 'epoch': '0.05797', 'train/total_time_seconds': '305.1', 'train/time_per_step_avg': '0.3573', 'train/epoch_time_elapsed': '705.5', 'train/estimated_remaining_minutes': '0.8278'}
65
+ {'loss': '3.212', 'grad_norm': '0.7734', 'learning_rate': '0.005', 'epoch': '0.05932', 'train/total_time_seconds': '312.2', 'train/time_per_step_avg': '0.3581', 'train/epoch_time_elapsed': '713.7', 'train/estimated_remaining_minutes': '0.7096'}
66
+ {'loss': '3.215', 'grad_norm': '0.4453', 'learning_rate': '0.005', 'epoch': '0.06067', 'train/total_time_seconds': '319.3', 'train/time_per_step_avg': '0.3582', 'train/epoch_time_elapsed': '721.7', 'train/estimated_remaining_minutes': '0.5914'}
67
+ {'eval_loss': '3.204', 'eval_runtime': '21.09', 'eval_samples_per_second': '451.8', 'eval_steps_per_second': '3.557', 'epoch': '0.06067', 'train/total_time_seconds': '319.3', 'train/time_per_step_avg': '0.3582', 'train/epoch_time_elapsed': '742.8', 'train/estimated_remaining_minutes': '0.5914'}
68
+ {'loss': '3.2', 'grad_norm': '0.4297', 'learning_rate': '0.005', 'epoch': '0.06202', 'train/total_time_seconds': '326.4', 'train/time_per_step_avg': '0.3563', 'train/epoch_time_elapsed': '750.9', 'train/estimated_remaining_minutes': '0.4731'}
69
+ {'loss': '3.186', 'grad_norm': '0.2695', 'learning_rate': '0.005', 'epoch': '0.06336', 'train/total_time_seconds': '333.7', 'train/time_per_step_avg': '0.3568', 'train/epoch_time_elapsed': '759.1', 'train/estimated_remaining_minutes': '0.355'}
70
+ {'eval_loss': '3.177', 'eval_runtime': '21.38', 'eval_samples_per_second': '445.6', 'eval_steps_per_second': '3.508', 'epoch': '0.06404', 'train/total_time_seconds': '337.2', 'train/time_per_step_avg': '0.3566', 'train/epoch_time_elapsed': '784.5', 'train/estimated_remaining_minutes': '0.2958'}
71
+ {'loss': '3.168', 'grad_norm': '0.4004', 'learning_rate': '0.005', 'epoch': '0.06471', 'train/total_time_seconds': '340.7', 'train/time_per_step_avg': '0.3559', 'train/epoch_time_elapsed': '788.5', 'train/estimated_remaining_minutes': '0.2366'}
72
+ {'loss': '3.164', 'grad_norm': '0.4941', 'learning_rate': '0.005', 'epoch': '0.06606', 'train/total_time_seconds': '347.7', 'train/time_per_step_avg': '0.3542', 'train/epoch_time_elapsed': '796.4', 'train/estimated_remaining_minutes': '0.1183'}
73
+ {'loss': '3.157', 'grad_norm': '0.6055', 'learning_rate': '0.005', 'epoch': '0.06741', 'train/total_time_seconds': '354.7', 'train/time_per_step_avg': '0.3532', 'train/epoch_time_elapsed': '804.4', 'train/estimated_remaining_minutes': '0'}
74
+ {'eval_loss': '3.169', 'eval_runtime': '20.96', 'eval_samples_per_second': '454.6', 'eval_steps_per_second': '3.579', 'epoch': '0.06741', 'train/total_time_seconds': '354.7', 'train/time_per_step_avg': '0.3532', 'train/epoch_time_elapsed': '825.4', 'train/estimated_remaining_minutes': '0'}
75
+ - If you are the owner of the model architecture code, please modify your model class such that it inherits from `GenerationMixin` (after `PreTrainedModel`, otherwise you'll get an exception).
76
+ - If you are not the owner of the model architecture class, please contact the model code owner to update it.
77
+ Writing model shards: 100%|██████████| 1/1 [00:00<00:00, 9.22it/s]
78
+ 100%|██████████| 1000/1000 [13:46<00:00, 1.21it/s]0:00, 9.30it/s]
79
+ {'train_runtime': '826.5', 'train_samples_per_second': '77.43', 'train_steps_per_second': '1.21', 'train_loss': '4.179', 'epoch': '0.06741', 'train/total_time_seconds': '354.7', 'train/time_per_step_avg': '0.3532', 'train/epoch_time_elapsed': '825.8', 'train/estimated_remaining_minutes': '0'}
80
+ 100%|██████████| 75/75 [00:20<00:00, 3.63it/s]
81
+ [transformers] TinyLlamaForCausalLM has generative capabilities, as `prepare_inputs_for_generation` is explicitly defined. However, it doesn't directly inherit from `GenerationMixin`. From 👉v4.50👈 onwards, `PreTrainedModel` will NOT inherit from `GenerationMixin`, and this model will lose the ability to call `generate` and other related functions.
82
+ - If you're using `trust_remote_code=True`, you can get rid of this warning by loading the model with an auto class. See https://huggingface.co/docs/transformers/en/model_doc/auto#auto-classes
83
+ - If you are the owner of the model architecture code, please modify your model class such that it inherits from `GenerationMixin` (after `PreTrainedModel`, otherwise you'll get an exception).
84
+ - If you are not the owner of the model architecture class, please contact the model code owner to update it.
85
+ Writing model shards: 100%|██████████| 1/1 [00:00<00:00, 11.28it/s]
zain/Activation/wandb/run-20260812_175304-hrggki9k/files/requirements.txt ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ asttokens==3.0.1
2
+ comm==0.2.3
3
+ debugpy==1.8.21
4
+ decorator==5.3.1
5
+ executing==2.2.1
6
+ nest-asyncio==1.6.0
7
+ parso==0.8.7
8
+ platformdirs==4.11.0
9
+ psutil==7.2.2
10
+ ptyprocess==0.7.0
11
+ pure_eval==0.2.3
12
+ Pygments==2.20.0
13
+ pyzmq==27.1.0
14
+ setuptools==83.0.0
15
+ six==1.17.0
16
+ tornado==6.5.7
17
+ traitlets==5.15.0
18
+ fsspec==2026.4.0
19
+ wcwidth==0.8.2
20
+ ipython_pygments_lexers==1.1.1
21
+ jedi==0.20.0
22
+ jupyter_core==5.9.1
23
+ matplotlib-inline==0.2.2
24
+ pexpect==4.9.0
25
+ prompt_toolkit==3.0.53
26
+ python-dateutil==2.9.0.post0
27
+ stack_data==0.6.3
28
+ wheel==0.47.0
29
+ jupyter_client==8.9.1
30
+ pip==26.1.2
31
+ ipython==9.15.0
32
+ ipykernel==7.2.0
33
+ threadpoolctl==3.6.0
34
+ pyparsing==3.3.2
35
+ typing_extensions==4.15.0
36
+ Jinja2==3.1.6
37
+ narwhals==2.24.0
38
+ kiwisolver==1.5.0
39
+ joblib==1.5.3
40
+ fonttools==4.63.0
41
+ cycler==0.12.1
42
+ scipy==1.17.1
43
+ pandas==3.0.5
44
+ contourpy==1.3.3
45
+ scikit-learn==1.9.0
46
+ matplotlib==3.11.1
47
+ urllib3==2.7.0
48
+ tqdm==4.70.0
49
+ idna==3.18
50
+ charset-normalizer==3.4.9
51
+ certifi==2026.7.22
52
+ requests==2.34.2
53
+ seaborn==0.13.2
54
+ uv==0.12.0
55
+ shellingham==1.5.4
56
+ mpmath==1.3.0
57
+ attrs==26.1.0
58
+ hf-xet==1.5.2
59
+ nvidia-nccl-cu12==2.21.5
60
+ MarkupSafe==3.0.3
61
+ regex==2026.7.19
62
+ importlib_metadata==9.0.0
63
+ httpcore==1.0.9
64
+ annotated-doc==0.0.5
65
+ multidict==6.7.1
66
+ aiohttp==3.14.3
67
+ aiosignal==1.4.0
68
+ xxhash==3.8.1
69
+ aiohappyeyeballs==2.7.1
70
+ mdurl==0.1.2
71
+ cuda-toolkit==13.0.3.0
72
+ networkx==3.6.1
73
+ PyYAML==6.0.3
74
+ nvidia-cufile==1.15.1.6
75
+ typer==0.27.0
76
+ torchaudio==2.6.0+cu124
77
+ rich==15.0.0
78
+ nvidia-cufft-cu12==11.2.1.3
79
+ h11==0.16.0
80
+ dill==0.4.1
81
+ cuda-pathfinder==1.6.0
82
+ filelock==3.29.0
83
+ nvidia-nvtx-cu12==12.4.127
84
+ httpx==0.28.1
85
+ anyio==4.14.2
86
+ numpy==2.4.4
87
+ yarl==1.24.5
88
+ click==8.4.2
89
+ triton==3.2.0
90
+ frozenlist==1.8.0
91
+ zipp==4.1.0
92
+ propcache==0.5.2
93
+ tokenizers==0.22.2
94
+ markdown-it-py==4.2.0
95
+ nvidia-cuda-runtime==13.0.96
96
+ cuda-bindings==13.3.1
97
+ nvidia-cuda-cupti==13.0.85
98
+ torch==2.6.0+cu124
99
+ multiprocess==0.70.19
100
+ pillow==12.2.0
101
+ transformers==5.16.0.dev0
102
+ wandb==0.28.1
103
+ nvidia-curand==10.4.0.35
104
+ sympy==1.13.1
105
+ nvidia-cusparse==12.6.3.3
106
+ nvidia-cuda-nvrtc==13.0.88
107
+ typing-inspection==0.4.2
108
+ nvidia-cusolver==12.0.4.66
109
+ nvidia-cufft==12.0.0.61
110
+ nvidia-cudnn-cu13==9.20.0.48
111
+ nvidia-cublas==13.1.1.3
112
+ pyarrow==25.0.0
113
+ evaluate==0.4.6
114
+ diffusers==0.39.0
115
+ pydantic==2.13.4
116
+ annotated-types==0.8.0
117
+ protobuf==7.35.1
118
+ sentry-sdk==2.66.1
119
+ einops==0.8.2
120
+ packaging==26.2
121
+ nvidia-nvjitlink-cu12==12.4.127
122
+ nvidia-curand-cu12==10.3.5.147
123
+ nvidia-cusparselt-cu12==0.6.2
124
+ nvidia-cusparse-cu12==12.3.1.170
125
+ nvidia-cuda-runtime-cu12==12.4.127
126
+ torchvision==0.21.0+cu124
127
+ nvidia-cuda-nvrtc-cu12==12.4.127
128
+ nvidia-cuda-cupti-cu12==12.4.127
129
+ nvidia-cusolver-cu12==11.6.1.9
130
+ nvidia-cublas-cu12==12.4.5.8
131
+ nvidia-cudnn-cu12==9.1.0.70
132
+ huggingface_hub==1.26.0
133
+ datasets==5.0.1
134
+ safetensors==0.8.0
135
+ accelerate==1.14.0
136
+ pydantic_core==2.46.4
137
+ ninja==1.13.0
138
+ autocommand==2.2.2
139
+ backports.tarfile==1.2.0
140
+ importlib_metadata==8.7.1
141
+ jaraco.text==4.0.0
142
+ jaraco.context==6.1.0
143
+ jaraco.functools==4.4.0
144
+ more-itertools==10.8.0
145
+ packaging==26.0
146
+ platformdirs==4.4.0
147
+ tomli==2.4.0
148
+ wheel==0.46.3
149
+ zipp==3.23.0
zain/Activation/wandb/run-20260812_175304-hrggki9k/files/wandb-metadata.json ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "os": "Linux-5.15.0-126-generic-x86_64-with-glibc2.35",
3
+ "python": "CPython 3.11.15",
4
+ "startedAt": "2026-08-12T17:53:04.074150Z",
5
+ "args": [
6
+ "--config",
7
+ "/mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/configs/baseline150L.yaml",
8
+ "--variants",
9
+ "glu-silu",
10
+ "glu-relu",
11
+ "glu-gelu",
12
+ "glu-sigmoid",
13
+ "glu-linear",
14
+ "glu-waleed10",
15
+ "mlp-waleed10",
16
+ "glu-silu-waleed10",
17
+ "mlp-silu-waleed10",
18
+ "glu-situglu",
19
+ "glu-waleed",
20
+ "glu-situglu_low",
21
+ "glu-waleedglu_low"
22
+ ],
23
+ "program": "/mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/sweep.py",
24
+ "codePath": "sweep.py",
25
+ "codePathLocal": "sweep.py",
26
+ "git": {
27
+ "remote": "https://github.com/w-ahmad1a10/Activation.git",
28
+ "commit": "c53713bcba08d1849136dad91288c4b82040634e"
29
+ },
30
+ "email": "deepnevro@gmail.com",
31
+ "root": "/mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation",
32
+ "host": "deeplens-k3s-node1",
33
+ "executable": "/mnt/data/zainulabideen/zain-exp/notebooks/my_env/bin/python",
34
+ "cpu_count": 112,
35
+ "cpu_count_logical": 224,
36
+ "gpu": "NVIDIA H100 80GB HBM3",
37
+ "gpu_count": 8,
38
+ "disk": {
39
+ "/": {
40
+ "total": "1560765693952",
41
+ "used": "716176670720"
42
+ }
43
+ },
44
+ "memory": {
45
+ "total": "2164089937920"
46
+ },
47
+ "gpu_nvidia": [
48
+ {
49
+ "name": "NVIDIA H100 80GB HBM3",
50
+ "memoryTotal": "85520809984",
51
+ "cudaCores": 16896,
52
+ "architecture": "Hopper",
53
+ "uuid": "GPU-39c684a5-fde6-83d7-1663-0859795881ae"
54
+ },
55
+ {
56
+ "name": "NVIDIA H100 80GB HBM3",
57
+ "memoryTotal": "85520809984",
58
+ "cudaCores": 16896,
59
+ "architecture": "Hopper",
60
+ "uuid": "GPU-68012e5a-38b6-b643-0ca6-62fb66720bf3"
61
+ },
62
+ {
63
+ "name": "NVIDIA H100 80GB HBM3",
64
+ "memoryTotal": "85520809984",
65
+ "cudaCores": 16896,
66
+ "architecture": "Hopper",
67
+ "uuid": "GPU-132944c4-b689-2b5f-89a4-d730401677ab"
68
+ },
69
+ {
70
+ "name": "NVIDIA H100 80GB HBM3",
71
+ "memoryTotal": "85520809984",
72
+ "cudaCores": 16896,
73
+ "architecture": "Hopper",
74
+ "uuid": "GPU-2df386cc-6d26-d0e2-7a2d-a057b0d95864"
75
+ },
76
+ {
77
+ "name": "NVIDIA H100 80GB HBM3",
78
+ "memoryTotal": "85520809984",
79
+ "cudaCores": 16896,
80
+ "architecture": "Hopper",
81
+ "uuid": "GPU-bfa16575-1d94-1aa2-4537-2c93433f42ef"
82
+ },
83
+ {
84
+ "name": "NVIDIA H100 80GB HBM3",
85
+ "memoryTotal": "85520809984",
86
+ "cudaCores": 16896,
87
+ "architecture": "Hopper",
88
+ "uuid": "GPU-bc6c3e3c-9b90-09ca-c034-774961847c54"
89
+ },
90
+ {
91
+ "name": "NVIDIA H100 80GB HBM3",
92
+ "memoryTotal": "85520809984",
93
+ "cudaCores": 16896,
94
+ "architecture": "Hopper",
95
+ "uuid": "GPU-00a441e1-7c95-e7d6-4c35-43d6b291aea9"
96
+ },
97
+ {
98
+ "name": "NVIDIA H100 80GB HBM3",
99
+ "memoryTotal": "85520809984",
100
+ "cudaCores": 16896,
101
+ "architecture": "Hopper",
102
+ "uuid": "GPU-1c4d29a2-4647-6fce-d8fc-0c5ecfbbd6ea"
103
+ }
104
+ ],
105
+ "cudaVersion": "12.4",
106
+ "writerId": "nyupeef48exzv166j8gx7nmchredluzy"
107
+ }
zain/Activation/wandb/run-20260812_175304-hrggki9k/files/wandb-summary.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"_wandb":{"runtime":847},"train/loss":3.1570945739746095,"train/grad_norm":0.60546875,"train_runtime":826.5493,"eval/loss":3.1693739891052246,"train/train/total_time_seconds":354.6520741917193,"_timestamp":1.7865580315405643e+09,"total_flos":4.839413121024e+15,"train/learning_rate":0.005,"train/train/epoch_time_elapsed":846.7927529215813,"_runtime":847,"train/train/time_per_step_avg":0.3532183859869838,"train_loss":4.179319068908692,"train/train/estimated_remaining_minutes":0,"_step":71,"train_samples_per_second":77.43,"eval/steps_per_second":3.569,"train/global_step":1000,"train/epoch":0.06740815638692282,"eval/samples_per_second":453.385,"eval/runtime":21.013,"train_steps_per_second":1.21}
zain/Activation/wandb/run-20260812_175304-hrggki9k/logs/debug-core.log ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"time":"2026-08-12T17:51:29.496049185Z","level":"INFO","msg":"main: starting server","port-filename":"/tmp/tmp7lru5pey/port-1355517.txt","pid":1355517,"detached":false,"idle-timeout":600000000000,"log-level":0,"disable-analytics":false,"shutdown-on-parent-exit":false,"enable-dcgm-profiling":false}
2
+ {"time":"2026-08-12T17:51:29.496747364Z","level":"INFO","msg":"server: will exit if parent process dies","ppid":1355517}
3
+ {"time":"2026-08-12T17:51:29.49671311Z","level":"INFO","msg":"server: accepting connections","addr":{"Name":"/tmp/wandb-1355517-1357782-3052194627/socket","Net":"unix"}}
4
+ {"time":"2026-08-12T17:51:29.674347603Z","level":"INFO","msg":"connection: ManageConnectionData: new connection created","id":"1(@)"}
5
+ {"time":"2026-08-12T17:52:11.162138091Z","level":"INFO","msg":"connection: ManageConnectionData: new connection created","id":"2(@)"}
6
+ {"time":"2026-08-12T17:52:11.242645021Z","level":"INFO","msg":"handleInformInit: received","streamId":"ycyhhejh","id":"2(@)"}
7
+ {"time":"2026-08-12T17:52:11.508233203Z","level":"INFO","msg":"handleInformInit: stream started","streamId":"ycyhhejh","id":"2(@)"}
8
+ {"time":"2026-08-12T17:52:17.001520061Z","level":"INFO","msg":"connection: cancelling request","id":"2(@)","requestId":"6684d59dll8w"}
9
+ {"time":"2026-08-12T17:52:32.412124918Z","level":"INFO","msg":"connection: cancelling request","id":"2(@)","requestId":"6684d59dll8w"}
10
+ {"time":"2026-08-12T17:52:32.887487538Z","level":"INFO","msg":"connection: cancelling request","id":"2(@)","requestId":"6684d59dll8w"}
11
+ {"time":"2026-08-12T17:52:32.888505Z","level":"INFO","msg":"handleInformFinish: finish message received","streamId":"ycyhhejh","id":"2(@)"}
12
+ {"time":"2026-08-12T17:52:32.889313366Z","level":"INFO","msg":"handleInformFinish: stream closed","streamId":"ycyhhejh","id":"2(@)"}
13
+ {"time":"2026-08-12T17:52:34.597228944Z","level":"INFO","msg":"connection: closing","id":"2(@)"}
14
+ {"time":"2026-08-12T17:52:34.597314364Z","level":"INFO","msg":"connection: closed successfully","id":"2(@)"}
15
+ {"time":"2026-08-12T17:52:34.597242804Z","level":"INFO","msg":"processOutgoingData: finished","id":"2(@)"}
16
+ {"time":"2026-08-12T17:52:34.597322441Z","level":"INFO","msg":"connection: ManageConnectionData: connection closed","id":"2(@)"}
17
+ {"time":"2026-08-12T17:53:03.98517338Z","level":"INFO","msg":"connection: ManageConnectionData: new connection created","id":"3(@)"}
18
+ {"time":"2026-08-12T17:53:04.076747848Z","level":"INFO","msg":"handleInformInit: received","streamId":"hrggki9k","id":"3(@)"}
19
+ {"time":"2026-08-12T17:53:04.339071164Z","level":"INFO","msg":"handleInformInit: stream started","streamId":"hrggki9k","id":"3(@)"}
20
+ {"time":"2026-08-12T17:53:09.739880255Z","level":"INFO","msg":"connection: cancelling request","id":"3(@)","requestId":"tj6i5mzy43l0"}
21
+ {"time":"2026-08-12T18:07:11.667315857Z","level":"INFO","msg":"connection: cancelling request","id":"3(@)","requestId":"tj6i5mzy43l0"}
22
+ {"time":"2026-08-12T18:07:12.178747012Z","level":"INFO","msg":"connection: cancelling request","id":"3(@)","requestId":"tj6i5mzy43l0"}
23
+ {"time":"2026-08-12T18:07:12.180598654Z","level":"INFO","msg":"handleInformFinish: finish message received","streamId":"hrggki9k","id":"3(@)"}
24
+ {"time":"2026-08-12T18:07:12.181733156Z","level":"INFO","msg":"handleInformFinish: stream closed","streamId":"hrggki9k","id":"3(@)"}
25
+ {"time":"2026-08-12T18:07:13.412475061Z","level":"INFO","msg":"handleInformInit: received","streamId":"utqzlg67","id":"3(@)"}
26
+ {"time":"2026-08-12T18:07:13.679314069Z","level":"INFO","msg":"handleInformInit: stream started","streamId":"utqzlg67","id":"3(@)"}
27
+ {"time":"2026-08-12T18:07:19.044675117Z","level":"INFO","msg":"connection: cancelling request","id":"3(@)","requestId":"atkqmrzkldx8"}
28
+ {"time":"2026-08-12T18:21:24.445193258Z","level":"INFO","msg":"connection: cancelling request","id":"3(@)","requestId":"atkqmrzkldx8"}
29
+ {"time":"2026-08-12T18:21:25.196343989Z","level":"INFO","msg":"connection: cancelling request","id":"3(@)","requestId":"atkqmrzkldx8"}
30
+ {"time":"2026-08-12T18:21:25.198067009Z","level":"INFO","msg":"handleInformFinish: finish message received","streamId":"utqzlg67","id":"3(@)"}
31
+ {"time":"2026-08-12T18:21:25.199000312Z","level":"INFO","msg":"handleInformFinish: stream closed","streamId":"utqzlg67","id":"3(@)"}
32
+ {"time":"2026-08-12T18:21:26.321522195Z","level":"INFO","msg":"handleInformInit: received","streamId":"vyycsg6r","id":"3(@)"}
33
+ {"time":"2026-08-12T18:21:26.578729863Z","level":"INFO","msg":"handleInformInit: stream started","streamId":"vyycsg6r","id":"3(@)"}
34
+ {"time":"2026-08-12T18:21:31.999599169Z","level":"INFO","msg":"connection: cancelling request","id":"3(@)","requestId":"h28g0ntapnl9"}
zain/Activation/wandb/run-20260812_175304-hrggki9k/logs/debug-internal.log ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {"time":"2026-08-12T17:53:04.076899017Z","level":"INFO","msg":"wandb-core"}
2
+ {"time":"2026-08-12T17:53:04.077036839Z","level":"INFO","msg":"stream: starting","core version":"0.28.1"}
3
+ {"time":"2026-08-12T17:53:04.338896465Z","level":"INFO","msg":"stream: created new stream","id":"hrggki9k"}
4
+ {"time":"2026-08-12T17:53:04.338980088Z","level":"INFO","msg":"handler: started"}
5
+ {"time":"2026-08-12T17:53:04.339064128Z","level":"INFO","msg":"stream: started"}
6
+ {"time":"2026-08-12T17:53:04.339075647Z","level":"INFO","msg":"writer: started","stream_id":"hrggki9k"}
7
+ {"time":"2026-08-12T17:53:04.339102826Z","level":"INFO","msg":"sender: started"}
8
+ {"time":"2026-08-12T17:53:04.923957807Z","level":"INFO","msg":"filestream: sending request","total_files":1,"console_offset":0,"console_lines":1}
9
+ {"time":"2026-08-12T17:53:05.038683027Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
10
+ {"time":"2026-08-12T17:53:19.924410071Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":0,"history_lines":1,"events_offset":0,"events_lines":2,"console_offset":1,"console_lines":3,"uploaded_len":2}
11
+ {"time":"2026-08-12T17:53:20.031904396Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
12
+ {"time":"2026-08-12T17:53:34.924344715Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":1,"history_lines":1,"events_offset":2,"events_lines":2,"console_offset":2,"console_lines":1}
13
+ {"time":"2026-08-12T17:53:35.034525535Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
14
+ {"time":"2026-08-12T17:53:49.924189652Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":2,"history_lines":1,"events_offset":4,"events_lines":1,"console_offset":2,"console_lines":1}
15
+ {"time":"2026-08-12T17:53:50.033021307Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
16
+ {"time":"2026-08-12T17:54:04.92424093Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":3,"history_lines":2,"events_offset":5,"events_lines":3,"console_offset":2,"console_lines":1}
17
+ {"time":"2026-08-12T17:54:05.042251156Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
18
+ {"time":"2026-08-12T17:54:19.924260321Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":5,"history_lines":1,"events_offset":8,"events_lines":2,"console_offset":2,"console_lines":1}
19
+ {"time":"2026-08-12T17:54:20.043281164Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
20
+ {"time":"2026-08-12T17:54:34.924379827Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":6,"history_lines":1,"events_offset":10,"events_lines":2,"console_offset":2,"console_lines":1}
21
+ {"time":"2026-08-12T17:54:35.043997534Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
22
+ {"time":"2026-08-12T17:54:49.924601407Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":7,"history_lines":2,"events_offset":12,"events_lines":2,"console_offset":2,"console_lines":1}
23
+ {"time":"2026-08-12T17:54:50.038107004Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
24
+ {"time":"2026-08-12T17:55:04.924131125Z","level":"INFO","msg":"filestream: sending request","total_files":2,"events_offset":14,"events_lines":2,"console_offset":4,"console_lines":9}
25
+ {"time":"2026-08-12T17:55:05.060356783Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
26
+ {"time":"2026-08-12T17:55:19.92445297Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":9,"history_lines":2,"events_offset":16,"events_lines":2,"console_offset":2,"console_lines":1}
27
+ {"time":"2026-08-12T17:55:20.055452607Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
28
+ {"time":"2026-08-12T17:55:34.924556457Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":11,"history_lines":2,"events_offset":18,"events_lines":2,"console_offset":2,"console_lines":1}
29
+ {"time":"2026-08-12T17:55:35.030920175Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
30
+ {"time":"2026-08-12T17:55:49.924611904Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":13,"history_lines":1,"events_offset":20,"events_lines":2,"console_offset":2,"console_lines":1}
31
+ {"time":"2026-08-12T17:55:50.026253556Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
32
+ {"time":"2026-08-12T17:56:04.924982252Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":14,"history_lines":1,"events_offset":22,"events_lines":2,"console_offset":2,"console_lines":1}
33
+ {"time":"2026-08-12T17:56:05.053212874Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
34
+ {"time":"2026-08-12T17:56:19.924105547Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":15,"history_lines":1,"events_offset":24,"events_lines":2,"console_offset":2,"console_lines":1}
35
+ {"time":"2026-08-12T17:56:20.067438584Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
36
+ {"time":"2026-08-12T17:56:34.924635672Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":16,"history_lines":2,"events_offset":26,"events_lines":2,"console_offset":2,"console_lines":1}
37
+ {"time":"2026-08-12T17:56:35.047221057Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
38
+ {"time":"2026-08-12T17:56:49.924320453Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":18,"history_lines":1,"events_offset":28,"events_lines":1,"console_offset":2,"console_lines":1}
39
+ {"time":"2026-08-12T17:56:50.04108346Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
40
+ {"time":"2026-08-12T17:57:04.924977488Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":19,"history_lines":1,"events_offset":29,"events_lines":3,"console_offset":2,"console_lines":1}
41
+ {"time":"2026-08-12T17:57:05.033285291Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
42
+ {"time":"2026-08-12T17:57:19.92419735Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":20,"history_lines":1,"events_offset":32,"events_lines":2,"console_offset":2,"console_lines":1}
43
+ {"time":"2026-08-12T17:57:20.086844688Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
44
+ {"time":"2026-08-12T17:57:34.924530245Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":21,"history_lines":2,"events_offset":34,"events_lines":2,"console_offset":2,"console_lines":1}
45
+ {"time":"2026-08-12T17:57:35.048094586Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
46
+ {"time":"2026-08-12T17:57:49.924278933Z","level":"INFO","msg":"filestream: sending request","total_files":2,"events_offset":36,"events_lines":2,"console_offset":5,"console_lines":1}
47
+ {"time":"2026-08-12T17:57:50.053408952Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
48
+ {"time":"2026-08-12T17:58:04.924247294Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":23,"history_lines":2,"events_offset":38,"events_lines":2,"console_offset":2,"console_lines":1}
49
+ {"time":"2026-08-12T17:58:05.058183944Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
50
+ {"time":"2026-08-12T17:58:19.924267924Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":25,"history_lines":2,"events_offset":40,"events_lines":2,"console_offset":2,"console_lines":1}
51
+ {"time":"2026-08-12T17:58:20.079607681Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
52
+ {"time":"2026-08-12T17:58:34.92417317Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":27,"history_lines":1,"events_offset":42,"events_lines":2,"console_offset":2,"console_lines":1}
53
+ {"time":"2026-08-12T17:58:35.039228745Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
54
+ {"time":"2026-08-12T17:58:49.92475203Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":28,"history_lines":1,"events_offset":44,"events_lines":2,"console_offset":2,"console_lines":1}
55
+ {"time":"2026-08-12T17:58:50.038320311Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
56
+ {"time":"2026-08-12T17:59:04.924781147Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":29,"history_lines":1,"events_offset":46,"events_lines":2,"console_offset":2,"console_lines":1}
57
+ {"time":"2026-08-12T17:59:05.042846096Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
58
+ {"time":"2026-08-12T17:59:19.924517427Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":30,"history_lines":2,"events_offset":48,"events_lines":2,"console_offset":2,"console_lines":1}
59
+ {"time":"2026-08-12T17:59:20.048847481Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
60
+ {"time":"2026-08-12T17:59:34.924142827Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":32,"history_lines":1,"events_offset":50,"events_lines":2,"console_offset":5,"console_lines":1}
61
+ {"time":"2026-08-12T17:59:35.090795711Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
62
+ {"time":"2026-08-12T17:59:49.924860357Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":33,"history_lines":1,"events_offset":52,"events_lines":1,"console_offset":13,"console_lines":25}
63
+ {"time":"2026-08-12T17:59:50.059568428Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
64
+ {"time":"2026-08-12T18:00:04.924609165Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":34,"history_lines":2,"events_offset":53,"events_lines":3,"console_offset":38,"console_lines":2}
65
+ {"time":"2026-08-12T18:00:05.110076024Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
66
+ {"time":"2026-08-12T18:00:19.925065733Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":36,"history_lines":1,"events_offset":56,"events_lines":2,"console_offset":40,"console_lines":1}
67
+ {"time":"2026-08-12T18:00:20.032512976Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
68
+ {"time":"2026-08-12T18:00:34.924060721Z","level":"INFO","msg":"filestream: sending request","total_files":1,"events_offset":58,"events_lines":2}
69
+ {"time":"2026-08-12T18:00:35.038541884Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
70
+ {"time":"2026-08-12T18:00:49.924605Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":37,"history_lines":3,"events_offset":60,"events_lines":2,"console_offset":41,"console_lines":3}
71
+ {"time":"2026-08-12T18:00:50.048539238Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
72
+ {"time":"2026-08-12T18:01:04.924584748Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":40,"history_lines":1,"events_offset":62,"events_lines":2,"console_offset":44,"console_lines":1}
73
+ {"time":"2026-08-12T18:01:05.033829972Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
74
+ {"time":"2026-08-12T18:01:19.924611073Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":41,"history_lines":1,"events_offset":64,"events_lines":2,"console_offset":45,"console_lines":1}
75
+ {"time":"2026-08-12T18:01:20.029593042Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
76
+ {"time":"2026-08-12T18:01:34.925040006Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":42,"history_lines":1,"events_offset":66,"events_lines":2,"console_offset":46,"console_lines":1}
77
+ {"time":"2026-08-12T18:01:35.064189504Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
78
+ {"time":"2026-08-12T18:01:49.924458325Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":43,"history_lines":1,"events_offset":68,"events_lines":2,"console_offset":47,"console_lines":1}
79
+ {"time":"2026-08-12T18:01:50.058784995Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
80
+ {"time":"2026-08-12T18:02:04.925163434Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":44,"history_lines":2,"events_offset":70,"events_lines":2,"console_offset":48,"console_lines":2}
81
+ {"time":"2026-08-12T18:02:05.064760096Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
82
+ {"time":"2026-08-12T18:02:19.924630965Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":46,"history_lines":1,"events_offset":72,"events_lines":2,"console_offset":50,"console_lines":1}
83
+ {"time":"2026-08-12T18:02:20.022710012Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
84
+ {"time":"2026-08-12T18:02:34.924969759Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":47,"history_lines":1,"events_offset":74,"events_lines":2,"console_offset":51,"console_lines":1}
85
+ {"time":"2026-08-12T18:02:35.03681233Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
86
+ {"time":"2026-08-12T18:02:49.924786892Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":48,"history_lines":2,"events_offset":76,"events_lines":1,"console_offset":52,"console_lines":2}
87
+ {"time":"2026-08-12T18:02:50.065566507Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
88
+ {"time":"2026-08-12T18:03:04.924790646Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":50,"history_lines":1,"events_offset":77,"events_lines":3,"console_offset":54,"console_lines":1}
89
+ {"time":"2026-08-12T18:03:05.098703149Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
90
+ {"time":"2026-08-12T18:03:19.924756316Z","level":"INFO","msg":"filestream: sending request","total_files":1,"events_offset":80,"events_lines":2}
91
+ {"time":"2026-08-12T18:03:20.074096242Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
92
+ {"time":"2026-08-12T18:03:34.924448572Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":51,"history_lines":2,"events_offset":82,"events_lines":2,"console_offset":55,"console_lines":2}
93
+ {"time":"2026-08-12T18:03:35.063594897Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
94
+ {"time":"2026-08-12T18:03:49.924833484Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":53,"history_lines":2,"events_offset":84,"events_lines":2,"console_offset":57,"console_lines":2}
95
+ {"time":"2026-08-12T18:03:50.05288207Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
96
+ {"time":"2026-08-12T18:04:04.924840703Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":55,"history_lines":1,"events_offset":86,"events_lines":2,"console_offset":59,"console_lines":1}
97
+ {"time":"2026-08-12T18:04:05.096087137Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
98
+ {"time":"2026-08-12T18:04:19.925174248Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":56,"history_lines":1,"events_offset":88,"events_lines":2,"console_offset":60,"console_lines":1}
99
+ {"time":"2026-08-12T18:04:20.072628681Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
100
+ {"time":"2026-08-12T18:04:34.924442094Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":57,"history_lines":1,"events_offset":90,"events_lines":2,"console_offset":61,"console_lines":1}
101
+ {"time":"2026-08-12T18:04:35.039611389Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
102
+ {"time":"2026-08-12T18:04:49.924855584Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":58,"history_lines":1,"events_offset":92,"events_lines":2,"console_offset":62,"console_lines":1}
103
+ {"time":"2026-08-12T18:04:50.072800406Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
104
+ {"time":"2026-08-12T18:05:04.924238971Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":59,"history_lines":2,"events_offset":94,"events_lines":2,"console_offset":63,"console_lines":2}
105
+ {"time":"2026-08-12T18:05:05.097361275Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
106
+ {"time":"2026-08-12T18:05:19.924462456Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":61,"history_lines":1,"events_offset":96,"events_lines":2,"console_offset":65,"console_lines":1}
107
+ {"time":"2026-08-12T18:05:20.029527048Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
108
+ {"time":"2026-08-12T18:05:34.924329692Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":62,"history_lines":1,"events_offset":98,"events_lines":2,"console_offset":66,"console_lines":1}
109
+ {"time":"2026-08-12T18:05:35.02759865Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
110
+ {"time":"2026-08-12T18:05:49.924162531Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":63,"history_lines":2,"events_offset":100,"events_lines":2,"console_offset":67,"console_lines":2}
111
+ {"time":"2026-08-12T18:05:50.0541957Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
112
+ {"time":"2026-08-12T18:06:04.924927099Z","level":"INFO","msg":"filestream: sending request","total_files":1,"events_offset":102,"events_lines":2}
113
+ {"time":"2026-08-12T18:06:05.066969956Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
114
+ {"time":"2026-08-12T18:06:19.924165076Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":65,"history_lines":2,"events_offset":104,"events_lines":2,"console_offset":69,"console_lines":2}
115
+ {"time":"2026-08-12T18:06:20.04066715Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
116
+ {"time":"2026-08-12T18:06:34.924283893Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":67,"history_lines":2,"events_offset":106,"events_lines":2,"console_offset":71,"console_lines":2}
117
+ {"time":"2026-08-12T18:06:35.046479676Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
118
+ {"time":"2026-08-12T18:06:49.924399809Z","level":"INFO","msg":"filestream: sending request","total_files":1,"events_offset":108,"events_lines":2}
119
+ {"time":"2026-08-12T18:06:50.042922784Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
120
+ {"time":"2026-08-12T18:07:04.924708661Z","level":"INFO","msg":"filestream: sending request","total_files":4,"history_offset":69,"history_lines":2,"events_offset":110,"events_lines":2,"console_offset":73,"console_lines":7}
121
+ {"time":"2026-08-12T18:07:05.102867255Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
122
+ {"time":"2026-08-12T18:07:12.061660338Z","level":"INFO","msg":"fileTransfer: Close: file transfer manager closed"}
123
+ {"time":"2026-08-12T18:07:12.061928891Z","level":"INFO","msg":"filestream: sending request","total_files":3,"history_offset":71,"history_lines":1,"console_offset":79,"console_lines":6,"uploaded_len":3,"complete":true,"exit_code":0}
124
+ {"time":"2026-08-12T18:07:12.176355657Z","level":"INFO","msg":"filestream: request sent","status":"200 OK"}
125
+ {"time":"2026-08-12T18:07:12.17743319Z","level":"INFO","msg":"handler: operation stats","stats":{}}
126
+ {"time":"2026-08-12T18:07:12.180636501Z","level":"INFO","msg":"stream: finishing up"}
127
+ {"time":"2026-08-12T18:07:12.180651797Z","level":"INFO","msg":"handler: closed"}
128
+ {"time":"2026-08-12T18:07:12.180758203Z","level":"INFO","msg":"sender: closed"}
129
+ {"time":"2026-08-12T18:07:12.180766266Z","level":"INFO","msg":"stream: all finished"}
zain/Activation/wandb/run-20260812_175304-hrggki9k/logs/debug.log ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_setup.py:_flush():81] Current SDK version is 0.28.1
2
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_setup.py:_flush():81] Configure stats pid to 1371664
3
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_setup.py:_flush():81] Loading settings from environment variables
4
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_init.py:setup_run_log_directory():729] Logging user logs to /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/wandb/run-20260812_175304-hrggki9k/logs/debug.log
5
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_init.py:setup_run_log_directory():730] Logging internal logs to /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/wandb/run-20260812_175304-hrggki9k/logs/debug-internal.log
6
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_init.py:init():772] calling init triggers
7
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_init.py:init():777] wandb.init called with sweep_config: {}
8
+ config: {'_wandb': {}}
9
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_init.py:init():820] starting backend
10
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_init.py:init():826] Connected to an existing wandb-core service via WANDB_SERVICE
11
+ 2026-08-12 17:53:04,075 INFO MainThread:1371664 [wandb_init.py:init():835] sending inform_init request
12
+ 2026-08-12 17:53:04,339 INFO MainThread:1371664 [wandb_init.py:init():840] backend started and connected
13
+ 2026-08-12 17:53:04,343 INFO MainThread:1371664 [wandb_init.py:init():910] updated telemetry
14
+ 2026-08-12 17:53:04,349 INFO MainThread:1371664 [wandb_init.py:init():933] communicating run to backend with 90.0 second timeout
15
+ 2026-08-12 17:53:04,663 INFO MainThread:1371664 [wandb_init.py:init():978] starting run threads in backend
16
+ 2026-08-12 17:53:04,737 INFO MainThread:1371664 [wandb_run.py:_console_start():2621] atexit reg
17
+ 2026-08-12 17:53:04,737 INFO MainThread:1371664 [wandb_run.py:_redirect():2471] redirect: wrap_raw
18
+ 2026-08-12 17:53:04,737 INFO MainThread:1371664 [wandb_run.py:_redirect():2540] Wrapping output streams.
19
+ 2026-08-12 17:53:04,737 INFO MainThread:1371664 [wandb_run.py:_redirect():2563] Redirects installed.
20
+ 2026-08-12 17:53:04,740 INFO MainThread:1371664 [wandb_init.py:init():1016] run started, returning control to user process
21
+ 2026-08-12 17:53:04,741 INFO MainThread:1371664 [wandb_run.py:_config_callback():1346] config_cb None None {'transformers_version': '5.16.0.dev0', 'architectures': None, 'output_hidden_states': False, 'return_dict': True, 'dtype': None, 'chunk_size_feed_forward': 0, 'is_encoder_decoder': False, 'id2label': {0: 'LABEL_0', 1: 'LABEL_1'}, 'label2id': {'LABEL_0': 0, 'LABEL_1': 1}, 'problem_type': None, 'vocab_size': 4096, 'hidden_size': 128, 'intermediate_size': 256, 'num_hidden_layers': 150, 'num_attention_heads': 4, 'num_key_value_heads': 4, 'hidden_act': 'silu', 'max_position_embeddings': 512, 'initializer_range': 0.02, 'rms_norm_eps': 1e-06, 'use_cache': False, 'pad_token_id': 0, 'bos_token_id': 1, 'eos_token_id': 2, 'pretraining_tp': 1, 'tie_word_embeddings': True, 'rope_parameters': {'rope_theta': 10000.0, 'rope_type': 'default'}, 'attention_bias': False, 'attention_dropout': 0.0, 'mlp_bias': False, 'head_dim': 32, '_name_or_path': '', 'tokenizer_name': 'w-ahmad/tiny-stories-tokenizer', 'mlp_type': 'glu', 'activation': 'silu', 'waleed_beta': 10.0, 'model_type': 'tiny_llama', 'output_attentions': False, 'output_dir': 'out/glu-silu-150L_run', 'per_device_train_batch_size': 64, 'num_train_epochs': 1, 'max_steps': 1000, 'learning_rate': 0.005, 'lr_scheduler_type': 'constant_with_warmup', 'lr_scheduler_kwargs': None, 'warmup_steps': 200, 'optim': 'adamw_torch_fused', 'optim_args': None, 'weight_decay': 0.0, 'adam_beta1': 0.9, 'adam_beta2': 0.999, 'adam_epsilon': 1e-08, 'optim_target_modules': None, 'gradient_accumulation_steps': 1, 'average_tokens_across_devices': True, 'max_grad_norm': 0.0, 'label_smoothing_factor': 0.0, 'bf16': True, 'fp16': False, 'bf16_full_eval': False, 'fp16_full_eval': False, 'tf32': None, 'gradient_checkpointing': False, 'gradient_checkpointing_kwargs': None, 'torch_compile': False, 'torch_compile_backend': None, 'torch_compile_mode': None, 'use_liger_kernel': False, 'liger_kernel_config': None, 'neftune_noise_alpha': None, 'torch_empty_cache_steps': None, 'auto_find_batch_size': False, 'logging_strategy': 'steps', 'logging_steps': 20, 'logging_first_step': False, 'log_on_each_node': True, 'logging_nan_inf_filter': True, 'include_num_input_tokens_seen': 'no', 'log_level': 'passive', 'log_level_replica': 'warning', 'disable_tqdm': False, 'report_to': ['wandb'], 'run_name': 'LM-glu-silu-150L-25.1M-20260812-175302', 'project': 'huggingface', 'trackio_space_id': None, 'trackio_bucket_id': None, 'trackio_static_space_id': None, 'eval_strategy': 'steps', 'eval_steps': 50, 'eval_delay': 0, 'per_device_eval_batch_size': 128, 'prediction_loss_only': False, 'eval_on_start': False, 'eval_do_concat_batches': True, 'eval_use_gather_object': False, 'eval_accumulation_steps': None, 'include_for_metrics': [], 'batch_eval_metrics': False, 'save_only_model': False, 'save_strategy': 'steps', 'save_steps': 1000, 'save_on_each_node': False, 'save_total_limit': None, 'enable_jit_checkpoint': False, 'push_to_hub': False, 'hub_token': '<HUB_TOKEN>', 'hub_private_repo': None, 'hub_model_id': 'w-ahmad/6L-glu-silu-150L', 'hub_strategy': 'every_save', 'hub_always_push': False, 'hub_revision': None, 'load_best_model_at_end': False, 'metric_for_best_model': None, 'greater_is_better': None, 'ignore_data_skip': False, 'restore_callback_states_from_checkpoint': False, 'full_determinism': False, 'seed': 42, 'data_seed': 42, 'use_cpu': False, 'accelerator_config': {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}, 'parallelism_config': None, 'dataloader_drop_last': False, 'dataloader_num_workers': 0, 'dataloader_pin_memory': True, 'dataloader_persistent_workers': False, 'dataloader_prefetch_factor': None, 'dataloader_multiprocessing_context': None, 'dataloader_in_order': True, 'remove_unused_columns': False, 'label_names': None, 'train_sampling_strategy': 'random', 'length_column_name': 'length', 'ddp_find_unused_parameters': None, 'ddp_bucket_cap_mb': None, 'ddp_broadcast_buffers': None, 'ddp_static_graph': None, 'ddp_backend': None, 'ddp_timeout': 1800, 'fsdp': None, 'fsdp_config': None, 'deepspeed': None, 'debug': [], 'skip_memory_metrics': True, 'do_train': False, 'do_eval': True, 'do_predict': False, 'resume_from_checkpoint': None, 'local_rank': -1}
22
+ 2026-08-12 17:53:04,747 INFO MainThread:1371664 [wandb_config.py:__setitem__():155] [no run ID] config set model/num_parameters = 25138816 - <bound method Run._config_callback of <wandb.sdk.wandb_run.Run object at 0x14c70c726090>>
23
+ 2026-08-12 17:53:04,747 INFO MainThread:1371664 [wandb_run.py:_config_callback():1346] config_cb model/num_parameters 25138816 None
24
+ 2026-08-12 18:07:11,666 INFO MainThread:1371664 [wandb_run.py:_finish():2383] finishing run deepnevro-deepnevro/research2/hrggki9k
25
+ 2026-08-12 18:07:11,666 INFO MainThread:1371664 [wandb_run.py:_atexit_cleanup():2588] got exitcode: 0
26
+ 2026-08-12 18:07:11,667 INFO MainThread:1371664 [wandb_run.py:_restore():2570] restore
27
+ 2026-08-12 18:07:11,667 INFO MainThread:1371664 [wandb_run.py:_restore():2576] restore done
28
+ 2026-08-12 18:07:12,180 INFO MainThread:1371664 [wandb_run.py:_footer_sync_info():3993] logging synced files
zain/Activation/wandb/run-20260812_175304-hrggki9k/run-hrggki9k.wandb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c25d3acdbd13f0cb7e6a536d2b4dca836e3453ebcbdd4b48c5a3f70e00b85f94
3
+ size 929598
zain/Activation/wandb/run-20260812_180713-utqzlg67/files/config.yaml ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _name_or_path:
2
+ value: ""
3
+ _wandb:
4
+ value:
5
+ cli_version: 0.28.1
6
+ e:
7
+ brca6pc78labe08rkhb4qgqvs3b0yaeu:
8
+ args:
9
+ - --config
10
+ - /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/configs/baseline150L.yaml
11
+ - --variants
12
+ - glu-silu
13
+ - glu-relu
14
+ - glu-gelu
15
+ - glu-sigmoid
16
+ - glu-linear
17
+ - glu-waleed10
18
+ - mlp-waleed10
19
+ - glu-silu-waleed10
20
+ - mlp-silu-waleed10
21
+ - glu-situglu
22
+ - glu-waleed
23
+ - glu-situglu_low
24
+ - glu-waleedglu_low
25
+ codePath: sweep.py
26
+ codePathLocal: sweep.py
27
+ cpu_count: 112
28
+ cpu_count_logical: 224
29
+ cudaVersion: "12.4"
30
+ disk:
31
+ /:
32
+ total: "1560765693952"
33
+ used: "716176330752"
34
+ email: deepnevro@gmail.com
35
+ executable: /mnt/data/zainulabideen/zain-exp/notebooks/my_env/bin/python
36
+ git:
37
+ commit: c53713bcba08d1849136dad91288c4b82040634e
38
+ remote: https://github.com/w-ahmad1a10/Activation.git
39
+ gpu: NVIDIA H100 80GB HBM3
40
+ gpu_count: 8
41
+ gpu_nvidia:
42
+ - architecture: Hopper
43
+ cudaCores: 16896
44
+ memoryTotal: "85520809984"
45
+ name: NVIDIA H100 80GB HBM3
46
+ uuid: GPU-39c684a5-fde6-83d7-1663-0859795881ae
47
+ - architecture: Hopper
48
+ cudaCores: 16896
49
+ memoryTotal: "85520809984"
50
+ name: NVIDIA H100 80GB HBM3
51
+ uuid: GPU-68012e5a-38b6-b643-0ca6-62fb66720bf3
52
+ - architecture: Hopper
53
+ cudaCores: 16896
54
+ memoryTotal: "85520809984"
55
+ name: NVIDIA H100 80GB HBM3
56
+ uuid: GPU-132944c4-b689-2b5f-89a4-d730401677ab
57
+ - architecture: Hopper
58
+ cudaCores: 16896
59
+ memoryTotal: "85520809984"
60
+ name: NVIDIA H100 80GB HBM3
61
+ uuid: GPU-2df386cc-6d26-d0e2-7a2d-a057b0d95864
62
+ - architecture: Hopper
63
+ cudaCores: 16896
64
+ memoryTotal: "85520809984"
65
+ name: NVIDIA H100 80GB HBM3
66
+ uuid: GPU-bfa16575-1d94-1aa2-4537-2c93433f42ef
67
+ - architecture: Hopper
68
+ cudaCores: 16896
69
+ memoryTotal: "85520809984"
70
+ name: NVIDIA H100 80GB HBM3
71
+ uuid: GPU-bc6c3e3c-9b90-09ca-c034-774961847c54
72
+ - architecture: Hopper
73
+ cudaCores: 16896
74
+ memoryTotal: "85520809984"
75
+ name: NVIDIA H100 80GB HBM3
76
+ uuid: GPU-00a441e1-7c95-e7d6-4c35-43d6b291aea9
77
+ - architecture: Hopper
78
+ cudaCores: 16896
79
+ memoryTotal: "85520809984"
80
+ name: NVIDIA H100 80GB HBM3
81
+ uuid: GPU-1c4d29a2-4647-6fce-d8fc-0c5ecfbbd6ea
82
+ host: deeplens-k3s-node1
83
+ memory:
84
+ total: "2164089937920"
85
+ os: Linux-5.15.0-126-generic-x86_64-with-glibc2.35
86
+ program: /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation/sweep.py
87
+ python: CPython 3.11.15
88
+ root: /mnt/data/zainulabideen/zain-exp/notebooks/zain/Activation
89
+ startedAt: "2026-08-12T18:07:13.410106Z"
90
+ writerId: brca6pc78labe08rkhb4qgqvs3b0yaeu
91
+ m:
92
+ - "1": train/global_step
93
+ "6":
94
+ - 3
95
+ "7": []
96
+ - "2": '*'
97
+ "5": 1
98
+ "6":
99
+ - 1
100
+ "7": []
101
+ python_version: 3.11.15
102
+ t:
103
+ "1":
104
+ - 1
105
+ - 5
106
+ - 11
107
+ - 41
108
+ - 49
109
+ - 51
110
+ - 53
111
+ - 71
112
+ "2":
113
+ - 1
114
+ - 5
115
+ - 11
116
+ - 41
117
+ - 49
118
+ - 51
119
+ - 53
120
+ - 71
121
+ "3":
122
+ - 2
123
+ - 7
124
+ - 13
125
+ - 19
126
+ - 62
127
+ - 66
128
+ "4": 3.11.15
129
+ "5": 0.28.1
130
+ "6": 5.16.0.dev0
131
+ "9":
132
+ "1": transformers_trainer
133
+ "12": 0.28.1
134
+ "13": linux-x86_64
135
+ accelerator_config:
136
+ value:
137
+ dispatch_batches: null
138
+ even_batches: true
139
+ gradient_accumulation_kwargs: null
140
+ non_blocking: false
141
+ split_batches: false
142
+ use_seedable_sampler: true
143
+ activation:
144
+ value: relu
145
+ adam_beta1:
146
+ value: 0.9
147
+ adam_beta2:
148
+ value: 0.999
149
+ adam_epsilon:
150
+ value: 1e-08
151
+ architectures:
152
+ value: null
153
+ attention_bias:
154
+ value: false
155
+ attention_dropout:
156
+ value: 0
157
+ auto_find_batch_size:
158
+ value: false
159
+ average_tokens_across_devices:
160
+ value: true
161
+ batch_eval_metrics:
162
+ value: false
163
+ bf16:
164
+ value: true
165
+ bf16_full_eval:
166
+ value: false
167
+ bos_token_id:
168
+ value: 1
169
+ chunk_size_feed_forward:
170
+ value: 0
171
+ data_seed:
172
+ value: 42
173
+ dataloader_drop_last:
174
+ value: false
175
+ dataloader_in_order:
176
+ value: true
177
+ dataloader_multiprocessing_context:
178
+ value: null
179
+ dataloader_num_workers:
180
+ value: 0
181
+ dataloader_persistent_workers:
182
+ value: false
183
+ dataloader_pin_memory:
184
+ value: true
185
+ dataloader_prefetch_factor:
186
+ value: null
187
+ ddp_backend:
188
+ value: null
189
+ ddp_broadcast_buffers:
190
+ value: null
191
+ ddp_bucket_cap_mb:
192
+ value: null
193
+ ddp_find_unused_parameters:
194
+ value: null
195
+ ddp_static_graph:
196
+ value: null
197
+ ddp_timeout:
198
+ value: 1800
199
+ debug:
200
+ value: []
201
+ deepspeed:
202
+ value: null
203
+ disable_tqdm:
204
+ value: false
205
+ do_eval:
206
+ value: true
207
+ do_predict:
208
+ value: false
209
+ do_train:
210
+ value: false
211
+ dtype:
212
+ value: null
213
+ enable_jit_checkpoint:
214
+ value: false
215
+ eos_token_id:
216
+ value: 2
217
+ eval_accumulation_steps:
218
+ value: null
219
+ eval_delay:
220
+ value: 0
221
+ eval_do_concat_batches:
222
+ value: true
223
+ eval_on_start:
224
+ value: false
225
+ eval_steps:
226
+ value: 50
227
+ eval_strategy:
228
+ value: steps
229
+ eval_use_gather_object:
230
+ value: false
231
+ fp16:
232
+ value: false
233
+ fp16_full_eval:
234
+ value: false
235
+ fsdp:
236
+ value: null
237
+ fsdp_config:
238
+ value: null
239
+ full_determinism:
240
+ value: false
241
+ gradient_accumulation_steps:
242
+ value: 1
243
+ gradient_checkpointing:
244
+ value: false
245
+ gradient_checkpointing_kwargs:
246
+ value: null
247
+ greater_is_better:
248
+ value: null
249
+ head_dim:
250
+ value: 32
251
+ hidden_act:
252
+ value: silu
253
+ hidden_size:
254
+ value: 128
255
+ hub_always_push:
256
+ value: false
257
+ hub_model_id:
258
+ value: w-ahmad/6L-glu-relu-150L
259
+ hub_private_repo:
260
+ value: null
261
+ hub_revision:
262
+ value: null
263
+ hub_strategy:
264
+ value: every_save
265
+ hub_token:
266
+ value: <HUB_TOKEN>
267
+ id2label:
268
+ value:
269
+ "0": LABEL_0
270
+ "1": LABEL_1
271
+ ignore_data_skip:
272
+ value: false
273
+ include_for_metrics:
274
+ value: []
275
+ include_num_input_tokens_seen:
276
+ value: "no"
277
+ initializer_range:
278
+ value: 0.02
279
+ intermediate_size:
280
+ value: 256
281
+ is_encoder_decoder:
282
+ value: false
283
+ label_names:
284
+ value: null
285
+ label_smoothing_factor:
286
+ value: 0
287
+ label2id:
288
+ value:
289
+ LABEL_0: 0
290
+ LABEL_1: 1
291
+ learning_rate:
292
+ value: 0.005
293
+ length_column_name:
294
+ value: length
295
+ liger_kernel_config:
296
+ value: null
297
+ load_best_model_at_end:
298
+ value: false
299
+ local_rank:
300
+ value: -1
301
+ log_level:
302
+ value: passive
303
+ log_level_replica:
304
+ value: warning
305
+ log_on_each_node:
306
+ value: true
307
+ logging_first_step:
308
+ value: false
309
+ logging_nan_inf_filter:
310
+ value: true
311
+ logging_steps:
312
+ value: 20
313
+ logging_strategy:
314
+ value: steps
315
+ lr_scheduler_kwargs:
316
+ value: null
317
+ lr_scheduler_type:
318
+ value: constant_with_warmup
319
+ max_grad_norm:
320
+ value: 0
321
+ max_position_embeddings:
322
+ value: 512
323
+ max_steps:
324
+ value: 1000
325
+ metric_for_best_model:
326
+ value: null
327
+ mlp_bias:
328
+ value: false
329
+ mlp_type:
330
+ value: glu
331
+ model/num_parameters:
332
+ value: 25138816
333
+ model_type:
334
+ value: tiny_llama
335
+ neftune_noise_alpha:
336
+ value: null
337
+ num_attention_heads:
338
+ value: 4
339
+ num_hidden_layers:
340
+ value: 150
341
+ num_key_value_heads:
342
+ value: 4
343
+ num_train_epochs:
344
+ value: 1
345
+ optim:
346
+ value: adamw_torch_fused
347
+ optim_args:
348
+ value: null
349
+ optim_target_modules:
350
+ value: null
351
+ output_attentions:
352
+ value: false
353
+ output_dir:
354
+ value: out/glu-relu-150L_run
355
+ output_hidden_states:
356
+ value: false
357
+ pad_token_id:
358
+ value: 0
359
+ parallelism_config:
360
+ value: null
361
+ per_device_eval_batch_size:
362
+ value: 128
363
+ per_device_train_batch_size:
364
+ value: 64
365
+ prediction_loss_only:
366
+ value: false
367
+ pretraining_tp:
368
+ value: 1
369
+ problem_type:
370
+ value: null
371
+ project:
372
+ value: huggingface
373
+ push_to_hub:
374
+ value: false
375
+ remove_unused_columns:
376
+ value: false
377
+ report_to:
378
+ value:
379
+ - wandb
380
+ restore_callback_states_from_checkpoint:
381
+ value: false
382
+ resume_from_checkpoint:
383
+ value: null
384
+ return_dict:
385
+ value: true
386
+ rms_norm_eps:
387
+ value: 1e-06
388
+ rope_parameters:
389
+ value:
390
+ rope_theta: 10000
391
+ rope_type: default
392
+ run_name:
393
+ value: LM-glu-relu-150L-25.1M-20260812-180712
394
+ save_on_each_node:
395
+ value: false
396
+ save_only_model:
397
+ value: false
398
+ save_steps:
399
+ value: 1000
400
+ save_strategy:
401
+ value: steps
402
+ save_total_limit:
403
+ value: null
404
+ seed:
405
+ value: 42
406
+ skip_memory_metrics:
407
+ value: true
408
+ tf32:
409
+ value: null
410
+ tie_word_embeddings:
411
+ value: true
412
+ tokenizer_name:
413
+ value: w-ahmad/tiny-stories-tokenizer
414
+ torch_compile:
415
+ value: false
416
+ torch_compile_backend:
417
+ value: null
418
+ torch_compile_mode:
419
+ value: null
420
+ torch_empty_cache_steps:
421
+ value: null
422
+ trackio_bucket_id:
423
+ value: null
424
+ trackio_space_id:
425
+ value: null
426
+ trackio_static_space_id:
427
+ value: null
428
+ train_sampling_strategy:
429
+ value: random
430
+ transformers_version:
431
+ value: 5.16.0.dev0
432
+ use_cache:
433
+ value: false
434
+ use_cpu:
435
+ value: false
436
+ use_liger_kernel:
437
+ value: false
438
+ vocab_size:
439
+ value: 4096
440
+ waleed_beta:
441
+ value: 10
442
+ warmup_steps:
443
+ value: 200
444
+ weight_decay:
445
+ value: 0