Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Extend accumulate! #68

Closed
vchuravy opened this issue Apr 5, 2018 · 5 comments
Closed

Extend accumulate! #68

vchuravy opened this issue Apr 5, 2018 · 5 comments

Comments

@vchuravy
Copy link
Member

vchuravy commented Apr 5, 2018

CuArrays has accumulate!, but it's limited: does not support anything but vectors, does not support the init keyword, and is slow (should use the shmem/shfl optims from https://github.com/JuliaGPU/CUDAnative.jl/blob/master/examples/scan.jl)

Old post:

@dpsanders and I just run into the situation where we wanted to do a cumsum on a CuArray.

CUDAnative has it as a example, but we should probably add the functionality to CuArrays https://github.com/JuliaGPU/CUDAnative.jl/blob/master/examples/scan.jl

@vchuravy vchuravy self-assigned this Apr 5, 2018
@maleadt
Copy link
Member

maleadt commented Apr 6, 2018

Maybe as a higher-order scan(f, ..; inclusive=true) function?

@dpsanders
Copy link
Contributor

dpsanders commented Feb 15, 2019

I have a simple and naive version of cumsum working. I can turn this into a version of accumulate!. Should I add this as a PR here?

@maleadt
Copy link
Member

maleadt commented Feb 15, 2019

Yes that would be nice! Is it based on the CUDAnative example?

@maleadt maleadt changed the title Support accumulate! Extend accumulate! Feb 22, 2019
@ali-ramadhan
Copy link

Happy to help work on this and contribute an efficient scan implementation.

I'm particularly interested in an efficient non-destructive mean(c, dims) where c is a non-contiguous view as it currently devolves into scalar operations.

The scan example seems to overwrite the array. I guess to make a non-destructive version you would take the work-efficient and accumulate into a temporary array?

Currently mean is pretty fast but I couldn't figure out how it's implemented.

@maleadt
Copy link
Member

maleadt commented Oct 14, 2019

Fixed by #447

@maleadt maleadt closed this as completed Oct 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants