-
Notifications
You must be signed in to change notification settings - Fork 32
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
Thread scalability is suboptimal #38
Comments
Recent changes in master do parallelize more things and scalability is not as bad as reported anymore. pygbm tend to stay close to 1.5 of the duration of lightgbm at worst. |
@ogrisel would it be worth taking a look with the new parallel diagnostics output http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics to check what is/isn't parallelized? |
Thanks for the feedback @stuartarchibald. This code does many calls to several jitted functions. Is there a way to get all the diagnostic reports for all the functions jitted by numba at the end of the benchmark script? |
Would setting the |
Thanks, this is exactly what I was looking for. Sorry for not reading the doc carefully enough. |
Actually what we really need is to do 2 runs under a profiler, one with It's also possible that we have a function in the critical path that is not parallelized at all for some reason. |
I think this is related numba/numba#3438, as setting the thread count to one is not the same as just switching parallelism off (parallel transformations and scheduling still take place). There are potentially cases where adding more than one thread causes the code to slow down (parallel kernels with negligible per-thread work, but all the overhead of scheduling), and further kernels which cost more to schedule and execute on a thread than to just use the executing thread to run them. |
I did a quick bench on the current master on a machine with many cores (without profiling for now):
Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz with 2x10 physical cores. This is not the same machine as previously but the scalability is still sub-optimal, so doing the profiling effort is required to understand where are the scalability bottlenecks. |
@ogrisel You can apply for a free Intel VTune license for profiling your code if you do research. It will be much better than the numba profiler. |
@Laurae2 I'm not sure what the "numba profiler" is, please could you clarify?! Numba has a built in parallel diagnostics tool which tracks transforms made to it's own IR of the Python source as it converts serial code to parallel code, but that's a compile-time diagnostic tool not a performance profiler. Further, Numba 0.41.0 JIT profiling works with Intel Vtune, set the |
@stuartarchibald You can use the numba profiler here: https://github.com/numba/data_profiler (it just adds the signatures in reality). Incurs overhead penalty. Still better to use Intel VTune for real profiling though (way more details and easier to pinpoint the issues). |
@Laurae2 Ah, so that's what you are referring to, thanks. Yes, indeed, they have different purposes... |
@ogrisel Note that LightGBM number of threads scale with the number of columns. Higgs dataset does not have enough columns for 48 threads (it will underestimate the scalability which gives you a lower scaling target). |
As reported in #30 (comment) , the scalability of pygbm is not as good as LightGBM.
Here are some results on a machine with the following CPUs:
Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz: 2 sockets each with 12 cores each which means 48 hyperthreads in total.
1 thread (sequential)
8 threads
48 (hyper)threads
All of those pygbm runs used numba 0.40 from anaconda using the tbb backend (which is the fastest for pygbm).
The text was updated successfully, but these errors were encountered: