Repository navigation
[MRG] Adding n_jobs to kernel_approximation.Nystroem - #18545
Conversation
component_indices_ is not needed
thomasjpfan
left a comment
There was a problem hiding this comment.
Thank you for the PR @LaurenzReitsam !
Can you provide a comment with a benchmark script and the corresponding results to see how different values of n_jobs improves performance of Nystroem?
|
@thomasjpfan thanks for the quick review! Here is a benchmark on my local machine: This yield the following results: calculation time with 1 jobs: 26.544 sec The effect is increasing with the size of n_components while fitting. But the bigger impact is in the |
|
How many physical and logical cores do you have on your machine? |
|
@ogrisel 8 physical cores, 16 cores in total. |
ogrisel
left a comment
There was a problem hiding this comment.
LGTM, just a tiny bit of missing doc for this change (see below):
|
There are two levels of parallelism here: OPENBLAS_NUM_THREADS=12calculation time with 1 jobs: 13.170 sec
calculation time with 2 jobs: 11.495 sec
calculation time with 3 jobs: 10.851 sec
calculation time with 4 jobs: 10.451 sec
calculation time with 5 jobs: 10.062 sec
calculation time with 6 jobs: 9.981 sec
calculation time with 7 jobs: 10.075 sec
calculation time with 8 jobs: 10.167 sec
calculation time with 9 jobs: 10.113 sec
calculation time with 10 jobs: 10.014 sec
calculation time with 11 jobs: 10.034 sec
calculation time with 12 jobs: 9.983 secOPENBLAS_NUM_THREADS=6calculation time with 1 jobs: 14.889 sec
calculation time with 2 jobs: 13.382 sec
calculation time with 3 jobs: 12.758 sec
calculation time with 4 jobs: 12.493 sec
calculation time with 5 jobs: 12.334 sec
calculation time with 6 jobs: 12.226 sec
calculation time with 7 jobs: 12.172 sec
calculation time with 8 jobs: 12.212 sec
calculation time with 9 jobs: 12.146 sec
calculation time with 10 jobs: 12.132 sec
calculation time with 11 jobs: 12.093 sec
calculation time with 12 jobs: 12.056 secOPENBLAS_NUM_THREADS=2calculation time with 1 jobs: 25.395 sec
calculation time with 2 jobs: 23.863 sec
calculation time with 3 jobs: 23.167 sec
calculation time with 4 jobs: 22.895 sec
calculation time with 5 jobs: 22.718 sec
calculation time with 6 jobs: 22.632 sec
calculation time with 7 jobs: 22.594 sec
calculation time with 8 jobs: 22.573 sec
calculation time with 9 jobs: 22.836 sec
calculation time with 10 jobs: 22.489 sec
calculation time with 11 jobs: 22.640 sec
calculation time with 12 jobs: 23.023 secGiven this, I think adding |
|
Thanks for the extensive benchmark @thomasjpfan . Can you also do the same without setting the |
Without setting calculation time with 1 jobs: 12.886 sec
calculation time with 2 jobs: 11.674 sec
calculation time with 3 jobs: 10.623 sec
calculation time with 4 jobs: 11.040 sec
calculation time with 5 jobs: 10.479 sec
calculation time with 6 jobs: 10.280 sec
calculation time with 7 jobs: 10.147 sec
calculation time with 8 jobs: 9.958 sec
calculation time with 9 jobs: 10.012 sec
calculation time with 10 jobs: 10.086 sec
calculation time with 11 jobs: 10.635 sec
calculation time with 12 jobs: 10.023 sec |
|
Great. So the improvement is not dramatic but it does never do worse that with |
* Update kernel_approximation.py component_indices_ is not needed * adding n_jobs to nystroem * adding description for n_jobs for nystroem * undo changes of component_indices_ * n_jobs: adding more detailed description
* Update kernel_approximation.py component_indices_ is not needed * adding n_jobs to nystroem * adding description for n_jobs for nystroem * undo changes of component_indices_ * n_jobs: adding more detailed description
Reference Issues/PRs
What does this implement/fix? Explain your changes.
Any other comments?