Skip to content

docs(inference): explain neighbor search in Python and ASE - #6156

Open
Miller10101010 wants to merge 2 commits into
deepmodeling:masterfrom
Miller10101010:docs-python-neighbor-search
Open

Miller10101010 wants to merge 2 commits into
deepmodeling:masterfrom
Miller10101010:docs-python-neighbor-search

Conversation

@Miller10101010

@Miller10101010 Miller10101010 commented Nov 24, 2026 •

Copy link
Copy Markdown

Document nlist_backend for the PyTorch Exportable backend, optional search libraries and the separate neighbor_graph_method used by graph-form models. Include examples for DeepPot and the ASE calculator.

Verified auto, native and vesin with frozen .pt2 and .pte water models in Python and ASE. Also checked the missing-library diagnostic and the error for an incompatible graph input.

Closes #5922.

Summary by CodeRabbit

  • Documentation
    • Added guidance on choosing a neighbor-search backend for frozen .pt2 and .pte models, including available options and how automatic selection works for single frames and batches.
    • Clarified installation requirements and error handling for Vesin, and documented which model types support neighbor-list configuration.
    • Explained how graph-form and edge-vector models interact with neighbor-search settings.
    • Renamed the TensorFlow subsection to “External neighbor list.”

@github-actions github-actions Bot added the Docs label Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Python inference documentation updates its neighbor-search section and describes backend selection for frozen .pt2 and .pte models, including supported options, dependency requirements, and parameter constraints.

Changes: Python inference documentation

Layer / File(s) Summary
Neighbor-list selection guidance
doc/inference/python.md
The section heading changes. New guidance describes "auto", "native", "vesin", and "nv" options, Vesin’s dependency requirement and missing-bindings error, and parameter constraints for graph-form and edge-vector models.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Suggested reviewers: njzjz

Merge Risk: Minimal · up to a8522

This is a documentation-only update on neighbor-list backend selection for Python and ASE inference. It does not change runtime behavior, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "docs(inference): explain neighbor search in Python and ASE" matches the main change. The summary and objectives show the PR documents the nlist_backend option (auto, native, vesin, nv) for …
Linked Issues check Passed [#5922] The issue asks for Python/ASE documentation of nlist_backend for the PyTorch Exportable backend. The reviewed head of doc/inference/python.md covers these points:
- The "Choosing a neighbor se…
Out of Scope Changes check Passed The change set is limited to doc/inference/python.md. Every added item maps to #5922 scope: nlist_backend, the optional vesin dependency and its missing-library error, neighbor_graph_method for gr…
Full details: Title check

Explanation

The title "docs(inference): explain neighbor search in Python and ASE" matches the main change. The summary and objectives show the PR documents the nlist_backend option (auto, native, vesin, nv) for Python and ASE inference, the optional vesin package and its ImportError behavior, and how graph-form models interact with neighbor_graph_method. The title is specific and concise, and it follows the conventional docs() prefix.

Full details: Linked Issues check

Explanation

[#5922] The issue asks for Python/ASE documentation of nlist_backend for the PyTorch Exportable backend. The reviewed head of doc/inference/python.md covers these points:

  • The "Choosing a neighbor search" section keeps the TensorFlow "External neighbor list {{ tensorflow_icon }}" content and its ase.neighborlist.NewPrimitiveNeighborList example.
  • The "PyTorch Exportable neighbor lists {{ pytorch_icon }}" subsection covers .pt2 and .pte models.
  • The table lists "auto", "native", "vesin", and "nv". deepmd/pt_expt/infer/deep_eval.py _setup_neighbor_backend accepts exactly these values. The "nv" row is a real option. It goes beyond the three values named in #5922, but it belongs to the same argument, so documenting it does not break scope.
  • The "vesin" row names the optional vesin[torch]>=0.6 install and the ImportError for an explicit request without Torch bindings. The exact error text was not verified in this review.
  • The examples DeepPot("model.pt2", nlist_backend="vesin") and DP(model="model.pt2", nlist_backend="vesin") match the DeepEval signature. The ASE calculator forwards nlist_backend to DeepPot.
  • The graph-form note says neighbor_graph_method selects the graph builder and that a non-default nlist_backend raises ValueError. The issue text says graph-form models ignore the setting. The current code raises ValueError for graph-routed artifacts instead. The doc follows the code, so the current requirement is met.
  • The "auto" rule (Vesin for one frame, NV for batches, native fallback) matches the deep_eval.py docstring. The truncated read did not cover the full selection branch, so the exact branch order is not independently confirmed.
    No coding requirement in #5922 remains unmet. The issue is documentation-only, so no automated test requirement applies. The incremental diff could not be read, so this verdict rests on a full read of the reviewed head file and the code evidence above.
Full details: Out of Scope Changes check

Explanation

The change set is limited to doc/inference/python.md. Every added item maps to #5922 scope: nlist_backend, the optional vesin dependency and its missing-library error, neighbor_graph_method for graph-form models, and DeepPot and ASE examples. The additional "nv" row and the edge-vector note describe options that deep_eval.py accepts for the same argument, so they are related documentation. The doc does not cover LAMMPS neighbor lists, which the issue excludes. The TensorFlow content is retained. The incremental diff could not be read, so this verdict rests on the full file read at head and the code evidence for the documented options.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f70011ad-7555-4376-a640-52ec0ac3648c
Commits

Reviewing files that changed from the base of the PR and between baefc10 and a8522ae.

Files selected for processing: 1

  • doc/inference/python.md
Files skipped from review as they are similar to previous changes: 1

  • doc/inference/python.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(inference): document vesin neighbor list and nlist_backend for Python/ASE inference

1 participant