MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / __check_params

Method __check_params

deepspeed/runtime/engine.py:1017–1022  ·  view source on GitHub ↗
(model: Module, dtype: torch.dtype)

Source from the content-addressed store, hash-verified

1015
1016 @staticmethod
1017 def __check_params(model: Module, dtype: torch.dtype) -> None:
1018 return
1019 if not all(param.dtype == dtype for param in model.parameters()) and dist.get_rank() == 0:
1020 raise ValueError(f"{dtype} is enabled but the following parameters have dtype that is "
1021 f"not {dtype}: "
1022 f"{[(n, p.dtype) for n, p in model.named_parameters() if p.dtype != dtype]}")
1023
1024 def _set_client_model(self, model):
1025 # register client model in _modules so that nn.module methods work correctly

Callers 1

Calls 1

get_rankMethod · 0.45

Tested by

no test coverage detected