Skip to content

Conversation

@t-vi
Copy link
Collaborator

@t-vi t-vi commented Jul 14, 2018

Fixes: #9421

I don't think it is easy to deal with non-contiguous array in cuda topk, so I'm adding a check.
The argument number is a bit confusing when it shows in PyTorch but it is consistent with the other checks. (Not sure whether it would make sense to eliminate argument numbers from the error TH/THC error messages given that they're probably off more than once...)

Do we need a test that it indeed refuses non-contiguous?

@soumith
Copy link
Contributor

soumith commented Jul 14, 2018

you should make the input tensor contiguous with newContiguous, rather than assert that the Tensor is contiguous

@t-vi
Copy link
Collaborator Author

t-vi commented Jul 14, 2018

Ok, thanks. I'm never sure whether we do that or leave it to the user...

Thank you, Soumith, for the review comment.
Also add a test.
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Jul 14, 2018
Summary:
Fixes: #9421

I don't think it is easy to deal with non-contiguous array in cuda topk, so I'm adding a check.
The argument number is a bit confusing when it shows in PyTorch but it is consistent with the other checks. (Not sure whether it would make sense to eliminate argument numbers from the error TH/THC error messages given that they're probably off more than once...)

Do we need a test that it indeed refuses non-contiguous?
Pull Request resolved: pytorch/pytorch#9441

Reviewed By: soumith

Differential Revision: D8850719

Pulled By: ezyang

fbshipit-source-id: d50561bb37ed50ab97aeaf54d8e3fc6c765bdc7c
zdevito pushed a commit to zdevito/ATen that referenced this pull request Jul 15, 2018
Summary:
Fixes: #9421

I don't think it is easy to deal with non-contiguous array in cuda topk, so I'm adding a check.
The argument number is a bit confusing when it shows in PyTorch but it is consistent with the other checks. (Not sure whether it would make sense to eliminate argument numbers from the error TH/THC error messages given that they're probably off more than once...)

Do we need a test that it indeed refuses non-contiguous?
Pull Request resolved: pytorch/pytorch#9441

Reviewed By: soumith

Differential Revision: D8850719

Pulled By: ezyang

fbshipit-source-id: d50561bb37ed50ab97aeaf54d8e3fc6c765bdc7c
petrex pushed a commit to petrex/pytorch that referenced this pull request Jul 16, 2018
* upstream/master: (24 commits)
  Implement tensor weak references (pytorch#9363)
  Nuke TestCollectEnv (pytorch#9459)
  Add test case for segmentation fault fix in grad_fn (pytorch#9457)
  Add peephole optimization for type_as operators. (pytorch#9316)
  Fix out-of-range error for test_neg (pytorch#9431)
  add depthwise conv support for mkldnn (pytorch#8782)
  Refactor `_log_sum_exp` (pytorch#9173)
  Add ModuleDict and ParameterDict containers (pytorch#8463)
  Introduce SupervisedPtr, delete THAllocator and THCDeviceAllocator (pytorch#9358)
  Introducing IsInf (pytorch#9169)
  add device to CUDAEvent (pytorch#9415)
  Make localScalar error message more intuitive (pytorch#9443)
  Only accept continguous tensors in TopK for cuda (pytorch#9441)
  Add support for .norm() pytorch onnx export and ReduceL1/ReduceL2 caffe2 operators (pytorch#9299)
  Only view() rhs of index_put if we need to (pytorch#9424)
  Add BatchBucketizeOp in caffe2 (pytorch#9385)
  Implementation of Wngrad optimizer caffe2 python wrapper and unit test on least square regression (pytorch#9001)
  Implementation and operator test for Wngrad optimizer (pytorch#8999)
  Fix segmentation fault in grad_fn (pytorch#9292)
  update docs (pytorch#9423)
  ...
goldsborough pushed a commit to goldsborough/pytorch that referenced this pull request Jul 20, 2018
Summary:
Fixes: pytorch#9421

I don't think it is easy to deal with non-contiguous array in cuda topk, so I'm adding a check.
The argument number is a bit confusing when it shows in PyTorch but it is consistent with the other checks. (Not sure whether it would make sense to eliminate argument numbers from the error TH/THC error messages given that they're probably off more than once...)

Do we need a test that it indeed refuses non-contiguous?
Pull Request resolved: pytorch#9441

Reviewed By: soumith

Differential Revision: D8850719

Pulled By: ezyang

fbshipit-source-id: d50561bb37ed50ab97aeaf54d8e3fc6c765bdc7c
jramseyer pushed a commit to jramseyer/pytorch that referenced this pull request Jul 30, 2018
Summary:
Fixes: pytorch#9421

I don't think it is easy to deal with non-contiguous array in cuda topk, so I'm adding a check.
The argument number is a bit confusing when it shows in PyTorch but it is consistent with the other checks. (Not sure whether it would make sense to eliminate argument numbers from the error TH/THC error messages given that they're probably off more than once...)

Do we need a test that it indeed refuses non-contiguous?
Pull Request resolved: pytorch#9441

Reviewed By: soumith

Differential Revision: D8850719

Pulled By: ezyang

fbshipit-source-id: d50561bb37ed50ab97aeaf54d8e3fc6c765bdc7c
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
Summary:
Fixes: pytorch#9421

I don't think it is easy to deal with non-contiguous array in cuda topk, so I'm adding a check.
The argument number is a bit confusing when it shows in PyTorch but it is consistent with the other checks. (Not sure whether it would make sense to eliminate argument numbers from the error TH/THC error messages given that they're probably off more than once...)

Do we need a test that it indeed refuses non-contiguous?
Pull Request resolved: pytorch#9441

Reviewed By: soumith

Differential Revision: D8850719

Pulled By: ezyang

fbshipit-source-id: d50561bb37ed50ab97aeaf54d8e3fc6c765bdc7c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.topk() returns incorrect values + indeces on non-contiguous tensors (CUDA)

4 participants