Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion transformer_engine/pytorch/module/grouped_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def backward(ctx, grad_output: torch.Tensor) -> Tuple[Union[torch.Tensor, None],
use_split_accumulator=wgrad_gemm_use_split_accumulator,
accumulate=(
accumulate_wgrad_into_param_main_grad
if not getattr(weights[0], "overwrite_main_grad", False)
if not getattr(origin_weights[0], "overwrite_main_grad", False)
else False
),
)
Expand Down
2 changes: 1 addition & 1 deletion transformer_engine/pytorch/module/layernorm_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ def backward(
"quantization_params": ctx.grad_weight_quantizer,
"accumulate": (
accumulate_wgrad_into_param_main_grad
if not getattr(weight, "overwrite_main_grad", False)
if not getattr(origin_weight, "overwrite_main_grad", False)
else False
),
"layout": "NT",
Expand Down
4 changes: 2 additions & 2 deletions transformer_engine/pytorch/module/layernorm_mlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ def backward(
"quantization_params": ctx.fc2_grad_weight_quantizer, # wgrad in high precision
"accumulate": (
accumulate_wgrad_into_param_main_grad
if not getattr(fc1_weight, "overwrite_main_grad", False)
if not getattr(origin_fc2_weight, "overwrite_main_grad", False)
else False
),
"layout": "NT",
Expand Down Expand Up @@ -1471,7 +1471,7 @@ def fc2_wgrad_gemm(
"quantization_params": ctx.fc1_grad_weight_quantizer,
"accumulate": (
accumulate_wgrad_into_param_main_grad
if not getattr(fc2_weight, "overwrite_main_grad", False)
if not getattr(origin_fc1_weight, "overwrite_main_grad", False)
else False
),
"layout": "NT",
Expand Down
Loading