[object Object]

[object Object][object Object]undefined
[object Object]
  • Description:

    Multiplies the input [object Object] by the corresponding [object Object] and [object Object] based on the input index values in [object Object], and accumulates the results into the input [object Object]to produce the output.

  • Formulas:

    Given an input tensor [object Object] with the last dimension length of 2d, the AddLora function performs the following operations:

    1. Rearrange [object Object] based on the index values in [object Object]. Elements of [object Object] corresponding to the same weight group are placed together.

    2. Loop through each LoRA group and perform matrix multiplication using its corresponding [object Object] element and [object Object].

      Z1=xiweightA[i,layerIdx,:,:]Z1 = x_{i} \cdot weightA[i, layerIdx, :, :]
    3. Multiply the resultant [object Object] with [object Object].

      Z2=Z1weightB[i,layerIdx,:,:]×scaleZ2 = Z1 \cdot weightB[i, layerIdx, :, :] \times scale
    4. Finally, accumulate [object Object] into [object Object] to obtain the output.

      out=y[:,yOffset:yOffset+ySliceSize]+Z2\text{out} = y[:, yOffset: yOffset+ySliceSize] + Z2
[object Object]

Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the computation process. Then, [object Object] is called to perform computation.

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

    [object Object]
    • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: The data formats of [object Object]weightB[object Object] and [object Object]weightAOptional[object Object] can be ND.
  • 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 computation:
    • [object Object] defaults to a deterministic implementation.
[object Object]

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

[object Object]