rahul003 commented on a change in pull request #10435: [MXNET-289] Allow specifying number of batches to run in an epoch to fix hang in dist sync for last epoch URL: https://github.com/apache/incubator-mxnet/pull/10435#discussion_r179958709
########## File path: python/mxnet/module/base_module.py ########## @@ -511,9 +514,12 @@ def fit(self, train_data, eval_data=None, eval_metric='acc', self.forward_backward(data_batch) self.update() try: - # pre fetch next batch - next_data_batch = next(data_iter) - self.prepare(next_data_batch, sparse_row_id_fn=sparse_row_id_fn) + if epoch_size and (nbatch == epoch_size - 1): Review comment: This is also not really an easily testable scenario because the issue only comes up in distributed settings. The core logic just uses the argument provided. Rest of the changes in the PR is just for an example. I can add an assert sure ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services