[object Object][object Object][object Object]undefined
[object Object]
  • Function: fuses matrix multiplication and general vector computation.

  • Formula:

    y=OP((x1@x2+bias),x3)y = OP((x1 @ x2 + bias), x3)

    The OP type is defined by the input fusedOpType. The following types are supported:

    Add operation:

    y=(x1@x2+bias)+x3y=(x1 @ x2 + bias) + x3

    Mul operation:

    y=(x1@x2+bias)x3y=(x1 @ x2 + bias) ∗ x3

    gelu_tanh operation:

    y=gelu_tanh(x1@x2+bias)y = gelu\_tanh(x1 @ x2 + bias)

    gelu_erf operation:

    y=gelu_erf(x1@x2+bias)y = gelu\_erf(x1 @ x2 + bias)

    Relu operation:

    y=relu(x1@x2+bias)y = relu(x1 @ x2 + bias)
[object Object]

Each operator has calls. You must call aclnnFusedMatmulGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnFusedMatmul to perform the computation.

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

    [object Object]
    • Ascend 950PR/Ascend 950DT:
      • When cubeMathType is set to 1, if the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, no processing is performed.
      • When cubeMathType is set to 2, this option is not supported if the input data type is BFLOAT16.
      • When cubeMathType is set to 3, if the input data type is FLOAT32, it is converted to HFLOAT32 for computation. If the input data type is not FLOAT32, this option is not supported.
      • When cubeMathType is set to 4, no processing is performed.
  • Returns

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

    The first-phase API implements input parameter validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

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

[object Object]
  • Deterministic description:

    • For [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object], aclnnFusedMatmul is implemented in a deterministic manner by default.
  • When fusedOpType is set to "gelu_erf" or "gelu_tanh", the data types of x1, x2, and x3 must be BFLOAT16 and FLOAT16. When fusedOpType is set to "", "relu", "add", or "mul", the data types of x1, x2, and x3 must be FLOAT32 (cubeMathType supports only 3), BFLOAT16, or FLOAT16.

[object Object]

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

[object Object]