What happens is that in the second run you get the JIT autodiffed abs and that has been broken when complex support was added to the derivative of backward. Sadly, it seems that while the autograd that you get on the first run had been updated 10 months ago, the JIT has not been getting as much love from the complex number transition.
The fix is trivial in line with the exception: Change sign to sgn here: pytorch/symbolic_script.cpp at 03a79f43e33c1bef65fc8912c27160d01e0e15d5 · pytorch/pytorch · GitHub 2
However, I have not managed to find a reproducing case, or maybe the nightly versions have a fix where the JIT avoids complex numbers altogether, I would not know.
Best regards
Thomas