Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down