Segmentation fault in torch.svd even for small matrices

Torch version: 0.5.0a0+e8536c0 (master branch as of 10-Jul-2018, 1.46 AM IST)

The below function calls exhibit segmentation fault:

In CPU:

import torch
x = torch.randn(32, 100) # works
print(torch.svd(x))

x = torch.randn(33, 100) # segmentation fault
print(torch.svd(x))

x = torch.randn(32,3500);  # works
print(torch.svd(x))

x = torch.randn(33, 3500) # segmentation fault
print(torch.svd(x))

##--------------------------------------------

x = torch.randn(100, 32) # works
print(torch.svd(x))

x = torch.randn(100, 33) # segmentation fault
print(torch.svd(x))

x = torch.randn(1000000,32);  # works
print(torch.svd(x))

x = torch.randn(1000000,33);  # segmentation fault
print(torch.svd(x))


In GPU (GeForce GTX Titan X):

import torch

x = torch.randn(16, 100).cuda();  # works
print(torch.svd(x))

x = torch.randn(17, 100).cuda();  # segmentation fault
print(torch.svd(x))

x = torch.randn(16, 3500).cuda();  # works
print(torch.svd(x))

x = torch.randn(17, 3500).cuda();  # segmentation fault
print(torch.svd(x))

x = torch.randn(16, 2500).cuda();  # works
print(torch.svd(x))

x = torch.randn(17, 2500).cuda();  # segmentation fault
print(torch.svd(x))

##-----------------------------------------------------------

x = torch.randn(100, 10).cuda();  # works
print(torch.svd(x))

x = torch.randn(100, 11).cuda();  # segmentation fault
print(torch.svd(x))

x = torch.randn(500, 10).cuda();  # works
print(torch.svd(x))

x = torch.randn(500, 11).cuda();  # segmentation fault
print(torch.svd(x))

Seems to be a bug?
I think, there are some corner cases not handled in code probably. I am not sure.

related posts: Segmentation fault for SVD implementation in GPU for large matrices

They all seem to work for me (after adding the missing ) in the third cpu case).

I’m on a recent master with (0.5.0a0+08daed4) as well. Maybe something with your dependencies and PyTorch being compiled with incompatible compilers? I use Debian’s gcc 5 and it seems to work well.

Best regards

Thomas

Works also on 0.5.0a0+3a71cf2, if that’s of any help.

I have attached the build log here.

@tom, @ptrblck I am using GCC 4.8.5, CUDA 9.0. Am I using old GCC?
I am not sure how to find out the wrong dependencies, as it did not give any error during build.
Is it possible for you to look at the build log and see if anything is fishy?

I do not know what dependencies are wrong.
I have collected pip wheels from here: torchvision, torch 0.4.0

and installed them. They do not give such segmentation faults.