-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Description
Storage views are currently used to implement CUDA IPC with the caching allocator. The basic problem is that you can only do IPC with a chunk of memory returned by cudaMalloc, but when you are using the caching CUDA allocator, lots of logically distinct allocations are together on the same cudaMalloc block, and you have no choice but to IPC the whole thing. A storage view was used to implement this situation, since you gave the entire CUDA caching allocator block a storage, and then you had the actual storages be views on this storage.
This is not a good reason to add something as complicated as storage views to PyTorch. So the new plan is this:
- When you transfer a CUDA tensor across IPC, its storage/offsets change: instead of being the same storages they were before, you get the entire CUDA allocation storage.
- The transferred tensors are non-resizable (this is true in practice today, since resizing would break sharing, but it is even more important after IPC, because a resize could cause you to clobber other allocations)
CC @apaszke, who I flew this plan by previously.
This should fix #5311
Metadata
Metadata
Assignees
Labels
No labels