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

How to integrate DeePMD-kit v3 with third-party packages such as ABACUS #4140

Closed
YuLiu98 opened this issue Sep 18, 2024 · 3 comments
Closed

Comments

@YuLiu98
Copy link

YuLiu98 commented Sep 18, 2024

Summary

DeePMD-kit v2 can be integrated with third-party packages such as ABACUS according to the doc: https://github.com/deepmodeling/deepmd-kit/blob/master/doc/inference/cxx.md

DeePMD-kit v3 can also do it and can be used to run MD with *.pb models. However, it will report the following error:

terminate called after throwing an instance of 'deepmd::hpp::deepmd_exception'
  what():  DeePMD-kit C API Error: DeePMD-kit Error: PyTorch backend is not built

How to solve this problem?

DeePMD-kit Version

v3.0.0b3

Backend and its version

TensorFlow

Python Version, CUDA Version, GCC Version, LAMMPS Version, etc

No response

Details

Note that the libdeepmd_c.tar.gz of DeePMD-kit v3.0.0b3 is integrated with abacus in this issue.
It seems to lack the torch library in the lib folder:

libdeepmd_cc.so  libdeepmd_dyn_cudart.so  libdeepmd_op.so  libtensorflow_cc.so.2
libdeepmd_c.so   libdeepmd_op_cuda.so     libdeepmd.so     libtensorflow_framework.so.2
@njzjz
Copy link
Member

njzjz commented Sep 18, 2024

For the reasons listed in #3120 (comment), the pre-compiled package is not compiled against PyTorch.
Please tell me if you have any idea.


Anyway, you can compile by yourself.

@YuLiu98
Copy link
Author

YuLiu98 commented Sep 19, 2024

For the reasons listed in #3120 (comment), the pre-compiled package is not compiled against PyTorch. Please tell me if you have any idea.

Anyway, you can compile by yourself.

Thank you. I have compile it by off-line packages. However, it reports the error:

terminate called after throwing an instance of 'deepmd::hpp::deepmd_exception'
  what():  DeePMD-kit C API Error: DeePMD-kit Error: DeePMD-kit PyTorch backend error: Method 'has_message_passing' is not defined.
Exception raised from get_method at /home/liuyu/soft/deepmd-v3b/include/torch/csrc/jit/api/object.h:110 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0xb2 (0x7281037975d2 in /home/liuyu/soft/test_deepmd/lib/././libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0xd2 (0x72810374cc3b in /home/liuyu/soft/test_deepmd/lib/././libc10.so)
frame #2: <unknown function> + 0x2e0c2 (0x728103c2a0c2 in /home/liuyu/soft/test_deepmd/lib/./libdeepmd_cc.so)
frame #3: <unknown function> + 0x2e458 (0x728103c2a458 in /home/liuyu/soft/test_deepmd/lib/./libdeepmd_cc.so)
frame #4: deepmd::DeepPotPT::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x2d5 (0x728103c2dec5 in /home/liuyu/soft/test_deepmd/lib/./libdeepmd_cc.so)
frame #5: deepmd::DeepPotPT::translate_error(std::function<void ()>) + 0x27 (0x728103c25a77 in /home/liuyu/soft/test_deepmd/lib/./libdeepmd_cc.so)
frame #6: deepmd::DeepPotPT::DeepPotPT(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x118 (0x728103c2a3b8 in /home/liuyu/soft/test_deepmd/lib/./libdeepmd_cc.so)
frame #7: deepmd::DeepPot::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x150 (0x728103c216f0 in /home/liuyu/soft/test_deepmd/lib/./libdeepmd_cc.so)
frame #8: deepmd::DeepPot::DeepPot(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x1a (0x728103c2189a in /home/liuyu/soft/test_deepmd/lib/./libdeepmd_cc.so)
frame #9: DP_NewDeepPotWithParam2 + 0xe3 (0x72810497ecc3 in /home/liuyu/soft/test_deepmd/lib/libdeepmd_c.so)
frame #10: ../../../build/abacus() [0x996f84]
frame #11: ../../../build/abacus() [0x996718]
frame #12: ../../../build/abacus() [0x7db3d6]
frame #13: ../../../build/abacus() [0x7dadaf]
frame #14: ../../../build/abacus() [0x417f53]
frame #15: <unknown function> + 0x29d90 (0x7280f7829d90 in /lib/x86_64-linux-gnu/libc.so.6)
frame #16: __libc_start_main + 0x80 (0x7280f7829e40 in /lib/x86_64-linux-gnu/libc.so.6)
frame #17: ../../../build/abacus() [0x417de5]

@njzjz
Copy link
Member

njzjz commented Sep 19, 2024

Thank you. I have compile it by off-line packages. However, it reports the error:

See #3954

@YuLiu98 YuLiu98 closed this as completed Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants