How to obtain model gradients with amp?

You can access the gradients in the same way as shown in your first approach after calling unscale manually as also shown in your second code snippet.