Use a pickle-alternative for serialization
🚀 Feature
Right now, if you use ddp_spawn or ddp-cpu, you are forced to make everything in your script pickleable. This is unfortunate, because there are many things that pickle cannot serialize correctly (e.g. lambda functions). One particular point of conflict is developing in a notebook -- if you write your pl.LightningModule in the notebook itself, it is attached to __main__ and cannot be pickled (and thus you cannot use ddp_spawn).
There are alternative serialization libraries, most notably cloudpickle and dill. I'm most familiar with cloudpickle, which is what Dask, a super popular parallel computing library, uses.
I'm not super familiar with how communication is handled, but would it be possible to use one of these libraries instead of pickle for serialization? I think that would make DDP much easier to use (especially for the interactive Jupyter notebook development usecase).