MCPcopy Index your code
hub / github.com/deepspeedai/DeepSpeed / module_state_dict

Method module_state_dict

deepspeed/runtime/engine.py:3484–3495  ·  view source on GitHub ↗
(self, destination=None, prefix="", keep_vars=False, exclude_frozen_parameters=False)

Source from the content-addressed store, hash-verified

3482 return tensor_list
3483
3484 def module_state_dict(self, destination=None, prefix="", keep_vars=False, exclude_frozen_parameters=False):
3485 sd = self.module.state_dict(destination=destination, prefix=prefix, keep_vars=keep_vars)
3486
3487 # Remove frozen parameter weights from state_dict if specified
3488 if exclude_frozen_parameters:
3489 for n, p in self.module.named_parameters():
3490 if not p.requires_grad and n in sd:
3491 del sd[n]
3492
3493 if self.random_ltd_enabled():
3494 sd = remove_random_ltd_state_dict(sd)
3495 return sd
3496
3497 @staticmethod
3498 def load_moe_state_dict(checkpoint_path,

Callers 3

_save_checkpointMethod · 0.95
save_16bit_modelMethod · 0.95
_save_moe_checkpointMethod · 0.45

Calls 3

random_ltd_enabledMethod · 0.95
state_dictMethod · 0.45

Tested by

no test coverage detected