Skip to content

Commit 3cb2b4c

Browse files
author
Han Wang
committed
fix(tests): import deepmd.pt before load_custom_ops in gen_model_devi
All other gen scripts import from deepmd.pt.utils.serialization before calling load_custom_ops(), which loads the installed libdeepmd_op_pt.so first. The guard in load_custom_ops() then skips the build-dir copy. gen_model_devi.py was missing this import, so load_custom_ops() loaded the build-dir .so first, then the later deepmd.infer import loaded the installed .so — triggering a duplicate op registration crash.
1 parent d9f317f commit 3cb2b4c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

source/tests/infer/gen_model_devi.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def main():
6666
}
6767

6868
# ---- 2. Build two models with different seeds ----
69+
from deepmd.pt.utils.serialization import ( # noqa: F401
70+
deserialize_to_file,
71+
)
6972
from deepmd.pt_expt.utils.serialization import (
7073
deserialize_to_file as pt_expt_deserialize_to_file,
7174
)

0 commit comments

Comments
 (0)