Wednesday, 15 April 2015

c++ - performance of python lapack calls vs. ublas lapack bindings -



c++ - performance of python lapack calls vs. ublas lapack bindings -

this yet question boost ublas (i new library).

i have tried profiling lapack's svd algorithm (gesdd) called via ublas lapack bindings , python's numpy (numpy svd. should noted according documentation numpy uses same lapack routine gesdd calculation of svd. somehow, ublas implementation consistently approximately twice slower (it scale size of matrix). tried matrices of next sizes: 500x5000, 1000x10000 , 2000x20000. results shown below (i cannot these tests pure, there background processes running). matrices same tests.

(these averaged on 10 tests)

size numpy ublas 500x5000 0.7(s) 1.5(s) 1000x10000 4.2 (s) 10.4(s) 2000x20000 29.3 (s) 78.7 (s)

things maintain in mind:

i looked through ublas bindings code , seems quite clean - passed reference. thus, there should no overheads related memory allocation, etc. i running tests on intel dual core (2 hyper threads per core) 64 bit intel i5 1.4 ghz. i used next compiler options: "-dndebug -ofast" + usual blas enabling stuff. to degree, tested matrix products using atlas bindings , eigenvalue computation using lapack. similarly, these 1.5-2 times slower numpy's implementations.

i not sure how numpy uses lapack. using multithreading perform calculations? not remember explicitly installing (i.e. linking numpy against) mkl or accelerate , not listed in installed packages. however, when @ activity monitor while running numpy threads seem maxed out, not case c++.

python c++ numpy lapack ublas

No comments:

Post a Comment