Discussion:
[theano-users] Theano sort - new GPU implementation
Victor Campmany
2017-06-14 20:01:00 UTC
Permalink
Hi,

We are planning to implement a new GPU accelerated sorting algorithm. We'd
like to know which are the most frequent sorting cases that you guys use
and the data sizes you are dealing with. For example, sorting a large 1d
array, sorting a given axis of a tensor or minibatch, or any other type of
sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Adam Becker
2017-06-15 00:47:41 UTC
Permalink
I'd prefer a gpuarray implementation with similar interface as numpy:

gpuarray.sort(arr, [axis=-1], [kind='radixsort'], [order='inc'])

Deep Learning folks would need a fast batched version, especially float32 /
int32 tensors on GPU. But anyway there should be a general algorithm deals
with all cases, never know what kind of model would come up in future.
Post by Victor Campmany
Hi,
We are planning to implement a new GPU accelerated sorting algorithm. We'd
like to know which are the most frequent sorting cases that you guys use
and the data sizes you are dealing with. For example, sorting a large 1d
array, sorting a given axis of a tensor or minibatch, or any other type of
sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Victor Campmany
2017-06-15 02:03:03 UTC
Permalink
The implementation would be for *Gpuarray*, not Theano, I mixed things up
sorry.
Post by Adam Becker
gpuarray.sort(arr, [axis=-1], [kind='radixsort'], [order='inc'])
Deep Learning folks would need a fast batched version, especially float32
/ int32 tensors on GPU. But anyway there should be a general algorithm
deals with all cases, never know what kind of model would come up in
future.
Post by Victor Campmany
Hi,
We are planning to implement a new GPU accelerated sorting algorithm.
We'd like to know which are the most frequent sorting cases that you guys
use and the data sizes you are dealing with. For example, sorting a large
1d array, sorting a given axis of a tensor or minibatch, or any other type
of sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frédéric Bastien
2017-06-19 22:16:26 UTC
Permalink
Adam, what input shapes do you do sort on right now? What axis?

This is to help to know which car to optimize.

Fred
Post by Victor Campmany
The implementation would be for *Gpuarray*, not Theano, I mixed things up
sorry.
Post by Adam Becker
gpuarray.sort(arr, [axis=-1], [kind='radixsort'], [order='inc'])
Deep Learning folks would need a fast batched version, especially float32
/ int32 tensors on GPU. But anyway there should be a general algorithm
deals with all cases, never know what kind of model would come up in
future.
Post by Victor Campmany
Hi,
We are planning to implement a new GPU accelerated sorting algorithm.
We'd like to know which are the most frequent sorting cases that you guys
use and the data sizes you are dealing with. For example, sorting a large
1d array, sorting a given axis of a tensor or minibatch, or any other type
of sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Adam Becker
2017-06-22 11:15:48 UTC
Permalink
Personally, I needed sorting channel axis of 4D CNN image tensor a while
ago. It's about sorting large batches of short vectors (around 32~128
channels). However this is just a corner case. I don't think I can tell
what kind of sorting most needed.

Just a suggestion, what about posting this thread on some popular place
such as /r/MachineLearning? So people using other frameworks can see this.
Post by Frédéric Bastien
Adam, what input shapes do you do sort on right now? What axis?
This is to help to know which car to optimize.
Fred
Post by Victor Campmany
The implementation would be for *Gpuarray*, not Theano, I mixed things
up sorry.
Post by Adam Becker
gpuarray.sort(arr, [axis=-1], [kind='radixsort'], [order='inc'])
Deep Learning folks would need a fast batched version, especially
float32 / int32 tensors on GPU. But anyway there should be a general
algorithm deals with all cases, never know what kind of model would come up
in future.
Post by Victor Campmany
Hi,
We are planning to implement a new GPU accelerated sorting algorithm.
We'd like to know which are the most frequent sorting cases that you guys
use and the data sizes you are dealing with. For example, sorting a large
1d array, sorting a given axis of a tensor or minibatch, or any other type
of sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Adam Becker
2017-06-30 01:02:08 UTC
Permalink
Has there been any progress? I'm in need of sorted TopK on GPU. I can go
with CPU sort but seems a bit slow.
Post by Victor Campmany
Hi,
We are planning to implement a new GPU accelerated sorting algorithm. We'd
like to know which are the most frequent sorting cases that you guys use
and the data sizes you are dealing with. For example, sorting a large 1d
array, sorting a given axis of a tensor or minibatch, or any other type of
sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Victor Campmany
2017-06-30 01:11:31 UTC
Permalink
We are working on both sorts for 1D arrays and sort of an axis of an
nd-array. We are trying to release it as soon as possible.
Post by Adam Becker
Has there been any progress? I'm in need of sorted TopK on GPU. I can go
with CPU sort but seems a bit slow.
Post by Victor Campmany
Hi,
We are planning to implement a new GPU accelerated sorting algorithm.
We'd like to know which are the most frequent sorting cases that you guys
use and the data sizes you are dealing with. For example, sorting a large
1d array, sorting a given axis of a tensor or minibatch, or any other type
of sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frédéric Bastien
2017-06-30 12:36:36 UTC
Permalink
There is a pr for topk, but it is not sorted. You can use it and keep the
sort on CPU for now. It will be faster like that I think.
Post by Victor Campmany
We are working on both sorts for 1D arrays and sort of an axis of an
nd-array. We are trying to release it as soon as possible.
Post by Adam Becker
Has there been any progress? I'm in need of sorted TopK on GPU. I can go
with CPU sort but seems a bit slow.
Post by Victor Campmany
Hi,
We are planning to implement a new GPU accelerated sorting algorithm.
We'd like to know which are the most frequent sorting cases that you guys
use and the data sizes you are dealing with. For example, sorting a large
1d array, sorting a given axis of a tensor or minibatch, or any other type
of sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Adam Becker
2017-06-30 13:15:16 UTC
Permalink
Well ... actually I opened that PR. I've pushed latest changes on Monday.
I'm guessing it has not been reviewed yet because you guys are too busy?
Post by Frédéric Bastien
There is a pr for topk, but it is not sorted. You can use it and keep the
sort on CPU for now. It will be faster like that I think.
Post by Victor Campmany
We are working on both sorts for 1D arrays and sort of an axis of an
nd-array. We are trying to release it as soon as possible.
Post by Adam Becker
Has there been any progress? I'm in need of sorted TopK on GPU. I can go
with CPU sort but seems a bit slow.
Post by Victor Campmany
Hi,
We are planning to implement a new GPU accelerated sorting algorithm.
We'd like to know which are the most frequent sorting cases that you guys
use and the data sizes you are dealing with. For example, sorting a large
1d array, sorting a given axis of a tensor or minibatch, or any other type
of sorting you come up with.
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...