-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Python-only platform-independent build of NuPIC? #1302
Comments
@breznak Very interesting proposal! I think this should be very possible with some work. There are some classes that call some C++ routines such as random number generation, and faster sparse matrix operations. We would need to create a pure python version of those. Not sure how the build system would work, as we would presumably want to support both options? |
💯 I was planning just suggest that, @breznak !! As we would have some work, we already could write it using OO approach.. This would improve performance on NuStudio, because it could use inherited classes from NuPIC in addition to NuPIC become Windows-friendly, because it wouldn't have C++ stuff. |
@subutai @rhyolight This pure python version also could solve this : #1246 among other issues. I think that NuPIC Python and NuPIC C++ should be independent in code but dependent in concept. I mean that both should follow the same model/specification but NuPIC Python focusing on simplicity and NuPIC C++ on performance. |
@david-ragazzi Even if we have a pure Python version of NuPIC, we still need to have a python + C++ version - the latter will be much faster than a pure python version. As such, I don't think we can avoid the pip/build issues. |
Yeah, but do you mean that this |
regarding the build process, yes, I think we should support both options, and agree that this pure python is more of a last resort for unsupported environments (due to speed). We already have a switch for building with or w/o swig, so I imagine changing the Cmake that if it's called with something like @david-ragazzi 👍 while I'm usually in favor for OOP changes, I hope this one could be a quickie with minimal work needed to be rewritten. |
I understand your concern.. We could first have a version working well without swig, and then convert it to OO later.. |
This is the gap I feel the Java version fills. It will be just as performant as the c++ version (for longer running processes due to cutting edge run time tech); be more mobile than any platform; easily installed in a blink of an eye; and reach more developers and have a greater accessibility in terms of ease-of-comprehension than any other platform. Respectfully, NuPIC really should have had a Java offering in the first place I feel. David
|
Yeah, basically what @breznak said. We would have two build options: one that would keep the current way plus another one for a pure python implementation. |
👍 It's ok for me (supposing that we should remove any implementation of SP and TP from it and put into to pure python implementation.. The current implementation should be only a binding of NuPIC C++.. |
Have someone working to remove sparse matrix from Python? If so we could remove If this happen, we will have only 2 bindings:
Remember that |
Please see this: #1728 Probably PyPy will help us with removal of C++ bindings without a traumatic loss of performance! |
Did this ever go anywhere? What would need to be done? Where can the code be found? With January 1, 2020 around the corner (the EOL date for CPython 2.x), it's sounding pretty nice. It seems that being pure python, it could run on pypy, which might approach C++ for performance. There's also the possibility of writing some portions of the pure python in cython. I've had some success in the past writing a single foo.m4 that can be used to automatically generate foo.py and foo.pyx. |
I got to know, but never actually tried, that nupic has dual implementation of the classes - in python and c++ (where c++ is not complete yet).
So, would it be possible to build nupic with python-only version? (without swig, w/o dependency on nupic.core)
This would make it truly OS-independent (at the speed cost) and could help eg. people waiting on numenta/nupic.core-legacy#103
The text was updated successfully, but these errors were encountered: