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 committed Oct 12, 2023
1 parent 83e109c commit fe1fbcd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,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 fe1fbcd

Please sign in to comment.