-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Release the GIL whenever possible #1512
Comments
In original experiments by @cowlicks we were only able to get a 30% increase when using canny edge detection in multiple threads. I/O wasn't an issue so we assumed that the GIL was to blame. A case study of removing the GIL and using |
Yes, please--any energy going to this is good, because we have been very bad on this front. |
Commenting so I get emails from this thread, sorry for the noise. |
Is there anyone who has Airspeed Velocity set up? It would be quite useful at this point. https://github.com/spacetelescope/asv/ @yarikoptic, any advice? |
@stefanv using asv reliably needs a dedicated server, in my understanding, so that the benchmarks are comparable across timepoints. (I have not yet tried this myself.) I met someone at MPUG (Melbourne Python Users Group) who has been playing around with asv. I've pinged him over email because I don't know his Github handle. He might be able to contribute here! |
Perhaps the astropy team would be willing to help, @cdeil? |
Happy to contribute here. I played around a bit with asv but as noted in the talk from scipy 2014 the benchmarks are tied to the particular machine and software. Next is the benchmarks you want to run. This is the repo with benchmarks from astropy using asv. The setup is straightforward and it just comes down to defining which benchmarks and which test matrix you want. Seems scikit-bio wants to start using asv as well. |
@koenvb happy to share our experience setting up asv if you have any questions. It's a great project and pretty straight forward to set up, but there are definitely some subtleties, and the operation can be a bit opaque and difficult to debug when something goes wrong. |
I've only played around with asv. For Astropy it's @mdboom and @astrofrog that have the most experience with asv and I think are running cron jobs to continuously run asv. Yes, you need to find a dedicated machine to run the benchmarks. But that can come later, getting familiar with asv and implementing a useful set of benchmarks can come first. You also need to discuss a bit about what kind of benchmarks you want and how they can be helpful to you without taking too much time to implement and run and then review and discuss the results. The main aspect of asv is that it runs the same benchmark for many commits in your repo, so you'll mainly learn something useful if there's a change in performance, i.e. a regression or improvement. |
Probably most of you are familiar with the GIL, but I felt the need to learn more about it. I found this article well done, with an enlightening video. http://lbolla.info/blog/2013/12/23/python-threads-cython-gil |
Closed by #1519 |
Well that was fast! |
From discussion in #1493, @mrocklin pointed out the many benefits of releasing the GIL for parallelization/serialization.
For many of our Cython files and functions this would be as simple as wrapping contents in a
with nogil:
blockOpening as a separate issue to facilitate discussion.
The text was updated successfully, but these errors were encountered: