Skip to content

Commit

Permalink
Lightning: set limit_train_batches and limit_val_batches (horovod#3237)
Browse files Browse the repository at this point in the history
Tell Lightning trainer that how many batches a single epoch needs.

Signed-off-by: Chongxiao Cao <chongxiaoc@uber.com>
Signed-off-by: weihanmines <weihan13@amd.com>
  • Loading branch information
chongxiaoc authored and weihanmines committed Dec 10, 2021
1 parent 8c2a307 commit 0e61f3c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions horovod/spark/lightning/remote.py
Expand Up @@ -193,6 +193,8 @@ def on_epoch_end(self, trainer: "pl.Trainer", pl_module: "pl.LightningModule") -
'gpus': _num_gpus,
'callbacks': callbacks,
'max_epochs': epochs,
'limit_train_batches': _train_steps_per_epoch,
'limit_val_batches': _val_steps_per_epoch,
'logger': train_logger,
'log_every_n_steps': log_every_n_steps,
'num_sanity_val_steps': 0,
Expand Down

0 comments on commit 0e61f3c

Please sign in to comment.