Function ‘EigBackward0’ returned nan values in its 0th output

Hi all, I use mixed-precision for my training when I call tensor.pinverse() to compute eigen vector and values of my tensor to compute loss. So, I have to change fp16 to fp32 because of sensitivity of pinverse() function to half dtype. Unfortunatly when I use scaler.scale(loss).backward() to backward loss in autocast block I get this error. note that the loss changed to the half dtype before calling backward.

RuntimeError: Function ‘EigBackward0’ returned nan values in its 0th output.

Any help would be really appreciated.

Double post with follow up from here.

1 Like