Skip to content

Commit 12a2a22

Browse files
committed
fix ut
Signed-off-by: Hongbin Liu <hongbinl@nvidia.com>
1 parent 97de523 commit 12a2a22

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

megatron/core/models/common/model_chunk_schedule_plan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,8 @@ def run(
505505
b_grad=b_grad,
506506
is_last_layer_in_bwd=(i == b_num_layers - 1),
507507
)
508-
b_layer.release_state()
508+
if i < b_num_layers - 1:
509+
b_layer.release_state()
509510
torch.cuda.nvtx.range_pop()
510511

511512
# backward pass for the remaining layers

0 commit comments

Comments
 (0)