Replies: 2 comments 2 replies
-
|
This looks like a TorchScript/source bug in the current dev tree, not a problem with your input file or the trained checkpoint. In from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .edge_cache import EdgeFeatureCachebut the scripted edge_cache: EdgeFeatureCacheDuring normal eager training this can work because the annotation is mainly for type checkers. During A maintainer-side fix is likely to make from .edge_cache import EdgeFeatureCacheIf that creates a circular import, the alternative is to remove/loosen that annotation on scripted paths, but the current state is definitely incompatible with TorchScript freeze. For your local source build, I would test the minimal runtime import first, then rerun only: dp --pt freeze -c model.ckpt.pt -o frozen_modelIf it then moves to a different TorchScript error, that would be the next blocker, but this first error is caused by the annotation being hidden behind |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the detailed follow-up. This is very useful, and I agree with your conclusion: please do not keep patching From the traceback sequence, this is a DeePMD-kit TorchScript compatibility issue in the current Also, you are right that I will treat this as a DPA4 freeze bug in the current development branch. For now, the safe recommendation is:
Thanks again for reducing the issue to the exact TorchScript blockers. That saves us a lot of debugging time, and sorry for the frustration here. — OpenClaw 2026.6.8 (844f405), model: custom-chat-jinzhezeng-group/gpt-5.5 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Training of a DPA4 model finishes successfully, but the freeze step fails. During dp --pt freeze, torch.jit.script(model) raises RuntimeError: Unknown type name 'EdgeFeatureCache' while compiling deepmd/pt/model/descriptor/sezm_nn/embedding.py.
DeePMD-kit Version
3.2.0b1.dev9+gbe6af6740
Backend and its version
PyTorch v2.8.0+cu128-ga1cb3cc05d4
Python Version, CUDA Version, GCC Version, LAMMPS Version, etc
Python 3.10; CUDA 12.8; Installed via conda env dp-master, built from source.
Details
I trained DPA4 model via dpgen and deepmd-kit. The model trains to completion without any issue. The error only occurs during freezing. Then I tried to freeze the model manually, and got the same error.
Via dpgen, which calls:
dp --pt freeze
Manually submitting a freeze job:
dp --pt freeze -c model.ckpt.pt -o frozen_model
Error log (identical for both):
[2026-06-19 14:41:47,279] DEEPMD INFO DeePMD version: 3.2.0b1.dev9+gbe6af6740
Traceback (most recent call last):
File ".../bin/dp", line 6, in
sys.exit(main())
File ".../deepmd/main.py", line 1061, in main
deepmd_main(args)
File ".../torch/distributed/elastic/multiprocessing/errors/init.py", line 357, in wrapper
return f(*args, **kwargs)
File ".../deepmd/pt/entrypoints/main.py", line 670, in main
freeze(model=FLAGS.model, output=FLAGS.output, head=FLAGS.head)
File ".../deepmd/pt/entrypoints/main.py", line 480, in freeze
model = torch.jit.script(model)
File ".../torch/jit/_script.py", line 1443, in script
ret = _script_impl(
...
File ".../torch/jit/_recursive.py", line 466, in create_methods_and_properties_from_stubs
concrete_type._create_methods_and_properties(
RuntimeError:
Unknown type name 'EdgeFeatureCache':
File ".../deepmd/pt/model/descriptor/sezm_nn/embedding.py", line 463
self,
*,
edge_cache: EdgeFeatureCache,
~~~~~~~~~~~~~~~~ <--- HERE
atype_flat: torch.Tensor,
n_nodes: int,
Reproducible Example, Input Files, and Commands
input.json
train.log
Further Information, Files, and Links
No response
Beta Was this translation helpful? Give feedback.
All reactions