Hi.
I have a program using distributed data parallel of Pytorch.
It’s working well, but I do not know how to access data in the GPU process from main().
In particular, a GPU process, train(), produces a list of loss, and I want to plot it in the main() after returning from spawn(). However, I do not know how to access the list in train() on GPU from main() on CPU.
If I use a global variable, it should work, but it does not seem to be the best answer. I understand that printing loss can be done by gpu[0], and maybe even plotting the graph too. But, I want to do many tasks to analyze the results in main().
I appreciate any information or examples. Thank you.