Position_ids misuses self.padding_idx
### System Info

issue is platform-independent

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

https://colab.research.google.com/drive/1ZuL1pc0fMBOnJahF18xArcFihfAmLwDo?usp=sharing

### Expected behavior

I'm self-assigning this and will file a PR - I'm just creating this issue so there's a record of it and I don't lose track! The issue is that the `position_ids` in several models (`RoBERTa` and any models that copied code from it) misuse `self.padding_idx` in at least two ways. Firstly, `self.padding_idx` is passed as the padding_idx to self.position_ids. This means that the position embedding in that position is never updated, even though there is no such thing as a padding token in position embeddings.

Secondly, `create_position_ids_from_inputs_embeds`, which was also written for `RoBERTa` before being copied to several other models initializes the position IDs starting from `self.padding_idx`, which does not make sense. This can cause a crash (see Colab above) when the model's padding_idx is not a low integer value, but even when it doesn't crash the model it creates incorrect position IDs whenever the user passes input embeds instead of input IDs.
Update: I think this is actually reproducing behaviour in the original RoBERTa, and isn't a bug after all. It's probably unnecessary when copied to all the other models out there, but it's not the end of the world as long as everyone keeps their padding_idx low.<|||||>@Rocketknight1 I ran through the same issue while training `XLMRobertaForMaskedLM`.
Here's the issue details:

1. The default padding token id is `1`
2. `create_position_ids_from_input_ids` will set position id of padding tokens to `1`, and the actual sequence starts at `2`
3. For input sequences of length truncated to max length, (defaults to `512`), the position id for the last token will be `513`
4. While creating positional embeddings, token with position id `513` (should be `512`) will through an indexing exception

I believe this needs to be addressed either by:

- XLMPreTrainedTokenizer and set padding token's id to `0` instead of `1`
- `create_position_ids_from_input_ids` implementation
<|||||>@YazanShannak Thank you for the report - this is similar to what I observed as well. Unfortunately, I don't think we can change the padding token ID for RoBERTa and RoBERTa-based models without breaking compatibility with the original implementation.

My suspicion is that the code for `create_position_ids_from_input_ids` is actually correct for RoBERTa, but was copied to other models and causes issues there. Can you check if you get the same error when using RoBERTa instead of XLMRoBERTa?