From 3d537353632e90deaf6e2e5032ef68f2ed5e20bd Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Thu, 2 Apr 2026 14:51:58 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20cap=20auto=20batch=5Fsize=20at=208192=20?= =?UTF-8?q?=E2=80=94=20prevents=202M+=20nonsense=20on=20H100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AutoBatchSizer computes raw VRAM ceiling which can be millions on 80GB. Cap at 8192: saturates H100 132 SMs for our GEMM sizes (80x256x128), diminishing returns above this for DQN gradient quality. Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/ml/src/trainers/dqn/trainer/constructor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ml/src/trainers/dqn/trainer/constructor.rs b/crates/ml/src/trainers/dqn/trainer/constructor.rs index 065130248..2b035187f 100644 --- a/crates/ml/src/trainers/dqn/trainer/constructor.rs +++ b/crates/ml/src/trainers/dqn/trainer/constructor.rs @@ -95,7 +95,7 @@ impl DQNTrainer { // batch_size == 0 -> auto-compute from VRAM (no artificial cap) if hyperparams.batch_size == 0 { - hyperparams.batch_size = max_safe_batch; + hyperparams.batch_size = max_safe_batch.min(8192); info!("AutoBatchSizer: batch_size auto-computed to {}", hyperparams.batch_size); } @@ -106,7 +106,7 @@ impl DQNTrainer { "DQN batch_size capped from {} -> {} (VRAM ceiling)", hyperparams.batch_size, max_safe_batch ); - hyperparams.batch_size = max_safe_batch; + hyperparams.batch_size = max_safe_batch.min(8192); } // Use override device if provided (hyperopt shares one CUDA context),