[object Object][object Object][object Object]undefined
[object Object]
  • The API function is to traverse different sampling points of feature maps with different sizes based on parameters such as the sampling location, attention weights, mapped value features, start index of multi-scale features, and spatial size of multi-scale feature maps (to convert the sampling location from a normalized value to an absolute location).

  • Formula:

    Map the normalized coordinates (u,v)[0,1](u,v)\in[0,1] of the sampling point to the pixel coordinate system of the feature map at layer \ell:

    x=uW0.5,y=vH0.5x = u \cdot W_\ell - 0.5, \qquad y = v \cdot H_\ell - 0.5

    Determine the four integer grid points between which the sampling point falls:

    x0=x,x1=x0+1,y0=y,y1=y0+1x_0 = \lfloor x \rfloor,\quad x_1 = x_0 + 1,\qquad y_0 = \lfloor y \rfloor,\quad y_1 = y_0 + 1

    Compute the offset of the sampling point relative to the upper-left grid point, which is used for interpolation weighting:

    αx=xx0,αy=yy0\alpha_x = x - x_0, \qquad \alpha_y = y - y_0

    Compute the bilinear interpolation weight. The sum of the four adjacent points is 1.

    w00=(1αy)(1αx),w10=(1αy)αx,w01=αy(1αx),w11=αyαx\begin{aligned} w_{00} &= (1-\alpha_y)(1-\alpha_x), \\ w_{10} &= (1-\alpha_y)\alpha_x, \\ w_{01} &= \alpha_y(1-\alpha_x), \\ w_{11} &= \alpha_y\alpha_x \end{aligned}

    Compute the feature vectors (length: DD) corresponding to the sampling points.

    bilinear(V;b,h,,x,y)=w00Vb,,y0,x0,h,:+w10Vb,,y0,x1,h,:+w01Vb,,y1,x0,h,:+w11Vb,,y1,x1,h,:\operatorname{bilinear}(V;\,b,h,\ell,x,y) = w_{00} \, V_{b,\ell,y_0,x_0,h,:} + w_{10} \, V_{b,\ell,y_0,x_1,h,:} + w_{01} \, V_{b,\ell,y_1,x_0,h,:} + w_{11} \, V_{b,\ell,y_1,x_1,h,:}

    Compute the weighted sum of the bilinear sampling results for all layers and all sampling points to obtain the final output:

    Ob,q,h,:==0L1p=0Np1Ab,q,h,,pbilinear ⁣(V;b,h,,xb,q,h,,p,yb,q,h,,p)O_{b,q,h,:} = \sum_{\ell=0}^{L-1} \sum_{p=0}^{N_p-1} A_{b,q,h,\ell,p} \cdot \operatorname{bilinear}\!\left(V;\,b,h,\ell, x_{b,q,h,\ell,p}, y_{b,q,h,\ell,p}\right)
[object Object]

Each operator has calls. First, aclnnMultiScaleDeformableAttnFunctionGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnMultiScaleDeformableAttnFunction is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters:

    [object Object]
    • Atlas inference products: The BFLOAT16 data type is not supported.
  • Returns:

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter verification. The following errors may be thrown:

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute:

    • aclnnMultiScaleDeformableAttnFunction defaults to a deterministic implementation.
  • [object Object]Atlas inference products[object Object]:

    • channels%32 = 0, and channels ≤ 256
    • 32 ≤ num_queries < 500000
    • num_levels ≤ 16
    • num_heads = [2, 4, 8]
    • num_points = [4, 8]
  • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training products/Atlas A3 inference products[object Object]:

    • channels%8 = 0, and channels ≤ 256
    • 32 ≤ num_queries < 500000
    • num_levels ≤ 16
    • num_heads ≤ 16
    • num_points ≤ 16
[object Object]

The following example is for reference only. For details, see .

[object Object]