ArushBuilds commited on
Commit
f1ef71c
·
verified ·
1 Parent(s): c40cb49

Upload checkpoint-15858 (SFT, final step)

Browse files
config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "PragyaForCausalLM"
4
+ ],
5
+ "auto_map": {
6
+ "AutoConfig": "configuration_pragya.PragyaConfig",
7
+ "AutoModelForCausalLM": "modeling_pragya.PragyaForCausalLM"
8
+ },
9
+ "bias": false,
10
+ "block_size": 1024,
11
+ "bos_token_id": 12287,
12
+ "d_rope": null,
13
+ "dropout": 0.0,
14
+ "dtype": "float32",
15
+ "engram_compressed_vocab": 9807,
16
+ "engram_embed_per_ngram": 128,
17
+ "engram_kernel_size": 4,
18
+ "engram_layer_ids": [
19
+ 1,
20
+ 8
21
+ ],
22
+ "engram_max_ngram": 3,
23
+ "engram_n_heads": 4,
24
+ "engram_seed": 0,
25
+ "engram_vocab_size": [
26
+ 4096,
27
+ 4096
28
+ ],
29
+ "eos_token_id": 12287,
30
+ "ffn_mult": 2,
31
+ "gen_headroom": 128,
32
+ "gpt_top_k": 64,
33
+ "gradient_checkpointing": false,
34
+ "int8_group_size": 128,
35
+ "max_gen_tokens": 1024,
36
+ "mod_budget_coeff": 0.05,
37
+ "mod_capacity": 0.25,
38
+ "mod_gate_entropy_coeff": 0.0,
39
+ "mod_hard_eval": false,
40
+ "model_type": "pragya_e2",
41
+ "moe_fixed_capacity": null,
42
+ "moe_top_k": 2,
43
+ "mtp_depth": 1,
44
+ "mtp_lambda": 0.1,
45
+ "n_embd": 384,
46
+ "n_experts": 8,
47
+ "n_head": 12,
48
+ "n_layer": 16,
49
+ "n_shared": 1,
50
+ "num_kv_heads": 6,
51
+ "pad_token_id": 12287,
52
+ "pattern": "dense",
53
+ "sliding_window_size": 512,
54
+ "tp_size": 1,
55
+ "transformers_version": "5.22.1",
56
+ "use_cache": false,
57
+ "use_engram": true,
58
+ "use_int8": false,
59
+ "use_moe": false,
60
+ "use_mtp": false,
61
+ "use_nvfp4": false,
62
+ "vocab_size": 12288
63
+ }
config.py ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ use_liger=False
3
+ xla_on_gpu=False
4
+ # ---------------------------------------------------------------------------
5
+ # Core shape -- chosen for GPU efficiency, not just "a number that fits"
6
+ # ---------------------------------------------------------------------------
7
+ CONTEXT = 1024
8
+ max_gen_tokens = 1024
9
+ gen_headroom = 128
10
+ vocab_size = 8192+4096
11
+ # ── Engram (static n-gram memory) ──────────────────────────────────
12
+ use_engram = True
13
+ engram_layer_ids = (1, 8) # two layers, one early, one mid
14
+ engram_max_ngram = 3 # 2-gram + 3-gram tables
15
+ engram_vocab_size = (4096, 4096) # halved from default
16
+ engram_embed_per_ngram = 128
17
+ engram_n_heads = 4
18
+ engram_kernel_size = 4
19
+ engram_seed = 0
20
+ engram_compressed_vocab = 0 # 0 → set from tokenizer lookup
21
+ bias = False
22
+ d_rope = None
23
+ top_k = 64
24
+ moe_top_k = 2
25
+ use_triton_fusions = False
26
+
27
+
28
+ gradient_checkpointing = False
29
+ num_kv_heads = 4
30
+ pattern = "dense"
31
+ sliding_window_size = 512
32
+
33
+ tensor_parallel_size = 1
34
+
35
+ # ─────────────────────────────────────────────────────────────────────
36
+ # Curriculum learning (token-level mixing across sources)
37
+ # ─────────────────────────────────────────────────────────────────────
38
+ # Master switch. False = old behavior (uniform random over the whole
39
+ # flat token array). True = per-source anchor schedule below.
40
+ CURRICULUM_ENABLED = False
41
+
42
+ # Number of training steps the anchor schedule spans. Set equal to
43
+ # MAX_STEPS in train.py so the ramp completes at run end.
44
+ CURRICULUM_TOTAL_STEPS = 20000
45
+
46
+ # Sources, in curriculum order (easiest first). Each entry:
47
+ # (name, [glob_patterns], w@0, w@T/3, w@2T/3, w@T)
48
+ # Between anchors, weights interpolate linearly. Columns should sum
49
+ # to ~1.0 (the code renormalizes if not).
50
+ # Files matching none of the globs are EXCLUDED from training.
51
+ CURRICULUM_SOURCES = [
52
+ ("tinystories", ["tinystories*.txt", "tiny_*.txt"],
53
+ 0.70, 0.10, 0.03, 0.02),
54
+ ("simplewiki", ["simplewiki*.txt", "wiki_*.txt"],
55
+ 0.10, 0.70, 0.10, 0.03),
56
+ ("cosmopedia", ["cosmopedia*.txt", "cosmo_*.txt"],
57
+ 0.10, 0.10, 0.70, 0.10),
58
+ ("finephrase", ["finephrase*.txt", "fine_*.txt"],
59
+ 0.10, 0.10, 0.17, 0.85),
60
+ ]
61
+
62
+ # Hard floor: no source ever drops below this fraction at any step.
63
+ # 0.0 disables. 0.02 = 2% minimum, prevents catastrophic forgetting.
64
+ CURRICULUM_FLOOR = 0.02
65
+
66
+ mod_capacity = 0.25
67
+ use_mtp = False
68
+ mtp_depth = 1
69
+ mtp_lambda = 0.1
70
+ use_nvfp4 = False
71
+ # config.py
72
+ use_fp8 = False
73
+ fp8_recipe = "rowwise_with_gw_hp" # default
74
+ fp8_bf16_tail_frac = 0.15 # default
75
+ use_int8 = False
76
+ int8_group_size = 128
77
+ mod_budget_coeff = 0.05
78
+ mod_gate_entropy_coeff = 0.0
79
+ mod_hard_eval = False
80
+ use_flexattention = True
81
+ numberoflayers = 16
82
+ numberofheads = 12
83
+ D_MODEL = 384
84
+ ALPHA_COMPILE_MODE="reduce-overhead"
85
+ num_kv_heads = 6
86
+ sliding_window_size = 512
87
+ use_sdpa=False
88
+ optimizer_8bit = True
89
+ use_wsd = True
90
+ wsd_decay_steps = 3500
91
+ ffn_mult = 8 // 3
92
+ use_moe = False
93
+ n_experts = 8
94
+ n_shared = 1
95
+ # T4 path
96
+
97
+ PRECISION = 'bf16'
98
+ GLOBAL_DTYPE = PRECISION
99
+ USE_ASYNC_LAYER_PREFETCH = True
100
+ intra_op_threads = 2
101
+ num_workers = 2
102
+ GPU_SIDE_BATCHING = True
103
+ DISABLE_MMAP = False
104
+
105
+ batch_size = 320
106
+ weight_decay = 0.01
107
+ use_static_lr = False
108
+ static_lr = 1e-3
109
+ learning_rate = 1e-3
110
+
111
+
112
+ attn_gate_window = 16
113
+ max_steps = 19000
114
+ data_parallel_only = True
115
+ use_fsdp = False
116
+ dropout = 0.0
117
+ use_muon = True
118
+ DATA_PATH = './training_data'
119
+ data_path = DATA_PATH
120
+ TOKENIZER_MODEL_PATH = './tokenizer'
121
+ use_streaming_batcher = False
configuration_pragya.py ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import PretrainedConfig
2
+
3
+
4
+ class PragyaConfig(PretrainedConfig):
5
+ """Config for Pragya E2. Field names match model.GPTConfig, except gpt_top_k
6
+ (GPTConfig.top_k), renamed because Transformers reserves top_k for generation.
7
+
8
+ Defaults are generated from the trained run's config.py, so PragyaConfig()
9
+ is the real model. engram_compressed_vocab is 0 by design: the model wrapper
10
+ reads it from the checkpoint's Engram lookup buffer.
11
+ """
12
+
13
+ model_type = "pragya_e2"
14
+
15
+ def __init__(
16
+ self,
17
+ block_size=1024,
18
+ vocab_size=12288,
19
+ n_layer=16,
20
+ n_head=12,
21
+ n_embd=384,
22
+ dropout=0.0,
23
+ bias=False,
24
+ ffn_mult=2,
25
+ d_rope=None,
26
+ gpt_top_k=64,
27
+ n_experts=8,
28
+ n_shared=1,
29
+ use_moe=False,
30
+ moe_top_k=2,
31
+ gradient_checkpointing=False,
32
+ num_kv_heads=6,
33
+ pattern='dense',
34
+ sliding_window_size=512,
35
+ tp_size=1,
36
+ gen_headroom=128,
37
+ max_gen_tokens=1024,
38
+ mod_capacity=0.25,
39
+ use_mtp=False,
40
+ mtp_depth=1,
41
+ mtp_lambda=0.1,
42
+ use_nvfp4=False,
43
+ use_int8=False,
44
+ int8_group_size=128,
45
+ mod_gate_entropy_coeff=0.0,
46
+ mod_budget_coeff=0.05,
47
+ mod_hard_eval=False,
48
+ moe_fixed_capacity=None,
49
+ use_engram=True,
50
+ engram_layer_ids=(1, 8),
51
+ engram_max_ngram=3,
52
+ engram_vocab_size=(4096, 4096),
53
+ engram_embed_per_ngram=128,
54
+ engram_n_heads=4,
55
+ engram_kernel_size=4,
56
+ engram_seed=0,
57
+ engram_compressed_vocab=0,
58
+ **kwargs,
59
+ ):
60
+ # Documents are [BOS ... EOS] and this tokenizer uses one id (12287) for all three.
61
+ # Without eos_token_id, generate() has no stop token and fills the whole context.
62
+ kwargs.setdefault("bos_token_id", 12287)
63
+ kwargs.setdefault("eos_token_id", 12287)
64
+ kwargs.setdefault("pad_token_id", 12287)
65
+ super().__init__(**kwargs)
66
+ self.block_size = block_size
67
+ self.vocab_size = vocab_size
68
+ self.n_layer = n_layer
69
+ self.n_head = n_head
70
+ self.n_embd = n_embd
71
+ self.dropout = dropout
72
+ self.bias = bias
73
+ self.ffn_mult = ffn_mult
74
+ self.d_rope = d_rope
75
+ self.gpt_top_k = gpt_top_k
76
+ self.n_experts = n_experts
77
+ self.n_shared = n_shared
78
+ self.use_moe = use_moe
79
+ self.moe_top_k = moe_top_k
80
+ self.gradient_checkpointing = gradient_checkpointing
81
+ self.num_kv_heads = num_kv_heads
82
+ self.pattern = pattern
83
+ self.sliding_window_size = sliding_window_size
84
+ self.tp_size = tp_size
85
+ self.gen_headroom = gen_headroom
86
+ self.max_gen_tokens = max_gen_tokens
87
+ self.mod_capacity = mod_capacity
88
+ self.use_mtp = use_mtp
89
+ self.mtp_depth = mtp_depth
90
+ self.mtp_lambda = mtp_lambda
91
+ self.use_nvfp4 = use_nvfp4
92
+ self.use_int8 = use_int8
93
+ self.int8_group_size = int8_group_size
94
+ self.mod_gate_entropy_coeff = mod_gate_entropy_coeff
95
+ self.mod_budget_coeff = mod_budget_coeff
96
+ self.mod_hard_eval = mod_hard_eval
97
+ self.moe_fixed_capacity = moe_fixed_capacity
98
+ self.use_engram = use_engram
99
+ self.engram_layer_ids = list(engram_layer_ids)
100
+ self.engram_max_ngram = engram_max_ngram
101
+ self.engram_vocab_size = list(engram_vocab_size)
102
+ self.engram_embed_per_ngram = engram_embed_per_ngram
103
+ self.engram_n_heads = engram_n_heads
104
+ self.engram_kernel_size = engram_kernel_size
105
+ self.engram_seed = engram_seed
106
+ self.engram_compressed_vocab = engram_compressed_vocab
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 12287,
4
+ "eos_token_id": [
5
+ 12287
6
+ ],
7
+ "pad_token_id": 12287,
8
+ "transformers_version": "5.22.1",
9
+ "use_mtp": false
10
+ }
kernel.py ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Attention kernel with two backends, chosen once at import.
2
+
3
+ * FlexAttention (default): CUDA with compute capability >= 8.0 (sm80+), torch >= 2.5.
4
+ Masks are BlockMasks; the mask logic lives in mask_mod.
5
+ * xFormers memory-efficient attention: CUDA GPUs below sm80 (no Triton/Flex support).
6
+ Masks are dense boolean (T, T) or (B, T, T) tensors converted to additive biases.
7
+
8
+ Every attention layer calls `fused_attention(q, k, v, mask)`; the mask object comes from
9
+ `causal_masks` or `doc_masks`, so the backend is invisible to model.py.
10
+
11
+ Attention-weight dropout is not supported on either backend (DenseMHA refuses dropout > 0).
12
+ """
13
+ import functools
14
+ import importlib
15
+ import warnings
16
+
17
+ import torch
18
+ import torch.nn.functional as F
19
+ from torch.nn.attention.flex_attention import create_block_mask, flex_attention
20
+
21
+ _IS_CUDA = torch.cuda.is_available() and torch.version.cuda is not None
22
+ _USE_XFORMERS = _IS_CUDA and torch.cuda.get_device_capability() < (8, 0)
23
+
24
+ _XFORMERS_OK = _USE_XFORMERS # cleared on the first failure; then SDPA is used
25
+
26
+ if _USE_XFORMERS:
27
+ # Loaded dynamically: Transformers scans source files for static imports and would
28
+ # require xformers on every machine, including ones that never use it.
29
+ xops = importlib.import_module("xformers.ops") # pip install xformers (match your torch)
30
+ _flex = None
31
+ else:
32
+ xops = None
33
+ _flex = torch.compile(flex_attention, dynamic=False) if _IS_CUDA else flex_attention
34
+
35
+
36
+ class _XMask:
37
+ """Dense allowed-positions mask for the xFormers path. allowed: bool (T, T) or (B, T, T)."""
38
+ __slots__ = ("allowed",)
39
+
40
+ def __init__(self, allowed: torch.Tensor):
41
+ self.allowed = allowed
42
+
43
+
44
+ def fused_attention(q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, mask) -> torch.Tensor:
45
+ """q: (B, Hq, T, D); k, v: (B, Hkv, T, D). GQA is handled natively (Hq a multiple of Hkv)."""
46
+ if isinstance(mask, _XMask):
47
+ return _xformers_attention(q, k, v, mask.allowed)
48
+ return _flex(q, k, v, block_mask=mask, enable_gqa=q.shape[1] != k.shape[1])
49
+
50
+
51
+ def _xformers_attention(q, k, v, allowed):
52
+ B, Hq, T, D = q.shape
53
+ Hkv = k.shape[1]
54
+ if Hq != Hkv:
55
+ # query head h uses kv head h // group, the same grouping FlexAttention's enable_gqa uses
56
+ group = Hq // Hkv
57
+ k = k.repeat_interleave(group, dim=1)
58
+ v = v.repeat_interleave(group, dim=1)
59
+ bias = torch.zeros(allowed.shape, dtype=q.dtype, device=q.device).masked_fill(~allowed, float("-inf"))
60
+ bias = bias[None, None] if bias.dim() == 2 else bias[:, None]
61
+ bias = bias.expand(B, Hq, T, T)
62
+ global _XFORMERS_OK
63
+ if _XFORMERS_OK:
64
+ try:
65
+ # xFormers expects (B, T, H, D)
66
+ out = xops.memory_efficient_attention(
67
+ q.transpose(1, 2), k.transpose(1, 2), v.transpose(1, 2), attn_bias=bias)
68
+ _record_backend("xformers")
69
+ return out.transpose(1, 2)
70
+ except Exception as e:
71
+ # Typical cause: xformers built for a different torch/CUDA than the runtime.
72
+ _XFORMERS_OK = False
73
+ warnings.warn(f"xformers memory_efficient_attention unavailable ({type(e).__name__}: {e}); "
74
+ "using torch scaled_dot_product_attention with the same mask.")
75
+ # Same math with PyTorch's built-in attention (works on any CUDA GPU, no extra package).
76
+ out = F.scaled_dot_product_attention(q, k, v, attn_mask=bias)
77
+ _record_backend("sdpa_masked")
78
+ return out
79
+
80
+
81
+ # ---------------------------------------------------------------------------
82
+ # Masks. One rule for every layer: window = window_size or seq_len; since q - kv <= seq_len - 1,
83
+ # "no window" is the same expression as "window = seq_len".
84
+ # ---------------------------------------------------------------------------
85
+
86
+ @functools.lru_cache(maxsize=None)
87
+ def _causal_mask(seq_len: int, window_size, device_key: str):
88
+ window = window_size or seq_len
89
+
90
+ def mask_mod(b, h, q_idx, kv_idx):
91
+ return (kv_idx <= q_idx) & (q_idx - kv_idx < window)
92
+
93
+ return create_block_mask(mask_mod, B=None, H=None, Q_LEN=seq_len, KV_LEN=seq_len, device=device_key)
94
+
95
+
96
+ @functools.lru_cache(maxsize=None)
97
+ def _xcausal_mask(seq_len: int, window_size, device_key: str):
98
+ idx = torch.arange(seq_len, device=device_key)
99
+ q_idx = idx[:, None]
100
+ kv_idx = idx[None, :]
101
+ window = window_size or seq_len
102
+ return _XMask((kv_idx <= q_idx) & (q_idx - kv_idx < window))
103
+
104
+
105
+ @torch.compiler.disable
106
+ def causal_masks(seq_len: int, windows, device) -> dict:
107
+ """{window_size: mask} for plain causal attention; cached per (seq_len, window, device)."""
108
+ if _USE_XFORMERS:
109
+ return {w: _xcausal_mask(seq_len, w, str(device)) for w in windows}
110
+ return {w: _causal_mask(seq_len, w, str(device)) for w in windows}
111
+
112
+
113
+ @torch.compiler.disable
114
+ def doc_masks(doc_ids: torch.Tensor, windows) -> dict:
115
+ """{window_size: mask} for causal + same-document attention. doc_ids: (B, T) int, per batch."""
116
+ b_, t_ = doc_ids.shape
117
+
118
+ if _USE_XFORMERS:
119
+ idx = torch.arange(t_, device=doc_ids.device)
120
+ q_idx = idx[:, None]
121
+ kv_idx = idx[None, :]
122
+ same_doc = doc_ids[:, :, None] == doc_ids[:, None, :] # (B, T, T)
123
+
124
+ def build_x(window_size):
125
+ window = window_size or t_
126
+ return _XMask(same_doc & (kv_idx <= q_idx) & (q_idx - kv_idx < window))
127
+
128
+ return {w: build_x(w) for w in windows}
129
+
130
+ def build(window_size):
131
+ window = window_size or t_
132
+
133
+ def mask_mod(b, h, q_idx, kv_idx):
134
+ return (doc_ids[b, q_idx] == doc_ids[b, kv_idx]) & (kv_idx <= q_idx) & (q_idx - kv_idx < window)
135
+
136
+ return create_block_mask(mask_mod, B=b_, H=None, Q_LEN=t_, KV_LEN=t_,
137
+ device=doc_ids.device, _compile=True)
138
+
139
+ return {w: build(w) for w in windows}
140
+
141
+
142
+ # ---------------------------------------------------------------------------
143
+ # Telemetry counters (model.py records its Liger/Triton success/fallback events here).
144
+ # ---------------------------------------------------------------------------
145
+
146
+ _backend_stats: dict[str, int] = {}
147
+
148
+
149
+ def _record_backend(name: str) -> None:
150
+ # Inside a compiled region this body runs only at trace time, so counting here under-reports.
151
+ # Record nothing while compiling rather than report wrong numbers.
152
+ if torch.compiler.is_compiling():
153
+ return
154
+ _backend_stats[name] = _backend_stats.get(name, 0) + 1
155
+
156
+
157
+ def get_backend_stats() -> dict[str, int]:
158
+ return dict(_backend_stats)
159
+
160
+
161
+ def reset_backend_stats() -> None:
162
+ _backend_stats.clear()
163
+
model.py ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7869aa4bc65771b579bd83bcbc2b621268fb0995302a429ce4c6f17f8c4dd9df
3
+ size 114127392
modeling_pragya.py ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import dataclasses
2
+
3
+ import torch
4
+ import torch.nn.functional as F
5
+ from transformers import GenerationMixin, PreTrainedModel
6
+ from transformers.modeling_outputs import CausalLMOutputWithPast
7
+
8
+ from .configuration_pragya import PragyaConfig
9
+ from .model import GPT, GPTConfig, KVCache
10
+ # The Hub loader only copies sibling files named in "from .name import" form. model.py
11
+ # falls back to "from . import config/kernel/ngram", so import them this way too.
12
+ from .config import * # noqa: F401,F403
13
+ from .kernel import * # noqa: F401,F403
14
+ from .ngram import * # noqa: F401,F403
15
+
16
+ # Config field names that differ between PragyaConfig and GPTConfig.
17
+ _RENAMED = {"top_k": "gpt_top_k"}
18
+ # Fields GPTConfig stores as tuples, which PragyaConfig stores as lists.
19
+ _TUPLE_FIELDS = ("engram_layer_ids", "engram_vocab_size")
20
+
21
+
22
+ def to_gpt_config(cfg: PragyaConfig) -> GPTConfig:
23
+ """Build a GPTConfig from every field, so no value comes from config.py defaults."""
24
+ kwargs = {}
25
+ for f in dataclasses.fields(GPTConfig):
26
+ value = getattr(cfg, _RENAMED.get(f.name, f.name))
27
+ if f.name in _TUPLE_FIELDS:
28
+ value = tuple(value)
29
+ kwargs[f.name] = value
30
+ return GPTConfig(**kwargs)
31
+
32
+
33
+ def _non_persistent_buffers(module):
34
+ """{name: tensor} for every non-persistent buffer in a torch module tree."""
35
+ out = {}
36
+ for prefix, sub in module.named_modules():
37
+ for buf_name in sub._non_persistent_buffers_set:
38
+ full = f"{prefix}.{buf_name}" if prefix else buf_name
39
+ out[full] = getattr(sub, buf_name)
40
+ return out
41
+
42
+
43
+ class PragyaForCausalLM(PreTrainedModel, GenerationMixin):
44
+ config_class = PragyaConfig
45
+ base_model_prefix = "model"
46
+ main_input_name = "input_ids"
47
+ supports_gradient_checkpointing = False
48
+ # wte.weight and lm_head.weight are one tensor; save only lm_head.weight.
49
+ _tied_weights_keys = {"model.transformer.wte.weight": "model.lm_head.weight"}
50
+
51
+ def __init__(self, config: PragyaConfig):
52
+ super().__init__(config)
53
+ if config.use_engram and config.engram_compressed_vocab <= 0:
54
+ raise ValueError(
55
+ "engram_compressed_vocab must be set before loading. It is computed from the "
56
+ "tokenizer when the model is first built, so the export step must record it."
57
+ )
58
+ self.model = GPT(to_gpt_config(config))
59
+ self.post_init()
60
+
61
+ def _move_missing_keys_from_meta_to_device(self, missing_keys, device_map, device_mesh, hf_quantizer):
62
+ # Transformers replaces every non-persistent buffer (RoPE tables, XSA masks, Engram
63
+ # `mods`) with uninitialised memory when loading. They are derived from the config,
64
+ # so rebuild them from a freshly constructed GPT.
65
+ super()._move_missing_keys_from_meta_to_device(missing_keys, device_map, device_mesh, hf_quantizer)
66
+ fresh = GPT(to_gpt_config(self.config))
67
+ own = _non_persistent_buffers(self.model)
68
+ with torch.no_grad():
69
+ for name, buf in _non_persistent_buffers(fresh).items():
70
+ own[name].copy_(buf)
71
+ del fresh
72
+ # wte and lm_head are one tensor. Checkpoints store one of the two, so tie from the
73
+ # one that was actually loaded, not from whichever happens to be first.
74
+ if "model.lm_head.weight" in missing_keys:
75
+ self.model.lm_head.weight = self.model.transformer.wte.weight
76
+ else:
77
+ self.model.transformer.wte.weight = self.model.lm_head.weight
78
+
79
+ def _init_weights(self, module):
80
+ # Weights come from GPT.__init__ (Engram tables, zero-init attention gate, tied
81
+ # embeddings) or from the checkpoint. Transformers' default would overwrite them.
82
+ pass
83
+
84
+ def get_input_embeddings(self):
85
+ return self.model.transformer.wte
86
+
87
+ def get_output_embeddings(self):
88
+ return self.model.lm_head
89
+
90
+ def forward(self, input_ids=None, attention_mask=None, labels=None,
91
+ logits_to_keep=0, past_key_values=None, use_cache=None, **kwargs):
92
+ if attention_mask is not None and not bool(torch.all(attention_mask == 1)):
93
+ if labels is not None:
94
+ raise NotImplementedError(
95
+ "attention_mask with padding is not supported for training. Use unpadded batches."
96
+ )
97
+ # Inference with padding: the model has no mask support, so each row is run on its own
98
+ # real tokens (no pads attended to, positions start at 0) and the logits are put back
99
+ # at the row's original positions. Padded positions get zeros.
100
+ return self._forward_unpadded_rows(input_ids, attention_mask, logits_to_keep)
101
+ if labels is not None:
102
+ # Training path. GPT compares logits[t] with targets[t] without shifting, so shift
103
+ # here: position t predicts token t+1. Trainer passes labels == input_ids.
104
+ logits, loss = self.model(input_ids[:, :-1], targets=labels[:, 1:])
105
+ return CausalLMOutputWithPast(loss=loss, logits=logits)
106
+
107
+ cache_wanted = bool(use_cache) or isinstance(past_key_values, KVCache)
108
+ if cache_wanted and self.model.supports_kv_cache:
109
+ return self._cached_forward(input_ids, past_key_values)
110
+
111
+ # Inference path. logits_to_keep=0 means logits for every position (B, T, V),
112
+ # which lm-evaluation-harness and loglikelihood scoring need. logits_to_keep=k
113
+ # returns the last k positions. Hidden states are captured after ln_f, and the
114
+ # projection is the same F.linear(x, lm_head.weight) GPT uses internally.
115
+ captured = {}
116
+ handle = self.model.transformer.ln_f.register_forward_hook(
117
+ lambda module, inp, out: captured.__setitem__("x", out))
118
+ try:
119
+ self.model(input_ids)
120
+ finally:
121
+ handle.remove()
122
+ x = captured["x"]
123
+ if logits_to_keep:
124
+ x = x[:, -logits_to_keep:, :]
125
+ logits = F.linear(x, self.model.lm_head.weight)
126
+ return CausalLMOutputWithPast(logits=logits)
127
+
128
+ def _forward_unpadded_rows(self, input_ids, attention_mask, logits_to_keep):
129
+ rows = []
130
+ for b in range(input_ids.size(0)):
131
+ keep = attention_mask[b].bool()
132
+ row = input_ids[b:b + 1, keep]
133
+ lg = self.forward(row).logits # (1, n, V), full logits
134
+ full = lg.new_zeros(1, input_ids.size(1), lg.size(-1))
135
+ full[:, keep] = lg
136
+ rows.append(full)
137
+ logits = torch.cat(rows, dim=0)
138
+ if logits_to_keep:
139
+ logits = logits[:, -logits_to_keep:]
140
+ return CausalLMOutputWithPast(logits=logits)
141
+
142
+ def _cached_forward(self, input_ids, past):
143
+ """Decoding with the model's own KVCache (prefill on the first call, one token per call).
144
+
145
+ Returns last-position logits, which is all generate() needs. Past the context window the
146
+ model's sliding-window behaviour applies, so the cache is dropped and the last block_size
147
+ tokens are re-encoded, matching GPT._generate_loop.
148
+ """
149
+ block = self.config.block_size
150
+ cache = past if isinstance(past, KVCache) else None
151
+ if cache is None:
152
+ cache = self.model.new_kv_cache()
153
+ if cache.pos + input_ids.size(1) > block:
154
+ window = input_ids[:, -block:]
155
+ logits, _ = self.model(window)
156
+ return CausalLMOutputWithPast(logits=logits, past_key_values=None)
157
+ logits, _ = self.model(input_ids, kv_cache=cache)
158
+ return CausalLMOutputWithPast(logits=logits, past_key_values=cache)
159
+
160
+ def _supports_default_dynamic_cache(self):
161
+ # Transformers would build its own DynamicCache, which needs num_hidden_layers and other
162
+ # standard attributes. Decoding uses the model's KVCache, so opt out.
163
+ return False
164
+
165
+ def prepare_inputs_for_generation(self, input_ids, past_key_values=None, **kwargs):
166
+ block = self.config.block_size
167
+ cache = past_key_values if isinstance(past_key_values, KVCache) else None
168
+ if cache is None or not self.model.supports_kv_cache or input_ids.size(1) > block:
169
+ # No usable cache, or the sequence has passed the window: re-encode the last
170
+ # block_size tokens, as GPT._generate_loop does.
171
+ return {"input_ids": input_ids[:, -block:]}
172
+ # Only tokens the cache has not seen yet: the whole prompt on the first call, then one token.
173
+ return {"input_ids": input_ids[:, cache.pos:],
174
+ "past_key_values": cache,
175
+ "use_cache": True}
ngram.py ADDED
@@ -0,0 +1,459 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Engram -- static n-gram memory (arXiv:2601.07372, DeepSeek engram_demo_v1.py),
3
+ adapted for Veylon/Arya's standard transformer (hc_mult = 1, tiktoken).
4
+
5
+ Fixes vs. the drafted port (all verified in test_engram.py):
6
+
7
+ 1. Hashing ran on CPU/numpy INSIDE forward(): a GPU->CPU sync + torch.compile
8
+ graph break on every Engram layer, every step (and fatal on XLA). Now the
9
+ hash is pure int64 torch ops on the model device, compile-friendly.
10
+ 2. Every Engram layer built its own NgramHashMapping (re-decoding the whole
11
+ vocab) and each call hashed ALL layers, then kept one. Now ONE NgramHasher
12
+ lives on GPT, hashes all layers once per forward.
13
+ 3. pad_id=None crashed np.pad; pad_id=-1 silently indexed the LAST lookup
14
+ entry. Left-context padding is now a dedicated reserved id (never
15
+ collides with a real token class).
16
+ 4. nn.RMSNorm (torch>=2.4 only, eps=finfo(fp16)=1e-3 default) replaced by a local
17
+ _RMSNorm (eps=1e-5, weight cast to the input dtype) matching model.RMSNorm's eager
18
+ path. It does NOT upcast to fp32.
19
+ 5. Gate dot-product computed in fp32 (sum over D in fp16 can overflow/lose
20
+ precision), cast back after the sigmoid.
21
+ 6. The compressed-vocab lookup is now a persistent buffer, so a checkpoint
22
+ carries it and inference needs no tokenizer object.
23
+ 7. sympy dependency dropped (trial-division primality is plenty for table sizes).
24
+ 8. Special-id discovery no longer assumes TokenizerWrapper._special_ids is a
25
+ set of ints (dict / missing attr both handled).
26
+ 9. embed_per_ngram % n_heads != 0 silently produced a wrong-width table ->
27
+ hard assert. Same for len(engram_vocab_size) < max_ngram-1.
28
+ """
29
+
30
+ from __future__ import annotations
31
+
32
+ import math
33
+ import re
34
+ import unicodedata
35
+ import warnings
36
+ from typing import List, Sequence
37
+
38
+ import numpy as np
39
+ import torch
40
+ import torch.nn as nn
41
+ import torch.nn.functional as F
42
+
43
+
44
+ # ─────────────────────────────────────────────────────────────────────────────
45
+ # Primes
46
+ # ─────────────────────────────────────────────────────────────────────────────
47
+
48
+ def _is_prime(n: int) -> bool:
49
+ if n < 2:
50
+ return False
51
+ if n < 4:
52
+ return True
53
+ if n % 2 == 0 or n % 3 == 0:
54
+ return False
55
+ i = 5
56
+ while i * i <= n:
57
+ if n % i == 0 or n % (i + 2) == 0:
58
+ return False
59
+ i += 6
60
+ return True
61
+
62
+
63
+ def find_next_prime(start: int, seen_primes: set) -> int:
64
+ candidate = start + 1
65
+ while True:
66
+ if _is_prime(candidate) and candidate not in seen_primes:
67
+ return candidate
68
+ candidate += 1
69
+
70
+
71
+ # ─────────────────────────────────────────────────────────────────────────────
72
+ # CompressedTokenizer -- build-time only (numpy). Output is a lookup table.
73
+ # ─────────────────────────────────────────────────────────────────────────────
74
+
75
+ class CompressedTokenizer:
76
+ """Maps raw token IDs -> compressed IDs (NFKC / strip-accents / lowercase /
77
+ whitespace-collapse of each token's surface string). Build-time only: the
78
+ result (`lookup_table`) is handed to the model as a persistent buffer."""
79
+
80
+ _SENTINEL = "\uE000"
81
+ _WS_RE = re.compile(r"[ \t\r\n]+")
82
+
83
+ def __init__(self, tokenizer_wrapper):
84
+ self.tokenizer = tokenizer_wrapper
85
+ self._special_ids = self._collect_special_ids(tokenizer_wrapper)
86
+ self.lookup_table, self.num_new_token = self._build_lookup_table()
87
+
88
+ def __len__(self):
89
+ return self.num_new_token
90
+
91
+ @staticmethod
92
+ def _collect_special_ids(tw) -> set:
93
+ ids = set()
94
+ raw = getattr(tw, "_special_ids", None)
95
+ if raw is not None:
96
+ if isinstance(raw, dict):
97
+ for k, v in raw.items():
98
+ for cand in (k, v):
99
+ if isinstance(cand, (int, np.integer)):
100
+ ids.add(int(cand))
101
+ else:
102
+ for v in raw:
103
+ if isinstance(v, (int, np.integer)):
104
+ ids.add(int(v))
105
+ vs = int(tw.vocab_size)
106
+ for name in ("bos_id", "eos_id", "pad_id"):
107
+ v = getattr(tw, name, None)
108
+ if isinstance(v, (int, np.integer)) and 0 <= int(v) < vs:
109
+ ids.add(int(v))
110
+ return ids
111
+
112
+ @classmethod
113
+ def _normalize(cls, text: str) -> str:
114
+ text = unicodedata.normalize("NFKC", text)
115
+ text = unicodedata.normalize("NFD", text)
116
+ text = "".join(c for c in text if unicodedata.category(c) != "Mn")
117
+ text = text.lower()
118
+ text = cls._WS_RE.sub(" ", text)
119
+ if text == " ": # lone space survives strip()
120
+ text = cls._SENTINEL
121
+ text = text.strip()
122
+ return text.replace(cls._SENTINEL, " ")
123
+
124
+ def _decode_id(self, tid: int) -> str:
125
+ tw = self.tokenizer
126
+ try:
127
+ enc = getattr(tw, "enc", None)
128
+ if enc is not None:
129
+ return enc.decode([tid])
130
+ return tw.decode([tid])
131
+ except Exception:
132
+ return ""
133
+
134
+ def _build_lookup_table(self):
135
+ key2new, new_tokens = {}, []
136
+ vocab_size = int(self.tokenizer.vocab_size)
137
+ lookup = np.empty(vocab_size, dtype=np.int64)
138
+ for tid in range(vocab_size):
139
+ if tid in self._special_ids:
140
+ key = f"__special_{tid}"
141
+ else:
142
+ text = self._decode_id(tid)
143
+ if not text or "\ufffd" in text:
144
+ key = f"__raw_{tid}"
145
+ else:
146
+ norm = self._normalize(text)
147
+ key = norm if norm else f"__raw_{tid}"
148
+ nid = key2new.get(key)
149
+ if nid is None:
150
+ nid = len(new_tokens)
151
+ key2new[key] = nid
152
+ new_tokens.append(key)
153
+ lookup[tid] = nid
154
+ return lookup, len(new_tokens)
155
+
156
+
157
+ # ─────────────────────────────────────────────────────────────────────────────
158
+ # NgramHasher -- static, deterministic, layer-specific, pure torch int64
159
+ # ─────────────────────────────────────────────────────────────────────────────
160
+
161
+ class NgramHasher(nn.Module):
162
+ """(B, T) raw ids -> per-layer embedding indices of shape (B, T, n_cols).
163
+
164
+ No parameters, no gradients. `lookup` and the hash multipliers `mult` are
165
+ persistent (state_dict); the prime moduli `mods` are re-derived from config.
166
+ `mult` comes from NumPy's Generator, which is not guaranteed stable across
167
+ NumPy releases, so it is saved with the checkpoint instead of re-derived.
168
+ """
169
+
170
+ def __init__(self, layer_ids: Sequence[int], max_ngram: int,
171
+ vocab_size_per_ngram: Sequence[int], n_heads: int,
172
+ compressed_vocab: int, raw_vocab_size: int, seed: int,
173
+ lookup: torch.Tensor | None = None):
174
+ super().__init__()
175
+ assert max_ngram >= 2, "engram_max_ngram must be >= 2"
176
+ assert len(vocab_size_per_ngram) >= max_ngram - 1, (
177
+ f"engram_vocab_size needs {max_ngram - 1} entries (ngram 2..{max_ngram}), "
178
+ f"got {len(vocab_size_per_ngram)}"
179
+ )
180
+ assert compressed_vocab > 0, "engram_compressed_vocab must be set (>0)"
181
+
182
+ self.layer_ids = tuple(int(l) for l in layer_ids)
183
+ self.max_ngram = int(max_ngram)
184
+ self.n_heads = int(n_heads)
185
+ self.n_cols = (self.max_ngram - 1) * self.n_heads
186
+ self.compressed_vocab = int(compressed_vocab)
187
+ # Reserved id for left-context padding: distinct from every token class.
188
+ self.pad_cid = self.compressed_vocab
189
+
190
+ if lookup is None:
191
+ # Every token would hash to class 0 and Engram would silently ignore its input. This is only
192
+ # valid if a checkpoint (which carries `lookup`) is loaded right after construction.
193
+ warnings.warn(
194
+ "NgramHasher built without a lookup table: all tokens map to class 0 until a checkpoint "
195
+ "containing `lookup` is loaded. Pass engram_lookup from CompressedTokenizer for training.",
196
+ stacklevel=2)
197
+ lookup = torch.zeros(int(raw_vocab_size), dtype=torch.int64)
198
+ else:
199
+ lookup = lookup.detach().to(torch.int64).clone()
200
+ assert lookup.numel() == int(raw_vocab_size), (
201
+ f"lookup has {lookup.numel()} entries, vocab_size={raw_vocab_size}")
202
+ assert int(lookup.max()) < self.compressed_vocab
203
+ self.register_buffer("lookup", lookup, persistent=True)
204
+
205
+ # Multipliers: r*2+1, bounded so tok*mult can never overflow int64.
206
+ # (+1 vocab slot for the reserved pad id.)
207
+ max_long = int(np.iinfo(np.int64).max)
208
+ M_max = max_long // (self.compressed_vocab + 1)
209
+ half_bound = max(1, M_max // 2)
210
+ PRIME_1 = 10007
211
+ mult = np.empty((len(self.layer_ids), self.max_ngram), dtype=np.int64)
212
+ for li, layer_id in enumerate(self.layer_ids):
213
+ g = np.random.default_rng(int(seed + PRIME_1 * int(layer_id)))
214
+ r = g.integers(low=0, high=half_bound, size=(self.max_ngram,), dtype=np.int64)
215
+ mult[li] = r * 2 + 1
216
+ self.register_buffer("mult", torch.from_numpy(mult), persistent=True)
217
+
218
+ # Distinct prime moduli per (layer, ngram order, head); unique globally.
219
+ seen: set = set()
220
+ self.head_sizes: List[List[int]] = [] # per layer: flat list, len n_cols
221
+ for _ in self.layer_ids:
222
+ flat = []
223
+ for ngram in range(2, self.max_ngram + 1):
224
+ search_start = int(vocab_size_per_ngram[ngram - 2]) - 1
225
+ for _h in range(self.n_heads):
226
+ found = find_next_prime(search_start, seen)
227
+ seen.add(found)
228
+ flat.append(found)
229
+ search_start = found
230
+ self.head_sizes.append(flat)
231
+ self.register_buffer(
232
+ "mods", torch.tensor(self.head_sizes, dtype=torch.int64), persistent=False)
233
+ head_offsets = []
234
+ for sizes in self.head_sizes:
235
+ offsets = []
236
+ offset = 0
237
+ for size in sizes:
238
+ offsets.append(offset)
239
+ offset += size
240
+ head_offsets.append(offsets)
241
+ self.register_buffer(
242
+ "head_offsets", torch.tensor(head_offsets, dtype=torch.int64), persistent=False)
243
+
244
+ def compress(self, idx: torch.Tensor) -> torch.Tensor:
245
+ return self.lookup[idx.long()] # idx is never negative (the -1 ignore index lives in targets)
246
+
247
+ def forward(self, idx: torch.Tensor, doc_ids: torch.Tensor | None = None,
248
+ cache: dict | None = None):
249
+ """Hash tokens, optionally using cached history for incremental decoding.
250
+
251
+ doc_ids (B, T), when supplied, replaces cross-document history with the
252
+ left-padding id so packed documents hash as if processed separately.
253
+ """
254
+ ids = self.compress(idx) # (B, T_new)
255
+ B, T_new = ids.shape
256
+ K = self.max_ngram - 1
257
+
258
+ if cache is not None:
259
+ hist_ids = cache.get("hash_hist_ids")
260
+ hist_doc = cache.get("hash_hist_doc")
261
+ if hist_ids is None:
262
+ hist_ids = ids.new_full((B, K), self.pad_cid)
263
+ hist_doc = (
264
+ torch.full((B, K), -1, dtype=doc_ids.dtype, device=doc_ids.device)
265
+ if doc_ids is not None else None
266
+ )
267
+ else:
268
+ hist_ids = hist_ids.to(device=ids.device)
269
+ if hist_doc is not None:
270
+ hist_doc = hist_doc.to(device=ids.device)
271
+ full_ids = torch.cat([hist_ids, ids], dim=1) # (B, K + T_new)
272
+ if doc_ids is not None and hist_doc is not None:
273
+ full_doc = torch.cat([hist_doc, doc_ids], dim=1)
274
+ else:
275
+ full_doc = doc_ids
276
+ cache["hash_hist_ids"] = full_ids[:, -K:].detach()
277
+ if full_doc is not None:
278
+ cache["hash_hist_doc"] = full_doc[:, -K:].detach()
279
+ else:
280
+ full_ids, full_doc = ids, doc_ids
281
+
282
+ T_full = full_ids.shape[1]
283
+ # Keep only one running hash per layer and one shifted-id tensor per order;
284
+ # broadcasting all layers and orders at once creates a large int64 product.
285
+ mixes = [full_ids * self.mult[li, 0] for li in range(len(self.layer_ids))]
286
+ out = {
287
+ layer_id: torch.empty(
288
+ (B, T_full, self.n_cols), dtype=torch.int64, device=full_ids.device)
289
+ for layer_id in self.layer_ids
290
+ }
291
+ for n in range(2, self.max_ngram + 1):
292
+ shifted = F.pad(full_ids, (n - 1, 0), value=self.pad_cid)[:, :T_full]
293
+ if full_doc is not None:
294
+ same = F.pad(full_doc, (n - 1, 0), value=-1)[:, :T_full] == full_doc
295
+ shifted = torch.where(same, shifted, torch.full_like(shifted, self.pad_cid))
296
+ lo = (n - 2) * self.n_heads
297
+ hi = lo + self.n_heads
298
+ for li, layer_id in enumerate(self.layer_ids):
299
+ mix = torch.bitwise_xor(mixes[li], shifted * self.mult[li, n - 1])
300
+ mixes[li] = mix
301
+ col = mix.unsqueeze(-1) % self.mods[li, lo:hi]
302
+ col += self.head_offsets[li, lo:hi]
303
+ out[layer_id][..., lo:hi] = col
304
+ if T_full > T_new:
305
+ out = {layer_id: values[:, -T_new:].contiguous() for layer_id, values in out.items()}
306
+ return out
307
+
308
+
309
+ # ─────────────────────────────────────────────────────────────────────────────
310
+ # Modules
311
+ # ─────────────────────────────────────────────────────────────────────────────
312
+
313
+ class _RMSNorm(nn.Module):
314
+ """RMSNorm with fused accumulation for the input dtype."""
315
+
316
+ def __init__(self, dim: int, eps: float = 1e-5):
317
+ super().__init__()
318
+ self.eps = eps
319
+ self.weight = nn.Parameter(torch.ones(dim))
320
+
321
+ def forward(self, x: torch.Tensor) -> torch.Tensor:
322
+ return F.rms_norm(x, (x.shape[-1],), self.weight.to(x.dtype), self.eps)
323
+
324
+
325
+ class ShortConv(nn.Module):
326
+ """(B, T, D) -> (B, T, D). Depthwise causal conv, dilation = max_ngram."""
327
+
328
+ def __init__(self, hidden_size: int, kernel_size: int = 4,
329
+ dilation: int = 1, activation: bool = True):
330
+ super().__init__()
331
+ self.activation = activation
332
+ self.kernel_size = kernel_size
333
+ self.dilation = dilation
334
+ self.conv = nn.Conv1d(
335
+ hidden_size, hidden_size, kernel_size=kernel_size,
336
+ groups=hidden_size, bias=False,
337
+ padding=(kernel_size - 1) * dilation, dilation=dilation,
338
+ )
339
+ self.norm = _RMSNorm(hidden_size)
340
+ self.act_fn = nn.SiLU() if activation else None
341
+
342
+ def forward(self, x: torch.Tensor, doc_ids: torch.Tensor | None = None,
343
+ cache: dict | None = None) -> torch.Tensor:
344
+ T = x.shape[1]
345
+ K, d = self.kernel_size, self.dilation
346
+ rf = (K - 1) * d
347
+ B, _, D = x.shape
348
+ xn = self.norm(x) # (B, T, D)
349
+
350
+ if cache is not None:
351
+ hist_xn = cache.get("sc_hist_x")
352
+ hist_doc = cache.get("sc_hist_doc")
353
+ if hist_xn is None:
354
+ hist_xn = xn.new_zeros(B, rf, D)
355
+ hist_doc = (
356
+ torch.full((B, rf), -1, dtype=doc_ids.dtype, device=doc_ids.device)
357
+ if doc_ids is not None else None
358
+ )
359
+ else:
360
+ hist_xn = hist_xn.to(dtype=xn.dtype, device=xn.device)
361
+ if hist_doc is not None:
362
+ hist_doc = hist_doc.to(device=xn.device)
363
+ full_xn = torch.cat([hist_xn, xn], dim=1) if rf > 0 else xn
364
+ if doc_ids is not None and hist_doc is not None:
365
+ full_doc = torch.cat([hist_doc, doc_ids], dim=1) if rf > 0 else doc_ids
366
+ else:
367
+ full_doc = doc_ids
368
+ if rf > 0:
369
+ cache["sc_hist_x"] = full_xn[:, -rf:].detach()
370
+ if full_doc is not None:
371
+ cache["sc_hist_doc"] = full_doc[:, -rf:].detach()
372
+ else:
373
+ full_xn, full_doc = xn, doc_ids
374
+
375
+ T_full = full_xn.shape[1]
376
+ w = self.conv.weight[:, 0, :].to(full_xn.dtype) # (D, K)
377
+ xp = F.pad(full_xn, (0, 0, rf, 0))
378
+
379
+ tap = xp[:, :T_full]
380
+ if full_doc is not None and K > 1:
381
+ s = (K - 1) * d
382
+ same = F.pad(full_doc, (s, 0), value=-1)[:, :T_full] == full_doc
383
+ tap = tap * same.unsqueeze(-1)
384
+ y = tap * w[:, 0]
385
+ for j in range(1, K):
386
+ tap = xp[:, j * d:j * d + T_full]
387
+ if full_doc is not None:
388
+ s = (K - 1 - j) * d
389
+ same = F.pad(full_doc, (s, 0), value=-1)[:, :T_full] == full_doc
390
+ tap = tap * same.unsqueeze(-1)
391
+ y.addcmul_(tap, w[:, j])
392
+ if T_full > T:
393
+ y = y[:, -T:].contiguous()
394
+ if self.activation:
395
+ y = self.act_fn(y)
396
+ return y
397
+
398
+
399
+ class MultiHeadEmbedding(nn.Module):
400
+ def __init__(self, list_of_N: List[int], D: int):
401
+ super().__init__()
402
+ self.embedding = nn.Embedding(sum(list_of_N), D)
403
+ self.reset_parameters()
404
+
405
+ def reset_parameters(self):
406
+ nn.init.normal_(self.embedding.weight, std=0.01)
407
+
408
+ def forward(self, hash_ids: torch.Tensor) -> torch.Tensor:
409
+ return self.embedding(hash_ids)
410
+
411
+
412
+ class Engram(nn.Module):
413
+ """Static n-gram memory with conditional gated injection (hc_mult = 1).
414
+
415
+ forward() returns the DELTA to add to the residual stream:
416
+ x = x + engram(x, hash_ids)
417
+ """
418
+
419
+ def __init__(self, hidden_size: int, head_sizes: List[int], max_ngram: int,
420
+ embed_per_ngram: int, n_heads: int, kernel_size: int):
421
+ super().__init__()
422
+ assert embed_per_ngram % n_heads == 0, (
423
+ f"engram_embed_per_ngram={embed_per_ngram} must be divisible by "
424
+ f"engram_n_heads={n_heads}")
425
+ self.hidden_size = hidden_size
426
+ d_head = embed_per_ngram // n_heads
427
+ engram_hidden = (max_ngram - 1) * embed_per_ngram
428
+
429
+ self.multi_head_embedding = MultiHeadEmbedding(list(head_sizes), d_head)
430
+ self.value_proj = nn.Linear(engram_hidden, hidden_size, bias=False)
431
+ self.key_proj = nn.Linear(engram_hidden, hidden_size, bias=False)
432
+ self.norm1 = _RMSNorm(hidden_size)
433
+ self.norm2 = _RMSNorm(hidden_size)
434
+ self.short_conv = ShortConv(hidden_size, kernel_size=kernel_size,
435
+ dilation=max_ngram)
436
+ self.reset_parameters()
437
+
438
+ def reset_parameters(self):
439
+ self.multi_head_embedding.reset_parameters()
440
+ nn.init.normal_(self.value_proj.weight, std=0.02)
441
+ nn.init.normal_(self.key_proj.weight, std=0.02)
442
+ # Zero-init the conv: ShortConv RMS-normalises its input, so without this the gated value is
443
+ # blown back up to ~1 rms and the initial delta is ~0.13 rms (larger than the residual stream at
444
+ # D<=256). With zeros the branch starts at ~0 and the conv weight gets gradient on step 1.
445
+ nn.init.zeros_(self.short_conv.conv.weight)
446
+
447
+ def forward(self, hidden_states: torch.Tensor, hash_ids: torch.Tensor,
448
+ doc_ids: torch.Tensor | None = None, cache: dict | None = None):
449
+ emb = self.multi_head_embedding(hash_ids).flatten(start_dim=-2) # (B,T,engram_hidden)
450
+ key = self.key_proj(emb)
451
+ nk = self.norm1(key)
452
+ nq = self.norm2(hidden_states)
453
+ # Product AND sum in fp32: with bf16 inputs, rounding nk*nq to bf16 first leaves gate errors up to
454
+ # ~0.02 (sqrt(|g|) amplifies small pre-activations); the casts fuse under torch.compile.
455
+ gate = (nk.float() * nq.float()).sum(dim=-1) / math.sqrt(self.hidden_size)
456
+ gate = gate.abs().clamp_min(1e-6).sqrt() * gate.sign()
457
+ gate = gate.sigmoid().unsqueeze(-1).to(hidden_states.dtype) # (B,T,1)
458
+ value = gate * self.value_proj(emb)
459
+ return value + self.short_conv(value, doc_ids, cache=cache)
optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f0ba3c44137a3fb75324ac0a6a1cd877aeadc13c324b7210af17721ba18d133
3
+ size 228177995
pragya.tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61c19bab1174704a4a4441475683bf1270277af15d2e2c95e964789128e482c4
3
+ size 14645
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10a3ff0aa1e5c1862bafecb07e5f9585646ede86fefc8837cd3a4073cdde1205
3
+ size 1465
tokenization_pragya.py ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+
4
+ import tiktoken
5
+ from transformers import PreTrainedTokenizer
6
+
7
+
8
+ def bytes_to_unicode():
9
+ """Reversible byte -> printable-char map (GPT-2 style). Every byte maps to
10
+ a unique character, so token strings never lose bytes."""
11
+ bs = (list(range(ord("!"), ord("~") + 1))
12
+ + list(range(ord("¡"), ord("¬") + 1))
13
+ + list(range(ord("®"), ord("ÿ") + 1)))
14
+ cs = bs[:]
15
+ n = 0
16
+ for b in range(256):
17
+ if b not in bs:
18
+ bs.append(b)
19
+ cs.append(256 + n)
20
+ n += 1
21
+ return {b: chr(c) for b, c in zip(bs, cs)}
22
+
23
+
24
+ _BYTE_ENCODER = bytes_to_unicode()
25
+ _BYTE_DECODER = {v: k for k, v in _BYTE_ENCODER.items()}
26
+
27
+
28
+ class PragyaTokenizer(PreTrainedTokenizer):
29
+ vocab_files_names = {"tokenizer_file": "pragya.tokenizer.json"}
30
+
31
+ def __init__(self, tokenizer_file=None, bos_token="<|bos|>",
32
+ eos_token="<|bos|>", pad_token="<|bos|>",
33
+ unk_token="<|bos|>", **kwargs):
34
+ if tokenizer_file is None:
35
+ raise ValueError(
36
+ "PragyaTokenizer needs tokenizer_file=<path to pragya.tokenizer.json>, "
37
+ "or load it with from_pretrained()."
38
+ )
39
+ with open(tokenizer_file, "r", encoding="utf-8") as f:
40
+ self._raw = json.load(f)
41
+
42
+ mergeable_ranks = {bytes.fromhex(k): int(v)
43
+ for k, v in self._raw["mergeable_ranks"].items()}
44
+ special_tokens = {k: int(v) for k, v in self._raw["special_tokens"].items()}
45
+ self._enc = tiktoken.Encoding(
46
+ name=self._raw["name"],
47
+ pat_str=self._raw["pat_str"],
48
+ mergeable_ranks=mergeable_ranks,
49
+ special_tokens=special_tokens,
50
+ )
51
+
52
+ # id <-> token string. Ordinary tokens use the reversible byte map;
53
+ # special tokens keep their literal string.
54
+ self._special_set = set(special_tokens)
55
+ self._id_to_tok = {}
56
+ for i in range(self._enc.n_vocab):
57
+ if i in set(special_tokens.values()):
58
+ continue
59
+ raw = self._enc.decode_single_token_bytes(i)
60
+ self._id_to_tok[i] = "".join(_BYTE_ENCODER[b] for b in raw)
61
+ for name, i in special_tokens.items():
62
+ self._id_to_tok[i] = name
63
+ self._tok_to_id = {t: i for i, t in self._id_to_tok.items()}
64
+
65
+ kwargs.setdefault("clean_up_tokenization_spaces", False)
66
+ kwargs.setdefault("padding_side", "left") # generation needs left padding
67
+ kwargs.setdefault("model_max_length", 1024) # CONTEXT in config__1_.py
68
+ super().__init__(bos_token=bos_token, eos_token=eos_token,
69
+ pad_token=pad_token, unk_token=unk_token, **kwargs)
70
+
71
+ @classmethod
72
+ def _from_pretrained(cls, resolved_vocab_files, pretrained_model_name_or_path,
73
+ *args, **kwargs):
74
+ # Transformers 5 can resolve our file to a default name (tokenizer.json) that
75
+ # we never ship. Find pragya.tokenizer.json in the local folder, or download it
76
+ # from the Hub repo, so loading works for both paths and repo ids.
77
+ if resolved_vocab_files.get("tokenizer_file") is None:
78
+ name = "pragya.tokenizer.json"
79
+ local_dir = str(pretrained_model_name_or_path)
80
+ if os.path.isdir(local_dir) and os.path.isfile(os.path.join(local_dir, name)):
81
+ resolved_vocab_files["tokenizer_file"] = os.path.join(local_dir, name)
82
+ else:
83
+ from huggingface_hub import hf_hub_download
84
+ from huggingface_hub.errors import EntryNotFoundError
85
+ try:
86
+ resolved_vocab_files["tokenizer_file"] = hf_hub_download(
87
+ repo_id=local_dir, filename=name,
88
+ revision=kwargs.get("revision"), token=kwargs.get("token"),
89
+ )
90
+ except EntryNotFoundError as e:
91
+ raise FileNotFoundError(
92
+ f"{name} is missing from {local_dir} on the Hub. Upload it to the "
93
+ f"repository root alongside the other tokenizer files."
94
+ ) from e
95
+ return super()._from_pretrained(resolved_vocab_files,
96
+ pretrained_model_name_or_path,
97
+ *args, **kwargs)
98
+
99
+ def _add_tokens(self, new_tokens, special_tokens=False):
100
+ # Transformers assigns ids past the end of the vocab to unknown tokens,
101
+ # which the model embedding cannot look up. Refuse them instead.
102
+ unknown = [t for t in new_tokens
103
+ if str(t) not in self._tok_to_id and str(t) not in self.added_tokens_encoder]
104
+ if unknown:
105
+ raise ValueError(
106
+ f"Cannot add tokens {unknown!r}: this tokenizer has a fixed vocab "
107
+ f"of {self._enc.n_vocab} tokens and the model embedding cannot grow "
108
+ f"without retraining."
109
+ )
110
+ return super()._add_tokens(new_tokens, special_tokens=special_tokens)
111
+
112
+ def tokenize(self, text, **kwargs):
113
+ # Bypass HF's special-token splitting: the training pipeline encoded
114
+ # "<|bos|>" in text as ordinary characters, so match that exactly.
115
+ return self._tokenize(text, **kwargs)
116
+
117
+ @property
118
+ def vocab_size(self):
119
+ return self._enc.n_vocab
120
+
121
+ def get_vocab(self):
122
+ return {**self._tok_to_id, **self.added_tokens_encoder}
123
+
124
+ def _tokenize(self, text, **kwargs):
125
+ return [self._id_to_tok[i] for i in self._enc.encode_ordinary(text)]
126
+
127
+ def _convert_token_to_id(self, token):
128
+ if token in self._tok_to_id:
129
+ return self._tok_to_id[token]
130
+ if token in self.added_tokens_encoder:
131
+ return self.added_tokens_encoder[token]
132
+ raise ValueError(
133
+ f"Unknown token {token!r}. This tokenizer ships with a fixed vocab "
134
+ f"of {self._enc.n_vocab} tokens; new special tokens cannot be added "
135
+ f"without retraining the model embedding."
136
+ )
137
+
138
+ def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):
139
+ # Training wrapper prepends <|bos|> by default (add_bos=True).
140
+ ids = [self.bos_token_id] + list(token_ids_0)
141
+ if token_ids_1 is not None:
142
+ ids += list(token_ids_1)
143
+ return ids
144
+
145
+ def _convert_id_to_token(self, index):
146
+ index = int(index)
147
+ if index not in self._id_to_tok:
148
+ raise ValueError(
149
+ f"Token id {index} is outside the vocab of {self.vocab_size} tokens."
150
+ )
151
+ return self._id_to_tok[index]
152
+
153
+ def _decode(self, token_ids, skip_special_tokens=False, **kwargs):
154
+ # Accept a single id, a list, or a tensor/array (callers pass all three).
155
+ if hasattr(token_ids, "tolist"):
156
+ token_ids = token_ids.tolist()
157
+ if isinstance(token_ids, int):
158
+ token_ids = [token_ids]
159
+ valid = [int(i) for i in token_ids if 0 <= int(i) < self.vocab_size]
160
+ return super()._decode(valid, skip_special_tokens=skip_special_tokens, **kwargs)
161
+
162
+ def convert_tokens_to_string(self, tokens):
163
+ special = self._special_set | set(self.added_tokens_encoder)
164
+ out = bytearray()
165
+ parts = []
166
+ for t in tokens:
167
+ if t in special:
168
+ parts.append(out.decode("utf-8", errors="replace"))
169
+ out = bytearray()
170
+ parts.append(t)
171
+ else:
172
+ out.extend(_BYTE_DECODER[c] for c in t)
173
+ parts.append(out.decode("utf-8", errors="replace"))
174
+ return "".join(parts)
175
+
176
+ def save_vocabulary(self, save_directory, filename_prefix=None):
177
+ name = (filename_prefix + "-" if filename_prefix else "") + "pragya.tokenizer.json"
178
+ path = os.path.join(save_directory, name)
179
+ with open(path, "w", encoding="utf-8") as f:
180
+ json.dump(self._raw, f, indent=2, ensure_ascii=False)
181
+ return (path,)
182
+
tokenizer_config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "12287": {
4
+ "content": "<|bos|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ }
11
+ },
12
+ "auto_map": {
13
+ "AutoTokenizer": [
14
+ "tokenization_pragya.PragyaTokenizer",
15
+ null
16
+ ]
17
+ },
18
+ "backend": "custom",
19
+ "bos_token": "<|bos|>",
20
+ "clean_up_tokenization_spaces": false,
21
+ "eos_token": "<|bos|>",
22
+ "is_local": false,
23
+ "local_files_only": false,
24
+ "model_max_length": 1024,
25
+ "pad_token": "<|bos|>",
26
+ "padding_side": "left",
27
+ "tokenizer_class": "PragyaTokenizer",
28
+ "unk_token": "<|bos|>"
29
+ }
trainer_state.json ADDED
@@ -0,0 +1,2253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_global_step": null,
3
+ "best_metric": null,
4
+ "best_model_checkpoint": null,
5
+ "epoch": 1.0,
6
+ "eval_steps": 500,
7
+ "global_step": 15858,
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.003152982721654685,
14
+ "grad_norm": 4.853567123413086,
15
+ "learning_rate": 9.9999880707815e-05,
16
+ "loss": 2.872132568359375,
17
+ "step": 50
18
+ },
19
+ {
20
+ "epoch": 0.00630596544330937,
21
+ "grad_norm": 8.673802375793457,
22
+ "learning_rate": 9.999633156224002e-05,
23
+ "loss": 2.0706358337402344,
24
+ "step": 100
25
+ },
26
+ {
27
+ "epoch": 0.009458948164964056,
28
+ "grad_norm": 3.1262404918670654,
29
+ "learning_rate": 9.998785338773455e-05,
30
+ "loss": 2.0303359985351563,
31
+ "step": 150
32
+ },
33
+ {
34
+ "epoch": 0.01261193088661874,
35
+ "grad_norm": 5.10759162902832,
36
+ "learning_rate": 9.997444702014325e-05,
37
+ "loss": 1.960927734375,
38
+ "step": 200
39
+ },
40
+ {
41
+ "epoch": 0.015764913608273427,
42
+ "grad_norm": 5.117474555969238,
43
+ "learning_rate": 9.995611378117058e-05,
44
+ "loss": 1.7625619506835937,
45
+ "step": 250
46
+ },
47
+ {
48
+ "epoch": 0.018917896329928113,
49
+ "grad_norm": 3.3129849433898926,
50
+ "learning_rate": 9.993285547825046e-05,
51
+ "loss": 1.963189697265625,
52
+ "step": 300
53
+ },
54
+ {
55
+ "epoch": 0.0220708790515828,
56
+ "grad_norm": 4.3984375,
57
+ "learning_rate": 9.990467440436808e-05,
58
+ "loss": 1.8761654663085938,
59
+ "step": 350
60
+ },
61
+ {
62
+ "epoch": 0.02522386177323748,
63
+ "grad_norm": 3.8485946655273438,
64
+ "learning_rate": 9.987157333783385e-05,
65
+ "loss": 1.8703598022460937,
66
+ "step": 400
67
+ },
68
+ {
69
+ "epoch": 0.028376844494892167,
70
+ "grad_norm": 3.3610949516296387,
71
+ "learning_rate": 9.98335555420095e-05,
72
+ "loss": 1.8849630737304688,
73
+ "step": 450
74
+ },
75
+ {
76
+ "epoch": 0.03152982721654685,
77
+ "grad_norm": 9.949187278747559,
78
+ "learning_rate": 9.979062476498629e-05,
79
+ "loss": 1.897828369140625,
80
+ "step": 500
81
+ },
82
+ {
83
+ "epoch": 0.03468280993820154,
84
+ "grad_norm": 3.609001398086548,
85
+ "learning_rate": 9.974278523921565e-05,
86
+ "loss": 1.9846488952636718,
87
+ "step": 550
88
+ },
89
+ {
90
+ "epoch": 0.037835792659856225,
91
+ "grad_norm": 2.9588377475738525,
92
+ "learning_rate": 9.96900416810917e-05,
93
+ "loss": 1.7952581787109374,
94
+ "step": 600
95
+ },
96
+ {
97
+ "epoch": 0.04098877538151091,
98
+ "grad_norm": 4.958306789398193,
99
+ "learning_rate": 9.963239929048644e-05,
100
+ "loss": 1.9661424255371094,
101
+ "step": 650
102
+ },
103
+ {
104
+ "epoch": 0.0441417581031656,
105
+ "grad_norm": 3.1150712966918945,
106
+ "learning_rate": 9.956986375023703e-05,
107
+ "loss": 1.8595201110839843,
108
+ "step": 700
109
+ },
110
+ {
111
+ "epoch": 0.04729474082482028,
112
+ "grad_norm": 4.197102069854736,
113
+ "learning_rate": 9.950244122558557e-05,
114
+ "loss": 1.8694996643066406,
115
+ "step": 750
116
+ },
117
+ {
118
+ "epoch": 0.05044772354647496,
119
+ "grad_norm": 3.935776472091675,
120
+ "learning_rate": 9.94301383635712e-05,
121
+ "loss": 1.8022630310058594,
122
+ "step": 800
123
+ },
124
+ {
125
+ "epoch": 0.05360070626812965,
126
+ "grad_norm": 2.621243953704834,
127
+ "learning_rate": 9.93529622923749e-05,
128
+ "loss": 1.8342015075683593,
129
+ "step": 850
130
+ },
131
+ {
132
+ "epoch": 0.056753688989784334,
133
+ "grad_norm": 5.246140956878662,
134
+ "learning_rate": 9.927092062061666e-05,
135
+ "loss": 1.8499333190917968,
136
+ "step": 900
137
+ },
138
+ {
139
+ "epoch": 0.05990667171143902,
140
+ "grad_norm": 2.5088658332824707,
141
+ "learning_rate": 9.918402143660537e-05,
142
+ "loss": 1.9792045593261718,
143
+ "step": 950
144
+ },
145
+ {
146
+ "epoch": 0.0630596544330937,
147
+ "grad_norm": 11.082776069641113,
148
+ "learning_rate": 9.909227330754144e-05,
149
+ "loss": 1.897413787841797,
150
+ "step": 1000
151
+ },
152
+ {
153
+ "epoch": 0.06621263715474839,
154
+ "grad_norm": 5.241158962249756,
155
+ "learning_rate": 9.899568527867216e-05,
156
+ "loss": 1.7708767700195311,
157
+ "step": 1050
158
+ },
159
+ {
160
+ "epoch": 0.06936561987640308,
161
+ "grad_norm": 4.000182151794434,
162
+ "learning_rate": 9.889426687239994e-05,
163
+ "loss": 1.9385163879394531,
164
+ "step": 1100
165
+ },
166
+ {
167
+ "epoch": 0.07251860259805776,
168
+ "grad_norm": 7.7123003005981445,
169
+ "learning_rate": 9.878802808734356e-05,
170
+ "loss": 1.6802894592285156,
171
+ "step": 1150
172
+ },
173
+ {
174
+ "epoch": 0.07567158531971245,
175
+ "grad_norm": 4.490638256072998,
176
+ "learning_rate": 9.867697939735235e-05,
177
+ "loss": 1.8175428771972657,
178
+ "step": 1200
179
+ },
180
+ {
181
+ "epoch": 0.07882456804136713,
182
+ "grad_norm": 5.000014781951904,
183
+ "learning_rate": 9.856113175047368e-05,
184
+ "loss": 1.7184861755371095,
185
+ "step": 1250
186
+ },
187
+ {
188
+ "epoch": 0.08197755076302182,
189
+ "grad_norm": 3.2123770713806152,
190
+ "learning_rate": 9.844049656787357e-05,
191
+ "loss": 1.8914837646484375,
192
+ "step": 1300
193
+ },
194
+ {
195
+ "epoch": 0.0851305334846765,
196
+ "grad_norm": 6.576638698577881,
197
+ "learning_rate": 9.831508574271071e-05,
198
+ "loss": 1.7806048583984375,
199
+ "step": 1350
200
+ },
201
+ {
202
+ "epoch": 0.0882835162063312,
203
+ "grad_norm": 7.240126132965088,
204
+ "learning_rate": 9.818491163896392e-05,
205
+ "loss": 1.707454833984375,
206
+ "step": 1400
207
+ },
208
+ {
209
+ "epoch": 0.09143649892798587,
210
+ "grad_norm": 2.1819403171539307,
211
+ "learning_rate": 9.804998709021327e-05,
212
+ "loss": 1.8345822143554686,
213
+ "step": 1450
214
+ },
215
+ {
216
+ "epoch": 0.09458948164964057,
217
+ "grad_norm": 2.9357962608337402,
218
+ "learning_rate": 9.791032539837478e-05,
219
+ "loss": 1.6845474243164062,
220
+ "step": 1500
221
+ },
222
+ {
223
+ "epoch": 0.09774246437129525,
224
+ "grad_norm": 3.118610382080078,
225
+ "learning_rate": 9.776594033238906e-05,
226
+ "loss": 1.7468299865722656,
227
+ "step": 1550
228
+ },
229
+ {
230
+ "epoch": 0.10089544709294992,
231
+ "grad_norm": 2.261528491973877,
232
+ "learning_rate": 9.761684612686381e-05,
233
+ "loss": 1.8356428527832032,
234
+ "step": 1600
235
+ },
236
+ {
237
+ "epoch": 0.10404842981460462,
238
+ "grad_norm": 2.1853625774383545,
239
+ "learning_rate": 9.746305748067054e-05,
240
+ "loss": 1.624322509765625,
241
+ "step": 1650
242
+ },
243
+ {
244
+ "epoch": 0.1072014125362593,
245
+ "grad_norm": 2.855556011199951,
246
+ "learning_rate": 9.730458955549537e-05,
247
+ "loss": 1.7296275329589843,
248
+ "step": 1700
249
+ },
250
+ {
251
+ "epoch": 0.11035439525791399,
252
+ "grad_norm": 3.9297707080841064,
253
+ "learning_rate": 9.714145797434428e-05,
254
+ "loss": 1.8347354125976563,
255
+ "step": 1750
256
+ },
257
+ {
258
+ "epoch": 0.11350737797956867,
259
+ "grad_norm": 2.9527971744537354,
260
+ "learning_rate": 9.69736788200029e-05,
261
+ "loss": 1.7922471618652345,
262
+ "step": 1800
263
+ },
264
+ {
265
+ "epoch": 0.11666036070122336,
266
+ "grad_norm": 4.253082275390625,
267
+ "learning_rate": 9.680126863345096e-05,
268
+ "loss": 1.723883056640625,
269
+ "step": 1850
270
+ },
271
+ {
272
+ "epoch": 0.11981334342287804,
273
+ "grad_norm": 2.4197330474853516,
274
+ "learning_rate": 9.662424441223148e-05,
275
+ "loss": 1.6388121032714844,
276
+ "step": 1900
277
+ },
278
+ {
279
+ "epoch": 0.12296632614453273,
280
+ "grad_norm": 6.219167709350586,
281
+ "learning_rate": 9.644262360877507e-05,
282
+ "loss": 1.878433074951172,
283
+ "step": 1950
284
+ },
285
+ {
286
+ "epoch": 0.1261193088661874,
287
+ "grad_norm": 5.6117706298828125,
288
+ "learning_rate": 9.625642412867937e-05,
289
+ "loss": 1.6546157836914062,
290
+ "step": 2000
291
+ },
292
+ {
293
+ "epoch": 0.1292722915878421,
294
+ "grad_norm": 4.747069835662842,
295
+ "learning_rate": 9.606566432894364e-05,
296
+ "loss": 1.7719760131835938,
297
+ "step": 2050
298
+ },
299
+ {
300
+ "epoch": 0.13242527430949677,
301
+ "grad_norm": 8.663575172424316,
302
+ "learning_rate": 9.587036301615917e-05,
303
+ "loss": 1.6918789672851562,
304
+ "step": 2100
305
+ },
306
+ {
307
+ "epoch": 0.13557825703115148,
308
+ "grad_norm": 3.6302502155303955,
309
+ "learning_rate": 9.567053944465504e-05,
310
+ "loss": 1.8181585693359374,
311
+ "step": 2150
312
+ },
313
+ {
314
+ "epoch": 0.13873123975280616,
315
+ "grad_norm": 14.437663078308105,
316
+ "learning_rate": 9.546621331459991e-05,
317
+ "loss": 1.7362814331054688,
318
+ "step": 2200
319
+ },
320
+ {
321
+ "epoch": 0.14188422247446084,
322
+ "grad_norm": 4.509804725646973,
323
+ "learning_rate": 9.525740477005986e-05,
324
+ "loss": 1.7941587829589845,
325
+ "step": 2250
326
+ },
327
+ {
328
+ "epoch": 0.14503720519611552,
329
+ "grad_norm": 5.562815189361572,
330
+ "learning_rate": 9.50441343970124e-05,
331
+ "loss": 1.6657884216308594,
332
+ "step": 2300
333
+ },
334
+ {
335
+ "epoch": 0.14819018791777022,
336
+ "grad_norm": 3.0274181365966797,
337
+ "learning_rate": 9.482642322131695e-05,
338
+ "loss": 1.8234332275390626,
339
+ "step": 2350
340
+ },
341
+ {
342
+ "epoch": 0.1513431706394249,
343
+ "grad_norm": 3.96207857131958,
344
+ "learning_rate": 9.460429270664193e-05,
345
+ "loss": 1.7132150268554687,
346
+ "step": 2400
347
+ },
348
+ {
349
+ "epoch": 0.15449615336107958,
350
+ "grad_norm": 3.421797752380371,
351
+ "learning_rate": 9.437776475234874e-05,
352
+ "loss": 1.7809776306152343,
353
+ "step": 2450
354
+ },
355
+ {
356
+ "epoch": 0.15764913608273426,
357
+ "grad_norm": 3.259612798690796,
358
+ "learning_rate": 9.414686169133271e-05,
359
+ "loss": 1.6762347412109375,
360
+ "step": 2500
361
+ },
362
+ {
363
+ "epoch": 0.16080211880438894,
364
+ "grad_norm": 3.375741720199585,
365
+ "learning_rate": 9.39116062878214e-05,
366
+ "loss": 1.6602528381347657,
367
+ "step": 2550
368
+ },
369
+ {
370
+ "epoch": 0.16395510152604365,
371
+ "grad_norm": 6.738144874572754,
372
+ "learning_rate": 9.367202173513025e-05,
373
+ "loss": 1.741137237548828,
374
+ "step": 2600
375
+ },
376
+ {
377
+ "epoch": 0.16710808424769832,
378
+ "grad_norm": 4.628149032592773,
379
+ "learning_rate": 9.34281316533761e-05,
380
+ "loss": 1.7104803466796874,
381
+ "step": 2650
382
+ },
383
+ {
384
+ "epoch": 0.170261066969353,
385
+ "grad_norm": 3.664982318878174,
386
+ "learning_rate": 9.317996008714844e-05,
387
+ "loss": 1.674332275390625,
388
+ "step": 2700
389
+ },
390
+ {
391
+ "epoch": 0.17341404969100768,
392
+ "grad_norm": 2.6816370487213135,
393
+ "learning_rate": 9.292753150313892e-05,
394
+ "loss": 1.6296810913085937,
395
+ "step": 2750
396
+ },
397
+ {
398
+ "epoch": 0.1765670324126624,
399
+ "grad_norm": 4.442898750305176,
400
+ "learning_rate": 9.267087078772934e-05,
401
+ "loss": 1.7200907897949218,
402
+ "step": 2800
403
+ },
404
+ {
405
+ "epoch": 0.17972001513431707,
406
+ "grad_norm": 3.3474419116973877,
407
+ "learning_rate": 9.241000324453798e-05,
408
+ "loss": 1.781136474609375,
409
+ "step": 2850
410
+ },
411
+ {
412
+ "epoch": 0.18287299785597175,
413
+ "grad_norm": 4.042556285858154,
414
+ "learning_rate": 9.214495459192516e-05,
415
+ "loss": 1.8000424194335938,
416
+ "step": 2900
417
+ },
418
+ {
419
+ "epoch": 0.18602598057762643,
420
+ "grad_norm": 3.282440662384033,
421
+ "learning_rate": 9.187575096045755e-05,
422
+ "loss": 1.7477403259277344,
423
+ "step": 2950
424
+ },
425
+ {
426
+ "epoch": 0.18917896329928113,
427
+ "grad_norm": 3.451063632965088,
428
+ "learning_rate": 9.160241889033212e-05,
429
+ "loss": 1.6878971862792969,
430
+ "step": 3000
431
+ },
432
+ {
433
+ "epoch": 0.1923319460209358,
434
+ "grad_norm": 3.1991782188415527,
435
+ "learning_rate": 9.132498532875962e-05,
436
+ "loss": 1.721937255859375,
437
+ "step": 3050
438
+ },
439
+ {
440
+ "epoch": 0.1954849287425905,
441
+ "grad_norm": 2.625821113586426,
442
+ "learning_rate": 9.104347762730778e-05,
443
+ "loss": 1.7239382934570313,
444
+ "step": 3100
445
+ },
446
+ {
447
+ "epoch": 0.19863791146424517,
448
+ "grad_norm": 9.162576675415039,
449
+ "learning_rate": 9.075792353920494e-05,
450
+ "loss": 1.806209259033203,
451
+ "step": 3150
452
+ },
453
+ {
454
+ "epoch": 0.20179089418589985,
455
+ "grad_norm": 2.865137815475464,
456
+ "learning_rate": 9.04683512166038e-05,
457
+ "loss": 1.7318582153320312,
458
+ "step": 3200
459
+ },
460
+ {
461
+ "epoch": 0.20494387690755456,
462
+ "grad_norm": 2.1771979331970215,
463
+ "learning_rate": 9.017478920780605e-05,
464
+ "loss": 1.7237417602539062,
465
+ "step": 3250
466
+ },
467
+ {
468
+ "epoch": 0.20809685962920924,
469
+ "grad_norm": 5.151927471160889,
470
+ "learning_rate": 8.987726645444773e-05,
471
+ "loss": 1.7477003479003905,
472
+ "step": 3300
473
+ },
474
+ {
475
+ "epoch": 0.21124984235086391,
476
+ "grad_norm": 2.5384881496429443,
477
+ "learning_rate": 8.957581228864616e-05,
478
+ "loss": 1.7482113647460937,
479
+ "step": 3350
480
+ },
481
+ {
482
+ "epoch": 0.2144028250725186,
483
+ "grad_norm": 6.593316555023193,
484
+ "learning_rate": 8.927045643010785e-05,
485
+ "loss": 1.6856721496582032,
486
+ "step": 3400
487
+ },
488
+ {
489
+ "epoch": 0.2175558077941733,
490
+ "grad_norm": 2.9909262657165527,
491
+ "learning_rate": 8.896122898319878e-05,
492
+ "loss": 1.61490478515625,
493
+ "step": 3450
494
+ },
495
+ {
496
+ "epoch": 0.22070879051582798,
497
+ "grad_norm": 9.641027450561523,
498
+ "learning_rate": 8.864816043397632e-05,
499
+ "loss": 1.7636630249023437,
500
+ "step": 3500
501
+ },
502
+ {
503
+ "epoch": 0.22386177323748266,
504
+ "grad_norm": 2.434013605117798,
505
+ "learning_rate": 8.833128164718368e-05,
506
+ "loss": 1.86688232421875,
507
+ "step": 3550
508
+ },
509
+ {
510
+ "epoch": 0.22701475595913734,
511
+ "grad_norm": 5.4786696434021,
512
+ "learning_rate": 8.801062386320707e-05,
513
+ "loss": 1.761875457763672,
514
+ "step": 3600
515
+ },
516
+ {
517
+ "epoch": 0.23016773868079202,
518
+ "grad_norm": 2.9664249420166016,
519
+ "learning_rate": 8.76862186949958e-05,
520
+ "loss": 1.688774871826172,
521
+ "step": 3650
522
+ },
523
+ {
524
+ "epoch": 0.23332072140244672,
525
+ "grad_norm": 6.82322883605957,
526
+ "learning_rate": 8.735809812494556e-05,
527
+ "loss": 1.5707682800292968,
528
+ "step": 3700
529
+ },
530
+ {
531
+ "epoch": 0.2364737041241014,
532
+ "grad_norm": 3.971310615539551,
533
+ "learning_rate": 8.702629450174538e-05,
534
+ "loss": 1.8241322326660157,
535
+ "step": 3750
536
+ },
537
+ {
538
+ "epoch": 0.23962668684575608,
539
+ "grad_norm": 2.892256259918213,
540
+ "learning_rate": 8.669084053718843e-05,
541
+ "loss": 1.6581959533691406,
542
+ "step": 3800
543
+ },
544
+ {
545
+ "epoch": 0.24277966956741076,
546
+ "grad_norm": 4.926596164703369,
547
+ "learning_rate": 8.635176930294706e-05,
548
+ "loss": 1.64531982421875,
549
+ "step": 3850
550
+ },
551
+ {
552
+ "epoch": 0.24593265228906547,
553
+ "grad_norm": 6.136980056762695,
554
+ "learning_rate": 8.600911422731237e-05,
555
+ "loss": 1.7906488037109376,
556
+ "step": 3900
557
+ },
558
+ {
559
+ "epoch": 0.24908563501072015,
560
+ "grad_norm": 2.399834156036377,
561
+ "learning_rate": 8.566290909189842e-05,
562
+ "loss": 1.5979080200195312,
563
+ "step": 3950
564
+ },
565
+ {
566
+ "epoch": 0.2522386177323748,
567
+ "grad_norm": 3.5449185371398926,
568
+ "learning_rate": 8.531318802831202e-05,
569
+ "loss": 1.8152336120605468,
570
+ "step": 4000
571
+ },
572
+ {
573
+ "epoch": 0.25539160045402953,
574
+ "grad_norm": 4.556742191314697,
575
+ "learning_rate": 8.495998551478759e-05,
576
+ "loss": 1.7356678771972656,
577
+ "step": 4050
578
+ },
579
+ {
580
+ "epoch": 0.2585445831756842,
581
+ "grad_norm": 2.8251750469207764,
582
+ "learning_rate": 8.460333637278808e-05,
583
+ "loss": 1.5453990173339844,
584
+ "step": 4100
585
+ },
586
+ {
587
+ "epoch": 0.2616975658973389,
588
+ "grad_norm": 2.4924354553222656,
589
+ "learning_rate": 8.424327576357201e-05,
590
+ "loss": 1.7409744262695312,
591
+ "step": 4150
592
+ },
593
+ {
594
+ "epoch": 0.26485054861899354,
595
+ "grad_norm": 2.6736836433410645,
596
+ "learning_rate": 8.387983918472697e-05,
597
+ "loss": 1.75020263671875,
598
+ "step": 4200
599
+ },
600
+ {
601
+ "epoch": 0.26800353134064825,
602
+ "grad_norm": 10.364773750305176,
603
+ "learning_rate": 8.351306246667006e-05,
604
+ "loss": 1.7393624877929688,
605
+ "step": 4250
606
+ },
607
+ {
608
+ "epoch": 0.27115651406230296,
609
+ "grad_norm": 5.713336944580078,
610
+ "learning_rate": 8.314298176911533e-05,
611
+ "loss": 1.538885040283203,
612
+ "step": 4300
613
+ },
614
+ {
615
+ "epoch": 0.2743094967839576,
616
+ "grad_norm": 4.43858003616333,
617
+ "learning_rate": 8.276963357750896e-05,
618
+ "loss": 1.821629180908203,
619
+ "step": 4350
620
+ },
621
+ {
622
+ "epoch": 0.2774624795056123,
623
+ "grad_norm": 23.337303161621094,
624
+ "learning_rate": 8.239305469943226e-05,
625
+ "loss": 1.6454342651367186,
626
+ "step": 4400
627
+ },
628
+ {
629
+ "epoch": 0.280615462227267,
630
+ "grad_norm": 3.1600468158721924,
631
+ "learning_rate": 8.201328226097279e-05,
632
+ "loss": 1.6436555480957031,
633
+ "step": 4450
634
+ },
635
+ {
636
+ "epoch": 0.28376844494892167,
637
+ "grad_norm": 2.385958433151245,
638
+ "learning_rate": 8.163035370306429e-05,
639
+ "loss": 1.8098031616210937,
640
+ "step": 4500
641
+ },
642
+ {
643
+ "epoch": 0.2869214276705764,
644
+ "grad_norm": 3.7839107513427734,
645
+ "learning_rate": 8.124430677779537e-05,
646
+ "loss": 1.7188877868652344,
647
+ "step": 4550
648
+ },
649
+ {
650
+ "epoch": 0.29007441039223103,
651
+ "grad_norm": 3.354954719543457,
652
+ "learning_rate": 8.085517954468768e-05,
653
+ "loss": 1.6609513854980469,
654
+ "step": 4600
655
+ },
656
+ {
657
+ "epoch": 0.29322739311388574,
658
+ "grad_norm": 2.1363513469696045,
659
+ "learning_rate": 8.046301036694368e-05,
660
+ "loss": 1.6629969787597656,
661
+ "step": 4650
662
+ },
663
+ {
664
+ "epoch": 0.29638037583554044,
665
+ "grad_norm": 2.8907933235168457,
666
+ "learning_rate": 8.006783790766448e-05,
667
+ "loss": 1.5718318176269532,
668
+ "step": 4700
669
+ },
670
+ {
671
+ "epoch": 0.2995333585571951,
672
+ "grad_norm": 2.4533779621124268,
673
+ "learning_rate": 7.966970112603815e-05,
674
+ "loss": 1.6219189453125,
675
+ "step": 4750
676
+ },
677
+ {
678
+ "epoch": 0.3026863412788498,
679
+ "grad_norm": 5.0952558517456055,
680
+ "learning_rate": 7.926863927349883e-05,
681
+ "loss": 1.8162387084960938,
682
+ "step": 4800
683
+ },
684
+ {
685
+ "epoch": 0.30583932400050445,
686
+ "grad_norm": 3.4920997619628906,
687
+ "learning_rate": 7.8864691889857e-05,
688
+ "loss": 1.8339678955078125,
689
+ "step": 4850
690
+ },
691
+ {
692
+ "epoch": 0.30899230672215916,
693
+ "grad_norm": 6.650540828704834,
694
+ "learning_rate": 7.845789879940129e-05,
695
+ "loss": 1.536930389404297,
696
+ "step": 4900
697
+ },
698
+ {
699
+ "epoch": 0.31214528944381387,
700
+ "grad_norm": 2.608124256134033,
701
+ "learning_rate": 7.804830010697239e-05,
702
+ "loss": 1.6511822509765626,
703
+ "step": 4950
704
+ },
705
+ {
706
+ "epoch": 0.3152982721654685,
707
+ "grad_norm": 3.004046678543091,
708
+ "learning_rate": 7.763593619400913e-05,
709
+ "loss": 1.7977149963378907,
710
+ "step": 5000
711
+ },
712
+ {
713
+ "epoch": 0.3184512548871232,
714
+ "grad_norm": 2.8951213359832764,
715
+ "learning_rate": 7.722084771456742e-05,
716
+ "loss": 1.69650390625,
717
+ "step": 5050
718
+ },
719
+ {
720
+ "epoch": 0.3216042376087779,
721
+ "grad_norm": 2.372918128967285,
722
+ "learning_rate": 7.680307559131212e-05,
723
+ "loss": 1.7052632141113282,
724
+ "step": 5100
725
+ },
726
+ {
727
+ "epoch": 0.3247572203304326,
728
+ "grad_norm": 3.3484256267547607,
729
+ "learning_rate": 7.638266101148277e-05,
730
+ "loss": 1.7605667114257812,
731
+ "step": 5150
732
+ },
733
+ {
734
+ "epoch": 0.3279102030520873,
735
+ "grad_norm": 2.811953544616699,
736
+ "learning_rate": 7.595964542283286e-05,
737
+ "loss": 1.6529649353027345,
738
+ "step": 5200
739
+ },
740
+ {
741
+ "epoch": 0.33106318577374194,
742
+ "grad_norm": 3.4263999462127686,
743
+ "learning_rate": 7.553407052954367e-05,
744
+ "loss": 1.4979841613769531,
745
+ "step": 5250
746
+ },
747
+ {
748
+ "epoch": 0.33421616849539665,
749
+ "grad_norm": 5.087120532989502,
750
+ "learning_rate": 7.51059782881127e-05,
751
+ "loss": 1.600594482421875,
752
+ "step": 5300
753
+ },
754
+ {
755
+ "epoch": 0.33736915121705136,
756
+ "grad_norm": 3.6007165908813477,
757
+ "learning_rate": 7.467541090321735e-05,
758
+ "loss": 1.7187171936035157,
759
+ "step": 5350
760
+ },
761
+ {
762
+ "epoch": 0.340522133938706,
763
+ "grad_norm": 3.5818512439727783,
764
+ "learning_rate": 7.424241082355393e-05,
765
+ "loss": 1.6174636840820313,
766
+ "step": 5400
767
+ },
768
+ {
769
+ "epoch": 0.3436751166603607,
770
+ "grad_norm": 4.568120956420898,
771
+ "learning_rate": 7.380702073765284e-05,
772
+ "loss": 1.98239501953125,
773
+ "step": 5450
774
+ },
775
+ {
776
+ "epoch": 0.34682809938201536,
777
+ "grad_norm": 3.639190673828125,
778
+ "learning_rate": 7.336928356966996e-05,
779
+ "loss": 1.6210305786132813,
780
+ "step": 5500
781
+ },
782
+ {
783
+ "epoch": 0.34998108210367007,
784
+ "grad_norm": 5.252638816833496,
785
+ "learning_rate": 7.29292424751549e-05,
786
+ "loss": 1.669630889892578,
787
+ "step": 5550
788
+ },
789
+ {
790
+ "epoch": 0.3531340648253248,
791
+ "grad_norm": 2.4306838512420654,
792
+ "learning_rate": 7.248694083679623e-05,
793
+ "loss": 1.5243975830078125,
794
+ "step": 5600
795
+ },
796
+ {
797
+ "epoch": 0.35628704754697943,
798
+ "grad_norm": 3.1585371494293213,
799
+ "learning_rate": 7.204242226014471e-05,
800
+ "loss": 1.6251898193359375,
801
+ "step": 5650
802
+ },
803
+ {
804
+ "epoch": 0.35944003026863414,
805
+ "grad_norm": 2.6724190711975098,
806
+ "learning_rate": 7.159573056931415e-05,
807
+ "loss": 1.5321110534667968,
808
+ "step": 5700
809
+ },
810
+ {
811
+ "epoch": 0.3625930129902888,
812
+ "grad_norm": 2.7691164016723633,
813
+ "learning_rate": 7.114690980266092e-05,
814
+ "loss": 1.5984962463378907,
815
+ "step": 5750
816
+ },
817
+ {
818
+ "epoch": 0.3657459957119435,
819
+ "grad_norm": 4.595975875854492,
820
+ "learning_rate": 7.069600420844234e-05,
821
+ "loss": 1.469564208984375,
822
+ "step": 5800
823
+ },
824
+ {
825
+ "epoch": 0.3688989784335982,
826
+ "grad_norm": 2.72231388092041,
827
+ "learning_rate": 7.024305824045429e-05,
828
+ "loss": 1.40793212890625,
829
+ "step": 5850
830
+ },
831
+ {
832
+ "epoch": 0.37205196115525285,
833
+ "grad_norm": 7.415063858032227,
834
+ "learning_rate": 6.978811655364864e-05,
835
+ "loss": 1.7532875061035156,
836
+ "step": 5900
837
+ },
838
+ {
839
+ "epoch": 0.37520494387690756,
840
+ "grad_norm": 2.393813133239746,
841
+ "learning_rate": 6.933122399973086e-05,
842
+ "loss": 1.5745999145507812,
843
+ "step": 5950
844
+ },
845
+ {
846
+ "epoch": 0.37835792659856227,
847
+ "grad_norm": 6.05046272277832,
848
+ "learning_rate": 6.88724256227381e-05,
849
+ "loss": 1.6636524963378907,
850
+ "step": 6000
851
+ },
852
+ {
853
+ "epoch": 0.3815109093202169,
854
+ "grad_norm": 2.008434772491455,
855
+ "learning_rate": 6.84117666545984e-05,
856
+ "loss": 1.6576199340820312,
857
+ "step": 6050
858
+ },
859
+ {
860
+ "epoch": 0.3846638920418716,
861
+ "grad_norm": 2.7076210975646973,
862
+ "learning_rate": 6.794929251067147e-05,
863
+ "loss": 1.6187727355957031,
864
+ "step": 6100
865
+ },
866
+ {
867
+ "epoch": 0.3878168747635263,
868
+ "grad_norm": 9.455795288085938,
869
+ "learning_rate": 6.748504878527123e-05,
870
+ "loss": 1.5639329528808594,
871
+ "step": 6150
872
+ },
873
+ {
874
+ "epoch": 0.390969857485181,
875
+ "grad_norm": 2.4191970825195312,
876
+ "learning_rate": 6.701908124717071e-05,
877
+ "loss": 1.71536376953125,
878
+ "step": 6200
879
+ },
880
+ {
881
+ "epoch": 0.3941228402068357,
882
+ "grad_norm": 9.594432830810547,
883
+ "learning_rate": 6.655143583508992e-05,
884
+ "loss": 1.5790968322753907,
885
+ "step": 6250
886
+ },
887
+ {
888
+ "epoch": 0.39727582292849034,
889
+ "grad_norm": 2.7539901733398438,
890
+ "learning_rate": 6.608215865316676e-05,
891
+ "loss": 1.6756141662597657,
892
+ "step": 6300
893
+ },
894
+ {
895
+ "epoch": 0.40042880565014505,
896
+ "grad_norm": 2.871234178543091,
897
+ "learning_rate": 6.561129596641177e-05,
898
+ "loss": 1.537653045654297,
899
+ "step": 6350
900
+ },
901
+ {
902
+ "epoch": 0.4035817883717997,
903
+ "grad_norm": 7.255851745605469,
904
+ "learning_rate": 6.513889419614691e-05,
905
+ "loss": 1.5986100769042968,
906
+ "step": 6400
907
+ },
908
+ {
909
+ "epoch": 0.4067347710934544,
910
+ "grad_norm": 2.803478956222534,
911
+ "learning_rate": 6.466499991542905e-05,
912
+ "loss": 1.5736700439453124,
913
+ "step": 6450
914
+ },
915
+ {
916
+ "epoch": 0.4098877538151091,
917
+ "grad_norm": 4.441070079803467,
918
+ "learning_rate": 6.418965984445839e-05,
919
+ "loss": 1.5858750915527344,
920
+ "step": 6500
921
+ },
922
+ {
923
+ "epoch": 0.41304073653676376,
924
+ "grad_norm": 3.3662540912628174,
925
+ "learning_rate": 6.371292084597241e-05,
926
+ "loss": 1.7305607604980469,
927
+ "step": 6550
928
+ },
929
+ {
930
+ "epoch": 0.41619371925841847,
931
+ "grad_norm": 4.166026592254639,
932
+ "learning_rate": 6.323482992062579e-05,
933
+ "loss": 1.5626411437988281,
934
+ "step": 6600
935
+ },
936
+ {
937
+ "epoch": 0.4193467019800731,
938
+ "grad_norm": 7.287445068359375,
939
+ "learning_rate": 6.275543420235679e-05,
940
+ "loss": 1.5980224609375,
941
+ "step": 6650
942
+ },
943
+ {
944
+ "epoch": 0.42249968470172783,
945
+ "grad_norm": 2.271918773651123,
946
+ "learning_rate": 6.227478095374027e-05,
947
+ "loss": 1.6121871948242188,
948
+ "step": 6700
949
+ },
950
+ {
951
+ "epoch": 0.42565266742338254,
952
+ "grad_norm": 2.7370519638061523,
953
+ "learning_rate": 6.179291756132826e-05,
954
+ "loss": 1.7519253540039061,
955
+ "step": 6750
956
+ },
957
+ {
958
+ "epoch": 0.4288056501450372,
959
+ "grad_norm": 3.291109800338745,
960
+ "learning_rate": 6.130989153097825e-05,
961
+ "loss": 1.593614044189453,
962
+ "step": 6800
963
+ },
964
+ {
965
+ "epoch": 0.4319586328666919,
966
+ "grad_norm": 2.3776819705963135,
967
+ "learning_rate": 6.08257504831697e-05,
968
+ "loss": 1.6327113342285156,
969
+ "step": 6850
970
+ },
971
+ {
972
+ "epoch": 0.4351116155883466,
973
+ "grad_norm": 3.4966859817504883,
974
+ "learning_rate": 6.034054214830909e-05,
975
+ "loss": 1.524584503173828,
976
+ "step": 6900
977
+ },
978
+ {
979
+ "epoch": 0.43826459831000125,
980
+ "grad_norm": 6.587697982788086,
981
+ "learning_rate": 5.985431436202447e-05,
982
+ "loss": 1.7271713256835937,
983
+ "step": 6950
984
+ },
985
+ {
986
+ "epoch": 0.44141758103165596,
987
+ "grad_norm": 5.027621746063232,
988
+ "learning_rate": 5.9367115060449364e-05,
989
+ "loss": 1.4599151611328125,
990
+ "step": 7000
991
+ },
992
+ {
993
+ "epoch": 0.4445705637533106,
994
+ "grad_norm": 2.3149125576019287,
995
+ "learning_rate": 5.887899227549689e-05,
996
+ "loss": 1.6622496032714844,
997
+ "step": 7050
998
+ },
999
+ {
1000
+ "epoch": 0.4477235464749653,
1001
+ "grad_norm": 2.9743404388427734,
1002
+ "learning_rate": 5.838999413012432e-05,
1003
+ "loss": 1.5690019226074219,
1004
+ "step": 7100
1005
+ },
1006
+ {
1007
+ "epoch": 0.45087652919662,
1008
+ "grad_norm": 3.092113494873047,
1009
+ "learning_rate": 5.79001688335888e-05,
1010
+ "loss": 1.6651068115234375,
1011
+ "step": 7150
1012
+ },
1013
+ {
1014
+ "epoch": 0.4540295119182747,
1015
+ "grad_norm": 2.21628737449646,
1016
+ "learning_rate": 5.7409564676694535e-05,
1017
+ "loss": 1.6519837951660157,
1018
+ "step": 7200
1019
+ },
1020
+ {
1021
+ "epoch": 0.4571824946399294,
1022
+ "grad_norm": 2.658684730529785,
1023
+ "learning_rate": 5.691823002703187e-05,
1024
+ "loss": 1.5685855102539064,
1025
+ "step": 7250
1026
+ },
1027
+ {
1028
+ "epoch": 0.46033547736158403,
1029
+ "grad_norm": 6.6410017013549805,
1030
+ "learning_rate": 5.642621332420879e-05,
1031
+ "loss": 1.6819776916503906,
1032
+ "step": 7300
1033
+ },
1034
+ {
1035
+ "epoch": 0.46348846008323874,
1036
+ "grad_norm": 5.142892837524414,
1037
+ "learning_rate": 5.5933563075075425e-05,
1038
+ "loss": 1.5651889038085938,
1039
+ "step": 7350
1040
+ },
1041
+ {
1042
+ "epoch": 0.46664144280489345,
1043
+ "grad_norm": 2.901061534881592,
1044
+ "learning_rate": 5.544032784894187e-05,
1045
+ "loss": 1.6200245666503905,
1046
+ "step": 7400
1047
+ },
1048
+ {
1049
+ "epoch": 0.4697944255265481,
1050
+ "grad_norm": 2.4046876430511475,
1051
+ "learning_rate": 5.4946556272789806e-05,
1052
+ "loss": 1.6270751953125,
1053
+ "step": 7450
1054
+ },
1055
+ {
1056
+ "epoch": 0.4729474082482028,
1057
+ "grad_norm": 2.8165345191955566,
1058
+ "learning_rate": 5.4452297026478486e-05,
1059
+ "loss": 1.5757356262207032,
1060
+ "step": 7500
1061
+ },
1062
+ {
1063
+ "epoch": 0.4761003909698575,
1064
+ "grad_norm": 2.545131206512451,
1065
+ "learning_rate": 5.3957598837945525e-05,
1066
+ "loss": 1.6749734497070312,
1067
+ "step": 7550
1068
+ },
1069
+ {
1070
+ "epoch": 0.47925337369151216,
1071
+ "grad_norm": 4.947996139526367,
1072
+ "learning_rate": 5.3462510478402825e-05,
1073
+ "loss": 1.5667103576660155,
1074
+ "step": 7600
1075
+ },
1076
+ {
1077
+ "epoch": 0.48240635641316687,
1078
+ "grad_norm": 10.719531059265137,
1079
+ "learning_rate": 5.2967080757528495e-05,
1080
+ "loss": 1.6775833129882813,
1081
+ "step": 7650
1082
+ },
1083
+ {
1084
+ "epoch": 0.4855593391348215,
1085
+ "grad_norm": 3.945706844329834,
1086
+ "learning_rate": 5.247135851865461e-05,
1087
+ "loss": 1.541700439453125,
1088
+ "step": 7700
1089
+ },
1090
+ {
1091
+ "epoch": 0.48871232185647623,
1092
+ "grad_norm": 4.664523124694824,
1093
+ "learning_rate": 5.197539263395201e-05,
1094
+ "loss": 1.6849325561523438,
1095
+ "step": 7750
1096
+ },
1097
+ {
1098
+ "epoch": 0.49186530457813094,
1099
+ "grad_norm": 2.7066149711608887,
1100
+ "learning_rate": 5.1479231999612046e-05,
1101
+ "loss": 1.6272938537597657,
1102
+ "step": 7800
1103
+ },
1104
+ {
1105
+ "epoch": 0.4950182872997856,
1106
+ "grad_norm": 3.3770575523376465,
1107
+ "learning_rate": 5.098292553102598e-05,
1108
+ "loss": 1.781251220703125,
1109
+ "step": 7850
1110
+ },
1111
+ {
1112
+ "epoch": 0.4981712700214403,
1113
+ "grad_norm": 2.614497661590576,
1114
+ "learning_rate": 5.048652215796257e-05,
1115
+ "loss": 1.6480955505371093,
1116
+ "step": 7900
1117
+ },
1118
+ {
1119
+ "epoch": 0.501324252743095,
1120
+ "grad_norm": 3.470582962036133,
1121
+ "learning_rate": 4.999007081974418e-05,
1122
+ "loss": 1.6021221923828124,
1123
+ "step": 7950
1124
+ },
1125
+ {
1126
+ "epoch": 0.5044772354647497,
1127
+ "grad_norm": 1.8953889608383179,
1128
+ "learning_rate": 4.949362046042195e-05,
1129
+ "loss": 1.5847406005859375,
1130
+ "step": 8000
1131
+ },
1132
+ {
1133
+ "epoch": 0.5076302181864043,
1134
+ "grad_norm": 6.359344482421875,
1135
+ "learning_rate": 4.899722002395052e-05,
1136
+ "loss": 1.6197129821777343,
1137
+ "step": 8050
1138
+ },
1139
+ {
1140
+ "epoch": 0.5107832009080591,
1141
+ "grad_norm": 3.1751062870025635,
1142
+ "learning_rate": 4.8500918449362686e-05,
1143
+ "loss": 1.6575222778320313,
1144
+ "step": 8100
1145
+ },
1146
+ {
1147
+ "epoch": 0.5139361836297137,
1148
+ "grad_norm": 4.892060279846191,
1149
+ "learning_rate": 4.800476466594477e-05,
1150
+ "loss": 1.8009135437011718,
1151
+ "step": 8150
1152
+ },
1153
+ {
1154
+ "epoch": 0.5170891663513684,
1155
+ "grad_norm": 3.5821950435638428,
1156
+ "learning_rate": 4.7508807588412607e-05,
1157
+ "loss": 1.503452911376953,
1158
+ "step": 8200
1159
+ },
1160
+ {
1161
+ "epoch": 0.5202421490730231,
1162
+ "grad_norm": 6.790828704833984,
1163
+ "learning_rate": 4.7013096112089274e-05,
1164
+ "loss": 1.71809814453125,
1165
+ "step": 8250
1166
+ },
1167
+ {
1168
+ "epoch": 0.5233951317946778,
1169
+ "grad_norm": 2.2684848308563232,
1170
+ "learning_rate": 4.651767910808453e-05,
1171
+ "loss": 1.7311285400390626,
1172
+ "step": 8300
1173
+ },
1174
+ {
1175
+ "epoch": 0.5265481145163324,
1176
+ "grad_norm": 3.4118940830230713,
1177
+ "learning_rate": 4.602260541847674e-05,
1178
+ "loss": 1.52655029296875,
1179
+ "step": 8350
1180
+ },
1181
+ {
1182
+ "epoch": 0.5297010972379871,
1183
+ "grad_norm": 3.000192403793335,
1184
+ "learning_rate": 4.552792385149774e-05,
1185
+ "loss": 1.7028633117675782,
1186
+ "step": 8400
1187
+ },
1188
+ {
1189
+ "epoch": 0.5328540799596418,
1190
+ "grad_norm": 39.9377555847168,
1191
+ "learning_rate": 4.503368317672073e-05,
1192
+ "loss": 1.5430813598632813,
1193
+ "step": 8450
1194
+ },
1195
+ {
1196
+ "epoch": 0.5360070626812965,
1197
+ "grad_norm": 2.711533546447754,
1198
+ "learning_rate": 4.453993212025242e-05,
1199
+ "loss": 1.5495613098144532,
1200
+ "step": 8500
1201
+ },
1202
+ {
1203
+ "epoch": 0.5391600454029511,
1204
+ "grad_norm": 3.9591002464294434,
1205
+ "learning_rate": 4.4046719359929065e-05,
1206
+ "loss": 1.6500083923339843,
1207
+ "step": 8550
1208
+ },
1209
+ {
1210
+ "epoch": 0.5423130281246059,
1211
+ "grad_norm": 3.133467435836792,
1212
+ "learning_rate": 4.355409352051747e-05,
1213
+ "loss": 1.6975883483886718,
1214
+ "step": 8600
1215
+ },
1216
+ {
1217
+ "epoch": 0.5454660108462606,
1218
+ "grad_norm": 3.454503059387207,
1219
+ "learning_rate": 4.3062103168921264e-05,
1220
+ "loss": 1.5262863159179687,
1221
+ "step": 8650
1222
+ },
1223
+ {
1224
+ "epoch": 0.5486189935679152,
1225
+ "grad_norm": 3.6723296642303467,
1226
+ "learning_rate": 4.2570796809392644e-05,
1227
+ "loss": 1.7020167541503906,
1228
+ "step": 8700
1229
+ },
1230
+ {
1231
+ "epoch": 0.55177197628957,
1232
+ "grad_norm": 5.7662529945373535,
1233
+ "learning_rate": 4.208022287875054e-05,
1234
+ "loss": 1.5918016052246093,
1235
+ "step": 8750
1236
+ },
1237
+ {
1238
+ "epoch": 0.5549249590112246,
1239
+ "grad_norm": 2.1820693016052246,
1240
+ "learning_rate": 4.159042974160537e-05,
1241
+ "loss": 1.5883863830566407,
1242
+ "step": 8800
1243
+ },
1244
+ {
1245
+ "epoch": 0.5580779417328793,
1246
+ "grad_norm": 3.121429920196533,
1247
+ "learning_rate": 4.110146568559077e-05,
1248
+ "loss": 1.6320164489746094,
1249
+ "step": 8850
1250
+ },
1251
+ {
1252
+ "epoch": 0.561230924454534,
1253
+ "grad_norm": 6.376467704772949,
1254
+ "learning_rate": 4.061337891660314e-05,
1255
+ "loss": 1.635543212890625,
1256
+ "step": 8900
1257
+ },
1258
+ {
1259
+ "epoch": 0.5643839071761887,
1260
+ "grad_norm": 7.583218574523926,
1261
+ "learning_rate": 4.012621755404901e-05,
1262
+ "loss": 1.5718000793457032,
1263
+ "step": 8950
1264
+ },
1265
+ {
1266
+ "epoch": 0.5675368898978433,
1267
+ "grad_norm": 3.7945668697357178,
1268
+ "learning_rate": 3.9640029626101146e-05,
1269
+ "loss": 1.6808647155761718,
1270
+ "step": 9000
1271
+ },
1272
+ {
1273
+ "epoch": 0.570689872619498,
1274
+ "grad_norm": 2.8824946880340576,
1275
+ "learning_rate": 3.915486306496356e-05,
1276
+ "loss": 1.685601806640625,
1277
+ "step": 9050
1278
+ },
1279
+ {
1280
+ "epoch": 0.5738428553411528,
1281
+ "grad_norm": 6.4140472412109375,
1282
+ "learning_rate": 3.867076570214584e-05,
1283
+ "loss": 1.5931394958496095,
1284
+ "step": 9100
1285
+ },
1286
+ {
1287
+ "epoch": 0.5769958380628074,
1288
+ "grad_norm": 2.3989524841308594,
1289
+ "learning_rate": 3.8187785263747804e-05,
1290
+ "loss": 1.6603244018554688,
1291
+ "step": 9150
1292
+ },
1293
+ {
1294
+ "epoch": 0.5801488207844621,
1295
+ "grad_norm": 3.4079809188842773,
1296
+ "learning_rate": 3.7705969365754e-05,
1297
+ "loss": 1.6268783569335938,
1298
+ "step": 9200
1299
+ },
1300
+ {
1301
+ "epoch": 0.5833018035061168,
1302
+ "grad_norm": 4.664431095123291,
1303
+ "learning_rate": 3.722536550933953e-05,
1304
+ "loss": 1.4689956665039063,
1305
+ "step": 9250
1306
+ },
1307
+ {
1308
+ "epoch": 0.5864547862277715,
1309
+ "grad_norm": 4.000642776489258,
1310
+ "learning_rate": 3.674602107618701e-05,
1311
+ "loss": 1.5993995666503906,
1312
+ "step": 9300
1313
+ },
1314
+ {
1315
+ "epoch": 0.5896077689494261,
1316
+ "grad_norm": 3.3489816188812256,
1317
+ "learning_rate": 3.6267983323815226e-05,
1318
+ "loss": 1.6080624389648437,
1319
+ "step": 9350
1320
+ },
1321
+ {
1322
+ "epoch": 0.5927607516710809,
1323
+ "grad_norm": 2.956134796142578,
1324
+ "learning_rate": 3.5791299380920164e-05,
1325
+ "loss": 1.562136688232422,
1326
+ "step": 9400
1327
+ },
1328
+ {
1329
+ "epoch": 0.5959137343927355,
1330
+ "grad_norm": 2.9019055366516113,
1331
+ "learning_rate": 3.531601624272873e-05,
1332
+ "loss": 1.596844482421875,
1333
+ "step": 9450
1334
+ },
1335
+ {
1336
+ "epoch": 0.5990667171143902,
1337
+ "grad_norm": 3.2570741176605225,
1338
+ "learning_rate": 3.484218076636553e-05,
1339
+ "loss": 1.5718740844726562,
1340
+ "step": 9500
1341
+ },
1342
+ {
1343
+ "epoch": 0.602219699836045,
1344
+ "grad_norm": 3.1301848888397217,
1345
+ "learning_rate": 3.436983966623337e-05,
1346
+ "loss": 1.5843309020996095,
1347
+ "step": 9550
1348
+ },
1349
+ {
1350
+ "epoch": 0.6053726825576996,
1351
+ "grad_norm": 2.8983476161956787,
1352
+ "learning_rate": 3.389903950940777e-05,
1353
+ "loss": 1.501625518798828,
1354
+ "step": 9600
1355
+ },
1356
+ {
1357
+ "epoch": 0.6085256652793543,
1358
+ "grad_norm": 2.442763566970825,
1359
+ "learning_rate": 3.3429826711045996e-05,
1360
+ "loss": 1.5783216857910156,
1361
+ "step": 9650
1362
+ },
1363
+ {
1364
+ "epoch": 0.6116786480010089,
1365
+ "grad_norm": 3.317591905593872,
1366
+ "learning_rate": 3.29622475298112e-05,
1367
+ "loss": 1.6270458984375,
1368
+ "step": 9700
1369
+ },
1370
+ {
1371
+ "epoch": 0.6148316307226637,
1372
+ "grad_norm": 5.122899532318115,
1373
+ "learning_rate": 3.249634806331168e-05,
1374
+ "loss": 1.551365509033203,
1375
+ "step": 9750
1376
+ },
1377
+ {
1378
+ "epoch": 0.6179846134443183,
1379
+ "grad_norm": 3.8709020614624023,
1380
+ "learning_rate": 3.203217424355643e-05,
1381
+ "loss": 1.5474314880371094,
1382
+ "step": 9800
1383
+ },
1384
+ {
1385
+ "epoch": 0.621137596165973,
1386
+ "grad_norm": 4.906006813049316,
1387
+ "learning_rate": 3.156977183242666e-05,
1388
+ "loss": 1.5910145568847656,
1389
+ "step": 9850
1390
+ },
1391
+ {
1392
+ "epoch": 0.6242905788876277,
1393
+ "grad_norm": 2.5910794734954834,
1394
+ "learning_rate": 3.110918641716428e-05,
1395
+ "loss": 1.4721426391601562,
1396
+ "step": 9900
1397
+ },
1398
+ {
1399
+ "epoch": 0.6274435616092824,
1400
+ "grad_norm": 11.209244728088379,
1401
+ "learning_rate": 3.0650463405877574e-05,
1402
+ "loss": 1.5800926208496093,
1403
+ "step": 9950
1404
+ },
1405
+ {
1406
+ "epoch": 0.630596544330937,
1407
+ "grad_norm": 2.9779834747314453,
1408
+ "learning_rate": 3.019364802306447e-05,
1409
+ "loss": 1.521623077392578,
1410
+ "step": 10000
1411
+ },
1412
+ {
1413
+ "epoch": 0.6337495270525918,
1414
+ "grad_norm": 4.262292385101318,
1415
+ "learning_rate": 2.973878530515397e-05,
1416
+ "loss": 1.553704071044922,
1417
+ "step": 10050
1418
+ },
1419
+ {
1420
+ "epoch": 0.6369025097742465,
1421
+ "grad_norm": 3.476924419403076,
1422
+ "learning_rate": 2.928592009606619e-05,
1423
+ "loss": 1.6724470520019532,
1424
+ "step": 10100
1425
+ },
1426
+ {
1427
+ "epoch": 0.6400554924959011,
1428
+ "grad_norm": 2.8566722869873047,
1429
+ "learning_rate": 2.883509704279114e-05,
1430
+ "loss": 1.580164031982422,
1431
+ "step": 10150
1432
+ },
1433
+ {
1434
+ "epoch": 0.6432084752175558,
1435
+ "grad_norm": 5.948812007904053,
1436
+ "learning_rate": 2.8386360590987166e-05,
1437
+ "loss": 1.5428895568847656,
1438
+ "step": 10200
1439
+ },
1440
+ {
1441
+ "epoch": 0.6463614579392105,
1442
+ "grad_norm": 3.7444076538085938,
1443
+ "learning_rate": 2.79397549805992e-05,
1444
+ "loss": 1.5748348999023438,
1445
+ "step": 10250
1446
+ },
1447
+ {
1448
+ "epoch": 0.6495144406608652,
1449
+ "grad_norm": 2.652961015701294,
1450
+ "learning_rate": 2.749532424149709e-05,
1451
+ "loss": 1.590621337890625,
1452
+ "step": 10300
1453
+ },
1454
+ {
1455
+ "epoch": 0.6526674233825198,
1456
+ "grad_norm": 3.2727580070495605,
1457
+ "learning_rate": 2.705311218913499e-05,
1458
+ "loss": 1.5267787170410156,
1459
+ "step": 10350
1460
+ },
1461
+ {
1462
+ "epoch": 0.6558204061041746,
1463
+ "grad_norm": 10.58151912689209,
1464
+ "learning_rate": 2.6613162420231484e-05,
1465
+ "loss": 1.4954409790039063,
1466
+ "step": 10400
1467
+ },
1468
+ {
1469
+ "epoch": 0.6589733888258292,
1470
+ "grad_norm": 3.0570061206817627,
1471
+ "learning_rate": 2.6175518308471642e-05,
1472
+ "loss": 1.4097785949707031,
1473
+ "step": 10450
1474
+ },
1475
+ {
1476
+ "epoch": 0.6621263715474839,
1477
+ "grad_norm": 2.9748072624206543,
1478
+ "learning_rate": 2.574022300023084e-05,
1479
+ "loss": 1.4549171447753906,
1480
+ "step": 10500
1481
+ },
1482
+ {
1483
+ "epoch": 0.6652793542691386,
1484
+ "grad_norm": 4.236860275268555,
1485
+ "learning_rate": 2.5307319410320994e-05,
1486
+ "loss": 1.7020782470703124,
1487
+ "step": 10550
1488
+ },
1489
+ {
1490
+ "epoch": 0.6684323369907933,
1491
+ "grad_norm": 2.981145143508911,
1492
+ "learning_rate": 2.4876850217759813e-05,
1493
+ "loss": 1.6508351135253907,
1494
+ "step": 10600
1495
+ },
1496
+ {
1497
+ "epoch": 0.671585319712448,
1498
+ "grad_norm": 3.248321771621704,
1499
+ "learning_rate": 2.444885786156308e-05,
1500
+ "loss": 1.588943328857422,
1501
+ "step": 10650
1502
+ },
1503
+ {
1504
+ "epoch": 0.6747383024341027,
1505
+ "grad_norm": 4.321737766265869,
1506
+ "learning_rate": 2.4023384536560638e-05,
1507
+ "loss": 1.5426924133300781,
1508
+ "step": 10700
1509
+ },
1510
+ {
1511
+ "epoch": 0.6778912851557574,
1512
+ "grad_norm": 2.416674852371216,
1513
+ "learning_rate": 2.3600472189236693e-05,
1514
+ "loss": 1.4259295654296875,
1515
+ "step": 10750
1516
+ },
1517
+ {
1518
+ "epoch": 0.681044267877412,
1519
+ "grad_norm": 2.6175670623779297,
1520
+ "learning_rate": 2.3180162513594123e-05,
1521
+ "loss": 1.4130958557128905,
1522
+ "step": 10800
1523
+ },
1524
+ {
1525
+ "epoch": 0.6841972505990667,
1526
+ "grad_norm": 2.6447396278381348,
1527
+ "learning_rate": 2.276249694704417e-05,
1528
+ "loss": 1.459014892578125,
1529
+ "step": 10850
1530
+ },
1531
+ {
1532
+ "epoch": 0.6873502333207214,
1533
+ "grad_norm": 4.287785530090332,
1534
+ "learning_rate": 2.2347516666321168e-05,
1535
+ "loss": 1.600723876953125,
1536
+ "step": 10900
1537
+ },
1538
+ {
1539
+ "epoch": 0.6905032160423761,
1540
+ "grad_norm": 4.545198440551758,
1541
+ "learning_rate": 2.1935262583422917e-05,
1542
+ "loss": 1.58876708984375,
1543
+ "step": 10950
1544
+ },
1545
+ {
1546
+ "epoch": 0.6936561987640307,
1547
+ "grad_norm": 7.753457546234131,
1548
+ "learning_rate": 2.1525775341577405e-05,
1549
+ "loss": 1.5217156982421876,
1550
+ "step": 11000
1551
+ },
1552
+ {
1553
+ "epoch": 0.6968091814856855,
1554
+ "grad_norm": 5.363049030303955,
1555
+ "learning_rate": 2.1119095311235797e-05,
1556
+ "loss": 1.5814126586914063,
1557
+ "step": 11050
1558
+ },
1559
+ {
1560
+ "epoch": 0.6999621642073401,
1561
+ "grad_norm": 5.7626848220825195,
1562
+ "learning_rate": 2.0715262586092428e-05,
1563
+ "loss": 1.5985421752929687,
1564
+ "step": 11100
1565
+ },
1566
+ {
1567
+ "epoch": 0.7031151469289948,
1568
+ "grad_norm": 4.6263017654418945,
1569
+ "learning_rate": 2.0314316979132035e-05,
1570
+ "loss": 1.6171270751953124,
1571
+ "step": 11150
1572
+ },
1573
+ {
1574
+ "epoch": 0.7062681296506496,
1575
+ "grad_norm": 2.6141841411590576,
1576
+ "learning_rate": 1.9916298018704665e-05,
1577
+ "loss": 1.6464085388183594,
1578
+ "step": 11200
1579
+ },
1580
+ {
1581
+ "epoch": 0.7094211123723042,
1582
+ "grad_norm": 2.904296636581421,
1583
+ "learning_rate": 1.952124494462873e-05,
1584
+ "loss": 1.5681950378417968,
1585
+ "step": 11250
1586
+ },
1587
+ {
1588
+ "epoch": 0.7125740950939589,
1589
+ "grad_norm": 17.208356857299805,
1590
+ "learning_rate": 1.9129196704322382e-05,
1591
+ "loss": 1.4759814453125,
1592
+ "step": 11300
1593
+ },
1594
+ {
1595
+ "epoch": 0.7157270778156136,
1596
+ "grad_norm": 4.990921497344971,
1597
+ "learning_rate": 1.874019194896376e-05,
1598
+ "loss": 1.4149720764160156,
1599
+ "step": 11350
1600
+ },
1601
+ {
1602
+ "epoch": 0.7188800605372683,
1603
+ "grad_norm": 3.007599353790283,
1604
+ "learning_rate": 1.8354269029680516e-05,
1605
+ "loss": 1.3602633666992188,
1606
+ "step": 11400
1607
+ },
1608
+ {
1609
+ "epoch": 0.7220330432589229,
1610
+ "grad_norm": 2.493307590484619,
1611
+ "learning_rate": 1.7971465993768815e-05,
1612
+ "loss": 1.7200181579589844,
1613
+ "step": 11450
1614
+ },
1615
+ {
1616
+ "epoch": 0.7251860259805776,
1617
+ "grad_norm": 2.6334586143493652,
1618
+ "learning_rate": 1.759182058094235e-05,
1619
+ "loss": 1.4771337890625,
1620
+ "step": 11500
1621
+ },
1622
+ {
1623
+ "epoch": 0.7283390087022323,
1624
+ "grad_norm": 4.686981201171875,
1625
+ "learning_rate": 1.721537021961167e-05,
1626
+ "loss": 1.5164639282226562,
1627
+ "step": 11550
1628
+ },
1629
+ {
1630
+ "epoch": 0.731491991423887,
1631
+ "grad_norm": 7.735423564910889,
1632
+ "learning_rate": 1.6842152023194145e-05,
1633
+ "loss": 1.4624899291992188,
1634
+ "step": 11600
1635
+ },
1636
+ {
1637
+ "epoch": 0.7346449741455416,
1638
+ "grad_norm": 3.569797992706299,
1639
+ "learning_rate": 1.6472202786455136e-05,
1640
+ "loss": 1.6836318969726562,
1641
+ "step": 11650
1642
+ },
1643
+ {
1644
+ "epoch": 0.7377979568671964,
1645
+ "grad_norm": 3.5440757274627686,
1646
+ "learning_rate": 1.610555898188039e-05,
1647
+ "loss": 1.5107637023925782,
1648
+ "step": 11700
1649
+ },
1650
+ {
1651
+ "epoch": 0.740950939588851,
1652
+ "grad_norm": 2.3150668144226074,
1653
+ "learning_rate": 1.5742256756080358e-05,
1654
+ "loss": 1.5355830383300781,
1655
+ "step": 11750
1656
+ },
1657
+ {
1658
+ "epoch": 0.7441039223105057,
1659
+ "grad_norm": 3.0666487216949463,
1660
+ "learning_rate": 1.53823319262265e-05,
1661
+ "loss": 1.6443894958496095,
1662
+ "step": 11800
1663
+ },
1664
+ {
1665
+ "epoch": 0.7472569050321605,
1666
+ "grad_norm": 3.2240090370178223,
1667
+ "learning_rate": 1.5025819976520244e-05,
1668
+ "loss": 1.5667915344238281,
1669
+ "step": 11850
1670
+ },
1671
+ {
1672
+ "epoch": 0.7504098877538151,
1673
+ "grad_norm": 4.273111343383789,
1674
+ "learning_rate": 1.4672756054694636e-05,
1675
+ "loss": 1.4949490356445312,
1676
+ "step": 11900
1677
+ },
1678
+ {
1679
+ "epoch": 0.7535628704754698,
1680
+ "grad_norm": 2.6397128105163574,
1681
+ "learning_rate": 1.4323174968549147e-05,
1682
+ "loss": 1.580462188720703,
1683
+ "step": 11950
1684
+ },
1685
+ {
1686
+ "epoch": 0.7567158531971245,
1687
+ "grad_norm": 4.470552444458008,
1688
+ "learning_rate": 1.3977111182518148e-05,
1689
+ "loss": 1.6157127380371095,
1690
+ "step": 12000
1691
+ },
1692
+ {
1693
+ "epoch": 0.7598688359187792,
1694
+ "grad_norm": 2.7804784774780273,
1695
+ "learning_rate": 1.3634598814273075e-05,
1696
+ "loss": 1.4012615966796875,
1697
+ "step": 12050
1698
+ },
1699
+ {
1700
+ "epoch": 0.7630218186404338,
1701
+ "grad_norm": 2.2358453273773193,
1702
+ "learning_rate": 1.3295671631358853e-05,
1703
+ "loss": 1.4852983093261718,
1704
+ "step": 12100
1705
+ },
1706
+ {
1707
+ "epoch": 0.7661748013620885,
1708
+ "grad_norm": 4.683980941772461,
1709
+ "learning_rate": 1.2960363047864849e-05,
1710
+ "loss": 1.6236349487304687,
1711
+ "step": 12150
1712
+ },
1713
+ {
1714
+ "epoch": 0.7693277840837432,
1715
+ "grad_norm": 2.738664150238037,
1716
+ "learning_rate": 1.2628706121130573e-05,
1717
+ "loss": 1.4560935974121094,
1718
+ "step": 12200
1719
+ },
1720
+ {
1721
+ "epoch": 0.7724807668053979,
1722
+ "grad_norm": 4.65731143951416,
1723
+ "learning_rate": 1.2300733548486748e-05,
1724
+ "loss": 1.6234567260742188,
1725
+ "step": 12250
1726
+ },
1727
+ {
1728
+ "epoch": 0.7756337495270526,
1729
+ "grad_norm": 5.1576104164123535,
1730
+ "learning_rate": 1.1976477664031682e-05,
1731
+ "loss": 1.596574249267578,
1732
+ "step": 12300
1733
+ },
1734
+ {
1735
+ "epoch": 0.7787867322487073,
1736
+ "grad_norm": 3.1281590461730957,
1737
+ "learning_rate": 1.1655970435443458e-05,
1738
+ "loss": 1.4229803466796875,
1739
+ "step": 12350
1740
+ },
1741
+ {
1742
+ "epoch": 0.781939714970362,
1743
+ "grad_norm": 2.9372220039367676,
1744
+ "learning_rate": 1.1339243460828503e-05,
1745
+ "loss": 1.4996551513671874,
1746
+ "step": 12400
1747
+ },
1748
+ {
1749
+ "epoch": 0.7850926976920166,
1750
+ "grad_norm": 3.2248833179473877,
1751
+ "learning_rate": 1.1026327965606147e-05,
1752
+ "loss": 1.4965032958984374,
1753
+ "step": 12450
1754
+ },
1755
+ {
1756
+ "epoch": 0.7882456804136714,
1757
+ "grad_norm": 2.159266471862793,
1758
+ "learning_rate": 1.0717254799430398e-05,
1759
+ "loss": 1.5509339904785155,
1760
+ "step": 12500
1761
+ },
1762
+ {
1763
+ "epoch": 0.791398663135326,
1764
+ "grad_norm": 2.4573779106140137,
1765
+ "learning_rate": 1.0412054433148421e-05,
1766
+ "loss": 1.6131498718261719,
1767
+ "step": 12550
1768
+ },
1769
+ {
1770
+ "epoch": 0.7945516458569807,
1771
+ "grad_norm": 4.4481658935546875,
1772
+ "learning_rate": 1.011075695579648e-05,
1773
+ "loss": 1.4983843994140624,
1774
+ "step": 12600
1775
+ },
1776
+ {
1777
+ "epoch": 0.7977046285786354,
1778
+ "grad_norm": 2.8198156356811523,
1779
+ "learning_rate": 9.813392071633615e-06,
1780
+ "loss": 1.6985472106933595,
1781
+ "step": 12650
1782
+ },
1783
+ {
1784
+ "epoch": 0.8008576113002901,
1785
+ "grad_norm": 9.23430347442627,
1786
+ "learning_rate": 9.519989097213094e-06,
1787
+ "loss": 1.5060746765136719,
1788
+ "step": 12700
1789
+ },
1790
+ {
1791
+ "epoch": 0.8040105940219447,
1792
+ "grad_norm": 2.075164794921875,
1793
+ "learning_rate": 9.230576958492121e-06,
1794
+ "loss": 1.5431832885742187,
1795
+ "step": 12750
1796
+ },
1797
+ {
1798
+ "epoch": 0.8071635767435994,
1799
+ "grad_norm": 27.49349594116211,
1800
+ "learning_rate": 8.945184187980233e-06,
1801
+ "loss": 1.5060545349121093,
1802
+ "step": 12800
1803
+ },
1804
+ {
1805
+ "epoch": 0.8103165594652542,
1806
+ "grad_norm": 9.251137733459473,
1807
+ "learning_rate": 8.663838921926164e-06,
1808
+ "loss": 1.4995553588867188,
1809
+ "step": 12850
1810
+ },
1811
+ {
1812
+ "epoch": 0.8134695421869088,
1813
+ "grad_norm": 2.920060396194458,
1814
+ "learning_rate": 8.38656889754409e-06,
1815
+ "loss": 1.7685847473144531,
1816
+ "step": 12900
1817
+ },
1818
+ {
1819
+ "epoch": 0.8166225249085635,
1820
+ "grad_norm": 2.4019455909729004,
1821
+ "learning_rate": 8.113401450279019e-06,
1822
+ "loss": 1.5964656066894531,
1823
+ "step": 12950
1824
+ },
1825
+ {
1826
+ "epoch": 0.8197755076302182,
1827
+ "grad_norm": 8.358434677124023,
1828
+ "learning_rate": 7.844363511111835e-06,
1829
+ "loss": 1.489500732421875,
1830
+ "step": 13000
1831
+ },
1832
+ {
1833
+ "epoch": 0.8229284903518729,
1834
+ "grad_norm": 3.5551395416259766,
1835
+ "learning_rate": 7.579481603904282e-06,
1836
+ "loss": 1.587592315673828,
1837
+ "step": 13050
1838
+ },
1839
+ {
1840
+ "epoch": 0.8260814730735275,
1841
+ "grad_norm": 12.914484024047852,
1842
+ "learning_rate": 7.318781842784e-06,
1843
+ "loss": 1.5424423217773438,
1844
+ "step": 13100
1845
+ },
1846
+ {
1847
+ "epoch": 0.8292344557951823,
1848
+ "grad_norm": 2.483072519302368,
1849
+ "learning_rate": 7.0622899295699764e-06,
1850
+ "loss": 1.6078681945800781,
1851
+ "step": 13150
1852
+ },
1853
+ {
1854
+ "epoch": 0.8323874385168369,
1855
+ "grad_norm": 7.478156566619873,
1856
+ "learning_rate": 6.810031151238733e-06,
1857
+ "loss": 1.678245849609375,
1858
+ "step": 13200
1859
+ },
1860
+ {
1861
+ "epoch": 0.8355404212384916,
1862
+ "grad_norm": 3.201509475708008,
1863
+ "learning_rate": 6.5620303774312274e-06,
1864
+ "loss": 1.5973834228515624,
1865
+ "step": 13250
1866
+ },
1867
+ {
1868
+ "epoch": 0.8386934039601462,
1869
+ "grad_norm": 2.6549758911132812,
1870
+ "learning_rate": 6.3183120580010745e-06,
1871
+ "loss": 1.5435140991210938,
1872
+ "step": 13300
1873
+ },
1874
+ {
1875
+ "epoch": 0.841846386681801,
1876
+ "grad_norm": 3.7113656997680664,
1877
+ "learning_rate": 6.0789002206041444e-06,
1878
+ "loss": 1.4877342224121093,
1879
+ "step": 13350
1880
+ },
1881
+ {
1882
+ "epoch": 0.8449993694034557,
1883
+ "grad_norm": 7.131357669830322,
1884
+ "learning_rate": 5.843818468329593e-06,
1885
+ "loss": 1.6756939697265625,
1886
+ "step": 13400
1887
+ },
1888
+ {
1889
+ "epoch": 0.8481523521251103,
1890
+ "grad_norm": 3.209019660949707,
1891
+ "learning_rate": 5.613089977372993e-06,
1892
+ "loss": 1.4503678894042968,
1893
+ "step": 13450
1894
+ },
1895
+ {
1896
+ "epoch": 0.8513053348467651,
1897
+ "grad_norm": 3.1845173835754395,
1898
+ "learning_rate": 5.38673749475142e-06,
1899
+ "loss": 1.6333909606933594,
1900
+ "step": 13500
1901
+ },
1902
+ {
1903
+ "epoch": 0.8544583175684197,
1904
+ "grad_norm": 4.371488571166992,
1905
+ "learning_rate": 5.164783336060819e-06,
1906
+ "loss": 1.4515260314941407,
1907
+ "step": 13550
1908
+ },
1909
+ {
1910
+ "epoch": 0.8576113002900744,
1911
+ "grad_norm": 2.6283791065216064,
1912
+ "learning_rate": 4.947249383276065e-06,
1913
+ "loss": 1.6989479064941406,
1914
+ "step": 13600
1915
+ },
1916
+ {
1917
+ "epoch": 0.8607642830117291,
1918
+ "grad_norm": 3.4831080436706543,
1919
+ "learning_rate": 4.7341570825935485e-06,
1920
+ "loss": 1.4910855102539062,
1921
+ "step": 13650
1922
+ },
1923
+ {
1924
+ "epoch": 0.8639172657333838,
1925
+ "grad_norm": 3.8321712017059326,
1926
+ "learning_rate": 4.525527442316929e-06,
1927
+ "loss": 1.49341552734375,
1928
+ "step": 13700
1929
+ },
1930
+ {
1931
+ "epoch": 0.8670702484550384,
1932
+ "grad_norm": 5.276515960693359,
1933
+ "learning_rate": 4.321381030785942e-06,
1934
+ "loss": 1.5483000183105469,
1935
+ "step": 13750
1936
+ },
1937
+ {
1938
+ "epoch": 0.8702232311766932,
1939
+ "grad_norm": 3.14579176902771,
1940
+ "learning_rate": 4.1217379743485885e-06,
1941
+ "loss": 1.3947171020507811,
1942
+ "step": 13800
1943
+ },
1944
+ {
1945
+ "epoch": 0.8733762138983479,
1946
+ "grad_norm": 2.654825448989868,
1947
+ "learning_rate": 3.92661795537696e-06,
1948
+ "loss": 1.4749700927734375,
1949
+ "step": 13850
1950
+ },
1951
+ {
1952
+ "epoch": 0.8765291966200025,
1953
+ "grad_norm": 3.828669786453247,
1954
+ "learning_rate": 3.736040210326791e-06,
1955
+ "loss": 1.4993699645996095,
1956
+ "step": 13900
1957
+ },
1958
+ {
1959
+ "epoch": 0.8796821793416572,
1960
+ "grad_norm": 2.1799724102020264,
1961
+ "learning_rate": 3.55002352784094e-06,
1962
+ "loss": 1.5674758911132813,
1963
+ "step": 13950
1964
+ },
1965
+ {
1966
+ "epoch": 0.8828351620633119,
1967
+ "grad_norm": 4.14724588394165,
1968
+ "learning_rate": 3.368586246897126e-06,
1969
+ "loss": 1.534229736328125,
1970
+ "step": 14000
1971
+ },
1972
+ {
1973
+ "epoch": 0.8859881447849666,
1974
+ "grad_norm": 5.016180992126465,
1975
+ "learning_rate": 3.1917462549998556e-06,
1976
+ "loss": 1.6074850463867187,
1977
+ "step": 14050
1978
+ },
1979
+ {
1980
+ "epoch": 0.8891411275066212,
1981
+ "grad_norm": 1.8124960660934448,
1982
+ "learning_rate": 3.0195209864169847e-06,
1983
+ "loss": 1.395457763671875,
1984
+ "step": 14100
1985
+ },
1986
+ {
1987
+ "epoch": 0.892294110228276,
1988
+ "grad_norm": 6.43141508102417,
1989
+ "learning_rate": 2.8519274204609038e-06,
1990
+ "loss": 1.4506192016601562,
1991
+ "step": 14150
1992
+ },
1993
+ {
1994
+ "epoch": 0.8954470929499306,
1995
+ "grad_norm": 2.8766117095947266,
1996
+ "learning_rate": 2.688982079814545e-06,
1997
+ "loss": 1.5080227661132812,
1998
+ "step": 14200
1999
+ },
2000
+ {
2001
+ "epoch": 0.8986000756715853,
2002
+ "grad_norm": 4.454990386962891,
2003
+ "learning_rate": 2.5307010289025103e-06,
2004
+ "loss": 1.5115219116210938,
2005
+ "step": 14250
2006
+ },
2007
+ {
2008
+ "epoch": 0.90175305839324,
2009
+ "grad_norm": 2.8794169425964355,
2010
+ "learning_rate": 2.3770998723072646e-06,
2011
+ "loss": 1.5923085021972656,
2012
+ "step": 14300
2013
+ },
2014
+ {
2015
+ "epoch": 0.9049060411148947,
2016
+ "grad_norm": 3.060925006866455,
2017
+ "learning_rate": 2.2281937532307506e-06,
2018
+ "loss": 1.5018788146972657,
2019
+ "step": 14350
2020
+ },
2021
+ {
2022
+ "epoch": 0.9080590238365494,
2023
+ "grad_norm": 6.880637168884277,
2024
+ "learning_rate": 2.08399735200141e-06,
2025
+ "loss": 1.5022019958496093,
2026
+ "step": 14400
2027
+ },
2028
+ {
2029
+ "epoch": 0.9112120065582041,
2030
+ "grad_norm": 4.857387065887451,
2031
+ "learning_rate": 1.9445248846269194e-06,
2032
+ "loss": 1.3896197509765624,
2033
+ "step": 14450
2034
+ },
2035
+ {
2036
+ "epoch": 0.9143649892798588,
2037
+ "grad_norm": 7.964158058166504,
2038
+ "learning_rate": 1.809790101392661e-06,
2039
+ "loss": 1.6113026428222657,
2040
+ "step": 14500
2041
+ },
2042
+ {
2043
+ "epoch": 0.9175179720015134,
2044
+ "grad_norm": 2.4885189533233643,
2045
+ "learning_rate": 1.6798062855061024e-06,
2046
+ "loss": 1.4576806640625,
2047
+ "step": 14550
2048
+ },
2049
+ {
2050
+ "epoch": 0.9206709547231681,
2051
+ "grad_norm": 5.294617652893066,
2052
+ "learning_rate": 1.5545862517872156e-06,
2053
+ "loss": 1.538426513671875,
2054
+ "step": 14600
2055
+ },
2056
+ {
2057
+ "epoch": 0.9238239374448228,
2058
+ "grad_norm": 3.588104248046875,
2059
+ "learning_rate": 1.4341423454051373e-06,
2060
+ "loss": 1.6244303894042968,
2061
+ "step": 14650
2062
+ },
2063
+ {
2064
+ "epoch": 0.9269769201664775,
2065
+ "grad_norm": 3.241389274597168,
2066
+ "learning_rate": 1.318486440661043e-06,
2067
+ "loss": 1.5407508850097655,
2068
+ "step": 14700
2069
+ },
2070
+ {
2071
+ "epoch": 0.9301299028881321,
2072
+ "grad_norm": 2.7573251724243164,
2073
+ "learning_rate": 1.207629939817534e-06,
2074
+ "loss": 1.5604298400878907,
2075
+ "step": 14750
2076
+ },
2077
+ {
2078
+ "epoch": 0.9332828856097869,
2079
+ "grad_norm": 2.5889720916748047,
2080
+ "learning_rate": 1.1015837719744348e-06,
2081
+ "loss": 1.5485455322265624,
2082
+ "step": 14800
2083
+ },
2084
+ {
2085
+ "epoch": 0.9364358683314415,
2086
+ "grad_norm": 3.1077330112457275,
2087
+ "learning_rate": 1.0003583919914016e-06,
2088
+ "loss": 1.617424774169922,
2089
+ "step": 14850
2090
+ },
2091
+ {
2092
+ "epoch": 0.9395888510530962,
2093
+ "grad_norm": 4.1840314865112305,
2094
+ "learning_rate": 9.039637794571509e-07,
2095
+ "loss": 1.6456863403320312,
2096
+ "step": 14900
2097
+ },
2098
+ {
2099
+ "epoch": 0.942741833774751,
2100
+ "grad_norm": 3.3467092514038086,
2101
+ "learning_rate": 8.124094377056135e-07,
2102
+ "loss": 1.4491183471679687,
2103
+ "step": 14950
2104
+ },
2105
+ {
2106
+ "epoch": 0.9458948164964056,
2107
+ "grad_norm": 2.538663387298584,
2108
+ "learning_rate": 7.25704392879012e-07,
2109
+ "loss": 1.4048564147949218,
2110
+ "step": 15000
2111
+ },
2112
+ {
2113
+ "epoch": 0.9490477992180603,
2114
+ "grad_norm": 4.097651481628418,
2115
+ "learning_rate": 6.438571930379833e-07,
2116
+ "loss": 1.527132568359375,
2117
+ "step": 15050
2118
+ },
2119
+ {
2120
+ "epoch": 0.952200781939715,
2121
+ "grad_norm": 3.757591724395752,
2122
+ "learning_rate": 5.668759073188756e-07,
2123
+ "loss": 1.515183868408203,
2124
+ "step": 15100
2125
+ },
2126
+ {
2127
+ "epoch": 0.9553537646613697,
2128
+ "grad_norm": 7.4409074783325195,
2129
+ "learning_rate": 4.947681251382063e-07,
2130
+ "loss": 1.5174710083007812,
2131
+ "step": 15150
2132
+ },
2133
+ {
2134
+ "epoch": 0.9585067473830243,
2135
+ "grad_norm": 7.107412338256836,
2136
+ "learning_rate": 4.2754095544442765e-07,
2137
+ "loss": 1.3609051513671875,
2138
+ "step": 15200
2139
+ },
2140
+ {
2141
+ "epoch": 0.961659730104679,
2142
+ "grad_norm": 4.804090976715088,
2143
+ "learning_rate": 3.652010260171146e-07,
2144
+ "loss": 1.5015805053710938,
2145
+ "step": 15250
2146
+ },
2147
+ {
2148
+ "epoch": 0.9648127128263337,
2149
+ "grad_norm": 4.099542140960693,
2150
+ "learning_rate": 3.0775448281348816e-07,
2151
+ "loss": 1.6412095642089843,
2152
+ "step": 15300
2153
+ },
2154
+ {
2155
+ "epoch": 0.9679656955479884,
2156
+ "grad_norm": 4.165719985961914,
2157
+ "learning_rate": 2.5520698936254975e-07,
2158
+ "loss": 1.6391523742675782,
2159
+ "step": 15350
2160
+ },
2161
+ {
2162
+ "epoch": 0.971118678269643,
2163
+ "grad_norm": 2.3679826259613037,
2164
+ "learning_rate": 2.0756372620669428e-07,
2165
+ "loss": 1.549954376220703,
2166
+ "step": 15400
2167
+ },
2168
+ {
2169
+ "epoch": 0.9742716609912978,
2170
+ "grad_norm": 3.1526825428009033,
2171
+ "learning_rate": 1.6482939039099143e-07,
2172
+ "loss": 1.702782440185547,
2173
+ "step": 15450
2174
+ },
2175
+ {
2176
+ "epoch": 0.9774246437129525,
2177
+ "grad_norm": 4.235635280609131,
2178
+ "learning_rate": 1.2700819500009454e-07,
2179
+ "loss": 1.4687045288085938,
2180
+ "step": 15500
2181
+ },
2182
+ {
2183
+ "epoch": 0.9805776264346071,
2184
+ "grad_norm": 5.9085822105407715,
2185
+ "learning_rate": 9.410386874291188e-08,
2186
+ "loss": 1.4969650268554688,
2187
+ "step": 15550
2188
+ },
2189
+ {
2190
+ "epoch": 0.9837306091562619,
2191
+ "grad_norm": 3.3030614852905273,
2192
+ "learning_rate": 6.611965558495637e-08,
2193
+ "loss": 1.5178204345703126,
2194
+ "step": 15600
2195
+ },
2196
+ {
2197
+ "epoch": 0.9868835918779165,
2198
+ "grad_norm": 2.6117329597473145,
2199
+ "learning_rate": 4.305831442857344e-08,
2200
+ "loss": 1.456710205078125,
2201
+ "step": 15650
2202
+ },
2203
+ {
2204
+ "epoch": 0.9900365745995712,
2205
+ "grad_norm": 4.085411548614502,
2206
+ "learning_rate": 2.4922118840936538e-08,
2207
+ "loss": 1.658289031982422,
2208
+ "step": 15700
2209
+ },
2210
+ {
2211
+ "epoch": 0.9931895573212258,
2212
+ "grad_norm": 3.8749728202819824,
2213
+ "learning_rate": 1.1712856829870777e-08,
2214
+ "loss": 1.5386245727539063,
2215
+ "step": 15750
2216
+ },
2217
+ {
2218
+ "epoch": 0.9963425400428806,
2219
+ "grad_norm": 2.440901279449463,
2220
+ "learning_rate": 3.4318306676217602e-09,
2221
+ "loss": 1.6089360046386718,
2222
+ "step": 15800
2223
+ },
2224
+ {
2225
+ "epoch": 0.9994955227645352,
2226
+ "grad_norm": 3.1938250064849854,
2227
+ "learning_rate": 7.985676244159912e-11,
2228
+ "loss": 1.4393968200683593,
2229
+ "step": 15850
2230
+ }
2231
+ ],
2232
+ "logging_steps": 50,
2233
+ "max_steps": 15858,
2234
+ "num_input_tokens_seen": 0,
2235
+ "num_train_epochs": 1,
2236
+ "save_steps": 500,
2237
+ "stateful_callbacks": {
2238
+ "TrainerControl": {
2239
+ "args": {
2240
+ "should_epoch_stop": false,
2241
+ "should_evaluate": false,
2242
+ "should_log": false,
2243
+ "should_save": true,
2244
+ "should_training_stop": true
2245
+ },
2246
+ "attributes": {}
2247
+ }
2248
+ },
2249
+ "total_flos": 656938445174016.0,
2250
+ "train_batch_size": 1,
2251
+ "trial_name": null,
2252
+ "trial_params": null
2253
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a3ff09b42b89a88656691947c7e244735d8ffdefa6b498e6ffca06b8d6473aba
3
+ size 5713