{"action":"created","issue":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1461","repository_url":"https://api.github.com/repos/xianyi/OpenBLAS","labels_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1461/labels{/name}","comments_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1461/comments","events_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1461/events","html_url":"https://github.com/xianyi/OpenBLAS/issues/1461","id":297048427,"node_id":"MDU6SXNzdWUyOTcwNDg0Mjc=","number":1461,"title":"performance on AMD Ryzen and Threadripper","user":{"login":"tkswe88","id":35581455,"node_id":"MDQ6VXNlcjM1NTgxNDU1","avatar_url":"https://avatars0.githubusercontent.com/u/35581455?v=4","gravatar_id":"","url":"https://api.github.com/users/tkswe88","html_url":"https://github.com/tkswe88","followers_url":"https://api.github.com/users/tkswe88/followers","following_url":"https://api.github.com/users/tkswe88/following{/other_user}","gists_url":"https://api.github.com/users/tkswe88/gists{/gist_id}","starred_url":"https://api.github.com/users/tkswe88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkswe88/subscriptions","organizations_url":"https://api.github.com/users/tkswe88/orgs","repos_url":"https://api.github.com/users/tkswe88/repos","events_url":"https://api.github.com/users/tkswe88/events{/privacy}","received_events_url":"https://api.github.com/users/tkswe88/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":80,"created_at":"2018-02-14T10:42:42Z","updated_at":"2018-06-17T05:51:43Z","closed_at":"2018-03-14T11:40:02Z","author_association":"NONE","body":"This report comes right from #1425 where the discussion drifted off from thread safety in openblas v. 0.2.20 to performance on AMD Ryzen and Threadripper processors (in this particular case a TR 1950X). I seems worthwhile to discuss this in a separate thread. Until now we had the following discussion\r\n\r\n@tkswe88 : After plenty of initial tests with the AMD TR 1950X processor, it seems that openblas (tested 0.2.19, 0.2.20 and the development version on Ubuntu 17.10 with kernel 4.13, gcc and gfortran v. 7.2) operates roughly 20% slower on the TR1950X than on an i7-4770 (4 cores) when using 1, 2 and 4 threads. This is somewhat surprising given that both CPUs use at most AVX2 and thus should be comparable in terms of vectorisation potential. I have already adjusted the OpenMP thread affinity to exclude that the (hidden) NUMA architecture of the TR1950X causes its lower performance. Other measures I took were 1) BIOS upgrade, 2) Linux kernel upgrade to 4.15, 3) increased DIMM frequency from 2133 to 2666 MHz. Except for the latter, which gave a speedup of roughly 3%, these measures did not have any effect on execution speed. Do you have any idea where the degraded performance on the TR1950X comes from? Is this related to a current lack of optimization in openblas or do we just have to wait for the next major release of gcc/gfortran to fix the problem? Of course, I would be willing to run tests, if this was of help in developing openblas.\r\n\r\n@brada4 : AMD has slightly slower AVX and AVX2 units per CPU, by no means slow in general, it still has heap of cores spare. Sometimes optimal AVX2 saturation means turning whole CPU cartridge to base, i.e non-turpo frequency.\r\n\r\n@martin-frbg: Could also be that getarch is mis-detecting the cache sizes on TR, or the various hardcoded block sizes from param.h for loop unrolling are \"more wrong\" on TR than they were on the smaller Ryzen. Overall support for the Ryzen architecture is currently limited to treating it like Haswell, see #1133,1147. There may be other assembly instructions besides AVX2 that are slower on Ryzen (#1147 mentions movntp*).\r\n\r\n@tkswe88:  Are there any tests I could do to find out about cache size detection errors or more appropriate settings for loop unroling?\r\n\r\n@brada4 What you asked to martin - copied parameters may need doubled or halved at least here: https://github.com/xianyi/OpenBLAS/pull/1133/files#diff-7a3ef0fabb9c6c40aac5ae459c3565f0\r\n\r\n@martin-frbg: You could simply check the autodetected information in config.h against the specification. (As far as I can determine, L3 size seems to be ignored as a parameter).\r\nAs far as appropriate settings go, the benchmark directory contains a few tests that can be used for timing individual functions. Adjusting the values in param.h (see https://github.com/xianyi/OpenBLAS/pull/1157/files) is a bit of a black art though.\r\n"},"comment":{"url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/comments/397856616","html_url":"https://github.com/xianyi/OpenBLAS/issues/1461#issuecomment-397856616","issue_url":"https://api.github.com/repos/xianyi/OpenBLAS/issues/1461","id":397856616,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzg1NjYxNg==","user":{"login":"brada4","id":16061801,"node_id":"MDQ6VXNlcjE2MDYxODAx","avatar_url":"https://avatars3.githubusercontent.com/u/16061801?v=4","gravatar_id":"","url":"https://api.github.com/users/brada4","html_url":"https://github.com/brada4","followers_url":"https://api.github.com/users/brada4/followers","following_url":"https://api.github.com/users/brada4/following{/other_user}","gists_url":"https://api.github.com/users/brada4/gists{/gist_id}","starred_url":"https://api.github.com/users/brada4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brada4/subscriptions","organizations_url":"https://api.github.com/users/brada4/orgs","repos_url":"https://api.github.com/users/brada4/repos","events_url":"https://api.github.com/users/brada4/events{/privacy}","received_events_url":"https://api.github.com/users/brada4/received_events","type":"User","site_admin":false},"created_at":"2018-06-17T05:51:43Z","updated_at":"2018-06-17T05:51:43Z","author_association":"CONTRIBUTOR","body":"This is not an overclocking forum...."}}
{"actor":{"display_login":"brada4"}}