diff --git a/giant/config.py b/giant/config.py index cbcf0e9..7001151 100644 --- a/giant/config.py +++ b/giant/config.py @@ -53,14 +53,15 @@ def auto_device() -> torch.device: return torch.device("cpu") -# Calibration point for estimate_batch_size(training=True): hidden_dim=512, -# n_blocks=6, batch_size=131072 measured at ~8 GiB VRAM. Activation memory is -# assumed to scale linearly with batch_size * hidden_dim * n_blocks (the -# ResBlock stack dominates), so this is a rough estimate rather than a -# guaranteed bound. -_REF_BYTES = 8 * 1024**3 -_REF_BATCH_SIZE = 131072 -_REF_HIDDEN_DIM = 512 +# Calibration point for estimate_batch_size(training=True): hidden_dim=1024, +# n_blocks=6, batch_size=29696 measured at ~7683 MiB VRAM (post-Phase-2 +# architecture, including the Stage-2 secondary decoder and n_sec head). +# Activation memory is assumed to scale linearly with +# batch_size * hidden_dim * n_blocks (the ResBlock stack dominates), so this +# is a rough estimate rather than a guaranteed bound. +_REF_BYTES = 7683 * 1024**2 +_REF_BATCH_SIZE = 29696 +_REF_HIDDEN_DIM = 1024 _REF_N_BLOCKS = 6 # Calibration point for estimate_batch_size(training=False): inference has no