rust-bert icon indicating copy to clipboard operation
rust-bert copied to clipboard

cargo run doesn`t work as expected!

Open SorooshMortazavi opened this issue 2 years ago • 11 comments

hello when i want to execute the project the following errors accures :

**The following warnings were emitted during compilation:

warning: libtch/torch_api.cpp:4:10: fatal error: torch/csrc/jit/passes/normalize_ops.h: No such file or directory warning: 4 | #include <torch/csrc/jit/passes/normalize_ops.h> warning: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: compilation terminated.

error: failed to run custom build command for torch-sys v0.6.1

Caused by: process didn't exit successfully: /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-af165b7611e2d52f/build-script-build (exit status: 1) --- stdout cargo:rerun-if-env-changed=TORCH_CUDA_VERSION cargo:rerun-if-env-changed=LIBTORCH cargo:rustc-link-search=native=/home/hp/Downloads/libtorch-shared-with-deps-latest/libtorch/lib cargo:rerun-if-changed=libtch/torch_api.cpp cargo:rerun-if-changed=libtch/torch_api.h cargo:rerun-if-changed=libtch/torch_api_generated.cpp.h cargo:rerun-if-changed=libtch/torch_api_generated.h cargo:rerun-if-changed=libtch/stb_image_write.h cargo:rerun-if-changed=libtch/stb_image_resize.h cargo:rerun-if-changed=libtch/stb_image.h cargo:rerun-if-env-changed=LIBTORCH_CXX11_ABI TARGET = Some("x86_64-unknown-linux-gnu") OPT_LEVEL = Some("0") HOST = Some("x86_64-unknown-linux-gnu") CXX_x86_64-unknown-linux-gnu = None CXX_x86_64_unknown_linux_gnu = None HOST_CXX = None CXX = None CXXFLAGS_x86_64-unknown-linux-gnu = None CXXFLAGS_x86_64_unknown_linux_gnu = None HOST_CXXFLAGS = None CXXFLAGS = None CRATE_CC_NO_DEFAULTS = None DEBUG = Some("true") CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2") running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/home/hp/Downloads/libtorch-shared-with-deps-latest/libtorch/include" "-I" "/home/hp/Downloads/libtorch-shared-with-deps-latest/libtorch/include/torch/csrc/api/include" "-Wl,-rpath=/home/hp/Downloads/libtorch-shared-with-deps-latest/libtorch/lib" "-std=c++14" "-D_GLIBCXX_USE_CXX11_ABI=1" "-o" "/home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-be15b08249a50a06/out/libtch/torch_api.o" "-c" "libtch/torch_api.cpp" cargo:warning=libtch/torch_api.cpp:4:10: fatal error: torch/csrc/jit/passes/normalize_ops.h: No such file or directory cargo:warning= 4 | #include <torch/csrc/jit/passes/normalize_ops.h> cargo:warning= | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cargo:warning=compilation terminated. exit status: 1

--- stderr

error occurred: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/home/hp/Downloads/libtorch-shared-with-deps-latest/libtorch/include" "-I" "/home/hp/Downloads/libtorch-shared-with-deps-latest/libtorch/include/torch/csrc/api/include" "-Wl,-rpath=/home/hp/Downloads/libtorch-shared-with-deps-latest/libtorch/lib" "-std=c++14" "-D_GLIBCXX_USE_CXX11_ABI=1" "-o" "/home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-be15b08249a50a06/out/libtch/torch_api.o" "-c" "libtch/torch_api.cpp" with args "c++" did not execute successfully (status code exit status: 1).

warning: build failed, waiting for other jobs to finish... error: build failed``**

i want to try cuda version and my cuda version is 10.1 but above errors showed to me

SorooshMortazavi avatar Mar 30 '22 14:03 SorooshMortazavi

Hello @SorooshMortazavi ,

Which version of the library are you using, and which version of libtorch have you downloaded?

guillaume-be avatar Apr 04 '22 17:04 guillaume-be

i use [email protected] and [email protected] and got this error now i`m trying to install cuda 10.2 in ubuntu 20.04.4 (my nvcc version was 10.1) because i tried [email protected] and libtorch with TORCH_CUDA_VERSION=cu111 and i got another error:

Finished dev [unoptimized + debuginfo] target(s) in 0.25s
     Running `target/debug/test-rust-bert2 test-rust-bert2`
