clm example training script uses larger train/eval data than it should
### System Info

```shell
- `transformers` version: 4.12.3
- Platform: Linux-4.15.0-180-generic-x86_64-with-Ubuntu-18.04-bionic
- Python version: 3.6.9
- PyTorch version (GPU?): 1.9.1+cu111 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: (True)
- Using distributed or parallel set-up in script?: (True)
```


### Who can help?

@sgugger @patil-suraj 

### Information

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

### Tasks

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

### Reproduction

1. Just run `examples/pytorch/language-modeling/run_clm.py` script with `max_train_samples` parameter with value 1, it'll still group first 1024 tokens regardless.

This is also a bug across libraries (i.e., tensorflow, FLAX) and also for `max_eval_samples` parameter as well.

### Expected behavior

```shell
The script should only use the max number of samples specified from the dataset. This happens because the grouping takes place before selecting the number of samples.
```

Grouping: (https://github.com/huggingface/transformers/blob/dcb08b99f44919425f8ba9be9ddcc041af8ec25e/examples/pytorch/language-modeling/run_clm.py#L447)

Dataset selection:(https://github.com/huggingface/transformers/blob/dcb08b99f44919425f8ba9be9ddcc041af8ec25e/examples/pytorch/language-modeling/run_clm.py#L460)


If you approve that this is a legitimate bug, then please let me know I will open the PR.<|||||>This is completely intended and not a bug. Sample/example is meant as one processed training/evaluation example, which is what is done here.<|||||>Yeah maybe for my purposes I needed it to filter the number of samples before grouping and I thought it would be same for others. 

Thanks for the quick response. Closing the issue :)