You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] monitor loss seems not being correctly computed. #3769
So currently the monitored loss is actually mini-batch loss divided by gradient_accumulation_steps, which will vary as the gradient_accumulation_steps changed in different settings. I don't know if it is the expecting behavior and in my opinion gradient_accumulation_steps should not change the training loss curve if global_batch_size is kept unchanged? (for example, micro_batch_size = 8, grad_acc_steps = 8, dp_size=8 should have the similar curve as micro_batch_size = 4, grad_acc_steps = 16, dp_size=8)
To Reproduce
Training with different grad_acc_steps while keeping global_batch_size unchanged.
Sorry but currently I do not have a quick script to reproduce this issue
Expected behavior
A clear and concise description of what you expected to happen.
ds_report output
Please run ds_report to give us details about your setup.
Screenshots
If applicable, add screenshots to help explain your problem.
System info (please complete the following information):
OS: [e.g. Ubuntu 18.04]
GPU count and types [e.g. two machines with x8 A100s each]
Interconnects (if applicable) [e.g., two machines connected with 100 Gbps IB]
Python version
Any other relevant info about your setup
Launcher context
Are you launching your experiment with the deepspeed launcher, MPI, or something else?
Docker context
Are you using a specific docker image that you can share?
Additional context
Add any other context about the problem here.
Adding on to this (as it's related to the same commit), we are seeing that the loss is no longer correctly monitored when no gradient accumulation is set, but it's reported as 0 consistently.
I may be mistaken, but this seems to be just one special case of a more general problem: one element from every interval between gradient accumulations is dropped as the current step's loss at an accumulation boundary is not part of self.losses at the time of reporting and will not be recorded to self.losseshere either.
All of the reported issues seem related to this commit: 4d269c6
I am also experiencing this issue. Is there any patch?
Currently, I just manually collect the losses from rank0 and write the correct loss event again with a different name. This is just what DeepSpeed to in DeepSpeedEngine.
Activity
chhensel commentedon Jun 22, 2023
Adding on to this (as it's related to the same commit), we are seeing that the loss is no longer correctly monitored when no gradient accumulation is set, but it's reported as 0 consistently.
Looking at this logic: https://github.com/microsoft/DeepSpeed/blob/master/deepspeed/runtime/engine.py#L1836-L1850
this seems only natural, because every step is at a gradient accumulation boundary and
self.losseswill be cleared every step.I may be mistaken, but this seems to be just one special case of a more general problem: one element from every interval between gradient accumulations is dropped as the current step's loss at an accumulation boundary is not part of
self.lossesat the time of reporting and will not be recorded toself.losseshere either.All of the reported issues seem related to this commit: 4d269c6
tginart commentedon Jun 22, 2023
I am also experiencing this issue. Is there any patch?
whr94621 commentedon Jun 25, 2023
Currently, I just manually collect the losses from rank0 and write the correct loss event again with a different name. This is just what DeepSpeed to in DeepSpeedEngine.