cbensimon HF Staff commited on
Commit
8acf492
·
1 Parent(s): f10a213

Revert "ZeroGPUWeights debug"

Browse files

This reverts commit 59e1cbc48c603c308c5e092af931ab9683a55b5d.

Files changed (1) hide show
  1. optimization_utils.py +0 -2
optimization_utils.py CHANGED
@@ -27,7 +27,6 @@ class ZeroGPUWeights:
27
  else:
28
  self.constants_map = constants_map
29
  def __reduce__(self):
30
- print('ZeroGPUWeights.__reduce__', f'{id(self)=}', sum([tensor.nbytes for tensor in self.constants_map.values()]))
31
  constants_map: dict[str, torch.Tensor] = {}
32
  for name, tensor in self.constants_map.items():
33
  tensor_ = torch.empty_like(tensor, device='cpu').pin_memory()
@@ -47,7 +46,6 @@ class ZeroGPUCompiledModel:
47
  self.compiled_model.set(compiled_model)
48
  return compiled_model(*args, **kwargs)
49
  def __reduce__(self):
50
- print('ZeroGPUCompiledModel.__reduce__', f'{id(self.weights)=}')
51
  return ZeroGPUCompiledModel, (self.archive_file, self.weights)
52
 
53
 
 
27
  else:
28
  self.constants_map = constants_map
29
  def __reduce__(self):
 
30
  constants_map: dict[str, torch.Tensor] = {}
31
  for name, tensor in self.constants_map.items():
32
  tensor_ = torch.empty_like(tensor, device='cpu').pin_memory()
 
46
  self.compiled_model.set(compiled_model)
47
  return compiled_model(*args, **kwargs)
48
  def __reduce__(self):
 
49
  return ZeroGPUCompiledModel, (self.archive_file, self.weights)
50
 
51