Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable moe logging to avoid deepseek hang #12168

Merged
merged 4 commits into from
Feb 14, 2025
Merged
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
8 changes: 5 additions & 3 deletions nemo/lightning/pytorch/strategies/megatron_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

from nemo.core.optim.mcore_optim import McoreDistributedOptimizer
from nemo.lightning import _strategy_lib, io
from nemo.lightning.megatron_parallel import CallbackConnector, MegatronParallel, aggregate_moe_loss_stats
from nemo.lightning.megatron_parallel import CallbackConnector, MegatronParallel
from nemo.lightning.pytorch.callbacks import ModelTransform
from nemo.lightning.pytorch.strategies.utils import (
RestoreConfig,
Expand Down Expand Up @@ -628,9 +628,11 @@
"reduced_train_loss", reduced_train_loss, prog_bar=True, batch_size=1, sync_dist=False
)
# Log any MoE losses.
# @akoumparouli: disabling this as it hangs with deepseek.
# TODO(@akoumparouli): loss_scale depends on the GBS.
for loss_name, loss_value in aggregate_moe_loss_stats(loss_scale=1.0).items():
self.lightning_module.log(loss_name, loss_value, prog_bar=True, rank_zero_only=True, batch_size=1)
# for loss_name, loss_value in aggregate_moe_loss_stats(loss_scale=1.0).items():
# self.lightning_module.log(
# loss_name, loss_value, prog_bar=True, rank_zero_only=True, batch_size=1)
Comment on lines +633 to +635

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

Copilot Autofix AI 2 days ago

To fix the problem, we should remove the commented-out code entirely. This will help maintain the clarity and readability of the code. If the code is needed for future reference, it can be documented in a separate file or re-enabled with proper context.

  • Locate the commented-out code in the training_step method.
  • Remove the commented-out lines (lines 633-635) entirely.
  • Ensure that the removal does not affect the functionality of the surrounding code.
Suggested changeset 1
nemo/lightning/pytorch/strategies/megatron_strategy.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/nemo/lightning/pytorch/strategies/megatron_strategy.py b/nemo/lightning/pytorch/strategies/megatron_strategy.py
--- a/nemo/lightning/pytorch/strategies/megatron_strategy.py
+++ b/nemo/lightning/pytorch/strategies/megatron_strategy.py
@@ -632,5 +632,5 @@
                 # TODO(@akoumparouli): loss_scale depends on the GBS.
-            # for loss_name, loss_value in aggregate_moe_loss_stats(loss_scale=1.0).items():
-            #    self.lightning_module.log(
-            #    loss_name, loss_value, prog_bar=True, rank_zero_only=True, batch_size=1)
+
+
+
 
EOF
@@ -632,5 +632,5 @@
# TODO(@akoumparouli): loss_scale depends on the GBS.
# for loss_name, loss_value in aggregate_moe_loss_stats(loss_scale=1.0).items():
# self.lightning_module.log(
# loss_name, loss_value, prog_bar=True, rank_zero_only=True, batch_size=1)




Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options

return out

Expand Down
Loading