{"action":"created","issue":{"url":"https://api.github.com/repos/numba/numba/issues/3206","repository_url":"https://api.github.com/repos/numba/numba","labels_url":"https://api.github.com/repos/numba/numba/issues/3206/labels{/name}","comments_url":"https://api.github.com/repos/numba/numba/issues/3206/comments","events_url":"https://api.github.com/repos/numba/numba/issues/3206/events","html_url":"https://github.com/numba/numba/issues/3206","id":348870553,"node_id":"MDU6SXNzdWUzNDg4NzA1NTM=","number":3206,"title":"@guvectorize copy_to_host() wasting too much time","user":{"login":"cristipurdel","id":41154308,"node_id":"MDQ6VXNlcjQxMTU0MzA4","avatar_url":"https://avatars0.githubusercontent.com/u/41154308?v=4","gravatar_id":"","url":"https://api.github.com/users/cristipurdel","html_url":"https://github.com/cristipurdel","followers_url":"https://api.github.com/users/cristipurdel/followers","following_url":"https://api.github.com/users/cristipurdel/following{/other_user}","gists_url":"https://api.github.com/users/cristipurdel/gists{/gist_id}","starred_url":"https://api.github.com/users/cristipurdel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristipurdel/subscriptions","organizations_url":"https://api.github.com/users/cristipurdel/orgs","repos_url":"https://api.github.com/users/cristipurdel/repos","events_url":"https://api.github.com/users/cristipurdel/events{/privacy}","received_events_url":"https://api.github.com/users/cristipurdel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-08-08T19:59:49Z","updated_at":"2018-09-15T16:51:23Z","closed_at":null,"author_association":"NONE","body":"- [x] I am using the latest released version of Numba (most recent is visible in\r\n the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).\r\n- [x] I have included below a minimal working reproducer (if you are unsure how\r\n to write one see http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).\r\n\r\nI have a code using @guvectorize, it is working correctly on both 'parallel' and 'cuda'\r\n\r\nFor 'cuda' I am using the following steps:\r\n- d_array1 = cuda.to_device(array1)  and so on for the other inputs, but not for res\r\n- arrOut1= guv_gen(d_array1 , d_array2, .... res)\r\n- arrOut= arrOut1.copy_to_host()  \r\n\r\nI am using multiple batches but this issue is happening also for single batch and at the end I am timing the 3 steps above:\r\n\r\n\r\n> host to device for batch 0 took 0.076 seconds\r\n> cuda run       for batch 0 took 0.01 seconds\r\n> device to host for batch 0 took 3.029 seconds\r\n> batch ID 0 run time using guvectorize on  13 MBs took 3.116 seconds\r\n> host to device for batch 1 took 0.074 seconds\r\n> cuda run       for batch 1 took 0.011 seconds\r\n> device to host for batch 1 took 2.999 seconds\r\n> batch ID 1 run time using guvectorize on  13 MBs took 3.086 seconds\r\n> host to device for batch 2 took 0.067 seconds\r\n> cuda run       for batch 2 took 0.01 seconds\r\n> device to host for batch 2 took 2.062 seconds\r\n> batch ID 2 run time using guvectorize on  8 MBs took 2.141 seconds\r\n\r\n\r\n\r\nWith a low end card, with 300-400 MB/s (both ways) transfer host to device looks ok\r\nWhat I do not understand is why the device to host is so slow?!?\r\nI am using numpy 0.38 and will update to 0.39, but I guess the problem is still there.\r\nCould it be that I should use the 'stream' argument also?"},"comment":{"url":"https://api.github.com/repos/numba/numba/issues/comments/421598418","html_url":"https://github.com/numba/numba/issues/3206#issuecomment-421598418","issue_url":"https://api.github.com/repos/numba/numba/issues/3206","id":421598418,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTU5ODQxOA==","user":{"login":"cristipurdel","id":41154308,"node_id":"MDQ6VXNlcjQxMTU0MzA4","avatar_url":"https://avatars0.githubusercontent.com/u/41154308?v=4","gravatar_id":"","url":"https://api.github.com/users/cristipurdel","html_url":"https://github.com/cristipurdel","followers_url":"https://api.github.com/users/cristipurdel/followers","following_url":"https://api.github.com/users/cristipurdel/following{/other_user}","gists_url":"https://api.github.com/users/cristipurdel/gists{/gist_id}","starred_url":"https://api.github.com/users/cristipurdel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristipurdel/subscriptions","organizations_url":"https://api.github.com/users/cristipurdel/orgs","repos_url":"https://api.github.com/users/cristipurdel/repos","events_url":"https://api.github.com/users/cristipurdel/events{/privacy}","received_events_url":"https://api.github.com/users/cristipurdel/received_events","type":"User","site_admin":false},"created_at":"2018-09-15T16:51:23Z","updated_at":"2018-09-15T16:51:23Z","author_association":"NONE","body":"numba version used: 0.40.0rc1 >>> getting similar results"}}
{"actor":{"display_login":"cristipurdel"}}