Skip to content

Commit b6346bf

Browse files
authored
double reduction user-friendly error (#7895)
Currently a numerical order of the param tells nothing to the user of what param is the problem. This PR fixes that. before: ``` AssertionError: The parameter 0 has already been reduced. ... ``` after: ``` AssertionError: The parameter model.embed_tokens.weight has already been reduced. ```
1 parent d9a4aad commit b6346bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deepspeed/runtime/zero/stage_1_and_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ def reduce_ipg_grads(self, comm_dtype=None):
15721572
param = self.bit16_groups[group_idx][param_idx_in_group]
15731573

15741574
assert self.params_already_reduced[param_id] == False, \
1575-
f"The parameter {param_id} has already been reduced. \
1575+
f"The parameter {debug_param2name(param)} has already been reduced. \
15761576
Gradient computed twice for this partition. \
15771577
Multiple gradient reduction is currently not supported"
15781578

0 commit comments

Comments
 (0)