Skip to content

[pytorch] randperm lacks CUDA implementation #6874

@jinserk

Description

@jinserk

If you have a question or would like help and support, please ask at our
forums.

If you are submitting a feature request, please preface the title with [feature request].
If you are submitting a bug report, please fill in the following details.

Issue description

when torch.cuda.FloatTensor is default tensor type, then torch.randperm shows an error as:

RuntimeError: randperm is only implemented for CPU

Code example

Python 3.6.5 (default, Apr 23 2018, 11:54:52) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.randperm(4)
tensor([ 1,  2,  3,  0])
>>> torch.randperm(4).tolist()
[1, 0, 2, 3]
>>> torch.set_default_tensor_type("torch.cuda.FloatTensor")
>>> torch.randperm(4).tolist()                                                                                                                                                                                                                
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: randperm is only implemented for CPU

System Info

PyTorch version: 0.5.0a0+b8ada73
Is debug build: No
CUDA used to build PyTorch: 9.1.85

OS: CentOS Linux 7 (Core)
GCC version: (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
CMake version: version 3.9.20170615-g7c529

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.1.85
GPU models and configuration: GPU 0: GeForce GTX 1070
Nvidia driver version: 390.30
cuDNN version: Probably one of the following:
/usr/local/cudnn_6.0-cuda_8.0/lib64/libcudnn.so.6.0.21
/usr/local/cudnn_6.0-cuda_8.0/lib64/libcudnn_static.a
/usr/local/cudnn_7.0.3-cuda_9.0/lib64/libcudnn.so.7.0.3
/usr/local/cudnn_7.0.3-cuda_9.0/lib64/libcudnn_static.a
/usr/local/cudnn_7.0.4-cuda_8.0/lib64/libcudnn.so.7.0.4
/usr/local/cudnn_7.0.4-cuda_8.0/lib64/libcudnn_static.a
/usr/local/cudnn_7.0.4-cuda_9.0/lib64/libcudnn.so.7.0.4
/usr/local/cudnn_7.0.4-cuda_9.0/lib64/libcudnn_static.a
/usr/local/cudnn_7.0.5+cuda_9.1/lib64/libcudnn.so.7.0.5
/usr/local/cudnn_7.0.5+cuda_9.1/lib64/libcudnn_static.a

Versions of relevant libraries:
[pip3] numpy (1.14.2)
[pip3] torch (0.5.0a0+b8ada73)
[pip3] torchaudio (0.1)
[pip3] torchfile (0.1.0)
[pip3] torchnet (0.0.1)
[pip3] warpctc-pytorch (0.1)
[conda] Could not collect
  • PyTorch or Caffe2: Pytorch
  • How you installed PyTorch (conda, pip, source): source
  • Build command you used (if compiling from source): python setup.py install
  • OS: CentOS 7
  • PyTorch version: 0.5.0a0+b8ada73
  • Python version: 3.6.5
  • CUDA/cuDNN version: 9.1/7.0.5
  • GPU models and configuration: GTX1080
  • GCC version (if compiling from source): 4.8.5
  • CMake version: 3.9.20170615-g7c529
  • Versions of any other relevant libraries:

Metadata

Metadata

Assignees

Labels

todoNot as important as medium or high priority tasks, but we will work on these.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions