You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does anyone have an implementation of std and var yet? Otherwise I'll have a go next week.
Afaict, we can't use THCudaTensor_reduceDim so we'll need something custom (but with a similar structure as reduceDim).
@soumith For reductions along a single dimension, we still have the restriction that the tensor must not have more than 4 dimensions. Did you say you're working on a fix for that? If so, what's the progress on it?
If you're not working on it, we could easily change the code to what we do for std and var, where there's no restriction on dimensionality at all.
@wickedfoo already has PR for that internally. Its all implemented. I'm on
vacay till 26th, so I will sync those changes at the end of this month.
On Feb 19, 2015 4:34 PM, "Dominik Grewe" notifications@github.com wrote:
@soumithhttps://github.com/soumith For reductions along a single
dimension, we still have the restriction that the tensor must not have more
than 4 dimensions. Did you say you're working on a fix for that? If so,
what's the progress on it?
If you're not working on it, we could easily change the code to what we do
for std and var, where there's no restriction on dimensionality at all.
Reply to this email directly or view it on GitHub #70 (comment).
His PR is for apply (and apply2) along an arbitrary dimension. Not reductions. It generalizes the copy kernels and changes all the tensor math to use these apply kernels where appropriate instead of make contiguous + thrust
For gather, which I suddenly realize could be useful for implementing ClassNLLCriterion.forward, without needing a custom kernel, I guess?, I suppose a simple naive first-cut could be:
use the isContiguous (toContiguous? asContiguous?) method to convert the tensor to contiguous format
simply assign one thread to each output location, and I dont think we need any local memory or anything right? So, just throw everything into warp-size blocks and it's basically done?
Does that sound about right? Anything else I should bear in mind if I write a naive gather along these lines? (I'll be targeting cltorch I confess, but it's quite easy to convert cutorch<->cltorch kernels I think?)
(Edit: what do you think is the most similar existing class/kernel to base this off? and/or thoughts on where to put this, ie filename(s)?)
One of my colleagues @SamGross is working on it by interfacing the magma cuda library. It'll happen over the next month or so when he finishes it up and sends a PR.
Magma looks cool. Has opencl version too it seems :-)
Is there any update on adding these functions? I'm in need of the cross product on cudatensors.
I can code it up if someone can point me towards the things that need to be done. All the layers I've written so far are on the lua side and I'm not sure how to make the connection between cuda and lua. Thanks!
Activity
clementfarabet commentedon Nov 8, 2014
Hey @soumith , so running
cutorch.test()currently reports errors oncumsumandcumprod(missing). That's on purpose?soumith commentedon Nov 8, 2014
Yes they are yet to be implemented on cutorch. I'll get to that next week. They can be done with a thrust:: scan
clementfarabet commentedon Nov 8, 2014
Ok cool.
On Sat, Nov 8, 2014 at 12:27 PM, Soumith Chintala notifications@github.com
wrote:
dominikgrewe commentedon Jan 3, 2015
Does anyone have an implementation of std and var yet? Otherwise I'll have a go next week.
Afaict, we can't use
THCudaTensor_reduceDimso we'll need something custom (but with a similar structure as reduceDim).soumith commentedon Jan 3, 2015
no, do not have it. this has been long overdue, but we should co-ordinate these, let me email you guys.
dominikgrewe commentedon Jan 20, 2015
Any progress on cumsum and cumprod?
soumith commentedon Jan 20, 2015
have not started them yet!
dominikgrewe commentedon Jan 20, 2015
Okay, I might have a go soon then, because we'd like to use it. Just waiting for the THCState PR to be merged.
soumith commentedon Jan 21, 2015
I will merge the THCState PR on Friday. All the patches have been prepared except for fbcunn, working on that as well.
dominikgrewe commentedon Feb 19, 2015
@soumith For reductions along a single dimension, we still have the restriction that the tensor must not have more than 4 dimensions. Did you say you're working on a fix for that? If so, what's the progress on it?
If you're not working on it, we could easily change the code to what we do for std and var, where there's no restriction on dimensionality at all.
soumith commentedon Feb 19, 2015
@wickedfoo already has PR for that internally. Its all implemented. I'm on
vacay till 26th, so I will sync those changes at the end of this month.
On Feb 19, 2015 4:34 PM, "Dominik Grewe" notifications@github.com wrote:
soumith commentedon Feb 19, 2015
His PR is for apply (and apply2) along an arbitrary dimension. Not reductions. It generalizes the copy kernels and changes all the tensor math to use these apply kernels where appropriate instead of make contiguous + thrust
soumith commentedon Feb 19, 2015
That's the status on that. He did not work yet on arbitrary reductions. If you want to tackle that, go for it.
dominikgrewe commentedon Feb 19, 2015
Thanks for the update. I'll have a go at the reductions kernel then.
Looking forward to the apply kernels!
25 remaining items
dominikgrewe commentedon Jun 15, 2015
That's right. I meant to do it, but haven't had the time yet, sorry.
hughperkins commentedon Jun 23, 2015
For
gather, which I suddenly realize could be useful for implementing ClassNLLCriterion.forward, without needing a custom kernel, I guess?, I suppose a simple naive first-cut could be:toContiguous?asContiguous?) method to convert the tensor to contiguous formatDoes that sound about right? Anything else I should bear in mind if I write a naive
gatheralong these lines? (I'll be targeting cltorch I confess, but it's quite easy to convert cutorch<->cltorch kernels I think?)(Edit: what do you think is the most similar existing class/kernel to base this off? and/or thoughts on where to put this, ie filename(s)?)
hughperkins commentedon Jun 23, 2015
Magma looks cool. Has opencl version too it seems :-)
hughperkins commentedon Jun 23, 2015
Here is a
gatherimplementation. It's not very tested yet..hughperkins commentedon Jun 24, 2015
Shoe-horned the lua wrapper into TensorMath.lua: hughperkins/cltorch@0e469f4
hughperkins commentedon Jun 24, 2015
Did scatter too, since seems like more of the same?
(Edit: and scatterFill, in same files)
abyravan commentedon Feb 23, 2016
Is there any update on adding these functions? I'm in need of the cross product on cudatensors.
I can code it up if someone can point me towards the things that need to be done. All the layers I've written so far are on the lua side and I'm not sure how to make the connection between cuda and lua. Thanks!
soumith commentedon Feb 28, 2016
@abyravan i could get to cross next week.
abyravan commentedon Feb 28, 2016
That would be great. Thanks a lot! Is there any sort of a tutorial or howto on adding new functionality for tensors? Would be useful to have :)
soumith commentedon Feb 28, 2016
You can look at existing PRs that are cross-linked in this thread.
Like:
#120
#96
#75
soumith commentedon Feb 28, 2016
nonzero is being implemented by FB, should be out in a few days.
cutorch
pvtokmakov commentedon Jun 26, 2017
Hi guys,
any hope on implementing the conv2 (or xcorr2 for that matter)?
ethanluoyc commentedon Aug 15, 2017
Just adding a note that
eyehas been implemented here pytorch/pytorch#2395sjain-stanford commentedon Dec 22, 2017
Thanks for supporting many of the math functions in
THC. I'm now waiting forhistc!