Skip to content

Commit

Permalink
disable moe logging to avoid deepseek hang (#12168)
Browse files Browse the repository at this point in the history
* disable moe logging to avoid deepseek hang

Signed-off-by: Alexandros Koumparoulis <[email protected]>

* disable moe logging to avoid deepseek hang

Signed-off-by: Alexandros Koumparoulis <[email protected]>

* Apply isort and black reformatting

Signed-off-by: akoumpa <[email protected]>

* Update megatron_strategy.py

pylint

Signed-off-by: Alexandros Koumparoulis <[email protected]>

---------

Signed-off-by: Alexandros Koumparoulis <[email protected]>
Signed-off-by: akoumpa <[email protected]>
Signed-off-by: Alexandros Koumparoulis <[email protected]>
Co-authored-by: akoumpa <[email protected]>
  • Loading branch information
akoumpa and akoumpa authored Feb 14, 2025
1 parent 5a42b6b commit 245f97c
Showing 1 changed file with 5 additions and 3 deletions.
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 @@ def training_step(self, dataloader_iter, *args: Any, **kwargs: Any) -> STEP_OUTP
"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)

return out

Expand Down

0 comments on commit 245f97c

Please sign in to comment.