How to handle RAM OOM in DDP?

Yes, lazily loading the dataset as explained in your previous post could reduce the memory usage and thus avoid the OOM if applicable.