This is the number of epochs you want to train multiplied by the length of your training dataloader then divided by the number of gradient accumulation steps.
The best way to use a custom optimizer/scheduler is to subclass Trainer and override the method create_optimizer_and_scheduler since in this method, you will get the number of training steps as an argument.