FilesLast commitLast update
8 days ago
2 months ago
3 months ago
13 days ago
13 days ago
2 months ago
13 days ago
13 days ago
12 days ago
README

ProdForceSeA

English | 简体中文

Product Support Status

Product Supported
Ascend 950PR&950DT products √
Atlas A3 products √
Atlas A2 products √
Atlas 200I/500 A2 inference products ×
Atlas inference products ×
Atlas training products ×

Function Description

  • Operator function: ProdForceSeA (Product Force for Smooth Edition Angular) is the backward force computation operator of the DeepPot-SE model in DeepMD-kit. It multiplies the derivatives of the neural network with respect to the descriptor (net_deriv) and the derivatives of the descriptor with respect to the coordinates (in_deriv) element-wise, then performs reduction accumulation to obtain the 3D force vector of each atom.

  • Computation formula:

Force of the central atom (negative sign):

force[k][i][d]=−∑a=0ndescrpt−1net_deriv[k][i][a]×in_deriv[k][i][a][d]force[k][i][d] = -\sum_{a=0}^{ndescrpt-1} net\_deriv[k][i][a] \times in\_deriv[k][i][a][d]

Force of the neighbor atom (positive sign, accumulated by the nlist index):

force[k][j][d]+=∑a=aa_startaa_end−1net_deriv[k][i][a]×in_deriv[k][i][a][d]force[k][j][d] += \sum_{a=aa\_start}^{aa\_end-1} net\_deriv[k][i][a] \times in\_deriv[k][i][a][d]

where ndescrpt=4×nneindescrpt = 4 \times nnei, nnei=n_a_sel+n_r_selnnei = n\_a\_sel + n\_r\_sel, j=nlist[k][i][j]j = nlist[k][i][j], and [aa_start,aa_end)=[j×4,j×4+4)[aa\_start, aa\_end) = [j \times 4, j \times 4 + 4).

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
net_deriv Input Derivatives of the network with respect to the descriptor, shape=(nframes, nloc*nnei*4). FLOAT ND
in_deriv Input Derivatives of the descriptor with respect to the coordinates, shape=(nframes, nloc*nnei*4*3). FLOAT ND
nlist Input Neighbor list, shape=(nframes, nloc*nnei). -1 indicates a virtual neighbor. INT32 ND
natoms Input Atom count information, shape=(ntypes+2,). natoms[0]=nloc, natoms[1]=nall. INT32 ND
n_a_sel Attribute Number of selected angular neighbors. The value range is [0, +∞), required. INT -
n_r_sel Attribute Number of selected radial neighbors. The value range is [0, +∞), required. n_a_sel + n_r_sel > 0. INT -
atom_force Output Forces on atoms, shape=(nframes, nall, 3). FLOAT ND

Constraint Description

  • Only the float32 data type is supported.
  • The complete set of dtypes declared by the REG_OP in the IR prototype op_graph/prod_force_se_a_proto.h is FLOAT16, FLOAT, and FLOAT64 (this is the registration scope on the graph side, which is wider than the delivered implementation). The current operator implementation and OpDef deliver only FLOAT. The preceding FLOAT16 and FLOAT64 have no corresponding kernels. If a graph is built in graph mode with either of these two dtypes, no available implementation exists and the graph is rejected.
  • The dtypes of net_deriv and in_deriv must be the same.
  • In nlist, an element value of -1 indicates a virtual neighbor, which is skipped.
  • n_a_sel>=0 and n_r_sel>=0, and n_a_sel+n_r_sel>0.
  • The number of elements of natoms is >= 3, natoms[0]=nloc>=0, and natoms[1]=nall>=nloc.
  • natoms is a value-dependent input. Dimension 1 (nall) of the output atom_force shape is determined by the runtime value of natoms[1].
  • Neighbor force accumulation uses intra-frame serial read-modify-write without atomic operations, and the output is deterministic.

Invocation Description

Invocation Method Sample Code Description
Graph-mode invocation test_geir_prod_force_se_a Invokes the ProdForceSeA operator by building a graph through the operator IR.