Kye Gomez commited on
Commit
a825ba2
·
1 Parent(s): f00d10b

[Update variants with parameter count equation]

Browse files
Files changed (4) hide show
  1. README.md +35 -0
  2. open_mythos/variants.py +26 -21
  3. pyproject.toml +1 -1
  4. variants_example.py +10 -0
README.md CHANGED
@@ -71,6 +71,41 @@ print(
71
 
72
 
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  ## Documentation
75
 
76
  | Page | Description |
 
71
 
72
 
73
 
74
+ ## Model Variants
75
+
76
+ Pre-configured scales from 1B to 1T parameters:
77
+
78
+ ```python
79
+ from open_mythos import (
80
+ mythos_1b,
81
+ mythos_3b,
82
+ mythos_10b,
83
+ mythos_50b,
84
+ mythos_100b,
85
+ mythos_500b,
86
+ mythos_1t,
87
+ OpenMythos,
88
+ )
89
+
90
+ cfg = mythos_7b() # returns a MythosConfig
91
+ model = OpenMythos(cfg)
92
+
93
+ total = sum(p.numel() for p in model.parameters())
94
+ print(f"Parameters: {total:,}")
95
+ ```
96
+
97
+ | Variant | `dim` | Experts | `expert_dim` | Loop iters | Context | Max output |
98
+ |---|---|---|---|---|---|---|
99
+ | `mythos_1b` | 2048 | 64 | 2048 | 16 | 4k | 4k |
100
+ | `mythos_3b` | 3072 | 64 | 4096 | 16 | 4k | 4k |
101
+ | `mythos_10b` | 4096 | 128 | 5632 | 24 | 8k | 4k |
102
+ | `mythos_50b` | 6144 | 256 | 9728 | 32 | 8k | 4k |
103
+ | `mythos_100b` | 8192 | 256 | 13568 | 32 | 1M | 128k |
104
+ | `mythos_500b` | 12288 | 512 | 23040 | 48 | 1M | 128k |
105
+ | `mythos_1t` | 16384 | 512 | 34560 | 64 | 1M | 128k |
106
+
107
+ ---
108
+
109
  ## Documentation
110
 
111
  | Page | Description |
open_mythos/variants.py CHANGED
@@ -1,8 +1,13 @@
1
  from open_mythos.main import MythosConfig
2
 
 
 
 
 
 
3
 
4
  def mythos_1b() -> MythosConfig:
5
- """1B parameter config. Small research/fine-tuning model. dim=2048, 16 experts, 16 loop iters, 4k context."""
6
  return MythosConfig(
7
  vocab_size=32000,
8
  dim=2048,
@@ -18,10 +23,10 @@ def mythos_1b() -> MythosConfig:
18
  qk_rope_head_dim=32,
19
  qk_nope_head_dim=64,
20
  v_head_dim=64,
21
- n_experts=16,
22
  n_shared_experts=2,
23
- n_experts_per_tok=2,
24
- expert_dim=256,
25
  act_threshold=0.99,
26
  rope_theta=500000.0,
27
  lora_rank=8,
@@ -29,7 +34,7 @@ def mythos_1b() -> MythosConfig:
29
 
30
 
31
  def mythos_3b() -> MythosConfig:
32
- """3B parameter config. Compact inference model. dim=3072, 32 experts, 16 loop iters, 4k context."""
33
  return MythosConfig(
34
  vocab_size=32000,
35
  dim=3072,
@@ -45,10 +50,10 @@ def mythos_3b() -> MythosConfig:
45
  qk_rope_head_dim=32,
46
  qk_nope_head_dim=96,
47
  v_head_dim=96,
48
- n_experts=32,
49
  n_shared_experts=2,
50
- n_experts_per_tok=2,
51
- expert_dim=384,
52
  act_threshold=0.99,
53
  rope_theta=500000.0,
54
  lora_rank=8,
@@ -56,7 +61,7 @@ def mythos_3b() -> MythosConfig:
56
 
57
 
58
  def mythos_10b() -> MythosConfig:
59
- """10B parameter config. Mid-scale general model. dim=4096, 64 experts, 24 loop iters, 8k context."""
60
  return MythosConfig(
61
  vocab_size=32000,
62
  dim=4096,
@@ -72,10 +77,10 @@ def mythos_10b() -> MythosConfig:
72
  qk_rope_head_dim=64,
73
  qk_nope_head_dim=128,
74
  v_head_dim=128,
75
- n_experts=64,
76
  n_shared_experts=2,
77
  n_experts_per_tok=4,
78
- expert_dim=512,
79
  act_threshold=0.99,
80
  rope_theta=500000.0,
81
  lora_rank=16,
@@ -83,7 +88,7 @@ def mythos_10b() -> MythosConfig:
83
 
84
 
85
  def mythos_50b() -> MythosConfig:
86
- """50B parameter config. Large reasoning model. dim=6144, 128 experts, 32 loop iters, 8k context."""
87
  return MythosConfig(
88
  vocab_size=32000,
89
  dim=6144,
@@ -99,10 +104,10 @@ def mythos_50b() -> MythosConfig:
99
  qk_rope_head_dim=64,
100
  qk_nope_head_dim=128,
101
  v_head_dim=128,
102
- n_experts=128,
103
  n_shared_experts=4,
104
  n_experts_per_tok=4,
105
- expert_dim=768,
106
  act_threshold=0.99,
107
  rope_theta=500000.0,
108
  lora_rank=32,
@@ -110,7 +115,7 @@ def mythos_50b() -> MythosConfig:
110
 
111
 
112
  def mythos_100b() -> MythosConfig:
113
- """100B parameter config. Frontier-class model. dim=8192, 160 experts, 32 loop iters, 1M context, 128k output."""
114
  return MythosConfig(
115
  vocab_size=32000,
116
  dim=8192,
@@ -126,10 +131,10 @@ def mythos_100b() -> MythosConfig:
126
  qk_rope_head_dim=64,
127
  qk_nope_head_dim=128,
128
  v_head_dim=128,
129
- n_experts=160,
130
  n_shared_experts=4,
131
  n_experts_per_tok=8,
132
- expert_dim=1024,
133
  act_threshold=0.99,
134
  rope_theta=1000000.0,
135
  lora_rank=64,
@@ -138,7 +143,7 @@ def mythos_100b() -> MythosConfig:
138
 
139
 
140
  def mythos_500b() -> MythosConfig:
141
- """500B parameter config. Ultra-scale MoE model. dim=12288, 256 experts, 48 loop iters, 1M context, 128k output."""
142
  return MythosConfig(
143
  vocab_size=100000,
144
  dim=12288,
@@ -154,10 +159,10 @@ def mythos_500b() -> MythosConfig:
154
  qk_rope_head_dim=64,
155
  qk_nope_head_dim=128,
156
  v_head_dim=128,
157
- n_experts=256,
158
  n_shared_experts=8,
159
  n_experts_per_tok=8,
160
- expert_dim=1536,
161
  act_threshold=0.99,
162
  rope_theta=1000000.0,
163
  lora_rank=128,
@@ -185,7 +190,7 @@ def mythos_1t() -> MythosConfig:
185
  n_experts=512,
186
  n_shared_experts=8,
187
  n_experts_per_tok=8,
188
- expert_dim=2048,
189
  act_threshold=0.99,
190
  rope_theta=2000000.0,
191
  lora_rank=256,
 
1
  from open_mythos.main import MythosConfig
2
 
3
+ # Parameter budget breakdown per variant:
4
+ # total ≈ embed + prelude/coda dense blocks + recurrent MLA + MoE
5
+ # MoE = 3 * dim * expert_dim * (n_experts + n_shared * n_experts_per_tok)
6
+ # expert_dim is solved from the residual budget after all other terms.
7
+
8
 
9
  def mythos_1b() -> MythosConfig:
10
+ """1B parameter config. Small research/fine-tuning model. dim=2048, 64 experts, 16 loop iters, 4k context."""
11
  return MythosConfig(
12
  vocab_size=32000,
13
  dim=2048,
 
23
  qk_rope_head_dim=32,
24
  qk_nope_head_dim=64,
25
  v_head_dim=64,
26
+ n_experts=64,
27
  n_shared_experts=2,
28
+ n_experts_per_tok=4,
29
+ expert_dim=2048,
30
  act_threshold=0.99,
31
  rope_theta=500000.0,
32
  lora_rank=8,
 
34
 
35
 
36
  def mythos_3b() -> MythosConfig:
37
+ """3B parameter config. Compact inference model. dim=3072, 64 experts, 16 loop iters, 4k context."""
38
  return MythosConfig(
39
  vocab_size=32000,
40
  dim=3072,
 
50
  qk_rope_head_dim=32,
51
  qk_nope_head_dim=96,
52
  v_head_dim=96,
53
+ n_experts=64,
54
  n_shared_experts=2,
55
+ n_experts_per_tok=4,
56
+ expert_dim=4096,
57
  act_threshold=0.99,
58
  rope_theta=500000.0,
59
  lora_rank=8,
 
61
 
62
 
63
  def mythos_10b() -> MythosConfig:
64
+ """10B parameter config. Mid-scale general model. dim=4096, 128 experts, 24 loop iters, 8k context."""
65
  return MythosConfig(
66
  vocab_size=32000,
67
  dim=4096,
 
77
  qk_rope_head_dim=64,
78
  qk_nope_head_dim=128,
79
  v_head_dim=128,
80
+ n_experts=128,
81
  n_shared_experts=2,
82
  n_experts_per_tok=4,
83
+ expert_dim=5632,
84
  act_threshold=0.99,
85
  rope_theta=500000.0,
86
  lora_rank=16,
 
88
 
89
 
90
  def mythos_50b() -> MythosConfig:
91
+ """50B parameter config. Large reasoning model. dim=6144, 256 experts, 32 loop iters, 8k context."""
92
  return MythosConfig(
93
  vocab_size=32000,
94
  dim=6144,
 
104
  qk_rope_head_dim=64,
105
  qk_nope_head_dim=128,
106
  v_head_dim=128,
107
+ n_experts=256,
108
  n_shared_experts=4,
109
  n_experts_per_tok=4,
110
+ expert_dim=9728,
111
  act_threshold=0.99,
112
  rope_theta=500000.0,
113
  lora_rank=32,
 
115
 
116
 
117
  def mythos_100b() -> MythosConfig:
118
+ """100B parameter config. Frontier-class model. dim=8192, 256 experts, 32 loop iters, 1M context, 128k output."""
119
  return MythosConfig(
120
  vocab_size=32000,
121
  dim=8192,
 
131
  qk_rope_head_dim=64,
132
  qk_nope_head_dim=128,
133
  v_head_dim=128,
134
+ n_experts=256,
135
  n_shared_experts=4,
136
  n_experts_per_tok=8,
137
+ expert_dim=13568,
138
  act_threshold=0.99,
139
  rope_theta=1000000.0,
140
  lora_rank=64,
 
143
 
144
 
145
  def mythos_500b() -> MythosConfig:
146
+ """500B parameter config. Ultra-scale MoE model. dim=12288, 512 experts, 48 loop iters, 1M context, 128k output."""
147
  return MythosConfig(
148
  vocab_size=100000,
149
  dim=12288,
 
159
  qk_rope_head_dim=64,
160
  qk_nope_head_dim=128,
161
  v_head_dim=128,
162
+ n_experts=512,
163
  n_shared_experts=8,
164
  n_experts_per_tok=8,
165
+ expert_dim=23040,
166
  act_threshold=0.99,
167
  rope_theta=1000000.0,
168
  lora_rank=128,
 
190
  n_experts=512,
191
  n_shared_experts=8,
192
  n_experts_per_tok=8,
193
+ expert_dim=34560,
194
  act_threshold=0.99,
195
  rope_theta=2000000.0,
196
  lora_rank=256,
pyproject.toml CHANGED
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
5
 
6
  [tool.poetry]
7
  name = "open-mythos"
8
- version = "0.1.0"
9
  description = "OpenMythos — open-source theoretical reconstruction of the Claude Mythos Recurrent-Depth Transformer architecture"
10
  license = "MIT"
11
  authors = ["Kye Gomez <kye@swarms.world>"]
 
5
 
6
  [tool.poetry]
7
  name = "open-mythos"
8
+ version = "0.2.0"
9
  description = "OpenMythos — open-source theoretical reconstruction of the Claude Mythos Recurrent-Depth Transformer architecture"
10
  license = "MIT"
11
  authors = ["Kye Gomez <kye@swarms.world>"]
variants_example.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ from open_mythos import (
2
+ mythos_1b,
3
+ OpenMythos,
4
+ )
5
+
6
+ cfg = mythos_1b()
7
+ model = OpenMythos(cfg)
8
+
9
+ total = sum(p.numel() for p in model.parameters())
10
+ print(f"Parameters: {total:,}")