Skip to content

What if I load data in __init__ function of LightningDataModule #10772

Discussion options

You must be logged in to vote

@zhiqiangdon

  1. lightning just runs prepare_data on the main process before the distributed process actually starts so there is no blocking happening behind the scenes.
  2. To tackle this issue we have prepare_data_per_node. A node is just a machine. If they share the disk then prepare_data_per_node should be set to False.
  3. User runs the __init__ function when they initialize the DataModule, lightning just send to across devices.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tchaton
Comment options

You must be logged in to vote
3 replies
@tchaton
Comment options

@zhiqiangdon
Comment options

@tarokiritani
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment