How to replace ddp sampler with my own?

Question:
Trying to use lightning on colab with TPU. I replaced the ddp sampler with my own sampler ( SubsetRandomSampler ). However after completing trainer.train() , my code hangs after printing out the following statement:

yes!

https://pytorch-lightning.readthedocs.io/en/stable/trainer.html#replace-sampler-ddp

trainer = Trainer(replace_sampler_ddp=True)