feat: publish 1.189B foundation model (config_1b.py)
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546"""⚡ ULTRON Systems // 1.1 Billion Parameter Financial Foundation Model ConfigurationDesigned specifically for NVIDIA A100 (80GB VRAM) SXM4 Tensor Core Accelerators."""from dataclasses import dataclass, fieldfrom typing import List, Optionalimport osimport torch
@dataclassclass Model1BConfig: # Model Parameter Sizing for ~1.1 Billion Parameters in_features: int = 8 # Number of stationary features generated per bar d_model: int = 2048 # Latent embedding dimension n_layers: int = 20 # Deep Conformer blocks n_heads: int = 16 # Query attention heads (128 dim per head) n_kv_heads: int = 8 # Key/Value heads (Grouped Query Attention - GQA) d_ff: int = 5504 # SwiGLU intermediate dimension conv_depthwise_kernel: int = 7 # Conformer depthwise conv kernel conv_kernels: List[int] = field(default_factory=lambda: [3, 7, 15, 31, 63, 127]) # Multi-Scale Convolutions patch_stride: int = 4 # Overlapping 1D conv patch stride (2048 -> 512 tokens) dropout: float = 0.05 use_revin: bool = True # Reversible Instance Normalization num_horizons: int = 7 # Forecast horizons: [1m, 3m, 5m, 15m, 30m, 60m, 1d] mask_ratio: float = 0.15 # 15% masked candlestick pre-training
@dataclassclass Training1BConfig: # Optimized for A100 80GB VRAM batch_size: int = 64 # Physical batch size on A100 80GB grad_accum_steps: int = 8 # Effective batch size = 64 * 8 = 512 learning_rate: float = 1.5e-4 # Foundation model base learning rate min_lr: float = 1e-6 weight_decay: float = 1e-1 # Stronger weight decay for large foundation models warmup_steps: int = 1000 precision: str = "bfloat16" # Native A100 Tensor Core BF16 grad_checkpointing: bool = True # Allows large sequence contexts up to 4096 seq_len: int = 2048 # 2048 minutes of continuous market history (~3 trading days) window_stride: int = 32 max_epochs: int = 3 pred_horizons: List[int] = field(default_factory=lambda: [1, 3, 5, 15, 30, 60, 390]) checkpoint_dir: str = "/content/drive/MyDrive/ohlcv_1b_checkpoints" local_checkpoint_dir: str = "./checkpoints_1b" log_interval: int = 10 save_every_steps: int = 100 device: str = "cuda" if torch.cuda.is_available() else "cpu"config_1b.pyAdded+46