[Feature Request] Migrate grid density model to dpmodel for multi-backend support
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python, pytorch, tensorflow
- Domain
- backend, machine-learning
Research direction
Start by reading the PyTorch implementations in deepmd/pt/, especially DensityFittingNet, DPDensityAtomicModel, GridDensityModel, GridDensityLoss, and DeepDensity, then compare them with the available dpmodel counterparts and PR #5999. Done means the reference model is implemented in dpmodel, PyTorch wraps it, and pt_expt support is added without losing the existing grid/density behavior.
Written by the indexing model from the issue text.
Description
Summary
PR #5999 implements a charge density model on grid points for the PyTorch
backend only. It should eventually be implemented once in dpmodel and
wrapped per backend. This issue tracks the current state and the
migration plan.
Detailed Description
Background
PR #5999 introduces a charge density model that predicts scalar densities on
grid points. The implementation currently exists only for the PyTorch
backend (deepmd/pt/): DensityFittingNet, DPDensityAtomicModel,
GridDensityModel, GridDensityLoss, and the DeepDensity evaluator.
This does not follow the project's direction of implementing new
functionality once in dpmodel and wrapping it for each backend
(pt / pt_expt / tf / jax / pd).
Current state
DensityFittingNetis a plainInvarFittingsubclass — nothing
backend-specific.- The grid/atom merge in
DPDensityAtomicModel.forward_atomicand the
directional grid-to-atom neighbor list both have dpmodel counterparts
(or can be expressed with existing dpmodel/array-api utilities). - The data-loading side is already backend-agnostic:
grid/densityare
declared with the loader'sspecial_shape="frame_major"contract. - The reserved grid type is the last entry of
type_map; its descriptor
input statistics are computed from the grid data during stat.
Plan
- Implement the reference version in
dpmodel(descriptor-agnostic
atomic model + density fitting + output definition). - Wrap it for the PyTorch backend (reuse the existing pt classes as the
wrapping layer where possible). - Add
pt_exptsupport once the dpmodel reference exists. - (Optional) tf/jax/pd wrappers following the same pattern.
- Follow-up optimization noted during review: evaluate the descriptor
only on grid centers instead of all merged grid+atom points
(requires center-subset support in the descriptor API).
References
- PR #5999 (this issue is linked from its description)
Further Information, Files, and Links
No response
- 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 ·