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

Problems using breze with GPU #40

Closed
makarl opened this issue Apr 24, 2014 · 6 comments
Closed

Problems using breze with GPU #40

makarl opened this issue Apr 24, 2014 · 6 comments

Comments

@makarl
Copy link
Contributor

makarl commented Apr 24, 2014

when using breze with theano using the GPU the program crashes in breze.arch.util.Model._unify_exprs(self, exprs) with the error raise ValueError("length not known")

this happens because exprs is not of the type theano.tensor.basic.TensorVariable but of the type theano.sandbox.cuda.var.CudaNdarrayVariable.

_unify_exprs then tries to iterate trough exprs, which results in raising the raise ValueError("length not known") exception

im using cudamat from http://code.google.com/p/cudamat/
and gnumpy from http://www.cs.toronto.edu/~tijmen/gnumpy.html

adria-p added a commit that referenced this issue Apr 24, 2014
Proposal for a fix for issue #40
@makarl
Copy link
Contributor Author

makarl commented Apr 25, 2014

additional to your fix i needed to add
if isinstance(expr, theano.sandbox.cuda.var.CudaNdarrayVariable):
return expr
inside breze.arch.util.cpu_expr_to_gpu to to catch the case when the expression is already a Gpu expression

its now working!
thank you all

@bayerj
Copy link
Contributor

bayerj commented Apr 25, 2014

Can someone please add a summary of this as a comment on top of this code?
I can then merge it.

On 25 April 2014 12:57, makarl [email protected] wrote:

additional to your fix i needed to add
if isinstance(expr, theano.sandbox.cuda.var.CudaNdarrayVariable):
return expr
inside breze.arch.util.cpu_expr_to_gpu to to catch the case when the
expression is already a Gpu expression

its now working!
thank you all


Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-41380802
.

Dipl. Inf. Justin Bayer
Lehrstuhl für Robotik und Echtzeitsysteme, Technische Universität München
http://www6.in.tum.de/Main/Bayerj

@makarl
Copy link
Contributor Author

makarl commented Apr 25, 2014

I just added a merge request, don't know how to connect it to this conversation

@makarl
Copy link
Contributor Author

makarl commented Apr 25, 2014

please do not merge it right now, I want to make some tests to be really sure everything works fine

@bayerj
Copy link
Contributor

bayerj commented May 3, 2014

Is #42 fixing this?

@makarl
Copy link
Contributor Author

makarl commented May 3, 2014

It's now working for my network, but it's extremely slow, like ten times compared to the CPU version.
Additionally you will need fix #43, since lbfgs can't handle gnumpy scalars. I set numpy_result to True only for loss functions. Is this the correct way ?

@bayerj bayerj closed this as completed in 4a918a9 Oct 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants