Skip to content

Notify user if group_by_length won't be used #15418

Description

@stefan-falk

@sgugger @stas00 (as suggested in 15196)

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:

if isinstance(train_dataset, torch.utils.data.IterableDataset):

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() which is never reached if said condition is true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions