diff --git a/config/gpu/h100.toml b/config/gpu/h100.toml index ef0aab8d6..fd5e87a1f 100644 --- a/config/gpu/h100.toml +++ b/config/gpu/h100.toml @@ -1,6 +1,6 @@ # H100 PCIe/SXM (80GB VRAM) -- full production [training] -batch_size = 1024 +batch_size = 0 # 0 = auto-compute from VRAM via AutoBatchSizer num_atoms = 51 buffer_size = 500_000 hidden_dim_base = 256 diff --git a/crates/ml/src/trainers/dqn/trainer/constructor.rs b/crates/ml/src/trainers/dqn/trainer/constructor.rs index 5692acf02..8ab5f4501 100644 --- a/crates/ml/src/trainers/dqn/trainer/constructor.rs +++ b/crates/ml/src/trainers/dqn/trainer/constructor.rs @@ -30,14 +30,6 @@ use super::DQNTrainer; impl DQNTrainer { pub(crate) fn new_internal(mut hyperparams: DQNHyperparameters, debug_logging: bool, override_device: Option) -> Result { - // Validate batch size is non-zero - if hyperparams.batch_size == 0 { - return Err(anyhow::anyhow!( - "Batch size must be greater than 0, got: {}", - hyperparams.batch_size - )); - } - // WAVE 26 P2.2: Validate gradient_accumulation_steps > 0 if hyperparams.gradient_accumulation_steps == 0 { return Err(anyhow::anyhow!( @@ -105,6 +97,13 @@ impl DQNTrainer { } }; + // batch_size == 0 is the sentinel for auto-compute from VRAM. + // Let AutoBatchSizer drive the batch size, capped at 8192. + if hyperparams.batch_size == 0 { + hyperparams.batch_size = max_safe_batch.min(STATIC_MAX_BATCH_SIZE); + info!("AutoBatchSizer: batch_size auto-computed to {}", hyperparams.batch_size); + } + // Cap to VRAM ceiling from AutoBatchSizer (no separate scale-UP — // AutoBatchSizer already accounts for model size and available VRAM) if hyperparams.batch_size > max_safe_batch {