Error: Tch tensor error: Internal torch error: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 3.95 GiB total capacity; 3.29 GiB already allocated; 7.19 MiB free; 3.31 GiB reserved in total by PyTorch)
Exception raised from malloc at ../c10/cuda/CUDACachingAllocator.cpp:288 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x69 (0x7f76297ffb29 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libc10.so)
frame #1: <unknown function> + 0x20109 (0x7f7628f47109 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libc10_cuda.so)
frame #2: <unknown function> + 0x20f97 (0x7f7628f47f97 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libc10_cuda.so)
frame #3: <unknown function> + 0x21584 (0x7f7628f48584 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libc10_cuda.so)
frame #4: THCStorage_resizeBytes(THCState*, c10::StorageImpl*, long) + 0x92 (0x7f766291b062 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cuda_cpp.so)
frame #5: at::native::empty_strided_cuda(c10::ArrayRef<long>, c10::ArrayRef<long>, c10::optional<c10::ScalarType>, c10::optional<c10::Layout>, c10::optional<c10::Device>, c10::optional<bool>) + 0x8b3 (0x7f766285e8a3 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cuda_cpp.so)
frame #6: <unknown function> + 0x2e95775 (0x7f76b81d6775 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cuda_cu.so)
frame #7: <unknown function> + 0x2e95853 (0x7f76b81d6853 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cuda_cu.so)
frame #8: <unknown function> + 0x170a993 (0x7f762b144993 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #9: <unknown function> + 0x16b6fdd (0x7f762b0f0fdd in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #10: at::empty_strided(c10::ArrayRef<long>, c10::ArrayRef<long>, c10::TensorOptions) + 0x176 (0x7f762af81cd6 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #11: at::native::to(at::Tensor const&, c10::Device, c10::ScalarType, bool, bool, c10::optional<c10::MemoryFormat>) + 0x62b (0x7f762ac392cb in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #12: <unknown function> + 0x1898df4 (0x7f762b2d2df4 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #13: at::Tensor::to(c10::Device, c10::ScalarType, bool, bool, c10::optional<c10::MemoryFormat>) const + 0x196 (0x7f762b493746 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #14: torch::jit::Unpickler::readInstruction() + 0x17f9 (0x7f762d24a7d9 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #15: torch::jit::Unpickler::run() + 0xa8 (0x7f762d24b318 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #16: torch::jit::Unpickler::parse_ivalue() + 0x2e (0x7f762d24b53e in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #17: torch::jit::readArchiveAndTensors(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, c10::optional<std::function<c10::StrongTypePtr (c10::QualifiedName const&)> >, c10::optional<std::function<c10::intrusive_ptr<c10::ivalue::Object, c10::detail::intrusive_target_default_null_type<c10::ivalue::Object> > (c10::StrongTypePtr, c10::IValue)> >, c10::optional<c10::Device>, caffe2::serialize::PyTorchStreamReader&) + 0x471 (0x7f762d1f4d71 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #18: <unknown function> + 0x37bb010 (0x7f762d1f5010 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #19: <unknown function> + 0x37bdeb7 (0x7f762d1f7eb7 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #20: torch::jit::load(std::shared_ptr<caffe2::serialize::ReadAdapterInterface>, c10::optional<c10::Device>, std::unordered_map<std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&) + 0x1a4 (0x7f762d1f8554 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #21: torch::jit::load(std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, c10::optional<c10::Device>, std::unordered_map<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >&) + 0xc5 (0x7f762d1fb305 in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #22: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, c10::optional<c10::Device>) + 0x6f (0x7f762d1fb40f in /home/hp/projects/test-rust-bert2/target/debug/build/torch-sys-0c63541dcafbe144/out/libtorch/libtorch/lib/libtorch_cpu.so)
frame #23: <unknown function> + 0xe2523f (0x55bf9d6cb23f in target/debug/test-rust-bert2)
frame #24: <unknown function> + 0x275ec3 (0x55bf9cb1bec3 in target/debug/test-rust-bert2)
frame #25: <unknown function> + 0x1f492c (0x55bf9ca9a92c in target/debug/test-rust-bert2)
frame #26: <unknown function> + 0x240bb7 (0x55bf9cae6bb7 in target/debug/test-rust-bert2)
frame #27: <unknown function> + 0x1d8f3a (0x55bf9ca7ef3a in target/debug/test-rust-bert2)
frame #28: <unknown function> + 0x1d27cb (0x55bf9ca787cb in target/debug/test-rust-bert2)
frame #29: <unknown function> + 0x1d240e (0x55bf9ca7840e in target/debug/test-rust-bert2)
frame #30: <unknown function> + 0x1d1a81 (0x55bf9ca77a81 in target/debug/test-rust-bert2)
frame #31: <unknown function> + 0xe9ec10 (0x55bf9d744c10 in target/debug/test-rust-bert2)
frame #32: <unknown function> + 0x1d1a50 (0x55bf9ca77a50 in target/debug/test-rust-bert2)
frame #33: <unknown function> + 0x1da04c (0x55bf9ca8004c in target/debug/test-rust-bert2)
frame #34: __libc_start_main + 0xf3 (0x7f76294090b3 in /lib/x86_64-linux-gnu/libc.so.6)
frame #35: <unknown function> + 0x1cedce (0x55bf9ca74dce in target/debug/test-rust-bert2)

by the way i can run project with cpu version of libtorch but its really slow and thought i have to use gpu version for faster result!

is my cuda version the problem?

SorooshMortazavi avatar Apr 05 '22 05:04 SorooshMortazavi

Hello @SorooshMortazavi ,

Libtorch comes packaged with its own CUDA version so your global installation should not impact this library installation. [email protected] is still based on [email protected] that uses Libtorch 1.10.x. This version of libtorch can be downloaded for ubuntu at: https://download.pytorch.org/libtorch/cu113/libtorch-cxx11-abi-shared-with-deps-1.10.1%2Bcu113.zip

Note that this crate will be updated this week to leverage the latest [email protected] with libtorch 1.11

guillaume-be avatar Apr 06 '22 17:04 guillaume-be

hello @guillaume-be i used libtorch 1.10.1 as you said and i does not have any compilation error. and now i can successfully build project but when i run the release version (or debug version no diffrence) i got bellow error.

