{"action":"created","issue":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/730","labels_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/730/labels{/name}","comments_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/730/comments","events_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/730/events","html_url":"https://github.com/xianyi/OpenBLAS/issues/730","id":124611697,"number":730,"title":"Suprisingly slow `dsyrk` on Mac","user":{"login":"jakirkham","id":3019665,"avatar_url":"https://avatars.githubusercontent.com/u/3019665?v=3","gravatar_id":"","url":"https://api.github.com/users/jakirkham","html_url":"https://github.com/jakirkham","followers_url":"https://api.github.com/users/jakirkham/followers","following_url":"https://api.github.com/users/jakirkham/following{/other_user}","gists_url":"https://api.github.com/users/jakirkham/gists{/gist_id}","starred_url":"https://api.github.com/users/jakirkham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakirkham/subscriptions","organizations_url":"https://api.github.com/users/jakirkham/orgs","repos_url":"https://api.github.com/users/jakirkham/repos","events_url":"https://api.github.com/users/jakirkham/events{/privacy}","received_events_url":"https://api.github.com/users/jakirkham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-01-02T21:16:14Z","updated_at":"2016-01-12T12:43:22Z","closed_at":null,"body":"Here is an example on Mac OS 10.9 on a Late 2013 MacBook Pro 15\" with a 2.3 GHz Intel Core i7-4850HQ using OpenBLAS 0.2.15, Python 2.7.11, NumPy 1.10.2, SciPy 0.16.1. I have verified that NumPy and SciPy are properly linked to the version of OpenBLAS specified. OpenBLAS has built with dynamic architecture in all cases and is running single threaded in all cases.\r\n\r\n    >>> import numpy\r\n    >>> from scipy.linalg import blas\r\n    >>> a = numpy.ones((100,101), dtype=numpy.float32)\r\n    >>> %timeit blas.ssyrk(1, a)\r\n    10000 loops, best of 3: 37.8 µs per loop\r\n    >>> a = numpy.ones((100,101), dtype=numpy.float64)\r\n    >>> %timeit blas.dsyrk(1, a)\r\n    1000 loops, best of 3: 520 µs per loop\r\n\r\nI wouldn't be surprised to see it takes twice as a long due to the fact that it is double versus single precision; however, taking over an order of magnitude longer seems to be a bit much.\r\n\r\nFollowing the same build procedure on a Linux VM on the same machine, I get a much more reasonable time for `dsyrk` (around double `ssyrk`). I have no idea whether this carries over to Windows or not. If someone is able to reproduce a similar example using C or Fortran, please share your steps."},"comment":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/comments/170900175","html_url":"https://github.com/xianyi/OpenBLAS/issues/730#issuecomment-170900175","issue_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/730","id":170900175,"user":{"login":"jakirkham","id":3019665,"avatar_url":"https://avatars.githubusercontent.com/u/3019665?v=3","gravatar_id":"","url":"https://api.github.com/users/jakirkham","html_url":"https://github.com/jakirkham","followers_url":"https://api.github.com/users/jakirkham/followers","following_url":"https://api.github.com/users/jakirkham/following{/other_user}","gists_url":"https://api.github.com/users/jakirkham/gists{/gist_id}","starred_url":"https://api.github.com/users/jakirkham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakirkham/subscriptions","organizations_url":"https://api.github.com/users/jakirkham/orgs","repos_url":"https://api.github.com/users/jakirkham/repos","events_url":"https://api.github.com/users/jakirkham/events{/privacy}","received_events_url":"https://api.github.com/users/jakirkham/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T12:43:22Z","updated_at":"2016-01-12T12:43:22Z","body":"> For single machine with always same CPU there is no need for DYNAMIC_ARCH or NUM_THREADS, they are automatically set for your CPU.\r\n\r\nThe reason I use dynamic architecture is I do support a variety of laptop and desktop machines with different architecture. Also, I use a cluster that has some older and some newer architectures depending on the node. This ends up being the easiest solution as opposed to pinning the build to the lowest common denominator as I get the right balance between support and performance. Maybe I am misunderstanding you. Is this a default build option?\r\n\r\nAs for setting the number of threads, often parallelism is dealt with at a higher level in my code. So, I normally want the BLAS to be single threaded. However, I may re-explore building it to run multithreaded for different applications.\r\n\r\n> Your build is perfectly fine. Please ask ones who equipped you with initial binary openblas to build it well just like you did moments ago.\r\n\r\nI always hand build OpenBLAS. Good to hear I am not way off base :)"}}