question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bss_eval_sources gets slower with more CPUs

See original GitHub issue

What ?

bss_eval_sources gets slower as the number of available CPUs grow. We got up to 4x slower computation with 32 cores compared to only one core (thx @sunits).

Expected behaviour

If not speeding up with number of available CPU cores, at least not slowing down.

How to reproduce :

  • Create a file sdr_speed_test.py containing
import numpy as np
from mir_eval.separation import bss_eval_sources

def time_sdr():
    ref = np.random.randn(2, 64000)
    est = np.random.randn(2, 64000)
    sdrs = bss_eval_sources(ref, est, compute_permutation=True)
  • Time the execution with all available cores :
python -m timeit -s "from sdr_speed_test import time_sdr" "time_sdr()" 
  • Time the execution with a single core:
taskset --cpu-list 0 python -m timeit -s "from sdr_speed_test import time_sdr" "time_sdr()"

The difference is even greater if you have a large number of cores on your machine but I could see the difference on my 8 core laptop. This was replicated on three different machines.

Additional info

Out np.__config__.show() looks like this :

blas_mkl_info:
  NOT AVAILABLE
blis_info:
  NOT AVAILABLE
openblas_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
lapack_mkl_info:
  NOT AVAILABLE
openblas_lapack_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
lapack_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
faroitcommented, Mar 10, 2020

did you try to disable BLAS for testing?

0reactions
mparientecommented, Mar 16, 2020

Thanks for trying. NumPy sends me to OpenBLAS, I’ll close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VirtualBox VM lags after increasing the numbers of CPUs the ...
When I change the # of processors to 3, it got dramatically laggy. Guest slows with more CPUs. No, you're not doing anything...
Read more >
Slower SQL Server performance after allocating more CPU ...
Queries are stepping off CPUs and not getting back on for a long time. ... Adding more RAM can also cause a sudden...
Read more >
The Parallelism Blues: when faster code is slower
Your computer has 2 or 4 or even more CPU cores, and if you can use them all then your code will run...
Read more >
Python multiprocessing working slower when using more cores
Thing is, im trying to run the same code in a computer with 5 times as many cpu cores (mine has 4, the...
Read more >
Why More CPU Cores Often Run no Faster, and Sometimes ...
Get all the tools you need to upgrade the factory HDD of any 2009-2019 iMac to a larger HDD or a modern SSD....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found