Skip to content

Navigation Menu

Sign in
Sign up

Error when running inference on DPA-3 #4952

Answered by OutisLi
nisargjoshi10 asked this question in Q&A
Discussion options

Hello,

I am trying to run LAMMPS with DPA-3. I installed Deepmd from the source code with pip install git+https://github.com/deepmodeling/deepmd-kit.git. When running LAMMPS simulation I get the following error:

deepmd/pt/model/descriptor/repformers.py", line 64, in forward
 argument8,
 ) -> torch.Tensor:
 raise NotImplementedError(
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 "border_op is not available since customized PyTorch OP library is not built when freezing the model. "
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 "See documentation for DPA-2 for details."
 ~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
 )
builtins.NotImplementedError: border_op is not available since customized PyTorch OP library is not built when freezing the model. See documentation for DPA-2 for details. (/home/prg/Softwares/ML_Packages/deepmd_v3/deepmd-kit/source/lmp/pair_deepmd.cpp:253)
Last command: run 10000

I tried following the solution provided in this issue, however installing with DP_VARIANT=cuda DP_ENABLE_PYTORCH=1 pip install git+https://github.com/deepmodeling/deepmd-kit.git@devel results in the same issue.

I am using PyTorch 2.7.0+cu128; DeePMD-kit v3.1.1.dev70+gaca4e8c48; with Python 3.13.5. I would appreciate any suggestions for fixing this error.

Thanks!

You must be logged in to vote

Hello,

I am trying to run LAMMPS with DPA-3. I installed Deepmd from the source code with pip install git+https://github.com/deepmodeling/deepmd-kit.git. When running LAMMPS simulation I get the following error:

deepmd/pt/model/descriptor/repformers.py", line 64, in forward
 argument8,
 ) -> torch.Tensor:
 raise NotImplementedError(
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 "border_op is not available since customized PyTorch OP library is not built when freezing the model. "
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 "See documentation for DPA-2 for details."
 ~~~~~~~~~~...

Replies: 5 comments 2 replies

Comment options

Hi @nisargjoshi10, did you re-freeze your model after installing with DP_VARIANT=cuda DP_ENABLE_PYTORCH=1 pip install git+https://github.com/deepmodeling/deepmd-kit.git@devel, i.e. dp --pt freeze with your trained checkpoint? This is required for .pth model to correctly link the compiled op.
BTW, I'm wondering which model did you use, since the logs here indicate maybe you are using DPA-2 rather than DPA-3?

You must be logged in to vote
1 reply
Comment options

Hi @iProzd yes I did re-freeze my model with dp --pt freeze. I'm using DPA-3. Here's the freeze command I've been using dp --pt freeze -c DPA-3.1-3M.pt -o frozen_model.pth --model-branch H2O_H2O-PD.

I'm also not sure why the logs show DPA-2 instead of DPA-3.

Comment options

Could you provide the full installation commands as well as the scripts you were using in this project?

You must be logged in to vote
0 replies
Comment options

Hello,

I am trying to run LAMMPS with DPA-3. I installed Deepmd from the source code with pip install git+https://github.com/deepmodeling/deepmd-kit.git. When running LAMMPS simulation I get the following error:

deepmd/pt/model/descriptor/repformers.py", line 64, in forward
 argument8,
 ) -> torch.Tensor:
 raise NotImplementedError(
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 "border_op is not available since customized PyTorch OP library is not built when freezing the model. "
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 "See documentation for DPA-2 for details."
 ~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
 )
builtins.NotImplementedError: border_op is not available since customized PyTorch OP library is not built when freezing the model. See documentation for DPA-2 for details. (/home/prg/Softwares/ML_Packages/deepmd_v3/deepmd-kit/source/lmp/pair_deepmd.cpp:253)
Last command: run 10000

I tried following the solution provided in this issue, however installing with DP_VARIANT=cuda DP_ENABLE_PYTORCH=1 pip install git+https://github.com/deepmodeling/deepmd-kit.git@devel results in the same issue.

I am using PyTorch 2.7.0+cu128; DeePMD-kit v3.1.1.dev70+gaca4e8c48; with Python 3.13.5. I would appreciate any suggestions for fixing this error.

Thanks!

You may refer to this article to reinstall deepmd-kit as well as lammps: https://pku.bohrium.com/notebooks/16945863382

If there is still any errors, you can reply directly.

You must be logged in to vote
1 reply
Comment options

@OutisLi Thanks for sending the notebook. I was able to get DPA-3 working with those installation instructions.

Answer selected by nisargjoshi10
Comment options

Is there a DPA-3 .pt file suitable for carbon nanotubes?

You must be logged in to vote
0 replies
Comment options

Is there a DPA-3 .pb file suitable for carbon nanotubes?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /