Skip to content

Commit

Permalink
do copy instead of assigment
Browse files Browse the repository at this point in the history
  • Loading branch information
samsja committed Sep 27, 2024
1 parent ba392de commit a143cab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zeroband/diloco.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def sync_inner_model(self, model: nn.Module):

self._logger.debug("sync inner model")
for param_offloaded, param in zip(self.param_list_cpu, model.parameters()):
param.data = param_offloaded.data.to("cuda") # todo: use copy_ here
param.data.copy_(param_offloaded.data.to(param.device)) # todo: use copy_ here

def get_offloaded_param(self, model: nn.Module) -> list[nn.Parameter]:
"""
Expand Down

0 comments on commit a143cab

Please sign in to comment.