Skip to content

Expose more arguments to dataloader #2332

@anton-emanuel

Description

@anton-emanuel

Summary

I have noticed differences in data loading speeds by varying persistent_workers, pin_memory, and prefetch_factor. In the dataloader. I saw that persistent_workers has already been enabled when num_workers>1 (#2291). Would it be possible to let more arguments than num_workers be configurable in datamodules?

Rationale

It enables faster data loading in some cases.

Implementation

Let pin_memory and prefetch_factor be configurable like num_workers. See #2333.

Alternatives

Maybe not so nice with many additional arguments to datamodule. Is there any way to get around that?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    datamodulesPyTorch Lightning datamodules

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions