Torch.linalg.eigh is significantly slower on GPU

Hi All,

I’ve just noticed that torch.linalg.eigh is significantly slower when ran on the GPU than CPU, and I was wondering is this the expected behaviour of such an operation?

For example,

from time import time
import torch

matrices = torch.randn(10000, 200, 200)

t1=time()
torch.linalg.eigh(matrices)
torch.cuda.synchronize()
t2=time()
cpu_time = t2-t1

matrices = matrices.to(torch.device('cuda'))

t1=time()
torch.linalg.eigh(matrices)
torch.cuda.synchronize()
t2=time()
gpu_time = t2-t1

#cpu_time: 12.991785526275635 (s)
#gpu_time: 42.85719561576843 (s)

Is this expected behaviour or a bug?

Any feedback would be greatly appreciated! :slight_smile: