File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -3293,6 +3293,8 @@ def prediction_pipeline_step(
3293
3293
actual_batch_size = inputs .shape [0 ]
3294
3294
model .micro_batch_size = 1
3295
3295
model .accumulate_steps = actual_batch_size
3296
+ # train & eval share the same p2p_helper, so clear it before and after each step
3297
+ model ._p2p_helper .clear_meta_cache ()
3296
3298
3297
3299
with paddle .no_grad ():
3298
3300
if has_labels :
@@ -3303,6 +3305,8 @@ def prediction_pipeline_step(
3303
3305
else :
3304
3306
raise ValueError ("pipeline mode eval need label!" )
3305
3307
model .micro_batch_size , model .accumulate_steps = model_config_backup
3308
+ # train & eval share the same p2p_helper, so clear it before and after each step
3309
+ model ._p2p_helper .clear_meta_cache ()
3306
3310
3307
3311
return (loss , None , labels )
3308
3312
You can’t perform that action at this time.
0 commit comments