I want to insert a trained pytorch model into the middle of a multi-process pipeline.  The input/output data for the model should never move off the GPU.  Device pointers to the data need to be passed back and forth between processes using CUDA IPC memory handles.
Basically, I need a way to access/create the IPC handles and to convert to/from torch.cuda.*Tensor objects.
What is the best way to implement this?  I know pycuda gives access to CUDA IPC handles (e.g. pycuda.driver.mem_get_ipc_handle), but from my experience pycuda does not play nicely with pytorch.  Are there any other simple solutions in the python realm?