Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug when transferring a tensor to pinned memory #1250

Open
sebffischer opened this issue Jan 22, 2025 · 0 comments
Open

bug when transferring a tensor to pinned memory #1250

sebffischer opened this issue Jan 22, 2025 · 0 comments

Comments

@sebffischer
Copy link
Collaborator

Not sure why this happens:

> x = torch_tensor(1, device = torch_device("cpu"))
> x$pin_memory(device = torch_device("cpu"))
Error in (function (self, device)  : 
  Attempted to set the storage of a tensor on device "cpu" to a storage on different device "mps:0".  This is no longer allowed; the devices must match.
Exception raised from checkSetStorage at /Users/runner/work/libtorch-mac-m1/libtorch-mac-m1/pytorch/aten/src/ATen/native/Resize.h:139 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) + 52 (0x10367c11c in libc10.dylib)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 140 (0x103678d6c in libc10.dylib)
frame #2: void at::native::checkSetStorage<long long>(at::Tensor&, c10::Storage, long long, c10::ArrayRef<long long>, c10::ArrayRef<long long>) + 496 (0x153902bec in libtorch_cpu.dylib)
frame #3: at::native::set_storage_cpu_(at::Tensor&, c10::Storage, long long, c10::ArrayRef<long long>, c10::ArrayRef<
> x$pin_memory()
Error in (function (self, device)  : Expected a torch_device
> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant