Merged
modified md files #13602
gitee-duhuipingAdd on 18 days ago
modified md files #13602
Merged
gitee-duhuipingAdd on 18 days ago
Total: 12 files changed+15-21
@@ -96,7 +96,7 @@ aclnnStatus aclnnForeachCopy(
96 <td>out(aclTensorList*)</td>96 <td>out(aclTensorList*)</td>
97 <td>输出</td>97 <td>输出</td>
98 <td>表示进行内容复制的输出张量列表,对应公式中的`y`。</td>98 <td>表示进行内容复制的输出张量列表,对应公式中的`y`。</td>
99- <td><ul><li>支持空Tensor。</li><li>该参数中所有Tensor的数据类型保持一致。</li><li>数据格式与入参`x`的数据格式一致,shape size大于等于入参`x`的shape size。</li><li>数据类型与入参`x`的数据类型存在一定的对应关系:<ul><li>当入参`x`的数据类型为FLOAT32时,输出的数据类型支持FLOAT16或者BFLOAT16。</li><li>当入参`x`的数据类型为FLOAT16时,输出的数据类型支持FLOAT32。</li><li>当输入`x`的数据类型不为FLOAT32或者FLOAT16时,输出的数据类型与输入`x`的数据类型保持一致。</li></ul></li></ul></td>99+ <td><ul><li>支持空Tensor。</li><li>该参数中所有Tensor的数据类型保持一致。</li><li>数据格式与入参`x`的数据格式一致,shape size大于等于入参`x`的shape size。</li><li>数据类型与入参`x`的数据类型存在一定的对应关系:<ul><li>当入参`x`的数据类型为FLOAT32时,输出的数据类型支持FLOAT16或者BFLOAT16。</li><li>当入参`x`的数据类型为FLOAT16时,输出的数据类型支持FLOAT32。</li><li>当入参`x`的数据类型为BFLOAT16时,输出的数据类型支持FLOAT32、BFLOAT16。</li><li>当输入`x`的数据类型不为FLOAT32、FLOAT16、BFLOAT16时,输出的数据类型与输入`x`的数据类型保持一致。</li></ul></li></ul></td>
100 <td>FLOAT32、FLOAT16、BFLOAT16、INT8、UINT8、INT16、UINT16、INT32、UINT32、INT64、DOUBLE、BOOL</td>100 <td>FLOAT32、FLOAT16、BFLOAT16、INT8、UINT8、INT16、UINT16、INT32、UINT32、INT64、DOUBLE、BOOL</td>
101 <td>ND</td>101 <td>ND</td>
102 <td>0-8</td>102 <td>0-8</td>
@@ -98,7 +98,7 @@ aclnnStatus aclnnForeachCopy(
98 <td>out (aclTensorList*)</td>98 <td>out (aclTensorList*)</td>
99 <td>Output</td>99 <td>Output</td>
100 <td>Output tensor list for content copy, corresponding to `y` in the formula.</td>100 <td>Output tensor list for content copy, corresponding to `y` in the formula.</td>
101- <td><ul><li>Supports empty tensors.</li><li>All tensors in this parameter must have the same data type.</li><li>The data format is the same as that of input `x`, and the shape size is greater than or equal to that of input `x`.</li><li>The data type corresponds to the data type of input `x` as follows:<ul><li>If the data type of input `x` is FLOAT32, the output data type can be FLOAT16 or BFLOAT16.</li><li>If the data type of input `x` is FLOAT16, the output data type can be FLOAT32.</li><li>If the data type of input `x` is not FLOAT32 or FLOAT16, the output data type is the same as that of input `x`.</li></ul></li></ul></td>101+ <td><ul><li>Supports empty tensors.</li><li>All tensors in this parameter must have the same data type.</li><li>The data format is the same as that of input `x`, and the shape size is greater than or equal to that of input `x`.</li><li>The data type corresponds to the data type of input `x` as follows:<ul><li>If the data type of input `x` is FLOAT32, the output data type can be FLOAT16 or BFLOAT16.</li><li>If the data type of input `x` is FLOAT16, the output data type can be FLOAT32.</li><li>If the data type of input `x` is BFLOAT16, the output data type can be FLOAT32 or BFLOAT16.</li><li>If the data type of input `x` is not FLOAT32, BFLOAT16 or FLOAT16, the output data type is the same as that of input `x`.</li></ul></li></ul></td>
102 <td>FLOAT32, FLOAT16, BFLOAT16, INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, DOUBLE, BOOL</td>102 <td>FLOAT32, FLOAT16, BFLOAT16, INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, DOUBLE, BOOL</td>
103 <td>ND</td>103 <td>ND</td>
104 <td>0-8</td>104 <td>0-8</td>
@@ -47,7 +47,7 @@
47 47 
48 pergroup量化方式48 pergroup量化方式
49 49 
50- 1. 矩阵乘后x''的shape为[M,N1,N2],在计算pergroup量化方式其中的mx_quantize时,需reshape为[M,N1*N2],记为x250+ 1. 矩阵乘后x''的shape为[M,N1,N2],在计算pergroup量化方式其中的mx_quantize时,需reshape为[M,N1*N2],记为x2
51 51 
52 2. 在x2第二维上按照groupsize进行分组,包含元素e0,e1...e31。计算出emax52 2. 在x2第二维上按照groupsize进行分组,包含元素e0,e1...e31。计算出emax
53 53 
@@ -133,7 +133,7 @@
133 <tr>133 <tr>
134 <td>dst_dtype</td>134 <td>dst_dtype</td>
135 <td>可选属性</td>135 <td>可选属性</td>
136- <td><ul><li>用于控制量化方式,当值为DT_FLOAT4_E2M1时表示为pergroup量化方式,当值为DT_INT32时表示pertoken量化方式。</li><li>默认值为DT_INT32。</li></ul></td>136+ <td><ul><li>用于控制量化方式,当值为DT_FLOAT4_E2M1时表示为pergroup量化方式,当值为DT_INT32时表示pertoken量化方式。</li><li>默认值为DT_INT4。</li></ul></td>
137 <td>INT</td>137 <td>INT</td>
138 <td>-</td>138 <td>-</td>
139 </tr>139 </tr>
@@ -135,7 +135,7 @@ English | [简体中文](./README.md)
135 <tr>135 <tr>
136 <td>dst_dtype</td>136 <td>dst_dtype</td>
137 <td>Optional attribute</td>137 <td>Optional attribute</td>
138- <td><ul><li>Controls the quantization mode. The value DT_FLOAT4_E2M1 indicates the pergroup quantization mode, and the value DT_INT32 indicates the pertoken quantization mode.</li><li>The default value is DT_INT32.</li></ul></td>138+ <td><ul><li>Controls the quantization mode. The value DT_FLOAT4_E2M1 indicates the pergroup quantization mode, and the value DT_INT32 indicates the pertoken quantization mode.</li><li>The default value is DT_INT4.</li></ul></td>
139 <td>INT</td>139 <td>INT</td>
140 <td>-</td>140 <td>-</td>
141 </tr>141 </tr>
@@ -327,8 +327,8 @@ aclnnStatus aclnnFlatQuantV3(
327 <td>传入参数中的必选输入(x、kroneckerP1、kroneckerP2)、必选输出(out、quantScale)是空指针。</td>327 <td>传入参数中的必选输入(x、kroneckerP1、kroneckerP2)、必选输出(out、quantScale)是空指针。</td>
328 </tr>328 </tr>
329 <tr>329 <tr>
330- <td rowspan="13">ACLNN_ERR_PARAM_INVALID</td>330+ <td rowspan="12">ACLNN_ERR_PARAM_INVALID</td>
331- <td rowspan="13">161002</td>331+ <td rowspan="12">161002</td>
332 <td>x、kroneckerP1、kroneckerP2、out、quantScale的数据类型或数据格式不在支持的范围之内。</td>332 <td>x、kroneckerP1、kroneckerP2、out、quantScale的数据类型或数据格式不在支持的范围之内。</td>
333 </tr>333 </tr>
334 <tr>334 <tr>
@@ -361,9 +361,6 @@ aclnnStatus aclnnFlatQuantV3(
361 <tr>361 <tr>
362 <td>out的数据类型为INT32时,x的shape尾轴不是out的shape尾轴大小的8倍,或者x与out的shape的非尾轴的大小不一致。</td>362 <td>out的数据类型为INT32时,x的shape尾轴不是out的shape尾轴大小的8倍,或者x与out的shape的非尾轴的大小不一致。</td>
363 </tr>363 </tr>
364- <tr>
365- <td>out的数据类型为INT32时,x的shape尾轴不是out的shape尾轴大小的8倍,或者x与out的shape的非尾轴的大小不一致。</td>
366- </tr>
367 <tr>364 <tr>
368 <td>groupList、groupListType的数据类型、维度、shape或参数取值不符合约束。</td>365 <td>groupList、groupListType的数据类型、维度、shape或参数取值不符合约束。</td>
369 </tr>366 </tr>
@@ -329,8 +329,8 @@ aclnnStatus aclnnFlatQuantV3(
329 <td>The required inputs (x, kroneckerP1, kroneckerP2) or required outputs (out, quantScale) in the input parameters are null pointers.</td>329 <td>The required inputs (x, kroneckerP1, kroneckerP2) or required outputs (out, quantScale) in the input parameters are null pointers.</td>
330 </tr>330 </tr>
331 <tr>331 <tr>
332- <td rowspan="13">ACLNN_ERR_PARAM_INVALID</td>332+ <td rowspan="12">ACLNN_ERR_PARAM_INVALID</td>
333- <td rowspan="13">161002</td>333+ <td rowspan="12">161002</td>
334 <td>The data type or data format of x, kroneckerP1, kroneckerP2, out, or quantScale is not within the supported range.</td>334 <td>The data type or data format of x, kroneckerP1, kroneckerP2, out, or quantScale is not within the supported range.</td>
335 </tr>335 </tr>
336 <tr>336 <tr>
@@ -363,9 +363,6 @@ aclnnStatus aclnnFlatQuantV3(
363 <tr>363 <tr>
364 <td>If the data type of out is INT32, the tail axis of the shape of x is not 8 times the tail axis size of the shape of out, or the sizes of the non-tail axes of the shapes of x and out do not match.</td>364 <td>If the data type of out is INT32, the tail axis of the shape of x is not 8 times the tail axis size of the shape of out, or the sizes of the non-tail axes of the shapes of x and out do not match.</td>
365 </tr>365 </tr>
366- <tr>
367- <td>If the data type of out is INT32, the tail axis of the shape of x is not 8 times the tail axis size of the shape of out, or the sizes of the non-tail axes of the shapes of x and out do not match.</td>
368- </tr>
369 <tr>366 <tr>
370 <td>The data type, dimension, shape, or parameter value of groupList or groupListType does not comply with the constraints.</td>367 <td>The data type, dimension, shape, or parameter value of groupList or groupListType does not comply with the constraints.</td>
371 </tr>368 </tr>
@@ -26,7 +26,7 @@
26- 接口功能:计算输入self的组归一化结果out,均值meanOut,标准差的倒数rstdOut。26- 接口功能:计算输入self的组归一化结果out,均值meanOut,标准差的倒数rstdOut。
27- 计算公式:27- 计算公式:
28 28 
29- 记$x=self$,$E[x] = \bar{x}$代表$x$的均值,$Var[x] = \frac{1}{n} * \sum_{i=1}^n(x_i - E[x])^2$代表$x$的样本方差,则29+ 记$x=self$,$E[x] = \bar{x}$代表$x$的均值,$Var[x] = \frac{1}{n} * \sum_{i=1}^n(x_i - E[x])^2$代表$x$的总体方差,则
30 30 
31 $$31 $$
32 out = \frac{x - E[x]}{\sqrt{Var[x] + eps}} * \gamma + \beta32 out = \frac{x - E[x]}{\sqrt{Var[x] + eps}} * \gamma + \beta
@@ -28,7 +28,7 @@
28- Description: Computes the group normalization result out, mean meanOut, and reciprocal of standard deviation rstdOut for the input self.28- Description: Computes the group normalization result out, mean meanOut, and reciprocal of standard deviation rstdOut for the input self.
29- Formula:29- Formula:
30 30 
31- Let $x=self$, where $E[x] = \bar{x}$ denotes the mean of $x$, and $Var[x] = \frac{1}{n} * \sum_{i=1}^n(x_i - E[x])^2$ denotes the sample variance of $x$. Then31+ Let $x=self$, where $E[x] = \bar{x}$ denotes the mean of $x$, and $Var[x] = \frac{1}{n} * \sum_{i=1}^n(x_i - E[x])^2$ denotes the population variance of $x$. Then
32 32 
33 $$33 $$
34 out = \frac{x - E[x]}{\sqrt{Var[x] + eps}} * \gamma + \beta34 out = \frac{x - E[x]}{\sqrt{Var[x] + eps}} * \gamma + \beta
@@ -13,7 +13,7 @@
13 13 
14## 功能说明14## 功能说明
15 15 
16-- 算子功能:前向L2Normalize(`y = x/max(sqrt(sum(x^2, dim)), eps)`)的反向算子。三输入`x`(前向输入)、`y`(前向输出,即归一化后的x)、`dy`(上游梯度),单输出`dx`(对x的梯度)。16+- 算子功能:前向L2Normalize($y = x/max(sqrt(sum(x^2, dim)), eps)$)的反向算子。三输入`x`(前向输入)、`y`(前向输出,即归一化后的x)、`dy`(上游梯度),单输出`dx`(对x的梯度)。
17 17 
18- 计算公式(沿属性`dim`指定的归约轴集合归约,keepdims广播回全形状):18- 计算公式(沿属性`dim`指定的归约轴集合归约,keepdims广播回全形状):
19 19 
@@ -15,7 +15,7 @@ English | [简体中文](./README.md)
15 15 
16## Function16## Function
17 17 
18-- Operator function: Backward operator of the forward L2Normalize (`y = x/max(sqrt(sum(x^2, dim)), eps)`). The three inputs are `x` (forward input), `y` (forward output, that is, the normalized x), and `dy` (upstream gradient), and the single output is `dx` (gradient with respect to x).18+- Operator function: Backward operator of the forward L2Normalize ($y = x/max(sqrt(sum(x^2, dim)), eps)$). The three inputs are `x` (forward input), `y` (forward output, that is, the normalized x), and `dy` (upstream gradient), and the single output is `dx` (gradient with respect to x).
19 19 
20- Formula (reduction is performed along the reduction axis set specified by the attribute `dim`, and keepdims broadcasts back to the full shape):20- Formula (reduction is performed along the reduction axis set specified by the attribute `dim`, and keepdims broadcasts back to the full shape):
21 21 
@@ -216,7 +216,7 @@ aclnnStatus aclnnSyncBatchNormGatherStats(
216 </table>216 </table>
217 217 
218 <!-- npu="A3,910b" id7 -->218 <!-- npu="A3,910b" id7 -->
219- - <term>Atlas A3系列产品</term>、<term>Atlas A2系列产品</term>:参数`totalSum`、`totalSquareSum`、`mean`、`variance`、`batchMean`、`batchInvstd`的数据类型不支持BFLOAT16。219+ - <term>Atlas A3系列产品</term>、<term>Atlas A2系列产品</term>:参数`totalSum`、`totalSquareSum`、`sampleCount`、`mean`、`variance`、`batchMean`、`batchInvstd`的数据类型不支持BFLOAT16。
220 <!-- end id7 -->220 <!-- end id7 -->
221 221 
222- **返回值**222- **返回值**
@@ -218,7 +218,7 @@ aclnnStatus aclnnSyncBatchNormGatherStats(
218 </table>218 </table>
219 219 
220 <!-- npu="A3,910b" id7 -->220 <!-- npu="A3,910b" id7 -->
221- - <term>Atlas A3 products</term>, <term>Atlas A2 products</term>: The data type of the parameters `totalSum`, `totalSquareSum`, `mean`, `variance`, `batchMean`, and `batchInvstd` does not support BFLOAT16.221+ - <term>Atlas A3 products</term>, <term>Atlas A2 products</term>: The data type of the parameters `totalSum`, `totalSquareSum`, `sampleCount`, `mean`, `variance`, `batchMean`, and `batchInvstd` does not support BFLOAT16.
222 <!-- end id7 -->222 <!-- end id7 -->
223 223 
224- **Return Value**224- **Return Value**