Deprecate descriptor-scoped exclude_types in favour of the model-level build-seam owner
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- machine-learning, testing
Research direction
Read deepmd/pt_expt/model/get_model.py:148-162 and deepmd/pt/model/model/init.py:388-403, then inspect the descriptor application sites in dpa4.py, dpa1.py, and repformers.py. Run the cross-backend consistency harness with descriptor-only and model-level exclusions; done means the warning is emitted, promotion is removed in both backends, and the model-level seam gives consistent results.
Written by the indexing model from the issue text.
Description
Since #5733 pair exclusion is a graph-native transform, but there are still two owners with two different scopes, and one builder silently promotes between them. That promotion makes two otherwise-equivalent model builders disagree by ~80 eV on the same input.
The two owners
| key | applied where | scope |
|---|---|---|
model-level pair_exclude_types |
graph build seam, folded into the graph before the atomic model sees it | every child of the composition, including analytical bridging (ZBL) |
descriptor-level exclude_types |
inside the descriptor forward, apply_pair_exclusion(graph, atype, self.emask) |
the learned descriptor features only |
Application sites for the descriptor-scoped key: deepmd/dpmodel/descriptor/dpa4.py:1514, deepmd/dpmodel/descriptor/dpa1.py:1866, deepmd/dpmodel/descriptor/repformers.py:622.
The split is already documented in deepmd/dpmodel/descriptor/dpa4_nn/edge_cache.py:279:
Model-level
pair_exclude_typesis a separate, graph-BUILD transform, already folded into the incoming graph.
The promotion
get_sezm_model copies the descriptor-scoped key into the model-scoped one, writes it back down onto the descriptor, and raises if both are set to different values:
deepmd/pt_expt/model/get_model.py:148-162deepmd/pt/model/model/__init__.py:388-403(identical)
get_standard_model does not do this, in either pt_expt or dpmodel.
Observable consequence
Same config in both builders — descriptor.exclude_types=[[0,1]], bridging_method: ZBL, bridging_r_inner: 0.8, bridging_r_outer: 1.2, type_map: [Ni, O] — evaluated on a 0.9 A Ni-O dimer:
| route | energy |
|---|---|
type: "dpa4" (promotes) |
-0.909 eV |
type: "standard" (does not) |
+79.056 eV |
dE = 79.97 eV, max|dF| = 318.48 eV/A. The difference is entirely whether the analytical ZBL child still sees the excluded pair. Surfaced during review of #5939.
Why the promotion is the wrong side to keep
A descriptor-scoped setting should stay descriptor-scoped. The promotion also forecloses a physically meaningful configuration: hiding a pair from the network while keeping its real short-range nuclear repulsion. And because only one of the two builders promotes, "which builder did you use" silently changes the physics.
Proposal
- Emit a
DeprecationWarningwhendescriptor.exclude_typesis set, directing users to model-levelpair_exclude_types. - Remove the promotion from
get_sezm_modelin pt and pt_expt together, so the backends cannot diverge mid-flight. - Leave
pair_exclude_typesas the single build-seam owner; at that point there is nothing left to reconcile and every builder agrees by construction. - Cover it in the cross-backend consistency harness (a data row exercising descriptor-only vs model-level exclusion), not a bespoke test, so a backend that skips the seam is visible.
Backwards compatibility
Step 2 is a behaviour change for existing dpa4/sezm configs that set only descriptor.exclude_types and rely on it reaching the bridging term — their energies will change. Hence the staged warning first. Configs that set pair_exclude_types explicitly are unaffected.
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 663
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 25
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepmodeling/deepmd-kit
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
deepmodeling/deepmd-kit#6086 ·
Maintainers usually reply within 3 days
-
Fine-tune descriptor mismatch warning should ignore seedPossibly taken @SiyuanChenToDo claimed this 23 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
deepmodeling/deepmd-kit#6038 · 2 comments ·
Maintainers usually reply within 3 days
-
Docs enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
deepmodeling/deepmd-kit#5766 · 1 comment ·
Maintainers usually reply within 3 days
-
branch: master lang: py todo comment type: todo
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
deepmodeling/deepmd-kit#5480 ·
Maintainers usually reply within 3 days
-
branch: master lang: toml todo comment type: todo
Difficulty 1/5 Under an hour Newbie friendliness 72/100
deepmodeling/deepmd-kit#5462 ·
Maintainers usually reply within 3 days
All issues in deepmodeling/deepmd-kit
Similar issues
-
documentation good first issue priority: P2 status: ready
Difficulty 1/5 Under an hour Newbie friendliness 88/100
RhinoLink-Tech/data-fabric#500 ·
Maintainers usually reply within 1 day
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EchoTools/nevr-runtime#2384 ·
Maintainers usually reply within 1 day
-
[Bug]: The H2 series' and the H3C's fan 3 is labelled "Chamber Fan", Bambu calls it the exhaust fanOpenarea:ui
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
btclib-org/btclib#3062 ·
Maintainers usually reply within 1 day
-
area:evals area:infra enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
jse-avl/support-bot#4 · 1 comment ·