-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Using PyMC3 on the GPU #1246
Comments
This error is strange. Can you update Theano to the dev version? It look like the reshape is upcasting the float32 to float64 when it On Mon, Jul 18, 2016 at 9:29 AM, Thomas Wiecki notifications@github.com
|
Just updated to |
0.7.0.dev... is very old. Can you update to 0.9.0.dev2? On Mon, Jul 18, 2016 at 3:38 PM, Thomas Wiecki notifications@github.com
|
Identical error on '0.9.0dev2.dev-d5944c965c453558ef834b439b671e0c01530b3c' |
@nouiz Any idea on what might be causing the error on most recent theano? |
Isn't the problem that the Metropolis sampler updates some of the variables A quick fix might just be adding On Thu, Jul 21, 2016 at 3:27 PM, Thomas Wiecki notifications@github.com
|
@fhuszar Interesting, I'll look into that. I suppose proposals should take either the type of the RV, or the type or floatX. |
Yes, but I think if the theano function has allow_input_downcast it should automatically figure that out. - I think |
allow_input_downcast to theano.function() only work on the input to the On Thu, Jul 21, 2016 at 10:58 AM, Ferenc Huszar notifications@github.com
|
If you use GPU in theanorc then all nodes in the company graph will be Also, ideally the random number generation, leapfrog step, metropolis On Thursday, 21 July 2016, Frédéric Bastien notifications@github.com
|
@fhuszar You are certainly correct that that's the issue. I did some manual down-casting in The leapfrog steps and metropolis updates are already happening in theano I believe (but could be wrong). The random number generation however is not, that would probably be a better fix. Could you be a bit more specific what would need to change? |
Another issue preventing running on the GPU is the _psi C function in distributions/special.py, which is missing the // For GPU support
#ifdef __CUDACC__
#define DEVICE __device__
#else
#define DEVICE
#endif
#ifndef _PSIFUNCDEFINED
#define _PSIFUNCDEFINED
DEVICE double _psi(double x){ Perhaps PyMC3 should use Theano's Psi instead? |
@magnushiie Thanks for the pointer, can you point to where in the theano code that is? Should definitely use that. |
Supported by JAX. |
Most input provided by @fhuszar.
It seems there are at least two blockers of using pymc3 on the gpu. The first one is incompatilibty with
float32
dtype. Here is an example model:Output:
Not sure where the
float64
dtype comes in. @nouiz any ideas?The second problem is related to #566 and should have a simple solution of only setting the test value behavior in the model context.
The text was updated successfully, but these errors were encountered: