self.ddp_plugin.on_after_setup_optimizers(self.trainer)
// set model properties before going into wrapper
self.trainer.model_connector.copy_trainer_model_properties(model)
// 16-bit
model = self.trainer.precision_connector.connect(model)
// device ids change depending on the DDP setup
device_ids = self.get_device_ids()
// allow user to configure ddp
model = self.configure_ddp(model, device_ids)
// set up training routine
self.trainer.train_loop.setup_training(model)
// train or test
results = self.train_or_test()
After Change
// allow user to configure ddp
model = self.configure_ddp(model, device_ids)
self.trainer.setup_trainer(model)
// train or test
results = self.train_or_test()