[Python] release/acquire Global Interpreter Lock (GIL) #2230
Open
tnarihi wants to merge 10 commits intoBVLC:masterfrom
Open
[Python] release/acquire Global Interpreter Lock (GIL) #2230tnarihi wants to merge 10 commits intoBVLC:masterfrom
tnarihi wants to merge 10 commits intoBVLC:masterfrom
Conversation
Now we can keep the exception information on Python interpreter. This is usefull if you are working on Python interface. You can catch the right Exception class when error occurs in your `PythonLayer`. Now we don't use `PyErr_Print` that clears exceptions. We use `PyErr_Fetch` to get the information and `PyErr_Restore` to restore the exceptions back. And I find that `bp::import` or `bp::object::attr` breaks Python interpreter if a module or an attribute doesn't exist. We now use `bp::exec` and `bp::eval` to keep Python interpreter working even after errors occur. I got the hint from the following page. http://boost.2283326.n4.nabble.com/embedded-python-td2702335.html And I also modified to use `bp::object` for `self_` member.
* Modified Makefile to link boost_regex for PythonLayer. * Travis installs boost_regex * Add a note of a new dependency boost_regex on Makefile.config.example
LayerParamter methods not to use raw_function
Layer methods not to use raw_function
Conflicts: python/caffe/_caffe.cpp
|
Any progress on this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dependencies: #2149 #2001
The final commit only mentions this PR. This releases GIL in CPU-intensive operation in C++ side such as
ForwardandBackward. This will allow us, for example, to prefetch in data layers in Python using a different thread (not process) while other layers are running.