I’m trying to train multiple models in parallel. The models does not share weights, but the inputs to all of them is the same. I followed the guidelines for multi processing, but for some reason the newly created process hangs when executing concatenating multiple tensors. Attached code snippet - the code hangs upon the torch.cat line. Executing the same un-paralleled code on the same machine works fine.
I’m using pytorch 0.4.0
def do_train():
    tensor_a = embed_text(text_a)
    tensor_b = embed_text(text_b)
    try:
        tensor_c = torch.cat([tensor_a, tensor_b], -1)
    except Exception as a:
        print(a)


def run(text_a, text_b):
    from torch.multiprocessing import Process
    process = Process(target=do_train, args=(text_a, text_b))
    process.start()
    process.join()