Skip to content
Snippets Groups Projects
Commit 2ffd556f authored by Tim Tobias Bauerle's avatar Tim Tobias Bauerle
Browse files

Set CPU as default location for unpickling received data to decrease GPU memory consumption

parent a2e920b1
Branches
No related tags found
2 merge requests!18Merge in main,!14Experiment configs
......@@ -27,7 +27,8 @@ def _tensor_to_bytes(tensor: torch.Tensor) -> bytes:
def _bytes_to_tensor(raw_bytes: bytes) -> torch.Tensor:
return pickle.loads(raw_bytes)
bs = io.BytesIO(raw_bytes)
return CpuUnpickler(bs).load()
def _state_dict_to_bytes(state_dict: StateDict) -> bytes:
......@@ -46,7 +47,8 @@ def _metrics_to_bytes(
def _bytes_to_metrics(raw_bytes: bytes):
return pickle.loads(raw_bytes)
bs = io.BytesIO(raw_bytes)
return CpuUnpickler(bs).load()
def tensor_to_proto(tensor: torch.Tensor) -> datastructures_pb2.Tensor:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment