Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
fc683d3
feat(dpmodel): add _project_frames helper for frame-aware DPA4 grid ops
Jun 18, 2026
9e3dbec
feat(dpmodel): generalize GridMLP to frame-aware (n_frames) for DPA4 …
Jun 18, 2026
db407ba
feat(dpmodel): generalize GridBranch to frame-aware (n_frames) for DP…
Jun 18, 2026
8e2ca7c
feat(dpmodel): generalize BaseGridNet (cross/flat/residual/n_frames>1…
Jun 18, 2026
e29a8c1
feat(dpmodel): port FrameContract/FrameExpand per-degree frame mixers…
Jun 18, 2026
8f0b63a
feat(dpmodel): port resolve_so3_grid + _build_so3_frame_set for DPA4 …
Jun 17, 2026
937abc9
test(dpmodel): cover SO3 grid util edge branches; refresh projection …
Jun 17, 2026
09d3ddd
feat(dpmodel): port SO3GridProjector (Wigner-D grid quadrature) for DPA4
Jun 17, 2026
28269e5
feat(dpmodel): port SO3GridNet (self+cross) for DPA4 SO3 grid
Jun 18, 2026
8038577
feat(dpmodel): wire SO3GridNet into FFN (un-guard ffn_so3_grid) for DPA4
Jun 18, 2026
e4937ff
feat(dpmodel): wire SO3/S2 cross-mode grid products into SO2Convoluti…
Jun 18, 2026
6fb8997
test(dpmodel): add fp32 grid-path parity for DPA4 SO3 grid
Jun 18, 2026
50d9df3
test(dpmodel): DPA4 SO3-grid consistency rows + descriptor interop + …
Jun 18, 2026
4a7be0e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 18, 2026
c56cdc2
fix(dpmodel): address AI-review findings on DPA4 SO3 grid (#5555)
Jun 18, 2026
83e0b79
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 18, 2026
8b8608b
fix(dpmodel): require nested projector @version; narrow version test …
Jun 19, 2026
be4e13c
ci: re-trigger readthedocs/CI (suspected transient post_install netwo…
Jun 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions deepmd/dpmodel/descriptor/dpa4_nn/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

Flags merely forwarded to sub-components keep their guards there (delegated,
not duplicated here): ``so2_attn_res``, ``so2_s2_activation``,
``node_wise_s2/so3``, ``message_node_s2/so3``, ``atten_f_mix``,
``atten_v_proj``, ``atten_o_proj`` (raised by ``SO2Convolution``) and
``ffn_so3_grid`` with the grid path active (raised by ``EquivariantFFN``).
``atten_f_mix``, ``atten_v_proj``, ``atten_o_proj`` (raised by
``SO2Convolution``). The cross-mode grid products (``node_wise_s2/so3``,
``message_node_s2/so3``) are ported and forwarded to ``SO2Convolution``.

The pt eval-time activation-checkpoint / nvtx instrumentation
(``DP_ACT_INFER``, ``DP_COMPILE_INFER``, ``nvtx_range``) is pt-runtime-only
Expand Down
65 changes: 36 additions & 29 deletions deepmd/dpmodel/descriptor/dpa4_nn/ffn.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
This module is the dpmodel port of ``deepmd.pt.model.descriptor.sezm_nn.ffn``.
It defines the full SO(3)-equivariant feed-forward network used inside SeZM
interaction blocks.

Branches guarded with ``NotImplementedError`` (flags unused by the core DPA4
config):

- ``ffn_so3_grid=True`` — the pt path instantiates ``SO3GridNet``
(pt ffn.py:209), which is not ported to dpmodel.
"""

from __future__ import (
Expand Down Expand Up @@ -40,6 +34,7 @@
)
from .grid_net import (
S2GridNet,
SO3GridNet,
)
from .projection import (
resolve_s2_grid_resolution,
Expand Down Expand Up @@ -91,7 +86,7 @@ class EquivariantFFN(NativeOP):
s2_activation
If True, enable the S2 FFN grid path.
ffn_so3_grid
If True, enable the SO3 Wigner-D FFN grid path (not ported).
If True, enable the SO3 Wigner-D FFN grid path.
lebedev_quadrature
If True, use Lebedev quadrature for the S2 projector in this FFN.
activation_function
Expand Down Expand Up @@ -141,10 +136,6 @@ def __init__(
self.use_grid_branch = self.grid_branch > 0
self.s2_activation = bool(s2_activation)
self.ffn_so3_grid = bool(ffn_so3_grid)
if self.ffn_so3_grid:
raise NotImplementedError(
"ffn_so3_grid=True (SO3GridNet) is not ported to dpmodel"
)
self.lebedev_quadrature = bool(lebedev_quadrature)
self.s2_grid_method = "lebedev" if self.lebedev_quadrature else "e3nn"
base_grid = resolve_s2_grid_resolution(
Expand All @@ -163,8 +154,7 @@ def __init__(
self.precision = precision
self.compute_precision = _compute_precision(precision)
self.trainable = bool(trainable)
# pt: grid_n_frames = 2 * kmax + 1 only when ffn_so3_grid (guarded above)
self.grid_n_frames = 1
self.grid_n_frames = 2 * self.kmax + 1 if self.ffn_so3_grid else 1

# === Step 0. Split deterministic seeds at the module top-level ===
seed_so3_in = child_seed(seed, 0)
Expand Down Expand Up @@ -199,22 +189,39 @@ def __init__(
if self.use_grid_branch
else ("mlp" if self.use_grid_mlp else "glu")
)
self.act: NativeOP = S2GridNet(
lmax=self.lmax,
channels=self.hidden_channels,
n_focus=1,
mode="self",
op_type=grid_op,
precision=self.compute_precision,
layout="ndfc",
grid_resolution_list=self.s2_grid_resolution,
coefficient_layout="packed",
grid_method=self.s2_grid_method,
grid_branches=max(1, self.grid_branch),
mlp_bias=self.mlp_bias,
trainable=self.trainable,
seed=seed_act,
)
self.act: NativeOP
if self.ffn_so3_grid:
self.act = SO3GridNet(
lmax=self.lmax,
kmax=self.kmax,
channels=self.hidden_channels,
n_focus=1,
mode="self",
op_type=grid_op,
precision=self.compute_precision,
layout="ndfc",
grid_branches=max(1, self.grid_branch),
mlp_bias=self.mlp_bias,
trainable=self.trainable,
seed=seed_act,
)
else:
self.act = S2GridNet(
lmax=self.lmax,
channels=self.hidden_channels,
n_focus=1,
mode="self",
op_type=grid_op,
precision=self.compute_precision,
layout="ndfc",
grid_resolution_list=self.s2_grid_resolution,
coefficient_layout="packed",
grid_method=self.s2_grid_method,
grid_branches=max(1, self.grid_branch),
mlp_bias=self.mlp_bias,
trainable=self.trainable,
seed=seed_act,
)
else:
self.act = GatedActivation(
lmax=self.lmax,
Expand Down
Loading
Loading