Skip to content

Commit

Permalink
Call prepare_data() after setup_environment() for XLA (#19181)
Browse files Browse the repository at this point in the history
Co-authored-by: awaelchli <[email protected]>
  • Loading branch information
jerrymannil and awaelchli authored Jan 10, 2024
1 parent b5d4ee5 commit bb14a97
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lightning/pytorch/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,17 +935,16 @@ def _run(

_verify_loop_configurations(self)

# hook
log.debug(f"{self.__class__.__name__}: preparing data")
self._data_connector.prepare_data()

# ----------------------------
# SET UP THE TRAINER
# ----------------------------
log.debug(f"{self.__class__.__name__}: setting up strategy environment")
self.strategy.setup_environment()
self.__setup_profiler()

log.debug(f"{self.__class__.__name__}: preparing data")
self._data_connector.prepare_data()

call._call_setup_hook(self) # allow user to set up LightningModule in accelerator environment
log.debug(f"{self.__class__.__name__}: configuring model")
call._call_configure_model(self)
Expand Down

0 comments on commit bb14a97

Please sign in to comment.