Each worker is roughly of the following form:
# socket is some form of communication
def train(id, device, batch_queue, socket):
construct_graph_and_compile()
if id == 1:
# This is the first process, so memory map the parameters
m_params = memory_map(params)
# Send them to the main thread