From c7c12a8aabf3e1e3efb131282e31fa8838950c8f Mon Sep 17 00:00:00 2001 From: "Etienne.bfx" Date: Fri, 12 Apr 2024 22:47:51 +0200 Subject: [PATCH 1/2] Update engine.py to avoid torch warning The state_dict function of module.py from torch write a warning if arguments are positional arguments and not keyword arguments --- deepspeed/runtime/engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepspeed/runtime/engine.py b/deepspeed/runtime/engine.py index 992d7877c179..a37efcf60439 100644 --- a/deepspeed/runtime/engine.py +++ b/deepspeed/runtime/engine.py @@ -2542,7 +2542,7 @@ def all_gather_scalar(self, value, dp_group): return tensor_list def module_state_dict(self, destination=None, prefix="", keep_vars=False, exclude_frozen_parameters=False): - sd = self.module.state_dict(destination, prefix, keep_vars) + sd = self.module.state_dict(destination = destination, prefix = prefix,keep_vars = keep_vars) # Remove frozen parameter weights from state_dict if specified if exclude_frozen_parameters: From 584f0c233798a382636713ac87cedfd8c9f5f657 Mon Sep 17 00:00:00 2001 From: ebonnafoux Date: Tue, 16 Apr 2024 20:22:00 +0200 Subject: [PATCH 2/2] formatting --- deepspeed/runtime/engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepspeed/runtime/engine.py b/deepspeed/runtime/engine.py index a37efcf60439..9a2b943b0992 100644 --- a/deepspeed/runtime/engine.py +++ b/deepspeed/runtime/engine.py @@ -2542,7 +2542,7 @@ def all_gather_scalar(self, value, dp_group): return tensor_list def module_state_dict(self, destination=None, prefix="", keep_vars=False, exclude_frozen_parameters=False): - sd = self.module.state_dict(destination = destination, prefix = prefix,keep_vars = keep_vars) + sd = self.module.state_dict(destination=destination, prefix=prefix, keep_vars=keep_vars) # Remove frozen parameter weights from state_dict if specified if exclude_frozen_parameters: