Skip to content

Commit bb14a97

Browse files
Call prepare_data() after setup_environment() for XLA (#19181)
Co-authored-by: awaelchli <[email protected]>
1 parent b5d4ee5 commit bb14a97

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lightning/pytorch/trainer/trainer.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -935,17 +935,16 @@ def _run(
935935

936936
_verify_loop_configurations(self)
937937

938-
# hook
939-
log.debug(f"{self.__class__.__name__}: preparing data")
940-
self._data_connector.prepare_data()
941-
942938
# ----------------------------
943939
# SET UP THE TRAINER
944940
# ----------------------------
945941
log.debug(f"{self.__class__.__name__}: setting up strategy environment")
946942
self.strategy.setup_environment()
947943
self.__setup_profiler()
948944

945+
log.debug(f"{self.__class__.__name__}: preparing data")
946+
self._data_connector.prepare_data()
947+
949948
call._call_setup_hook(self) # allow user to set up LightningModule in accelerator environment
950949
log.debug(f"{self.__class__.__name__}: configuring model")
951950
call._call_configure_model(self)

0 commit comments

Comments
 (0)