arj@arj-HP-ZBook-Studio-G3:~/test-rust-bert-folder/test-rust-bert$ ./target/release/test-rust-bert Error: Tch tensor error: Internal torch error: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 3.95 GiB total capacity; 3.16 GiB already allocated; 2.69 MiB free; 3.19 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF Exception raised from malloc at ../c10/cuda/CUDACachingAllocator.cpp:536 (most recent call first): frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) + 0x6b (0x7fb0d47100db in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libc10.so) frame #1: + 0x2bd0f (0x7fb0d3e37d0f in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libc10_cuda.so) frame #2: + 0x2cb26 (0x7fb0d3e38b26 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libc10_cuda.so) frame #3: + 0x2cfd8 (0x7fb0d3e38fd8 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libc10_cuda.so) frame #4: THCStorage_resizeBytes(THCState*, c10::StorageImpl*, long) + 0xea (0x7fb0ee8c210a in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cuda_cpp.so) frame #5: at::native::empty_strided_cuda(c10::ArrayRef, c10::ArrayRef, c10::optionalc10::ScalarType, c10::optionalc10::Layout, c10::optionalc10::Device, c10::optional) + 0x31b (0x7fb0ee844cab in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cuda_cpp.so) frame #6: + 0x2b185c3 (0x7fb15f7745c3 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cuda_cu.so) frame #7: + 0x2b1867b (0x7fb15f77467b in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cuda_cu.so) frame #8: + 0x1ddaa58 (0x7fb0d672aa58 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #9: at::_ops::empty_strided::call(c10::ArrayRef, c10::ArrayRef, c10::optionalc10::ScalarType, c10::optionalc10::Layout, c10::optionalc10::Device, c10::optional) + 0x1dc (0x7fb0d64f1ecc in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #10: at::native::_to_copy(at::Tensor const&, c10::optionalc10::ScalarType, c10::optionalc10::Layout, c10::optionalc10::Device, c10::optional, bool, c10::optionalc10::MemoryFormat) + 0x13f6 (0x7fb0d5fe9496 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #11: + 0x1f24653 (0x7fb0d6874653 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #12: + 0x1dd6618 (0x7fb0d6726618 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #13: at::_ops::_to_copy::redispatch(c10::DispatchKeySet, at::Tensor const&, c10::optionalc10::ScalarType, c10::optionalc10::Layout, c10::optionalc10::Device, c10::optional, bool, c10::optionalc10::MemoryFormat) + 0x14a (0x7fb0d629f5ea in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #14: + 0x3462d93 (0x7fb0d7db2d93 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #15: + 0x346329b (0x7fb0d7db329b in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #16: at::_ops::_to_copy::call(at::Tensor const&, c10::optionalc10::ScalarType, c10::optionalc10::Layout, c10::optionalc10::Device, c10::optional, bool, c10::optionalc10::MemoryFormat) + 0x1ea (0x7fb0d631c45a in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #17: at::native::to(at::Tensor const&, c10::Device, c10::ScalarType, bool, bool, c10::optionalc10::MemoryFormat) + 0xcb (0x7fb0d5fe77eb in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #18: + 0x1fc7722 (0x7fb0d6917722 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #19: at::_ops::to_device::call(at::Tensor const&, c10::Device, c10::ScalarType, bool, bool, c10::optionalc10::MemoryFormat) + 0x1af (0x7fb0d641d62f in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #20: torch::jit::Unpickler::readInstruction() + 0x19cd (0x7fb0d88c121d in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #21: torch::jit::Unpickler::run() + 0xa8 (0x7fb0d88c1af8 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #22: torch::jit::Unpickler::parse_ivalue() + 0x2e (0x7fb0d88c1c9e in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #23: torch::jit::readArchiveAndTensors(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, c10::optional<std::function<c10::StrongTypePtr (c10::QualifiedName const&)> >, c10::optional<std::function<c10::intrusive_ptr<c10::ivalue::Object, c10::detail::intrusive_target_default_null_typec10::ivalue::Object > (c10::StrongTypePtr, c10::IValue)> >, c10::optionalc10::Device, caffe2::serialize::PyTorchStreamReader&, std::shared_ptrtorch::jit::DeserializationStorageContext) + 0x51d (0x7fb0d888109d in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #24: + 0x3f2a29d (0x7fb0d887a29d in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #25: + 0x3f2bbfd (0x7fb0d887bbfd in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #26: torch::jit::load(std::shared_ptrcaffe2::serialize::ReadAdapterInterface, c10::optionalc10::Device, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >&) + 0x1cd (0x7fb0d887d1ad in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #27: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, c10::optionalc10::Device, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >&) + 0xc1 (0x7fb0d887f341 in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #28: torch::jit::load(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, c10::optionalc10::Device) + 0x6f (0x7fb0d887f44f in /home/arj/test-rust-bert-folder/test-rust-bert/libtorch-cxx11-abi-shared-with-deps-1.10.1+cu113/libtorch/lib/libtorch_cpu.so) frame #29: + 0x45e9fa (0x5628e84b69fa in ./target/release/test-rust-bert) frame #30: + 0x195933 (0x5628e81ed933 in ./target/release/test-rust-bert) frame #31: + 0x147f9f (0x5628e819ff9f in ./target/release/test-rust-bert) frame #32: + 0xfb1d6 (0x5628e81531d6 in ./target/release/test-rust-bert) frame #33: + 0xe1363 (0x5628e8139363 in ./target/release/test-rust-bert) frame #34: + 0xda763 (0x5628e8132763 in ./target/release/test-rust-bert) frame #35: + 0xda59d (0x5628e813259d in ./target/release/test-rust-bert) frame #36: + 0x4886e0 (0x5628e84e06e0 in ./target/release/test-rust-bert) frame #37: + 0xe1ea2 (0x5628e8139ea2 in ./target/release/test-rust-bert) frame #38: __libc_start_main + 0xf3 (0x7fb0d43330b3 in /lib/x86_64-linux-gnu/libc.so.6) frame #39: + 0xd94ee (0x5628e81314ee in ./target/release/test-rust-bert)

i searched around the web and some people who used python version said that we changed the batch size in their python code but i don't understand. how should i fix this error in my rust project. and my graphic card is Quadro M1000M by the way.

SorooshMortazavi avatar Apr 09 '22 06:04 SorooshMortazavi

Hello @SorooshMortazavi ,

The issue is indeed an out of memory error on your CUDA device. Unfortunately it has 4GB available which may be limiting for several large models available in this crate. You may try to reduce the number of inputs you pass to the model (or turn off beam search for generation-based pipelines). If you encounter this error for a single input without beam search you may unfortunately be limited to running it on your CPU.

guillaume-be avatar Apr 09 '22 12:04 guillaume-be

Hello, I have the same build error. When using the crate version 0.14.0 everything works as expected torch-sys builds without problems and everything is great. Every newer version will not compile no matter what I try. I downloaded the torch lib from the website either as pre c++-11 ABI and with c++-11 ABI, I have updated the compiler from gcc-9 and g++-9 to gcc-11 and g++-11. I have tried to globally install libtorch etc. I get a similiar output to the first issue description.

Note: I use ubuntu 20, the CPU version of libtorch version 1.10

Everything works great for 0.14.0 and thanks for the awesome library!

alleonhardt avatar Apr 13 '22 11:04 alleonhardt

Error when not using a locally installed libtorch and just invoking build without it:

error: failed to run custom build command for `torch-sys v0.6.1`

Caused by:
  process didn't exit successfully: `/home/alexander/Documents/DockerUnifiedUIMAInterface/test_containers/rust_sentiment/target/debug/build/torch-sys-28d336e7abdd26c8/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=TORCH_CUDA_VERSION
  cargo:rerun-if-env-changed=LIBTORCH
  cargo:rustc-link-search=native=/usr/lib
  cargo:rerun-if-changed=libtch/torch_api.cpp
  cargo:rerun-if-changed=libtch/torch_api.h
  cargo:rerun-if-changed=libtch/torch_api_generated.cpp.h
  cargo:rerun-if-changed=libtch/torch_api_generated.h
  cargo:rerun-if-changed=libtch/stb_image_write.h
  cargo:rerun-if-changed=libtch/stb_image_resize.h
  cargo:rerun-if-changed=libtch/stb_image.h
  cargo:rerun-if-env-changed=LIBTORCH_CXX11_ABI
  TARGET = Some("x86_64-unknown-linux-gnu")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-unknown-linux-gnu")
  CXX_x86_64-unknown-linux-gnu = None
  CXX_x86_64_unknown_linux_gnu = None
  HOST_CXX = None
  CXX = None
  CXXFLAGS_x86_64-unknown-linux-gnu = None
  CXXFLAGS_x86_64_unknown_linux_gnu = None
  HOST_CXXFLAGS = None
  CXXFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/usr/include" "-I" "/usr/include/torch/csrc/api/include" "-Wl,-rpath=/usr/lib" "-std=c++14" "-D_GLIBCXX_USE_CXX11_ABI=1" "-o" "/home/alexander/Documents/DockerUnifiedUIMAInterface/test_containers/rust_sentiment/target/debug/build/torch-sys-5a3cf9e70c40f37a/out/libtch/torch_api.o" "-c" "libtch/torch_api.cpp"
  cargo:warning=libtch/torch_api.cpp:1:9: fatal error: torch/csrc/autograd/engine.h: No such file or directory
  cargo:warning=    1 | #include<torch/csrc/autograd/engine.h>
  cargo:warning=      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=compilation terminated.
  exit status: 1

  --- stderr


  error occurred: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/usr/include" "-I" "/usr/include/torch/csrc/api/include" "-Wl,-rpath=/usr/lib" "-std=c++14" "-D_GLIBCXX_USE_CXX11_ABI=1" "-o" "/home/alexander/Documents/DockerUnifiedUIMAInterface/test_containers/rust_sentiment/target/debug/build/torch-sys-5a3cf9e70c40f37a/out/libtch/torch_api.o" "-c" "libtch/torch_api.cpp" with args "c++" did not execute successfully (status code exit status: 1).

alleonhardt avatar Apr 13 '22 11:04 alleonhardt

Error when using locally installed libtorch via environment variables (Error is truncated due to extremely long error)

  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api.cpp: In function ‘void atm_end_tracing(module, char*, at::Tensor**, int)’:
  cargo:warning=libtch/torch_api.cpp:971:30: error: ‘torch::jit::tracer’ has not been declared
  cargo:warning=  971 |     auto state = torch::jit::tracer::getTracingState();
  cargo:warning=      |                              ^~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api.cpp:979:17: error: ‘torch::jit::tracer’ has not been declared
  cargo:warning=  979 |     torch::jit::tracer::setTracingState(nullptr);
  cargo:warning=      |                 ^~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__baddbmm_mkl_(at::Tensor**, tensor, tensor, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:238:29: error: ‘_baddbmm_mkl_’ is not a member of ‘torch’
  cargo:warning=  238 |     auto outputs__ = torch::_baddbmm_mkl_(*self, *batch1, *batch2);
  cargo:warning=      |                             ^~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__conv_depthwise2d_backward(at::Tensor**, tensor, tensor, tensor, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t*, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:378:29: error: ‘_conv_depthwise2d_backward_out’ is not a member of ‘torch’
  cargo:warning=  378 |     auto outputs__ = torch::_conv_depthwise2d_backward_out(*grad_input, *grad_weight, *grad_output, *self, *weight, torch::IntArrayRef(kernel_size_data, kernel_size_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(dilation_data, dilation_len));
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__convolution_nogroup(at::Tensor**, tensor, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int, int64_t*, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:428:29: error: ‘_convolution_nogroup’ is not a member of ‘torch’
  cargo:warning=  428 |     auto outputs__ = torch::_convolution_nogroup(*input, *weight, (bias ? *bias : torch::Tensor()), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(dilation_data, dilation_len), (bool)transposed, torch::IntArrayRef(output_padding_data, output_padding_len));
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__inverse_helper(at::Tensor**, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:786:29: error: ‘_inverse_helper’ is not a member of ‘torch’
  cargo:warning=  786 |     auto outputs__ = torch::_inverse_helper(*self);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__log_softmax_backward_data(at::Tensor**, tensor, tensor, int64_t, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:815:84: error: cannot convert ‘at::Tensor’ to ‘c10::ScalarType’
  cargo:warning=  815 |     auto outputs__ = torch::_log_softmax_backward_data(*grad_output, *output, dim, *self);
  cargo:warning=      |                                                                                    ^~~~~
  cargo:warning=      |                                                                                    |
  cargo:warning=      |                                                                                    at::Tensor
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:215,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/_log_softmax_backward_data.h:26:143: note:   initializing argument 4 of ‘at::Tensor at::_log_softmax_backward_data(const at::Tensor&, const at::Tensor&, int64_t, c10::ScalarType)’
  cargo:warning=   26 | TORCH_API inline at::Tensor _log_softmax_backward_data(const at::Tensor & grad_output, const at::Tensor & output, int64_t dim, at::ScalarType input_dtype) {
  cargo:warning=      |                                                                                                                                ~~~~~~~~~~~~~~~^~~~~~~~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__log_softmax_backward_data_out(at::Tensor**, tensor, tensor, tensor, int64_t, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:822:94: error: cannot convert ‘at::Tensor’ to ‘c10::ScalarType’
  cargo:warning=  822 |     auto outputs__ = torch::_log_softmax_backward_data_out(*out, *grad_output, *output, dim, *self);
  cargo:warning=      |                                                                                              ^~~~~
  cargo:warning=      |                                                                                              |
  cargo:warning=      |                                                                                              at::Tensor
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:215,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/_log_softmax_backward_data.h:31:167: note:   initializing argument 5 of ‘at::Tensor& at::_log_softmax_backward_data_out(at::Tensor&, const at::Tensor&, const at::Tensor&, int64_t, c10::ScalarType)’
  cargo:warning=   31 | TORCH_API inline at::Tensor & _log_softmax_backward_data_out(at::Tensor & out, const at::Tensor & grad_output, const at::Tensor & output, int64_t dim, at::ScalarType input_dtype) {
  cargo:warning=      |                                                                                                                                                        ~~~~~~~~~~~~~~~^~~~~~~~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__nnpack_spatial_convolution_backward_input(at::Tensor**, tensor, tensor, tensor, int64_t*, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:929:29: error: ‘_nnpack_spatial_convolution_backward_input’ is not a member of ‘torch’
  cargo:warning=  929 |     auto outputs__ = torch::_nnpack_spatial_convolution_backward_input(*input, *grad_output, *weight, torch::IntArrayRef(padding_data, padding_len));
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__nnpack_spatial_convolution_backward_weight(at::Tensor**, tensor, int64_t*, int, tensor, int64_t*, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:936:29: error: ‘_nnpack_spatial_convolution_backward_weight’ is not a member of ‘torch’
  cargo:warning=  936 |     auto outputs__ = torch::_nnpack_spatial_convolution_backward_weight(*input, torch::IntArrayRef(weightsize_data, weightsize_len), *grad_output, torch::IntArrayRef(padding_data, padding_len));
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__softmax_backward_data(at::Tensor**, tensor, tensor, int64_t, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:1087:80: error: cannot convert ‘at::Tensor’ to ‘c10::ScalarType’
  cargo:warning= 1087 |     auto outputs__ = torch::_softmax_backward_data(*grad_output, *output, dim, *self);
  cargo:warning=      |                                                                                ^~~~~
  cargo:warning=      |                                                                                |
  cargo:warning=      |                                                                                at::Tensor
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:253,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/_softmax_backward_data.h:26:139: note:   initializing argument 4 of ‘at::Tensor at::_softmax_backward_data(const at::Tensor&, const at::Tensor&, int64_t, c10::ScalarType)’
  cargo:warning=   26 | TORCH_API inline at::Tensor _softmax_backward_data(const at::Tensor & grad_output, const at::Tensor & output, int64_t dim, at::ScalarType input_dtype) {
  cargo:warning=      |                                                                                                                            ~~~~~~~~~~~~~~~^~~~~~~~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__softmax_backward_data_out(at::Tensor**, tensor, tensor, tensor, int64_t, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:1094:97: error: cannot convert ‘at::Tensor’ to ‘c10::ScalarType’
  cargo:warning= 1094 |     auto outputs__ = torch::_softmax_backward_data_out(*grad_input, *grad_output, *output, dim, *self);
  cargo:warning=      |                                                                                                 ^~~~~
  cargo:warning=      |                                                                                                 |
  cargo:warning=      |                                                                                                 at::Tensor
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:253,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/_softmax_backward_data.h:31:170: note:   initializing argument 5 of ‘at::Tensor& at::_softmax_backward_data_out(at::Tensor&, const at::Tensor&, const at::Tensor&, int64_t, c10::ScalarType)’
  cargo:warning=   31 | TORCH_API inline at::Tensor & _softmax_backward_data_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & output, int64_t dim, at::ScalarType input_dtype) {
  cargo:warning=      |                                                                                                                                                           ~~~~~~~~~~~~~~~^~~~~~~~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg__svd_helper(at::Tensor**, tensor, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:1277:29: error: ‘_svd_helper’ is not a member of ‘torch’
  cargo:warning= 1277 |     auto outputs__ = torch::_svd_helper(*self, (bool)some, (bool)compute_uv);
  cargo:warning=      |                             ^~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_conv_depthwise3d_backward(at::Tensor**, tensor, tensor, tensor, tensor, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t*, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3471:29: error: ‘conv_depthwise3d_backward_out’ is not a member of ‘torch’
  cargo:warning= 3471 |     auto outputs__ = torch::conv_depthwise3d_backward_out(*grad_input, *grad_weight, *grad_bias, *grad_output, *self, *weight, torch::IntArrayRef(kernel_size_data, kernel_size_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(dilation_data, dilation_len));
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_cudnn_convolution_backward_input(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3753:29: error: ‘cudnn_convolution_backward_input’ is not a member of ‘torch’
  cargo:warning= 3753 |     auto outputs__ = torch::cudnn_convolution_backward_input(torch::IntArrayRef(self_size_data, self_size_len), *grad_output, *weight, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic, (bool)allow_tf32);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_cudnn_convolution_backward_weight(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3760:29: error: ‘cudnn_convolution_backward_weight’ is not a member of ‘torch’
  cargo:warning= 3760 |     auto outputs__ = torch::cudnn_convolution_backward_weight(torch::IntArrayRef(weight_size_data, weight_size_len), *grad_output, *self, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic, (bool)allow_tf32);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_cudnn_convolution_deprecated(at::Tensor**, tensor, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3767:69: error: could not convert ‘((bias != 0) ? at::Tensor((*(const at::Tensor*)bias)) : at::Tensor())’ from ‘at::Tensor’ to ‘c10::IntArrayRef’ {aka ‘c10::ArrayRef<long int>’}
  cargo:warning= 3767 |     auto outputs__ = torch::cudnn_convolution(*self, *weight, (bias ? *bias : torch::Tensor()), torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                                                               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                                                                     |
  cargo:warning=      |                                                                     at::Tensor
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_cudnn_convolution_deprecated2(at::Tensor**, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3774:46: error: too few arguments to function ‘at::Tensor at::cudnn_convolution(const at::Tensor&, const at::Tensor&, c10::IntArrayRef, c10::IntArrayRef, c10::IntArrayRef, int64_t, bool, bool, bool)’
  cargo:warning= 3774 |     auto outputs__ = torch::cudnn_convolution(*self, *weight, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                      ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:469,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/cudnn_convolution.h:26:29: note: declared here
  cargo:warning=   26 | TORCH_API inline at::Tensor cudnn_convolution(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef padding, at::IntArrayRef stride, at::IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, bool allow_tf32) {
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_cudnn_convolution_transpose_backward_input(at::Tensor**, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3795:29: error: ‘cudnn_convolution_transpose_backward_input’ is not a member of ‘torch’
  cargo:warning= 3795 |     auto outputs__ = torch::cudnn_convolution_transpose_backward_input(*grad_output, *weight, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic, (bool)allow_tf32);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_cudnn_convolution_transpose_backward_weight(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3802:29: error: ‘cudnn_convolution_transpose_backward_weight’ is not a member of ‘torch’
  cargo:warning= 3802 |     auto outputs__ = torch::cudnn_convolution_transpose_backward_weight(torch::IntArrayRef(weight_size_data, weight_size_len), *grad_output, *self, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic, (bool)allow_tf32);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_cudnn_convolution_transpose_deprecated(at::Tensor**, tensor, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3809:79: error: could not convert ‘((bias != 0) ? at::Tensor((*(const at::Tensor*)bias)) : at::Tensor())’ from ‘at::Tensor’ to ‘c10::IntArrayRef’ {aka ‘c10::ArrayRef<long int>’}
  cargo:warning= 3809 |     auto outputs__ = torch::cudnn_convolution_transpose(*self, *weight, (bias ? *bias : torch::Tensor()), torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(output_padding_data, output_padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                                                                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                                                                               |
  cargo:warning=      |                                                                               at::Tensor
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_cudnn_convolution_transpose_deprecated2(at::Tensor**, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:3816:56: error: too few arguments to function ‘at::Tensor at::cudnn_convolution_transpose(const at::Tensor&, const at::Tensor&, c10::IntArrayRef, c10::IntArrayRef, c10::IntArrayRef, c10::IntArrayRef, int64_t, bool, bool, bool)’
  cargo:warning= 3816 |     auto outputs__ = torch::cudnn_convolution_transpose(*self, *weight, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(output_padding_data, output_padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:472,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/cudnn_convolution_transpose.h:26:29: note: declared here
  cargo:warning=   26 | TORCH_API inline at::Tensor cudnn_convolution_transpose(const at::Tensor & self, const at::Tensor & weight, at::IntArrayRef padding, at::IntArrayRef output_padding, at::IntArrayRef stride, at::IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, bool allow_tf32) {
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_grid_sampler_2d_backward(at::Tensor**, tensor, tensor, tensor, int64_t, int64_t, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:5754:53: error: too few arguments to function ‘std::tuple<at::Tensor, at::Tensor> at::grid_sampler_2d_backward(const at::Tensor&, const at::Tensor&, const at::Tensor&, int64_t, int64_t, bool, std::array<bool, 2>)’
  cargo:warning= 5754 |     auto outputs__ = torch::grid_sampler_2d_backward(*grad_output, *input, *grid, interpolation_mode, padding_mode, (bool)align_corners);
  cargo:warning=      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:609,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/grid_sampler_2d_backward.h:26:54: note: declared here
  cargo:warning=   26 | TORCH_API inline ::std::tuple<at::Tensor,at::Tensor> grid_sampler_2d_backward(const at::Tensor & grad_output, const at::Tensor & input, const at::Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners, ::std::array<bool,2> output_mask) {
  cargo:warning=      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_linspace(at::Tensor**, scalar, scalar, int64_t, uint8_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:7478:63: error: cannot convert ‘c10::optional<long int>’ to ‘int64_t’ {aka ‘long int’}
  cargo:warning= 7478 |     auto outputs__ = torch::linspace(*start, *end, steps_null ? c10::nullopt : c10::optional<int64_t>(steps_v), at::device(device_of_int(options_device)).dtype(at::ScalarType(options_kind)));
  cargo:warning=      |                                                    ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                                                               |
  cargo:warning=      |                                                               c10::optional<long int>
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/torch/csrc/api/include/torch/types.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data.h:3,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/all.h:8,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/torch.h:3,
  cargo:warning=                 from libtch/torch_api.cpp:5:
  cargo:warning=/home/alexander/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:327:86: note:   initializing argument 3 of ‘at::Tensor torch::linspace(const c10::Scalar&, const c10::Scalar&, int64_t, c10::TensorOptions)’
  cargo:warning=  327 | inline at::Tensor linspace(const at::Scalar & start, const at::Scalar & end, int64_t steps, at::TensorOptions options = {}) {
  cargo:warning=      |                                                                              ~~~~~~~~^~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_linspace_out(at::Tensor**, tensor, scalar, scalar, int64_t, uint8_t)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:7485:73: error: cannot convert ‘c10::optional<long int>’ to ‘int64_t’ {aka ‘long int’}
  cargo:warning= 7485 |     auto outputs__ = torch::linspace_out(*out, *start, *end, steps_null ? c10::nullopt : c10::optional<int64_t>(steps_v));
  cargo:warning=      |                                                              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                                                                         |
  cargo:warning=      |                                                                         c10::optional<long int>
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:730,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/linspace.h:36:120: note:   initializing argument 4 of ‘at::Tensor& at::linspace_out(at::Tensor&, const c10::Scalar&, const c10::Scalar&, int64_t)’
  cargo:warning=   36 | TORCH_API inline at::Tensor & linspace_out(at::Tensor & out, const at::Scalar & start, const at::Scalar & end, int64_t steps) {
  cargo:warning=      |                                                                                                                ~~~~~~~~^~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_logspace(at::Tensor**, scalar, scalar, int64_t, uint8_t, double, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:7786:63: error: cannot convert ‘c10::optional<long int>’ to ‘int64_t’ {aka ‘long int’}
  cargo:warning= 7786 |     auto outputs__ = torch::logspace(*start, *end, steps_null ? c10::nullopt : c10::optional<int64_t>(steps_v), base, at::device(device_of_int(options_device)).dtype(at::ScalarType(options_kind)));
  cargo:warning=      |                                                    ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                                                               |
  cargo:warning=      |                                                               c10::optional<long int>
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/torch/csrc/api/include/torch/types.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/data.h:3,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/all.h:8,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/api/include/torch/torch.h:3,
  cargo:warning=                 from libtch/torch_api.cpp:5:
  cargo:warning=/home/alexander/libtorch/include/torch/csrc/autograd/generated/variable_factories.h:331:86: note:   initializing argument 3 of ‘at::Tensor torch::logspace(const c10::Scalar&, const c10::Scalar&, int64_t, double, c10::TensorOptions)’
  cargo:warning=  331 | inline at::Tensor logspace(const at::Scalar & start, const at::Scalar & end, int64_t steps, double base = 10.0, at::TensorOptions options = {}) {
  cargo:warning=      |                                                                              ~~~~~~~~^~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_logspace_out(at::Tensor**, tensor, scalar, scalar, int64_t, uint8_t, double)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:7793:73: error: cannot convert ‘c10::optional<long int>’ to ‘int64_t’ {aka ‘long int’}
  cargo:warning= 7793 |     auto outputs__ = torch::logspace_out(*out, *start, *end, steps_null ? c10::nullopt : c10::optional<int64_t>(steps_v), base);
  cargo:warning=      |                                                              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=      |                                                                         |
  cargo:warning=      |                                                                         c10::optional<long int>
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:750,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/logspace.h:36:120: note:   initializing argument 4 of ‘at::Tensor& at::logspace_out(at::Tensor&, const c10::Scalar&, const c10::Scalar&, int64_t, double)’
  cargo:warning=   36 | TORCH_API inline at::Tensor & logspace_out(at::Tensor & out, const at::Scalar & start, const at::Scalar & end, int64_t steps, double base=10.0) {
  cargo:warning=      |                                                                                                                ~~~~~~~~^~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_miopen_convolution_backward_bias(at::Tensor**, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8398:29: error: ‘miopen_convolution_backward_bias’ is not a member of ‘torch’
  cargo:warning= 8398 |     auto outputs__ = torch::miopen_convolution_backward_bias(*grad_output);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_miopen_convolution_backward_input(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8405:29: error: ‘miopen_convolution_backward_input’ is not a member of ‘torch’
  cargo:warning= 8405 |     auto outputs__ = torch::miopen_convolution_backward_input(torch::IntArrayRef(self_size_data, self_size_len), *grad_output, *weight, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_miopen_convolution_backward_weight(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8412:29: error: ‘miopen_convolution_backward_weight’ is not a member of ‘torch’
  cargo:warning= 8412 |     auto outputs__ = torch::miopen_convolution_backward_weight(torch::IntArrayRef(weight_size_data, weight_size_len), *grad_output, *self, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_miopen_convolution_transpose_backward_input(at::Tensor**, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8426:29: error: ‘miopen_convolution_transpose_backward_input’ is not a member of ‘torch’
  cargo:warning= 8426 |     auto outputs__ = torch::miopen_convolution_transpose_backward_input(*grad_output, *weight, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_miopen_convolution_transpose_backward_weight(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8433:29: error: ‘miopen_convolution_transpose_backward_weight’ is not a member of ‘torch’
  cargo:warning= 8433 |     auto outputs__ = torch::miopen_convolution_transpose_backward_weight(torch::IntArrayRef(weight_size_data, weight_size_len), *grad_output, *self, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_miopen_depthwise_convolution_backward_input(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8447:29: error: ‘miopen_depthwise_convolution_backward_input’ is not a member of ‘torch’
  cargo:warning= 8447 |     auto outputs__ = torch::miopen_depthwise_convolution_backward_input(torch::IntArrayRef(self_size_data, self_size_len), *grad_output, *weight, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_miopen_depthwise_convolution_backward_weight(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8454:29: error: ‘miopen_depthwise_convolution_backward_weight’ is not a member of ‘torch’
  cargo:warning= 8454 |     auto outputs__ = torch::miopen_depthwise_convolution_backward_weight(torch::IntArrayRef(weight_size_data, weight_size_len), *grad_output, *self, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)benchmark, (bool)deterministic);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_mkldnn_convolution_backward_input(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8521:29: error: ‘mkldnn_convolution_backward_input’ is not a member of ‘torch’
  cargo:warning= 8521 |     auto outputs__ = torch::mkldnn_convolution_backward_input(torch::IntArrayRef(self_size_data, self_size_len), *grad_output, *weight, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)bias_defined);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_mkldnn_convolution_backward_weights(at::Tensor**, int64_t*, int, tensor, tensor, int64_t*, int, int64_t*, int, int64_t*, int, int64_t, int)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:8528:29: error: ‘mkldnn_convolution_backward_weights’ is not a member of ‘torch’
  cargo:warning= 8528 |     auto outputs__ = torch::mkldnn_convolution_backward_weights(torch::IntArrayRef(weight_size_data, weight_size_len), *grad_output, *self, torch::IntArrayRef(padding_data, padding_len), torch::IntArrayRef(stride_data, stride_len), torch::IntArrayRef(dilation_data, dilation_len), groups, (bool)bias_defined);
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_softplus_backward(at::Tensor**, tensor, tensor, scalar, scalar, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:11215:46: error: too many arguments to function ‘at::Tensor at::softplus_backward(const at::Tensor&, const at::Tensor&, const c10::Scalar&, const c10::Scalar&)’
  cargo:warning=11215 |     auto outputs__ = torch::softplus_backward(*grad_output, *self, *beta, *threshold, *output);
  cargo:warning=      |                      ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:1015,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/softplus_backward.h:36:29: note: declared here
  cargo:warning=   36 | TORCH_API inline at::Tensor softplus_backward(const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & beta, const at::Scalar & threshold) {
  cargo:warning=      |                             ^~~~~~~~~~~~~~~~~
  cargo:warning=In file included from libtch/torch_api.cpp:10:
  cargo:warning=libtch/torch_api_generated.cpp.h: In function ‘void atg_softplus_backward_grad_input(at::Tensor**, tensor, tensor, tensor, scalar, scalar, tensor)’:
  cargo:warning=libtch/torch_api_generated.cpp.h:11222:50: error: too many arguments to function ‘at::Tensor& at::softplus_backward_out(at::Tensor&, const at::Tensor&, const at::Tensor&, const c10::Scalar&, const c10::Scalar&)’
  cargo:warning=11222 |     auto outputs__ = torch::softplus_backward_out(*grad_input, *grad_output, *self, *beta, *threshold, *output);
  cargo:warning=      |                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:16:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   16 |     x \
  cargo:warning=      |     ^
  cargo:warning=In file included from /home/alexander/libtorch/include/ATen/Functions.h:1015,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/input_metadata.h:10,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/function.h:7,
  cargo:warning=                 from /home/alexander/libtorch/include/torch/csrc/autograd/engine.h:11,
  cargo:warning=                 from libtch/torch_api.cpp:1:
  cargo:warning=/home/alexander/libtorch/include/ATen/ops/softplus_backward.h:26:31: note: declared here
  cargo:warning=   26 | TORCH_API inline at::Tensor & softplus_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, const at::Scalar & beta, const at::Scalar & threshold) {
  cargo:warning=      |                               ^~~~~~~~~~~~~~~~~~~~~
  exit status: 1

  --- stderr


  error occurred: Command "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "/home/alexander/libtorch/include" "-I" "/home/alexander/libtorch/include/torch/csrc/api/include" "-Wl,-rpath=/home/alexander/libtorch/lib" "-std=c++14" "-D_GLIBCXX_USE_CXX11_ABI=1" "-o" "/home/alexander/Documents/DockerUnifiedUIMAInterface/test_containers/rust_sentiment/target/debug/build/torch-sys-5a3cf9e70c40f37a/out/libtch/torch_api.o" "-c" "libtch/torch_api.cpp" with args "c++" did not execute successfully (status code exit status: 1).

alleonhardt avatar Apr 13 '22 11:04 alleonhardt

Should I open this again in tch-sys? It is probably related to them and not the this crate.

alleonhardt avatar Apr 13 '22 11:04 alleonhardt

Hello @alleonhardt ,

The local version (latest version of this repository) requires libtorch 1.11.x. The latest version published on crates.io requires libtorch 1.10.x

guillaume-be avatar Apr 13 '22 18:04 guillaume-be

Hi, unfortunately I got this error Rustc 1.61.0 nightly Libtorch instalation: manual Libtorch version: v1.11.0 cxx11 abi + cu113 -> Using v.1.12.0 from docs link I'm getting error: failed to run custom build command for torch-sys v0.7.2 Rust-bers version: 0.18 OS: Arch Linux

These errors appeared about 3 or 4 days ago when I updated my system. Before that moment I didn't have any problems.

Full Error Log

Error:

 Compiling cached-path v0.5.3
   Compiling tch v0.7.2
   Compiling rust-bert v0.18.0
   Compiling berd v0.1.0 (/home/r/projects/rust/berd)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustcLM2cDQ/symbols.o" "/home/r/projects/rust/berd/target/debug/deps/berd-6b6377244c895707.157iewas35ll61dk.rcgu.o" ... random error
  /usr/bin/ld: /home/r/libtorch/lib/libtorch_cuda_cu.so: undefined reference to `at::native::copy_ignoring_overlaps(at::Tensor const&, at::Tensor const&)'
          /usr/bin/ld: /home/r/libtorch/lib/libtorch_cuda_cu.so: undefined reference to `at::native::clamp_max_out(at::Tensor const&, c10::Scalar const&, at::Tensor&)'
          collect2: error: ld returned 1 exit status
          
  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `berd` due to previous error

Raduc4 avatar Jul 17 '22 10:07 Raduc4