Properly calculate the total train iterations and recalculate num epochs in no_trainer scripts
# What does this PR do?

This PR fixes a situation where your `max_train_steps` was less than that of a single epoch, but yet the script would still continue through the entire first epoch due to how the number of batches recalculation was performed. 

## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@sgugger 
_The documentation is not available anymore as the PR was closed or merged._<|||||>@sgugger new timings when compared to old. Main decreases repeatedly were seen between image_classification, swag, and squad (though squad is an iffy one. the previous two I can guarantee):

<html><body>
<!--StartFragment--><google-sheets-html-origin>

Example | Before | After
-- | -- | --
image_classification | 99.7 | 40.55
swag | 65.21 | 55.31
squad | 59.45 | 41.67
clm | 37.45 | 35.69
ner | 28.34 | 25.51
glue | 21.88 | 19.35
mlm | 18.52 | 15.47

<!--EndFragment-->
</body>
</html>