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

Make Theano support more different Production setup #2271

Open
nouiz opened this Issue Nov 19, 2014 · 9 comments

Comments

Projects
None yet
5 participants
@nouiz
Member

nouiz commented Nov 19, 2014

This is a meta ticket with links to other tickets that would make Theano support more different production setup. Theano can already be used in different production setup.

  • See this page with information: https://github.com/Theano/Theano/wiki/Servers
  • Make Theano function threads safe gh-2186
  • Generate a shared library per function that can be used from other non-python program: gh-2722.
    • Remove the NumPy and Python dependency from the library gh-2260
  • Have a "production mode" for theano which removes most asserts and checks for errors gh-3441

How to for Theano in server mode:

  • Using Theano in a server can be done.
    • In the VM/container, you still need g++ do be available. Make sure you compile the Theano function in the golden image. That way the c code will be reused in all clone of the VM/container.
    • To speed up the compilation, pickle and unpickle your Theano function in the same environment it will be used. With recent Theano version, this will skip the optimization phase. This don't allow to change cpu vs gpu computation and don't always support changing Theano version.

There is some examples somewhere of how to make call a Theano function from C via the Python C interface.

@cancan101

This comment has been minimized.

cancan101 commented Nov 20, 2014

An example where this might be interesting would be if there is ever a Metal backend for Theano, running on iOS. I don't know the feasibility of running a Python interpreter on iOS, but my hunch is that would be difficult.

@nouiz

This comment has been minimized.

Member

nouiz commented Nov 20, 2014

I just found this for python on iOS:

http://pythonforios.com/

So it is probably not too hard.

On Thu, Nov 20, 2014 at 12:36 PM, Alex Rothberg notifications@github.com
wrote:

An example where this might be interesting would be if there is ever a
Metal
https://developer.apple.com/library/ios/documentation/Miscellaneous/Conceptual/MetalProgrammingGuide/Compute-Ctx/Compute-Ctx.html#//apple_ref/doc/uid/TP40014221-CH6-SW3
backend for Theano, running on iOS. I don't know the feasibility of running
a Python interpreter on iOS, but my hunch is that would be difficult.


Reply to this email directly or view it on GitHub
#2271 (comment).

@cancan101

This comment has been minimized.

cancan101 commented Nov 20, 2014

@abergeron

This comment has been minimized.

Member

abergeron commented Nov 21, 2014

For Metal, I could see that working as an additional libgpuarray backend. It presents something close to the OpenCL pipeline to the user so it might be workable.

However I have exactly zero time to be working on that right now, so it will be either somebody else or much later.

@pranavsubramani

This comment has been minimized.

pranavsubramani commented Dec 14, 2016

Hey, I was just wondering if there was any update on this issue? Theano production would be really interesting especially for organizations looking to run Theano models on a server.

@nouiz

This comment has been minimized.

Member

nouiz commented Dec 16, 2016

@pranavsubramani

This comment has been minimized.

pranavsubramani commented Dec 16, 2016

Ah okay thanks :)

@ferrouswheel

This comment has been minimized.

ferrouswheel commented Dec 17, 2016

@nouiz Is there documentation somewhere that demonstrates this?

While I enjoy using Theano and related projects for research, the deployment story seemed awkward enough that I go with other frameworks.

Ideally the server deployed to shouldn't need a compiler and could be disabled from trying to compile anything, instead raising an Exception that the generated libraries are out of date.

(Sorry if this already exists or is explained somewhere else!)

@nouiz

This comment has been minimized.

Member

nouiz commented Dec 20, 2016

I updated the descriptions with more information and a link to other documentation. For pickle, it is simple:

import cPickle
f = theano.function(...)
with fd as open("fct.pkl", 'w'):
    cPickle.dump(f, fn, -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment