Unverified Commit 61cf1020 authored by Liyuan Liu's avatar Liyuan Liu Committed by GitHub
Browse files

bug fix for using `return_layernorm_output=True` (#1382)



the current implementation would release the output of ln, leading to an error if setting `return_layernorm_output=True`.
Signed-off-by: default avatarLiyuan Liu <llychinalz@gmail.com>
Co-authored-by: default avatarTim Moon <4406448+timmoon10@users.noreply.github.com>
parent b898cbe1
...@@ -373,7 +373,7 @@ class _LayerNormMLP(torch.autograd.Function): ...@@ -373,7 +373,7 @@ class _LayerNormMLP(torch.autograd.Function):
ub=ub_obj_lnout if ub_overlap_ag else None, ub=ub_obj_lnout if ub_overlap_ag else None,
extra_output_tensor=ln_out if ub_overlap_ag else None, extra_output_tensor=ln_out if ub_overlap_ag else None,
) )
if not is_grad_enabled: if not is_grad_enabled and not return_layernorm_output:
clear_tensor_data(ln_out_total) clear_tensor_data(ln_out_total)
if bias_gelu_nvfusion: if bias_gelu_nvfusion:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment