Notify user if group_by_length won't be used
@sgugger @stas00 (as suggested in [15196](https://github.com/huggingface/transformers/issues/15196#issuecomment-1024143208))

It is just a minor issue but it could prevent some head-scratching:

Setting `group_by_length` to `True` during training has, as far as I can see, no effect if the provided dataset is a `torch.utils.data.IterableDataset`, as can be seen in this line:

https://github.com/huggingface/transformers/blob/c4d1fd77fa52d72b66207c6002d3ec13cc36dca8/src/transformers/trainer.py#L646

Entering this branch will run the training without bucketing / grouping. 

Imo it would be best to raise an exception or, at the very least, print a warning message for the user. Grouping only happens in [`_get_train_sampler()`](https://github.com/huggingface/transformers/blob/c4d1fd77fa52d72b66207c6002d3ec13cc36dca8/src/transformers/trainer.py#L566:L628) which [is never reached](https://github.com/huggingface/transformers/blob/c4d1fd77fa52d72b66207c6002d3ec13cc36dca8/src/transformers/trainer.py#L646:L664) if said condition is true.


Yes, that's a great idea! Will add something for that today.