简体   繁体   中英

Theano: mixing CPU and GPU?

I built a neural network which needs to use the Cholesky decomposition and solve triangular systems as part of its computation. This means that I also need to compute the gradients of the whole computation, of course.

When I try to compile the code I get the error "No Cula available". Unfortunately, I can't download Cula from the website .

I was wondering if it's possible to mix CPU and GPU with theano. The matrices I need to use Cholesky and Solve on are small (100x100) so I could do that part on the CPU. To do so, though, I'd need to transfer the matrices to the CPU right after they've been computed by the GPU and then send the result back to the GPU. Is it possible to do this transparently enough?

This transfer is transparent. No need to do something special. But I would recommand that you profile the Theano graph, just to be sure: http://deeplearning.net/software/theano/tutorial/profiling.html#tut-profiling

For cula, There is a PR that give a solve op based on cusolver now provided by NVIDIA. So this is probably not needed anymore. Try this PR: https://github.com/Theano/Theano/pull/4917

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM