-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Description
🐛 Bug
I create a small tensor on cpu that is not pinned. When I call is_pinned I get an exception if Im in Debug mode, but not in Release. I use torchlib (windows) version 1.6. However the issue seems to be a bit random, not always giving the issue.
To Reproduce
auto v = torch::zeros({2, 2})
v.is_pinned();
Steps to reproduce the behavior:
- Run the code above.
Expected behavior
The v.is_pinned() should return true or false.
Environment
- Windows 10
- torchlib v1.6
- Microsoft Visual Studio Community 2019, Version 16.5.5
Additional context
There seem to be an intermittent issue with pinning for me in general. Occasionally it throws an exception. For instance creating
an small pinned tensor using torch::empty. The trace for such an error:
Exception raised from DynamicLibrary at ....\aten\src\ATen\DynamicLibrary.cpp:53 (most recent call first):
00007FFD93C76F3200007FFD93C765E0 c10.dll!c10::detail::LogAPIUsageFakeReturn [ @ ]
00007FFD93C7737200007FFD93C765E0 c10.dll!c10::detail::LogAPIUsageFakeReturn [ @ ]
00007FFD93C76F9200007FFD93C765E0 c10.dll!c10::detail::LogAPIUsageFakeReturn [ @ ]
00007FFD93C77DD100007FFD93C765E0 c10.dll!c10::detail::LogAPIUsageFakeReturn [ @ ]
00007FFD93C77B6500007FFD93C765E0 c10.dll!c10::detail::LogAPIUsageFakeReturn [ @ ]
00007FFD93C75B3F00007FFD93C75AD0 c10.dll!c10::Error::Error [ @ ]
00007FFCEF9025A300007FFCEF9023E0 torch_cpu.dll!at::DynamicLibrary::DynamicLibrary [ @ ]
00007FFD0178A6DB00007FFD01789410 torch_cuda.dll!at::cuda::getPinnedMemoryAllocator [ @ ]
00007FFD017899F400007FFD01789410 torch_cuda.dll!at::cuda::getPinnedMemoryAllocator [ @ ]
00007FFD01789C2800007FFD01789410 torch_cuda.dll!at::cuda::getPinnedMemoryAllocator [ @ ]
00007FFD0178A02900007FFD01789410 torch_cuda.dll!at::cuda::getPinnedMemoryAllocator [ @ ]
00007FFD018E0ED300007FFD018D3700 torch_cuda.dll!THCCachingHostAllocator_emptyCache [ @ ]
00007FFD018D359A00007FFD01791A70 torch_cuda.dll!at::native::set_cuda_ [ @ ]
00007FFCEFF13F9000007FFCEFF13AD0 torch_cpu.dll!at::native::empty_cpu [ @ ]
00007FFCF02F2E2000007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02E92F800007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02EC46C00007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02D05E000007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02D6D2000007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02EE6EA00007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02B94A600007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02E92F800007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02EC46C00007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02D05E000007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF02D6D2000007FFCF02B16D0 torch_cpu.dll!at::native::mkldnn_sigmoid_ [ @ ]
00007FFCF056413800007FFCF04027B0 torch_cpu.dll!at::_test_serialization_subcmul [ @ ]
00007FFCF05F7D1900007FFCF04027B0 torch_cpu.dll!at::_test_serialization_subcmul [ @ ]
00007FFCF03B517900007FFCF03B5040 torch_cpu.dll!at::empty [ @ ]
00007FFD93D19B5600007FFD93D19AA0 cstorchlib.dll!<lambda_aef86b9d363f7b679dd639b14320b516>::operator() [C:\Packages\libtorch\include\torch\csrc\autograd\generated\variable_factories.h @ 217]
00007FFD93D1A6FD00007FFD93D1A690 cstorchlib.dll!torch::empty [C:\Packages\libtorch\include\torch\csrc\autograd\generated\variable_factories.h @ 215]
00007FFD93D1181600007FFD93D11730 cstorchlib.dll!torch_empty [C:\Users\anders\Documents\GitHub\cstorch\cstorch_solution\cstorchlib\tensor.cpp @ 45]
00007FFD3534DA6B ! [ @ ]
cc @ezyang @gchanan @zou3519 @bdhirsh @heitorschueroff @peterjc123 @maxluk @nbcsm @guyang3532 @gunandrose4u @smartcat2010 @mszhanyi