Zeus param-count script
Browse files- param_count.py +16 -0
param_count.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Zeus (#14662) Claim: architecture is ~100M params ("Zeus-100M").
|
| 2 |
+
Verifiable from the released config + modeling code (no weights needed).
|
| 3 |
+
flash_attn is stubbed because it's only used in forward(), not for building layers."""
|
| 4 |
+
import sys, types, json, torch
|
| 5 |
+
for n in ["flash_attn", "flash_attn.bert_padding"]:
|
| 6 |
+
sys.modules[n] = types.ModuleType(n)
|
| 7 |
+
sys.modules["flash_attn"].flash_attn_varlen_func = lambda *a, **k: None
|
| 8 |
+
sys.modules["flash_attn.bert_padding"].unpad_input = lambda *a, **k: None
|
| 9 |
+
sys.modules["flash_attn.bert_padding"].pad_input = lambda *a, **k: None
|
| 10 |
+
# expects a local clone of github.com/GestaltCogTeam/Zeus on sys.path
|
| 11 |
+
from zeus.configuration_zeus import ZeusConfig
|
| 12 |
+
from zeus.modeling_zeus import ZeusForPrediction
|
| 13 |
+
c = ZeusConfig(**json.load(open("zeus/config.json")))
|
| 14 |
+
m = ZeusForPrediction(c)
|
| 15 |
+
n = sum(p.numel() for p in m.parameters())
|
| 16 |
+
print(f"Zeus params: {n:,} ({n/1e6:.1f}M)") # 102,104,841 -> 102.1M
|