From 7e6f793c5182d7da95e443967be0a6c9777bd01e Mon Sep 17 00:00:00 2001 From: duanjunwen <935724073@qq.com> Date: Tue, 24 Sep 2024 08:08:32 +0000 Subject: [PATCH] [fix] fix detach_output_obj clone; --- colossalai/pipeline/schedule/zero_bubble_pp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/colossalai/pipeline/schedule/zero_bubble_pp.py b/colossalai/pipeline/schedule/zero_bubble_pp.py index 31befd052..bbad921b2 100644 --- a/colossalai/pipeline/schedule/zero_bubble_pp.py +++ b/colossalai/pipeline/schedule/zero_bubble_pp.py @@ -622,10 +622,10 @@ class ZeroBubbleVPipeScheduler(PipelineSchedule): else: # detach output detached_output_obj = tree_map(detach, output_obj) - # 3-2 clone output - output_obj = tree_map(clone, output_obj) + # 3-2 clone detached_output_obj + detached_output_obj = tree_map(clone, detached_output_obj) + # 3-3 release cloned output.data; release_tensor_data output for bwd b & w; (do not detach output) - # output_obj = tree_map(clone, output_obj) if model_chunk_id == 1 and self.stage_manager.is_first_stage(ignore_chunk=True): # We should not release_tensor_data bwd LOSS pass