I am optimizing some function with 20 different initializations.
To speed up, I am using multiprocessing(20 processes) on cpus not using gpus.
My program does matrix calculation with the matrix whose dimension is increased by one compared to the previous step.
e.g) 20 by 20 at step(n)=> 21 by 21 at step(n+1)
When I used torch.gesv, it stopped at the step where the matrix size is 37 by 37,
so I replaced it with torch.inverse().mm(), then it stopped at matrix size of 128 by 128.
and this time, the problem occurs at mm() command.(not in this torch.inverse().mm(), in previous mm() command)
Even with the randomness of my program, for multiple runs,
the problem occurs at the step of exactly the same size matrix.
In debugging mode, those problematic lines takes unreasonably long time and returns None(printing nothing in debugging console), after running those problematic codes, then any calculation(even simply printing value of variable) returns None(printing nothing) and CPU% usage of those subprocesses are less than 5% mostly 0%, which seems doing nothing.
but before testing(running) those problematic lines in debugging mode,
if I change the arguments to numpy.array and do the same calculation with numpy then it works well.
This problem doesn’t happen if I don’t use multiprocessing,
and the same problem occurs only with 1 subprocess(which mean one initialization in my case).
Maybe my knowledge about multiprocessing it not enough, below is code where I use multiprocessing
	pool = torch.multiprocessing.Pool(n_init)
	results = [pool.apply_async(optimize, args=([arguments depending on i])) for i in range(n_init)]
	return_values = [res.get() for res in results]
	minimum, minimum_value = zip(*return_values)

Any idea about this problem?
Thanks in advance.