Skip to content

[Question] The logic of data sampler in data parallel. #38428

Open
@kxzxvbk

Description

@kxzxvbk

Hi, thanks for your attention.

When reading the source code of transformers, I cannot understand the implementation of _get_train_sampler in trainer.py. Why the default data sampler is RandomSampler rather than DistributedSampler? How does the trainer handle the sampler for data parallel?

reference code: https://github.com/huggingface/transformers/blob/main/src/transformers/trainer.py#L975

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