Unverified Commit 458ff028 authored by Cheng Li's avatar Cheng Li Committed by GitHub
Browse files

Bug fix: Remove client optimizer param_group list item that does not have 'params' (#827)


Co-authored-by: default avatarJeff Rasley <jerasley@microsoft.com>
parent 35fd7ccd
...@@ -585,6 +585,12 @@ class DeepSpeedEngine(Module): ...@@ -585,6 +585,12 @@ class DeepSpeedEngine(Module):
def _configure_optimizer(self, client_optimizer, model_parameters): def _configure_optimizer(self, client_optimizer, model_parameters):
if client_optimizer is not None: if client_optimizer is not None:
client_optimizer.param_groups[:] = [
pg for pg in client_optimizer.param_groups if len(pg["params"]) != 0
]
logger.info(
"Removing param_group that has no 'params'in the client Optimizer")
basic_optimizer = client_optimizer basic_optimizer = client_optimizer
if self.global_rank == 0: if self.global_rank == 0:
logger.info('Using client Optimizer as basic optimizer') logger.info('Using client Optimizer as basic optimizer')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment