pytorch_scatter icon indicating copy to clipboard operation
pytorch_scatter copied to clipboard

scatter_median?

Open justanhduc opened this issue 2 years ago • 4 comments

Hi. I need a scatter_median and am trying to develop based on your wonderful CUDA implementations. However, afaik all scatter methods here use atomic update, while to get median, it needs to gather and sort (or is there any way I'm not aware of?), which is not very straight forward to me how I can utilize your codes. Do you have any suggestion regarding this problem? Thanks alot!

justanhduc avatar Jul 17 '21 08:07 justanhduc

You are right that this is not straightforward to add as a scatter operation, since each thread will process entries in isolation. This is probably best implemented as a segment_csr kernel, in which the indices pointing to the same output are ordered, see here.

rusty1s avatar Jul 18 '21 08:07 rusty1s

Thanks for the suggestion. I will check it out.

justanhduc avatar Jul 19 '21 03:07 justanhduc

@justanhduc are you ready with this feature ? Can I try it ? I am in dire need of this feature! Best of luck ! @rusty1s As per now is there any other hack to get scatter_median output, without doing cpp ? I can think of a one but it will require me to convert sparse graph to dense matrix.

aGIToz avatar Aug 29 '21 20:08 aGIToz

This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?

github-actions[bot] avatar Feb 26 '22 01:02 github-actions[bot]

Check out Fast k-Selection Algorithms for Graphics Processing Units TOLU ALABI, JEFFREY D. BLANCHARD, BRADLEY GORDON, and RUSSEL STEINBACH 12acm-alabi.pdf

guicho271828 avatar Apr 06 '23 09:04 guicho271828

We also have an implementation of this directly in PyG, see here.

rusty1s avatar Apr 06 '23 15:04 rusty1s