(Part 2) feat: allow for tp_size attr for tplizing the model
Author: kmehant
Pull request: yes

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Discussed at https://github.com/huggingface/accelerate/pull/3457

1. Introduce `tp_size` to allow for TP sharding apart from world size
2. Make `tp_size` an attribute of the model only initialized after TP sharding completed which can be an indicator if the model has undergone tp sharding for usage in accelerate. (discussed with @SunMarc)
3. Remove `tp_size` from train arguments, since from now on it is to perform TP training only if the model has undergone TP sharding already.


## 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#create-a-pull-request),
      Pull Request section?
- [x] 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.

- trainer: @muellerzr and @SunMarc


Comments:
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the `Ready for review` button (at the bottom of the PR page). This will assign reviewers and trigger CI.

Please fix the conflits and I will merge this PR ! 

https://github.com/huggingface/transformers/pull/37054#issuecomment-2783334991

@SunMarc Fixed the conflicts and the failing test seem to be unrelated. Thanks

@SunMarc looks like even the recently merged commit is failing for this testcase, so its totally unrelated to this PR. 

@SunMarc rebased the branch, are we waiting on something?

Waiting for the tests to pass ;) I will merge it as soon as the ci is green ! 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_37054). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.