{"action":"created","issue":{"url":"https://api.github.com/repos/cupy/cupy/issues/1779","repository_url":"https://api.github.com/repos/cupy/cupy","labels_url":"https://api.github.com/repos/cupy/cupy/issues/1779/labels{/name}","comments_url":"https://api.github.com/repos/cupy/cupy/issues/1779/comments","events_url":"https://api.github.com/repos/cupy/cupy/issues/1779/events","html_url":"https://github.com/cupy/cupy/issues/1779","id":378043162,"node_id":"MDU6SXNzdWUzNzgwNDMxNjI=","number":1779,"title":"OutOfMemoryError: out of memory to allocate ","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":[{"id":679707227,"node_id":"MDU6TGFiZWw2Nzk3MDcyMjc=","url":"https://api.github.com/repos/cupy/cupy/labels/st:awaiting-response","name":"st:awaiting-response","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":{"login":"kmaehashi","id":939877,"node_id":"MDQ6VXNlcjkzOTg3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/939877?v=4","gravatar_id":"","url":"https://api.github.com/users/kmaehashi","html_url":"https://github.com/kmaehashi","followers_url":"https://api.github.com/users/kmaehashi/followers","following_url":"https://api.github.com/users/kmaehashi/following{/other_user}","gists_url":"https://api.github.com/users/kmaehashi/gists{/gist_id}","starred_url":"https://api.github.com/users/kmaehashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmaehashi/subscriptions","organizations_url":"https://api.github.com/users/kmaehashi/orgs","repos_url":"https://api.github.com/users/kmaehashi/repos","events_url":"https://api.github.com/users/kmaehashi/events{/privacy}","received_events_url":"https://api.github.com/users/kmaehashi/received_events","type":"User","site_admin":false},"assignees":[{"login":"kmaehashi","id":939877,"node_id":"MDQ6VXNlcjkzOTg3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/939877?v=4","gravatar_id":"","url":"https://api.github.com/users/kmaehashi","html_url":"https://github.com/kmaehashi","followers_url":"https://api.github.com/users/kmaehashi/followers","following_url":"https://api.github.com/users/kmaehashi/following{/other_user}","gists_url":"https://api.github.com/users/kmaehashi/gists{/gist_id}","starred_url":"https://api.github.com/users/kmaehashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmaehashi/subscriptions","organizations_url":"https://api.github.com/users/kmaehashi/orgs","repos_url":"https://api.github.com/users/kmaehashi/repos","events_url":"https://api.github.com/users/kmaehashi/events{/privacy}","received_events_url":"https://api.github.com/users/kmaehashi/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-11-06T21:35:56Z","updated_at":"2018-11-07T16:10:20Z","closed_at":"2018-11-07T16:07:44Z","author_association":"NONE","body":"Similar issue to #1489 \r\nI am running the following code on a GT1030 with 2 GB of RAM and getting an error\r\n\r\n1st issue if I ran with N = 11000, it occupies around 1.5GB (it should occupy around 572MB by my calculations)\r\n\r\n2nd how do I flush the video memory without restarting the kernel, since del and None are not working?\r\n\r\n```\r\nfrom timeit import default_timer as timer\r\nfrom numba import cuda\r\n\r\ntry:\r\n    import cupy as cp\r\n    \r\n    cuda.current_context().deallocations.clear()\r\n    N = 12000\r\n\r\n    A_cp = cp.random.randn(N**2, dtype=cp.float32).reshape(N,N)\r\n    B_cp = cp.random.randn(N, dtype=cp.float32) \r\n    start = timer()        \r\n    X_cp = cp.linalg.tensorsolve(A_cp, B_cp, axes=None)\r\n    elapsed_time_cp = timer() - start\r\n    print(elapsed_time_cp)\r\n    \r\n    del A_cp\r\n    del B_cp\r\n    del X_cp\r\n   \r\n    A_cp = None\r\n    B_cp = None\r\n    X_cp = None    \r\n    \r\n    cuda.current_context().deallocations.clear()\r\n    print('test1')\r\nexcept ImportError:\r\n    cupy = None\r\n    print('test2')    \r\n```\r\nTraceback error:\r\n\r\n```\r\n\r\n  File \"<ipython-input-1-2ad9c58b2b59>\", line 1, in <module>\r\n    runfile('***/untitled0.py', wdir='***')\r\n\r\n  File \"***\\Anaconda3\\lib\\site-packages\\spyder\\utils\\site\\sitecustomize.py\", line 705, in runfile\r\n    execfile(filename, namespace)\r\n\r\n  File \"***\\Anaconda3\\lib\\site-packages\\spyder\\utils\\site\\sitecustomize.py\", line 102, in execfile\r\n    exec(compile(f.read(), filename, 'exec'), namespace)\r\n\r\n  File \"***/untitled0.py\", line 13, in <module>\r\n    X_cp = cp.linalg.tensorsolve(A_cp, B_cp, axes=None)\r\n\r\n  File \"***\\Anaconda3\\lib\\site-packages\\cupy\\linalg\\solve.py\", line 147, in tensorsolve\r\n    result = solve(a, b)\r\n\r\n  File \"***\\Anaconda3\\lib\\site-packages\\cupy\\linalg\\solve.py\", line 59, in solve\r\n    return _solve(a, b)\r\n\r\n  File \"***\\Anaconda3\\lib\\site-packages\\cupy\\linalg\\solve.py\", line 69, in _solve\r\n    a = cupy.asfortranarray(a)\r\n\r\n  File \"***\\Anaconda3\\lib\\site-packages\\cupy\\manipulation\\kind.py\", line 21, in asfortranarray\r\n    return core.asfortranarray(a, dtype)\r\n\r\n  File \"cupy\\core\\core.pyx\", line 2373, in cupy.core.core.asfortranarray\r\n\r\n  File \"cupy\\core\\core.pyx\", line 2386, in cupy.core.core.asfortranarray\r\n\r\n  File \"cupy\\core\\core.pyx\", line 150, in cupy.core.core.ndarray.__init__\r\n\r\n  File \"cupy\\cuda\\memory.pyx\", line 517, in cupy.cuda.memory.alloc\r\n\r\n  File \"cupy\\cuda\\memory.pyx\", line 1064, in cupy.cuda.memory.MemoryPool.malloc\r\n\r\n  File \"cupy\\cuda\\memory.pyx\", line 1085, in cupy.cuda.memory.MemoryPool.malloc\r\n\r\n  File \"cupy\\cuda\\memory.pyx\", line 899, in cupy.cuda.memory.SingleDeviceMemoryPool.malloc\r\n\r\n  File \"cupy\\cuda\\memory.pyx\", line 920, in cupy.cuda.memory.SingleDeviceMemoryPool._malloc\r\n\r\n  File \"cupy\\cuda\\memory.pyx\", line 694, in cupy.cuda.memory._try_malloc\r\n\r\nOutOfMemoryError: out of memory to allocate 576000000 bytes (total 1728096256 bytes)\r\n\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cupy/cupy/issues/comments/436678294","html_url":"https://github.com/cupy/cupy/issues/1779#issuecomment-436678294","issue_url":"https://api.github.com/repos/cupy/cupy/issues/1779","id":436678294,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjY3ODI5NA==","user":{"login":"kmaehashi","id":939877,"node_id":"MDQ6VXNlcjkzOTg3Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/939877?v=4","gravatar_id":"","url":"https://api.github.com/users/kmaehashi","html_url":"https://github.com/kmaehashi","followers_url":"https://api.github.com/users/kmaehashi/followers","following_url":"https://api.github.com/users/kmaehashi/following{/other_user}","gists_url":"https://api.github.com/users/kmaehashi/gists{/gist_id}","starred_url":"https://api.github.com/users/kmaehashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmaehashi/subscriptions","organizations_url":"https://api.github.com/users/kmaehashi/orgs","repos_url":"https://api.github.com/users/kmaehashi/repos","events_url":"https://api.github.com/users/kmaehashi/events{/privacy}","received_events_url":"https://api.github.com/users/kmaehashi/received_events","type":"User","site_admin":false},"created_at":"2018-11-07T16:10:20Z","updated_at":"2018-11-07T16:10:20Z","author_association":"MEMBER","body":"> The memory pool significantly improves the performance by mitigating the overhead of memory allocation and CPU/GPU synchronization.\r\n\r\nIt depends on the workload. Please try your code with memory pool enabled/disabled.\r\n\r\n> the size of actual allocation may become larger than the requested array size\r\n\r\nAllocation size is rounded up to the unit size of 512 bytes.\r\nDepending on the workload, the allocation size may also become larger if there is a memory fragmentation. You can check `mempool.used_bytes()` and `mempool.total_bytes()`."}}
{"actor":{"display_login":"kmaehashi"}}