Thanks for the explanation!
Please check the best practices here: Multiprocessing best practices — PyTorch 1.9.1 documentation 6
2 suggestions:

You can replace Queue with SimpleQueue. This seems to work for me.
You can consider reusing buffers passed through the queue to avoid additional memory copy.