pytorch_dlprim icon indicating copy to clipboard operation
pytorch_dlprim copied to clipboard

Error with torch.save(model.state_dict(), sPath): don't know how to determine data location of torch.storage.UntypedStorage

Open sukamenev opened this issue 1 year ago • 3 comments

torch.save(model.state_dict(), sFileName) File "/home/ineev/programming/ZenDnn/lib/python3.10/site-packages/torch/serialization.py", line 423, in save _save(obj, opened_zipfile, pickle_module, pickle_protocol) File "/home/ineev/programming/ZenDnn/lib/python3.10/site-packages/torch/serialization.py", line 635, in _save pickler.dump(obj) File "/home/ineev/programming/ZenDnn/lib/python3.10/site-packages/torch/serialization.py", line 620, in persistent_id location = location_tag(storage) File "/home/ineev/programming/ZenDnn/lib/python3.10/site-packages/torch/serialization.py", line 209, in location_tag raise RuntimeError("don't know how to determine data location of " RuntimeError: don't know how to determine data location of torch.storage.UntypedStorage

Error raised only when I'm using ocl-backend.

sukamenev avatar Mar 23 '24 15:03 sukamenev

I don't know why this is happening. But I recall if I move the model to CPU it saves correctly.

I hadn't figured out yet why it fails.

artyom-beilis avatar Mar 23 '24 16:03 artyom-beilis

Yes. Model on CPU saves correctly.

sukamenev avatar Mar 23 '24 21:03 sukamenev

Do you have any idea what part of the code is wrong?

sukamenev avatar Mar 25 '24 21:03 sukamenev

Already fixed in master some time ago - I needed to implement allocator interface for backend

artyom-beilis avatar Aug 29 '24 19:08 artyom-beilis