How to add a pretrain step in training_step

Not sure what exactly you wanna do, but have a look at the available hooks here:

https://pytorch-lightning.readthedocs.io/en/stable/_modules/pytorch_lightning/core/hooks.html

There is also something like on_pretrain_routine_start