Skip to content

Commit

Permalink
undo merge error (#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Anthony authored Nov 27, 2024
1 parent a8f7913 commit f532580
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions megatron/model/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,9 +1248,8 @@ def forward(self, x, attention_mask, layer_past=None):
raise KeyError(self.moe_type)

with torch.enable_grad() if not self.eval else nullcontext():
if (
mlp_bias == None,
self.num_experts > 1 and self.moe_type == "deepspeed",
if mlp_bias == None or (
self.num_experts > 1 and self.moe_type == "deepspeed"
):
# No dropout either
assert mlp_bias is None
Expand Down
2 changes: 1 addition & 1 deletion megatron/neox_arguments/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ def calculate_derived(self):
else:
fp16_conflict = "DeepSpeed fp16 field was set but precision conflicts"
assert self.precision == "fp16", fp16_conflict

if self.bf16 and self.bf16.get("enabled", False):
if self.precision is None:
self.update_value("precision", "bfloat16")
Expand Down

0 comments on commit f532580

Please sign in to comment.