Skip to content

Commit

Permalink
fix mp bug (PaddlePaddle#58037)
Browse files Browse the repository at this point in the history
  • Loading branch information
FeixLiu authored and ForFishes committed Oct 16, 2023
1 parent 9c00539 commit 948a09a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ def _prepare_for_model(self):
logger.info("mp's parameters is ready")

def _pre_forward(self, *inputs, **kwargs):
mp_configs = self._strategy.hybrid_configs["mp_configs"]
need_broadcast_data = mp_configs.need_broadcast_data
need_broadcast_data = True
if self._strategy is not None:
mp_configs = self._strategy.hybrid_configs["mp_configs"]
need_broadcast_data = mp_configs.need_broadcast_data
if need_broadcast_data:
logger.debug("mp start broadcast input data")
return broadcast_input_data(self._hcg, *inputs, **kwargs)

0 comments on commit 948a09a

Please sign in to comment.