Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try new rand(Float32) in kernel #7

Closed
simsurace opened this issue Mar 21, 2021 · 6 comments · Fixed by #14
Closed

Try new rand(Float32) in kernel #7

simsurace opened this issue Mar 21, 2021 · 6 comments · Fixed by #14
Labels
enhancement New feature or request

Comments

@simsurace
Copy link
Collaborator

So this rand is basically an alternative to the GPUArrays.gpu_rand?

This is rand from Random, made compatible by redefining default_rng on the device and using our own RNG. So yes, this is definitely the path forward, but we'll obviously have to flesh out the implementation by making sure the necessary APIs are GPU compatible and either overriding more calls or extending the RNG.

Originally posted by @maleadt in JuliaGPU/CUDA.jl#772 (comment)

@simsurace simsurace added the enhancement New feature or request label Mar 21, 2021
@simsurace simsurace changed the title Try new rand() in kernel Try new rand(Float32) in kernel Mar 24, 2021
@simsurace
Copy link
Collaborator Author

@maleadt Just to let you know: I just tried the implementation of rand from CUDA.jl/#772 to replace the GPUArrays.gpu_rand(Float32, CUDA.CuKernelContext(), randstates) by rand(Float32) everywhere in my kernel kernel_BTRS. The resulting speed is almost identical (if slightly faster) using the new function. Note that in Julia 1.5 and using the GPUArrays sampler, the speed is quite a bit faster issue #8.

@maleadt
Copy link
Member

maleadt commented Mar 24, 2021

That's good, although the memory usage of the new implementation will be (much) larger for now. I plan to revisit it before releasing CUDA 3.0 though. The performance difference with 1.5 is a problem, would be good if you could reduce to something I can have a look at 🙂

@simsurace
Copy link
Collaborator Author

Yes, I will look into that and provide a minimal example!

@maleadt
Copy link
Member

maleadt commented Mar 24, 2021

Awesome, thanks.

@simsurace
Copy link
Collaborator Author

simsurace commented Mar 25, 2021

@maleadt See comment on issue #8

@simsurace
Copy link
Collaborator Author

Still not fully functional, see JuliaGPU/CUDA.jl#788 (comment)

@simsurace simsurace reopened this Apr 1, 2021
@simsurace simsurace linked a pull request May 4, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants