diff --git a/crates/ml/src/cuda_pipeline/gpu_dqn_trainer.rs b/crates/ml/src/cuda_pipeline/gpu_dqn_trainer.rs index 1886e9042..feb3a8e4f 100644 --- a/crates/ml/src/cuda_pipeline/gpu_dqn_trainer.rs +++ b/crates/ml/src/cuda_pipeline/gpu_dqn_trainer.rs @@ -1521,7 +1521,9 @@ impl GpuDqnTrainer { /// from overwhelming the subsequent auxiliary gradient additions. /// All operations are async on the same stream — zero CPU sync. pub fn clip_grad_buf_inplace(&mut self, max_norm: f32) -> Result<(), MLError> { - // clip_grad_buf_inplace: standalone kernel launch (not captured in CUDA graph) + // Disable cudarc event tracking — graph replay leaves stale events + // that cause INVALID_VALUE on post-graph kernel launches. + let _evt_guard = EventTrackingGuard::new(self.stream.context()); // Zero the grad_norm accumulator self.stream .memset_zeros(&mut self.grad_norm_buf) @@ -3571,7 +3573,6 @@ impl GpuDqnTrainer { fn launch_grad_norm(&self) -> Result<(), MLError> { let tp = self.total_params as i32; let blocks = ((self.total_params + 255) / 256) as u32; - tp, blocks, self.ptrs.grad_buf, self.ptrs.grad_norm_buf); let launch_cfg = LaunchConfig { grid_dim: (blocks, 1, 1),