diff --git a/megatron/core/models/common/language_module/language_module.py b/megatron/core/models/common/language_module/language_module.py index 9d8eddbdda6..d238e2130d9 100644 --- a/megatron/core/models/common/language_module/language_module.py +++ b/megatron/core/models/common/language_module/language_module.py @@ -1,4 +1,4 @@ -# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. import logging import os from typing import Optional, Tuple @@ -202,7 +202,8 @@ def setup_embeddings_and_output_layer(self) -> None: # Mark embedding and output layer for decoupled_lr and other features. # This is the original Megatron attribute used by decoupled_lr, Muon, FSDP, etc. - if self.pre_process and hasattr(self, 'embedding'): + # Include MTP-stage embedding too: it is a duplicated copy of the pre_process embedding + if (self.pre_process or getattr(self, 'mtp_process', False)) and hasattr(self, 'embedding'): self.embedding.word_embeddings.weight.is_embedding_or_output_parameter = True if ( self.post_process