SVD Error "svd_cuda_gesvdj" not implemented for 'Half'

Hello,

I am trying to compute the SVD with PyTorch 1.9, using a Nvidia RTX 3080 with NVIDIA-SMI 460.91.03, Driver Version: 460.91.03, and CUDA Version: 11.2.

I get this error when I compute the SVD for a 24x128 matrix:

  File "/home/kion/simclr-alignment/models/rank_loss.py", line 35, in forward
    U, S, V = torch.linalg.svd(A, full_matrices=True)
RuntimeError: "svd_cuda_gesvdj" not implemented for 'Half'

Is this error caused by the matrix dimensions? Error also occurs when full_matrices=False.

Note: Just checked and the same error occurs with a 192 x 128 matrix.

Turns out this issue was caused by mixed-precision (16-bit values). By casting the matrices into a float first, I was able to fix this issue. Keeping thread for visibility of issue.