Unverified Commit 66268bd3 authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

add DeepSpeedZeroConfig repr method (#596)


Co-authored-by: default avatarJeff Rasley <jerasley@microsoft.com>
parent 8a184b6b
...@@ -6,6 +6,7 @@ Licensed under the MIT license. ...@@ -6,6 +6,7 @@ Licensed under the MIT license.
from deepspeed.runtime.config_utils import get_scalar_param from deepspeed.runtime.config_utils import get_scalar_param
from deepspeed.utils import logger from deepspeed.utils import logger
from deepspeed.runtime.zero.constants import * from deepspeed.runtime.zero.constants import *
import json
class DeepSpeedZeroConfig(object): class DeepSpeedZeroConfig(object):
...@@ -54,6 +55,9 @@ class DeepSpeedZeroConfig(object): ...@@ -54,6 +55,9 @@ class DeepSpeedZeroConfig(object):
def repr(self): def repr(self):
return self.__dict__ return self.__dict__
def __repr__(self):
return json.dumps(self.__dict__, sort_keys=True, indent=4)
def _initialize(self, zero_config_dict): def _initialize(self, zero_config_dict):
self.stage = get_scalar_param(zero_config_dict, self.stage = get_scalar_param(zero_config_dict,
ZERO_OPTIMIZATION_STAGE, ZERO_OPTIMIZATION_STAGE,
......
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