Text Generation
Transformers
Safetensors
Korean
English
aether_v2_7way
foundation-model
sovereign-ai
fully-open
open-source
mixture-of-experts
Mixture of Experts
heterogeneous-attention
latin-square
from-scratch
reproducible
pretrained
korean
vidraft
aether
conversational
custom_code
Instructions to use FINAL-Bench/Aether-7B-5Attn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FINAL-Bench/Aether-7B-5Attn with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FINAL-Bench/Aether-7B-5Attn", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("FINAL-Bench/Aether-7B-5Attn", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FINAL-Bench/Aether-7B-5Attn with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FINAL-Bench/Aether-7B-5Attn" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FINAL-Bench/Aether-7B-5Attn", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FINAL-Bench/Aether-7B-5Attn
- SGLang
How to use FINAL-Bench/Aether-7B-5Attn with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "FINAL-Bench/Aether-7B-5Attn" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FINAL-Bench/Aether-7B-5Attn", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "FINAL-Bench/Aether-7B-5Attn" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FINAL-Bench/Aether-7B-5Attn", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FINAL-Bench/Aether-7B-5Attn with Docker Model Runner:
docker model run hf.co/FINAL-Bench/Aether-7B-5Attn
Upload mini_config.py with huggingface_hub
Browse files- mini_config.py +214 -0
mini_config.py
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# coding=utf-8
|
| 3 |
+
"""
|
| 4 |
+
V2-7way Mini Configuration (Phase 4 PoC).
|
| 5 |
+
|
| 6 |
+
목적: 1B params 작은 모델로 49 layer 7×7 Latin Square 구조 검증.
|
| 7 |
+
- 단일 B200 1대 (192GB)에서 학습 가능
|
| 8 |
+
- Mini PoC 1B → 본 학습 30B 검증 후 진행
|
| 9 |
+
|
| 10 |
+
사용:
|
| 11 |
+
python -c "from mini_config import mini_cfg; print(mini_cfg)"
|
| 12 |
+
또는 train_v2_mini.py에서 import
|
| 13 |
+
"""
|
| 14 |
+
from aether_pkg.configuration_aether_v2_7way import AETHERV27wayConfig
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# =============================================================================
|
| 18 |
+
# Mini Scale (1B params)
|
| 19 |
+
# =============================================================================
|
| 20 |
+
mini_cfg = AETHERV27wayConfig(
|
| 21 |
+
# Hidden / FFN (Mini scale: hidden 4096 → 2048)
|
| 22 |
+
hidden_size=2048,
|
| 23 |
+
intermediate_size=6144,
|
| 24 |
+
expert_intermediate_size=640,
|
| 25 |
+
|
| 26 |
+
# 49 layers (구조 그대로 검증)
|
| 27 |
+
num_hidden_layers=49,
|
| 28 |
+
|
| 29 |
+
# Attention (mini)
|
| 30 |
+
num_attention_heads=16,
|
| 31 |
+
num_key_value_heads=4,
|
| 32 |
+
head_dim=128,
|
| 33 |
+
sliding_window_size=512,
|
| 34 |
+
compress_block_size=16,
|
| 35 |
+
|
| 36 |
+
# MoE (구조 그대로)
|
| 37 |
+
num_experts=25,
|
| 38 |
+
num_experts_per_tok=7,
|
| 39 |
+
use_shared_expert=True,
|
| 40 |
+
|
| 41 |
+
# Position
|
| 42 |
+
max_position_embeddings=4096,
|
| 43 |
+
rope_theta=10000.0,
|
| 44 |
+
|
| 45 |
+
# Norm + activation
|
| 46 |
+
rms_norm_eps=1e-6,
|
| 47 |
+
hidden_act="silu",
|
| 48 |
+
attention_dropout=0.0,
|
| 49 |
+
|
| 50 |
+
# Vocab
|
| 51 |
+
vocab_size=151936,
|
| 52 |
+
pad_token_id=151643,
|
| 53 |
+
|
| 54 |
+
# Training
|
| 55 |
+
initializer_range=0.02,
|
| 56 |
+
use_cache=False,
|
| 57 |
+
output_router_logits=True,
|
| 58 |
+
router_aux_loss_coef=0.001,
|
| 59 |
+
tie_word_embeddings=False,
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
# =============================================================================
|
| 64 |
+
# Nano Scale (~100M params, 단일 GPU 빠른 검증)
|
| 65 |
+
# =============================================================================
|
| 66 |
+
nano_cfg = AETHERV27wayConfig(
|
| 67 |
+
hidden_size=512,
|
| 68 |
+
intermediate_size=1536,
|
| 69 |
+
expert_intermediate_size=192,
|
| 70 |
+
num_hidden_layers=49,
|
| 71 |
+
num_attention_heads=8,
|
| 72 |
+
num_key_value_heads=2,
|
| 73 |
+
head_dim=64,
|
| 74 |
+
sliding_window_size=256,
|
| 75 |
+
compress_block_size=8,
|
| 76 |
+
num_experts=25,
|
| 77 |
+
num_experts_per_tok=7,
|
| 78 |
+
use_shared_expert=True,
|
| 79 |
+
max_position_embeddings=2048,
|
| 80 |
+
rope_theta=10000.0,
|
| 81 |
+
rms_norm_eps=1e-6,
|
| 82 |
+
hidden_act="silu",
|
| 83 |
+
attention_dropout=0.0,
|
| 84 |
+
vocab_size=151936,
|
| 85 |
+
pad_token_id=151643,
|
| 86 |
+
initializer_range=0.02,
|
| 87 |
+
use_cache=False,
|
| 88 |
+
output_router_logits=True,
|
| 89 |
+
router_aux_loss_coef=0.001,
|
| 90 |
+
tie_word_embeddings=False,
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
# =============================================================================
|
| 95 |
+
# Full Scale (30B params, 본 학습용)
|
| 96 |
+
# =============================================================================
|
| 97 |
+
full_cfg = AETHERV27wayConfig(
|
| 98 |
+
hidden_size=4096,
|
| 99 |
+
intermediate_size=12288,
|
| 100 |
+
expert_intermediate_size=1280,
|
| 101 |
+
num_hidden_layers=49,
|
| 102 |
+
num_attention_heads=32,
|
| 103 |
+
num_key_value_heads=8,
|
| 104 |
+
head_dim=128,
|
| 105 |
+
sliding_window_size=2048,
|
| 106 |
+
compress_block_size=64,
|
| 107 |
+
num_experts=25,
|
| 108 |
+
num_experts_per_tok=7,
|
| 109 |
+
use_shared_expert=True,
|
| 110 |
+
max_position_embeddings=8192,
|
| 111 |
+
rope_theta=1000000.0,
|
| 112 |
+
rms_norm_eps=1e-6,
|
| 113 |
+
hidden_act="silu",
|
| 114 |
+
attention_dropout=0.0,
|
| 115 |
+
vocab_size=151936,
|
| 116 |
+
pad_token_id=151643,
|
| 117 |
+
initializer_range=0.02,
|
| 118 |
+
use_cache=False,
|
| 119 |
+
output_router_logits=True,
|
| 120 |
+
router_aux_loss_coef=0.001,
|
| 121 |
+
tie_word_embeddings=False,
|
| 122 |
+
)
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
# =============================================================================
|
| 126 |
+
# Param 카운트 추정 (참고용)
|
| 127 |
+
# =============================================================================
|
| 128 |
+
def estimate_params(cfg):
|
| 129 |
+
"""Rough parameter count for an AETHER-V2-7way config."""
|
| 130 |
+
h = cfg.hidden_size
|
| 131 |
+
L = cfg.num_hidden_layers
|
| 132 |
+
n_e = cfg.num_experts
|
| 133 |
+
e_int = cfg.expert_intermediate_size
|
| 134 |
+
n_h = cfg.num_attention_heads
|
| 135 |
+
n_kv = getattr(cfg, "num_key_value_heads", n_h)
|
| 136 |
+
head_dim = cfg.head_dim
|
| 137 |
+
vocab = cfg.vocab_size
|
| 138 |
+
|
| 139 |
+
# Embed + LM head (tied or not)
|
| 140 |
+
embed = vocab * h
|
| 141 |
+
lm_head = vocab * h
|
| 142 |
+
|
| 143 |
+
# Per-layer attention: q,k,v,o
|
| 144 |
+
attn_per_layer = h * (n_h * head_dim) + h * (n_kv * head_dim) * 2 + (n_h * head_dim) * h
|
| 145 |
+
|
| 146 |
+
# Per-layer MoE: 25 experts × (gate + up + down)
|
| 147 |
+
expert_per_layer = n_e * (h * e_int * 3)
|
| 148 |
+
# Shared expert
|
| 149 |
+
shared = h * e_int * 3 if cfg.use_shared_expert else 0
|
| 150 |
+
# Router gate
|
| 151 |
+
router = h * n_e
|
| 152 |
+
|
| 153 |
+
# Per-layer norms (RMSNorm: 2 weights)
|
| 154 |
+
norms = h * 2
|
| 155 |
+
|
| 156 |
+
per_layer = attn_per_layer + expert_per_layer + shared + router + norms
|
| 157 |
+
total = embed + lm_head + per_layer * L + h # final norm
|
| 158 |
+
|
| 159 |
+
return {
|
| 160 |
+
"total": total,
|
| 161 |
+
"total_M": total / 1e6,
|
| 162 |
+
"total_B": total / 1e9,
|
| 163 |
+
"embed": embed,
|
| 164 |
+
"per_layer_attn": attn_per_layer,
|
| 165 |
+
"per_layer_moe": expert_per_layer + shared + router,
|
| 166 |
+
"L": L,
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
if __name__ == "__main__":
|
| 171 |
+
print("=" * 70)
|
| 172 |
+
print("V2-7way Config Sizes")
|
| 173 |
+
print("=" * 70)
|
| 174 |
+
for name, cfg in [("nano", nano_cfg), ("mini", mini_cfg), ("full", full_cfg)]:
|
| 175 |
+
info = estimate_params(cfg)
|
| 176 |
+
print(f"\n[{name}]")
|
| 177 |
+
print(f" hidden_size: {cfg.hidden_size}")
|
| 178 |
+
print(f" layers: {cfg.num_hidden_layers}")
|
| 179 |
+
print(f" experts: {cfg.num_experts} (top-{cfg.num_experts_per_tok})")
|
| 180 |
+
print(f" expert dim: {cfg.expert_intermediate_size}")
|
| 181 |
+
print(f" attn heads: {cfg.num_attention_heads} ({cfg.num_key_value_heads} kv)")
|
| 182 |
+
print(f" vocab: {cfg.vocab_size}")
|
| 183 |
+
print(f" estimated params: {info['total_B']:.2f}B")
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
# =============================================================================
|
| 187 |
+
# Onebee Scale (~1.03B params, Phase 2 Chinchilla-optimal - 20B 20:1)
|
| 188 |
+
# =============================================================================
|
| 189 |
+
onebee_cfg = AETHERV27wayConfig(
|
| 190 |
+
hidden_size=768,
|
| 191 |
+
intermediate_size=2304,
|
| 192 |
+
expert_intermediate_size=256,
|
| 193 |
+
num_hidden_layers=49,
|
| 194 |
+
num_attention_heads=8,
|
| 195 |
+
num_key_value_heads=2,
|
| 196 |
+
head_dim=64,
|
| 197 |
+
sliding_window_size=256,
|
| 198 |
+
compress_block_size=8,
|
| 199 |
+
num_experts=25,
|
| 200 |
+
num_experts_per_tok=7,
|
| 201 |
+
use_shared_expert=True,
|
| 202 |
+
max_position_embeddings=2048,
|
| 203 |
+
rope_theta=10000.0,
|
| 204 |
+
rms_norm_eps=1e-6,
|
| 205 |
+
hidden_act="silu",
|
| 206 |
+
attention_dropout=0.0,
|
| 207 |
+
vocab_size=151936,
|
| 208 |
+
pad_token_id=151643,
|
| 209 |
+
initializer_range=0.02,
|
| 210 |
+
use_cache=False,
|
| 211 |
+
output_router_logits=True,
|
| 212 |
+
router_aux_loss_coef=0.001,
|
| 213 |
+
tie_word_embeddings=False,
|
| 214 |
+
)
|