{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/11796","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/11796/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/11796/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/11796/events","html_url":"https://github.com/numpy/numpy/issues/11796","id":352629000,"node_id":"MDU6SXNzdWUzNTI2MjkwMDA=","number":11796,"title":"np.divide.accumulate gives incorrect results for float64 on Numpy 1.15.0 using Intel compiler","user":{"login":"stevesimmons","id":2830459,"node_id":"MDQ6VXNlcjI4MzA0NTk=","avatar_url":"https://avatars2.githubusercontent.com/u/2830459?v=4","gravatar_id":"","url":"https://api.github.com/users/stevesimmons","html_url":"https://github.com/stevesimmons","followers_url":"https://api.github.com/users/stevesimmons/followers","following_url":"https://api.github.com/users/stevesimmons/following{/other_user}","gists_url":"https://api.github.com/users/stevesimmons/gists{/gist_id}","starred_url":"https://api.github.com/users/stevesimmons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevesimmons/subscriptions","organizations_url":"https://api.github.com/users/stevesimmons/orgs","repos_url":"https://api.github.com/users/stevesimmons/repos","events_url":"https://api.github.com/users/stevesimmons/events{/privacy}","received_events_url":"https://api.github.com/users/stevesimmons/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/numpy/numpy/milestones/61","html_url":"https://github.com/numpy/numpy/milestone/61","labels_url":"https://api.github.com/repos/numpy/numpy/milestones/61/labels","id":3587761,"node_id":"MDk6TWlsZXN0b25lMzU4Nzc2MQ==","number":61,"title":"1.15.2 release","description":"","creator":{"login":"charris","id":77272,"node_id":"MDQ6VXNlcjc3Mjcy","avatar_url":"https://avatars3.githubusercontent.com/u/77272?v=4","gravatar_id":"","url":"https://api.github.com/users/charris","html_url":"https://github.com/charris","followers_url":"https://api.github.com/users/charris/followers","following_url":"https://api.github.com/users/charris/following{/other_user}","gists_url":"https://api.github.com/users/charris/gists{/gist_id}","starred_url":"https://api.github.com/users/charris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charris/subscriptions","organizations_url":"https://api.github.com/users/charris/orgs","repos_url":"https://api.github.com/users/charris/repos","events_url":"https://api.github.com/users/charris/events{/privacy}","received_events_url":"https://api.github.com/users/charris/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2018-08-21T18:58:22Z","updated_at":"2018-08-21T18:59:04Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2018-08-21T16:59:35Z","updated_at":"2018-08-25T10:03:21Z","closed_at":null,"author_association":"NONE","body":"I have a unit test failing on `np.divide.accumulate` with numpy 1.15.0 compiled with the Intel compiler. The same code is fine with a local build of GCC.\r\n\r\nPerhaps this is related to ENH: umath: don't make temporary copies for in-place accumulation (https://github.com/numpy/numpy/pull/10665) where @juliantaylor fixed `numpy/core/src/umath/loops.c.src` for GCC's `ivdep` pragma. That was reviewed by @eric-wieser .\r\n\r\n### Reproducing code example\r\n\r\nSource code was 1.15.0 compiled with the Intel compiler 2018.1.163.  where np.divide.accumulate fails in the numpy unit tests. \r\n\r\nI can reproduce with this Python 2.7 test case for `float64` dtype. It runs correctly for `float32` and `float128` on the Intel compiler. It also runs correctly for `float64` using GCC instead of Intel.\r\n\r\n```\r\n$ python -c \"import numpy as np; acc = np.divide.accumulate;  \r\n  a = np.ones(8, dtype=np.float64);  \r\n  print acc(a, out=2*np.ones_like(a)); print acc(a); print acc(a); print acc(a); \r\n  print acc(a, out=2*np.ones_like(a))\"\r\n[1. 1. 2. 2. 2. 2. 2. 2.]\r\n[1. 1. 1. 1. 2. 2. 2. 2.]\r\n[1. 1. 1. 1. 1. 1. 2. 2.]\r\n[1. 1. 1. 1. 1. 1. 1. 1.]\r\n[1. 1. 2. 2. 2. 2. 2. 2.]\r\n```\r\nNotice how only the next two elements are set each time `np.divide.accumulate` runs. That suggests the `float64`s are being processed in pairs. Then in the final line, specifying the output array again returns to the first line's incorrect behavior.\r\n\r\n### Numpy/Python version information:\r\n\r\nnumpy 1.15.0 build with ICC 2018.1.163.  \r\npython 2.7.11 built with GCC 4.9.3.\r\n"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/415958293","html_url":"https://github.com/numpy/numpy/issues/11796#issuecomment-415958293","issue_url":"https://api.github.com/repos/numpy/numpy/issues/11796","id":415958293,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTk1ODI5Mw==","user":{"login":"juliantaylor","id":542663,"node_id":"MDQ6VXNlcjU0MjY2Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/542663?v=4","gravatar_id":"","url":"https://api.github.com/users/juliantaylor","html_url":"https://github.com/juliantaylor","followers_url":"https://api.github.com/users/juliantaylor/followers","following_url":"https://api.github.com/users/juliantaylor/following{/other_user}","gists_url":"https://api.github.com/users/juliantaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/juliantaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliantaylor/subscriptions","organizations_url":"https://api.github.com/users/juliantaylor/orgs","repos_url":"https://api.github.com/users/juliantaylor/repos","events_url":"https://api.github.com/users/juliantaylor/events{/privacy}","received_events_url":"https://api.github.com/users/juliantaylor/received_events","type":"User","site_admin":false},"created_at":"2018-08-25T10:03:21Z","updated_at":"2018-08-25T10:03:21Z","author_association":"CONTRIBUTOR","body":"But I am not sure how this triggers with icc, the overlap is for the example is 8 bytes so the existing 16 byte SSE2 check should catch it and no vectorized code be executed. Instead it should run the usual loop trivial loop that a decent compiler should not be able to miscompile.\r\nCan you debug which code path it takes in the `DOUBLE_divide` function?"}}
{"actor":{"display_login":"juliantaylor"}}