Can you let us know why are you doing this?
You are essentially doing a rms of all the gradients for all the parameters.
I feel the gradient value would be too large in your case for every parameter update. Which might be causing the problem. Maybe if you could clip the gradients it might solve the problem.