Skip to content
Closed
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
6 changes: 6 additions & 0 deletions megatron/core/transformer/multi_token_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ def _checkpointed_forward(
hidden_states: Tensor,
decoder_input: Tensor,
attention_mask: Optional[Tensor] = None,
padding_mask: Optional[Tensor] = None,
context: Optional[Tensor] = None,
context_mask: Optional[Tensor] = None,
rotary_pos_emb: Optional[Tensor] = None,
Expand Down Expand Up @@ -1130,6 +1131,7 @@ def custom_forward(
hidden_states,
decoder_input,
attention_mask,
padding_mask,
context,
context_mask,
rotary_pos_emb,
Expand All @@ -1141,6 +1143,7 @@ def custom_forward(
hidden_states=hidden_states,
decoder_input=decoder_input,
attention_mask=attention_mask,
padding_mask=padding_mask,
context=context,
context_mask=context_mask,
rotary_pos_emb=rotary_pos_emb,
Expand Down Expand Up @@ -1187,6 +1190,7 @@ def checkpoint_handler():
hidden_states,
decoder_input,
attention_mask,
padding_mask,
context,
context_mask,
rotary_pos_emb,
Expand All @@ -1206,6 +1210,7 @@ def checkpoint_handler():
hidden_states,
decoder_input,
attention_mask,
padding_mask,
context,
context_mask,
rotary_pos_emb,
Expand All @@ -1232,6 +1237,7 @@ def checkpoint_handler():
hidden_states=hidden_states,
decoder_input=decoder_input,
attention_mask=attention_mask,
padding_mask=padding_mask,
context=context,
context_mask=context_mask,
rotary_pos_emb=rotary_pos_emb,
Expand Down
3 changes: 0 additions & 3 deletions tests/unit_tests/transformer/test_multi_token_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ def test_sharded_state_dict(self, tp, cp):
assert f"mtp.layers.{i}.hnorm.weight" in sharded_state_dict.keys()
assert f"mtp.layers.{i}.eh_proj.weight" in sharded_state_dict.keys()

@pytest.mark.flaky_in_dev
@pytest.mark.skipif(
not HAVE_TE or not is_te_min_version("2.1.0"),
reason="grouped_gemm requires TransformerEngine >= 2.1.0",
Expand Down Expand Up @@ -530,7 +529,6 @@ def set_ckpt_path(ckpt_path):
for name, param in gpt_model[0].named_parameters():
assert param.main_grad is not None

@pytest.mark.flaky_in_dev
@pytest.mark.skipif(
not HAVE_TE or not is_te_min_version("1.7.0"),
reason="Only transformer-engine>=1.7.0 supports MoE FP8 training",
Expand Down Expand Up @@ -627,7 +625,6 @@ def test_packed_sequences(self, tp, cp):
for name, param in gpt_model[0].named_parameters():
assert param.main_grad is not None, f"Gradient missing for {name}"

@pytest.mark.flaky_in_dev
@pytest.mark.skipif(
not HAVE_TE or not is_te_min_version("2.1.0"),
reason="grouped_gemm requires TransformerEngine >= 2.1.0",
Expand Down
Loading