Spaces:
Runtime error
Runtime error
ZeroGPUWeights debug
Browse files26 unmodified lines27282930313213 unmodified lines46474849505126 unmodified lineselse:self.constants_map = constants_mapdef __reduce__(self):constants_map: dict[str, torch.Tensor] = {}for name, tensor in self.constants_map.items():tensor_ = torch.empty_like(tensor, device='cpu').pin_memory()13 unmodified linesself.compiled_model.set(compiled_model)return compiled_model(*args, **kwargs)def __reduce__(self):return ZeroGPUCompiledModel, (self.archive_file, self.weights)26 unmodified lines2728293031323313 unmodified lines4748495051525326 unmodified lineselse:self.constants_map = constants_mapdef __reduce__(self):print('ZeroGPUWeights.__reduce__', f'{id(self)=}', sum([tensor.nbytes for tensor in self.constants_map.values()]))constants_map: dict[str, torch.Tensor] = {}for name, tensor in self.constants_map.items():tensor_ = torch.empty_like(tensor, device='cpu').pin_memory()13 unmodified linesself.compiled_model.set(compiled_model)return compiled_model(*args, **kwargs)def __reduce__(self):print('ZeroGPUCompiledModel.__reduce__', f'{id(self.weights)=}')return ZeroGPUCompiledModel, (self.archive_file, self.weights)
optimization_utils.py+2