Kye Gomez commited on
Commit ·
9cce1c1
1
Parent(s): 299a0cd
variants
Browse files- open_mythos/__init__.py +16 -0
- open_mythos/main.py +2 -0
- open_mythos/variants.py +91 -0
open_mythos/__init__.py
CHANGED
|
@@ -15,6 +15,15 @@ from open_mythos.main import (
|
|
| 15 |
apply_rope,
|
| 16 |
loop_index_embedding,
|
| 17 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
__all__ = [
|
| 20 |
"MythosConfig",
|
|
@@ -32,4 +41,11 @@ __all__ = [
|
|
| 32 |
"precompute_rope_freqs",
|
| 33 |
"apply_rope",
|
| 34 |
"loop_index_embedding",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
]
|
|
|
|
| 15 |
apply_rope,
|
| 16 |
loop_index_embedding,
|
| 17 |
)
|
| 18 |
+
from open_mythos.variants import (
|
| 19 |
+
mythos_1b,
|
| 20 |
+
mythos_3b,
|
| 21 |
+
mythos_10b,
|
| 22 |
+
mythos_50b,
|
| 23 |
+
mythos_100b,
|
| 24 |
+
mythos_500b,
|
| 25 |
+
mythos_1t,
|
| 26 |
+
)
|
| 27 |
|
| 28 |
__all__ = [
|
| 29 |
"MythosConfig",
|
|
|
|
| 41 |
"precompute_rope_freqs",
|
| 42 |
"apply_rope",
|
| 43 |
"loop_index_embedding",
|
| 44 |
+
"mythos_1b",
|
| 45 |
+
"mythos_3b",
|
| 46 |
+
"mythos_10b",
|
| 47 |
+
"mythos_50b",
|
| 48 |
+
"mythos_100b",
|
| 49 |
+
"mythos_500b",
|
| 50 |
+
"mythos_1t",
|
| 51 |
]
|
open_mythos/main.py
CHANGED
|
@@ -78,6 +78,8 @@ class MythosConfig:
|
|
| 78 |
rope_theta: float = 500000.0
|
| 79 |
# LoRA depth adaptation
|
| 80 |
lora_rank: int = 16
|
|
|
|
|
|
|
| 81 |
|
| 82 |
|
| 83 |
# ---------------------------------------------------------------------------
|
|
|
|
| 78 |
rope_theta: float = 500000.0
|
| 79 |
# LoRA depth adaptation
|
| 80 |
lora_rank: int = 16
|
| 81 |
+
# Maximum tokens to generate per forward pass
|
| 82 |
+
max_output_tokens: int = 4096
|
| 83 |
|
| 84 |
|
| 85 |
# ---------------------------------------------------------------------------
|
open_mythos/variants.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from open_mythos.main import MythosConfig
|
| 2 |
+
|
| 3 |
+
# fmt: off
|
| 4 |
+
|
| 5 |
+
def mythos_1b() -> MythosConfig:
|
| 6 |
+
"""1B parameter config. Small research/fine-tuning model. dim=2048, 16 experts, 16 loop iters, 4k context."""
|
| 7 |
+
return MythosConfig(
|
| 8 |
+
vocab_size=32000, dim=2048, n_heads=16, n_kv_heads=4,
|
| 9 |
+
max_seq_len=4096, max_loop_iters=16, prelude_layers=2, coda_layers=2,
|
| 10 |
+
attn_type="mla", kv_lora_rank=256, q_lora_rank=512,
|
| 11 |
+
qk_rope_head_dim=32, qk_nope_head_dim=64, v_head_dim=64,
|
| 12 |
+
n_experts=16, n_shared_experts=2, n_experts_per_tok=2, expert_dim=256,
|
| 13 |
+
act_threshold=0.99, rope_theta=500000.0, lora_rank=8,
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def mythos_3b() -> MythosConfig:
|
| 18 |
+
"""3B parameter config. Compact inference model. dim=3072, 32 experts, 16 loop iters, 4k context."""
|
| 19 |
+
return MythosConfig(
|
| 20 |
+
vocab_size=32000, dim=3072, n_heads=24, n_kv_heads=6,
|
| 21 |
+
max_seq_len=4096, max_loop_iters=16, prelude_layers=2, coda_layers=2,
|
| 22 |
+
attn_type="mla", kv_lora_rank=384, q_lora_rank=768,
|
| 23 |
+
qk_rope_head_dim=32, qk_nope_head_dim=96, v_head_dim=96,
|
| 24 |
+
n_experts=32, n_shared_experts=2, n_experts_per_tok=2, expert_dim=384,
|
| 25 |
+
act_threshold=0.99, rope_theta=500000.0, lora_rank=8,
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def mythos_10b() -> MythosConfig:
|
| 30 |
+
"""10B parameter config. Mid-scale general model. dim=4096, 64 experts, 24 loop iters, 8k context."""
|
| 31 |
+
return MythosConfig(
|
| 32 |
+
vocab_size=32000, dim=4096, n_heads=32, n_kv_heads=8,
|
| 33 |
+
max_seq_len=8192, max_loop_iters=24, prelude_layers=2, coda_layers=2,
|
| 34 |
+
attn_type="mla", kv_lora_rank=512, q_lora_rank=1024,
|
| 35 |
+
qk_rope_head_dim=64, qk_nope_head_dim=128, v_head_dim=128,
|
| 36 |
+
n_experts=64, n_shared_experts=2, n_experts_per_tok=4, expert_dim=512,
|
| 37 |
+
act_threshold=0.99, rope_theta=500000.0, lora_rank=16,
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def mythos_50b() -> MythosConfig:
|
| 42 |
+
"""50B parameter config. Large reasoning model. dim=6144, 128 experts, 32 loop iters, 8k context."""
|
| 43 |
+
return MythosConfig(
|
| 44 |
+
vocab_size=32000, dim=6144, n_heads=48, n_kv_heads=8,
|
| 45 |
+
max_seq_len=8192, max_loop_iters=32, prelude_layers=3, coda_layers=3,
|
| 46 |
+
attn_type="mla", kv_lora_rank=512, q_lora_rank=1536,
|
| 47 |
+
qk_rope_head_dim=64, qk_nope_head_dim=128, v_head_dim=128,
|
| 48 |
+
n_experts=128, n_shared_experts=4, n_experts_per_tok=4, expert_dim=768,
|
| 49 |
+
act_threshold=0.99, rope_theta=500000.0, lora_rank=32,
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def mythos_100b() -> MythosConfig:
|
| 54 |
+
"""100B parameter config. Frontier-class model. dim=8192, 160 experts, 32 loop iters, 1M context, 128k output."""
|
| 55 |
+
return MythosConfig(
|
| 56 |
+
vocab_size=32000, dim=8192, n_heads=64, n_kv_heads=8,
|
| 57 |
+
max_seq_len=1000000, max_loop_iters=32, prelude_layers=4, coda_layers=4,
|
| 58 |
+
attn_type="mla", kv_lora_rank=512, q_lora_rank=2048,
|
| 59 |
+
qk_rope_head_dim=64, qk_nope_head_dim=128, v_head_dim=128,
|
| 60 |
+
n_experts=160, n_shared_experts=4, n_experts_per_tok=8, expert_dim=1024,
|
| 61 |
+
act_threshold=0.99, rope_theta=1000000.0, lora_rank=64,
|
| 62 |
+
max_output_tokens=131072,
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def mythos_500b() -> MythosConfig:
|
| 67 |
+
"""500B parameter config. Ultra-scale MoE model. dim=12288, 256 experts, 48 loop iters, 1M context, 128k output."""
|
| 68 |
+
return MythosConfig(
|
| 69 |
+
vocab_size=100000, dim=12288, n_heads=96, n_kv_heads=16,
|
| 70 |
+
max_seq_len=1000000, max_loop_iters=48, prelude_layers=4, coda_layers=4,
|
| 71 |
+
attn_type="mla", kv_lora_rank=1024, q_lora_rank=3072,
|
| 72 |
+
qk_rope_head_dim=64, qk_nope_head_dim=128, v_head_dim=128,
|
| 73 |
+
n_experts=256, n_shared_experts=8, n_experts_per_tok=8, expert_dim=1536,
|
| 74 |
+
act_threshold=0.99, rope_theta=1000000.0, lora_rank=128,
|
| 75 |
+
max_output_tokens=131072,
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def mythos_1t() -> MythosConfig:
|
| 80 |
+
"""1T parameter config. Maximum scale. dim=16384, 512 experts, 64 loop iters, 1M context, 128k output."""
|
| 81 |
+
return MythosConfig(
|
| 82 |
+
vocab_size=100000, dim=16384, n_heads=128, n_kv_heads=16,
|
| 83 |
+
max_seq_len=1000000, max_loop_iters=64, prelude_layers=6, coda_layers=6,
|
| 84 |
+
attn_type="mla", kv_lora_rank=1024, q_lora_rank=4096,
|
| 85 |
+
qk_rope_head_dim=64, qk_nope_head_dim=128, v_head_dim=128,
|
| 86 |
+
n_experts=512, n_shared_experts=8, n_experts_per_tok=8, expert_dim=2048,
|
| 87 |
+
act_threshold=0.99, rope_theta=2000000.0, lora_rank=256,
|
| 88 |
+
max_output_tokens=131072,
|
| 89 |
+
)
|
| 90 |
+
|
| 91 |
+
# fmt: on
|