Skip to content

static loss scale with stage 0 occured error #7145

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

Open
zoyC-0a opened this issue Mar 17, 2025 · 1 comment
Open

static loss scale with stage 0 occured error #7145

zoyC-0a opened this issue Mar 17, 2025 · 1 comment

Comments

@zoyC-0a
Copy link

zoyC-0a commented Mar 17, 2025

optimizer = FP16_Optimizer(

Config:
`
deepspeed_config = {
"fp16": {
"enabled": "auto",
"loss_scale": 4,
"loss_scale_window": 1000,
"initial_scale_power": 16,
"hysteresis": 2,
"min_loss_scale": 0.00001,
"auto_cast": True
},

"zero_optimization": {
    "stage": 0
},

"optimizer": {
    "type": "AdamW",
    "params": {
        "lr": "auto",
        "betas": "auto",
        "eps": "auto",
        "weight_decay": "auto"
    }
},

"scheduler": {
    "type": "WarmupLR",
    "params": {
        "warmup_min_lr": "auto",
        "warmup_max_lr": "auto",
        "warmup_num_steps": "auto"
    }
},
"gradient_clipping": 'auto',
"train_batch_size": 'auto',
"train_micro_batch_size_per_gpu": 'auto'

}
`

Error be like :
File "/usr/local/miniconda3/lib/python3.10/site-packages/deepspeed/runtime/engine.py", line 2119, in _take_model_step self.optimizer.step() File "/usr/local/miniconda3/lib/python3.10/site-packages/deepspeed/runtime/fp16/fused_optimizer.py", line 255, in step self.timers(OVERFLOW_CHECK_TIMER).start() TypeError: 'NoneType' object is not callable

So may be we should initialize timer before line 1571?

Then I changed zero_optimization to stage 2, and the error didn't show up again. Or are there any other solutions?

@tjruwase
Copy link
Contributor

@zoyC-0a, thanks for reporting this error. Do you mind creating a PR to pass timers=timers just like

timers=timers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants