Model requirement for multi-gpu training


I tried to train parallel with multi-gpu server, however the following error was returned.

RuntimeError: Expected to mark a variable ready only once. This error is caused by one of the following reasons: 1) Use of a module parameter outside the forward function. Please make sure model parameters are not shared across multiple concurrent forward-backward passes. or try to use _set_static_graph() as a workaround if this module graph does not change during training loop.2) Reused parameters in multiple reentrant backward passes. For example, if you use multiple checkpoint functions to wrap the same part of your model, it would result in the same set of parameters been used by different reentrant backward passes multiple times, and hence marking a variable ready multiple times. DDP does not support such use cases in default. You can try to use _set_static_graph() as a workaround if your module graph does not change over iterations.

How can I enable that parallel training?

I can normally train parallel with the same server.

Can you let me know what is the requirement of simulation model for parallel training?


Hi @yokoi.toshiaki , can you confirm what version of Modulus are you using? We have had some issues with parallel training for these heat sink problems in the past, but have made some bug fixes for issues like this. Thanks for reporting.

Check if you used checkpoint mechanism, maybe you can solve this problem by turning off the checkpoint.