fix: hyperopt preload buffer_size=1 → batch_size (PER capacity floor)
The data preload created a dummy DQNTrainer with buffer_size=1, which fails the GPU PER capacity check (capacity must be >= batch_size). This caused the preload to fail silently, falling back to per-trial data loading from disk — 50 × 5s = 250s wasted. Fix: set buffer_size = max(batch_size, 1024) so the PER allocation succeeds. The preload trainer doesn't train — it just loads data into a shared Arc for all trials. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -878,7 +878,10 @@ impl DQNTrainer {
|
||||
let mut preload_hyperparams = DQNHyperparameters::default();
|
||||
preload_hyperparams.mbp10_data_dir = self.mbp10_data_dir.clone().unwrap_or_default();
|
||||
preload_hyperparams.trades_data_dir = self.trades_data_dir.clone().unwrap_or_default();
|
||||
preload_hyperparams.buffer_size = 1;
|
||||
// Buffer size must be >= batch_size for GPU PER allocation.
|
||||
// Preload doesn't train — just loads data — but the trainer
|
||||
// constructor still creates a PER buffer.
|
||||
preload_hyperparams.buffer_size = preload_hyperparams.batch_size.max(1024);
|
||||
let mut loader = InternalDQNTrainer::new_with_device(preload_hyperparams, self.device.clone())
|
||||
.map_err(|e| MLError::TrainingError(format!("Failed to create data loader: {e}")))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user