| Files | Last commit | Last update |
|---|---|---|
| 10 months ago | ||
| 10 months ago | ||
| 1 month ago | ||
| 8 months ago | ||
| 1 month ago | ||
| 10 months ago | ||
| 14 days ago | ||
| 14 days ago |
MulAddn
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 | × |
| Kirin X90 processor series products | √ |
| Kirin 9030 processor series products | √ |
Function Description
-
Operator function:
Implements the fused computation of n>=2 mul operations and addn, reducing data movement time and memory usage.
-
Computation formula:
The inputs x1 and x2 are variable-length inputs, each being a list of N tensors. The shape of each tensor in the x1 input is [B, M, 1], and the shape of each tensor in the x2 input is [B, 1, K]. y is the output, with the shape [B, M, K]. N corresponds to the number n of the addn operator and also to the number of fused mul operators.
x1∗x2=yx1 * x2 = y
x1=[[B,M,1],[B,M,1],...,[B,M,1]](N[B,M,1]tensorsintotal)x1 = [[B, M, 1], [B, M, 1],...,[B, M, 1]] (N [B, M, 1] tensors in total)
x2=[[B,1,K],[B,1,K],...,[B,1,K]](N[B,1,K]tensorsintotal)x2 = [[B, 1, K],[B, 1, K],...,[B, 1, K]] (N [B, 1, K] tensors in total)
[[B,M,1],[B,M,1],...,[B,M,1]]∗[[B,1,K],[B,1,K],...,[B,1,K]]=y[[B, M, 1], [B, M, 1],...,[B, M, 1]] * [[B, 1, K],[B, 1, K],...,[B, 1, K]] = y
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x1 | Input | Input x1 in the formula. | FLOAT16, FLOAT32, BFLOAT16 | ND |
| x2 | Input | Input x2 in the formula. | FLOAT16, FLOAT32, BFLOAT16 | ND |
| N | Attribute | Number of fused mul operators. | INT | - |
| y | Output | y in the formula. | FLOAT16, FLOAT32, BFLOAT16 | ND |
- Kirin X90/Kirin 9030 processor series products: BFLOAT16 is not supported.
Constraint Description
- K<=2040;
- The shapes of the inputs x1 and x2 are [B,M,1] and [B,1,K], respectively;
- N>=2;
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| Graph-mode invocation | test_geir_mul_addn | Invokes the MulAddn operator by building a graph through the operator IR. |