diff --git a/crates/ml/src/trainers/ppo.rs b/crates/ml/src/trainers/ppo.rs index 84ceef19c..fef6d21ea 100644 --- a/crates/ml/src/trainers/ppo.rs +++ b/crates/ml/src/trainers/ppo.rs @@ -305,6 +305,21 @@ impl PpoTrainer { config.gae_config.gamma = hyperparams.gamma as f32; config.gae_config.lambda = hyperparams.gae_lambda; + // Auto-detect mixed precision capability based on GPU architecture + if device.is_cuda() { + match crate::memory_optimization::auto_batch_size::detect_gpu_memory() { + Ok((_total, _free, ref name)) => { + let detected = crate::dqn::mixed_precision::detect_from_gpu_name(name); + match &detected { + Some(c) => info!("PPO mixed precision: {:?} enabled (GPU: {})", c.dtype, name), + None => info!("PPO mixed precision: disabled (GPU: {})", name), + } + config.mixed_precision = detected; + } + Err(_) => {} + } + } + // Create PPO model with specified device (GPU or CPU) let model = PPO::with_device(config, device.clone())?;