Skip to content

Commit

Permalink
add DeepSpeedZeroConfig repr method (microsoft#596)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeff Rasley <[email protected]>
  • Loading branch information
stas00 and jeffra authored Dec 11, 2020
1 parent 8a184b6 commit 66268bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deepspeed/runtime/zero/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from deepspeed.runtime.config_utils import get_scalar_param
from deepspeed.utils import logger
from deepspeed.runtime.zero.constants import *
import json


class DeepSpeedZeroConfig(object):
Expand Down Expand Up @@ -54,6 +55,9 @@ def read_zero_config_deprecated(self, param_dict):
def repr(self):
return self.__dict__

def __repr__(self):
return json.dumps(self.__dict__, sort_keys=True, indent=4)

def _initialize(self, zero_config_dict):
self.stage = get_scalar_param(zero_config_dict,
ZERO_OPTIMIZATION_STAGE,
Expand Down

0 comments on commit 66268bd

Please sign in to comment.