Skip to content

Commit c0ccc61

Browse files
authored
[FEA] PP prepare_inputs add autocast (#10502) (#11043)
1 parent 8f88a68 commit c0ccc61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddlenlp/trainer/trainer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2568,7 +2568,8 @@ def training_pipeline_step(self, model: nn.Layer, inputs: Dict[str, Union[paddle
25682568
# for v in self._pp_data_buffer[0].values():
25692569
# assert isinstance(v, paddle.Tensor), f"Only support tensor as pipeline mode input, got type {type(v)}"
25702570

2571-
inputs = model._prepare_pipeline_inputs_func(self._pp_data_buffer)
2571+
with self.autocast_smart_context_manager():
2572+
inputs = model._prepare_pipeline_inputs_func(self._pp_data_buffer)
25722573
self._pp_data_buffer = []
25732574

25742575
model.train()

0 commit comments

Comments
 (0)