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

Speed up GPU computation on EI & gradEI #297

Closed
jialeiwang opened this issue Jul 15, 2014 · 0 comments · Fixed by #351
Closed

Speed up GPU computation on EI & gradEI #297

jialeiwang opened this issue Jul 15, 2014 · 0 comments · Fixed by #351

Comments

@jialeiwang
Copy link
Contributor

The original GPU implementation is slow, which is due to both malloc and operating on global memory for normal random numbers. To make the improvement, we should not use malloc for each thread, instead, we create shared memory within each block to hold random numbers, and let threads within that block read/write random numbers stored in shared memory.

The other potential improvement is instead of copying (no_of_blocks * no_of_threads) EI or grad_EI from GPU to CPU and averaging them, we can average them on GPU and then simply copy a single piece of EI or grad_EI back to CPU. This improvement has been proven to be negligible for reasonable large q and p(q=4, p=4). We might need to look back again to see if this improvement is worth to implement for large q,p.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant