Operator APIs (aclnn)
Instructions
To facilitate operator calling, a set of C-based APIs (prefixed with aclnn) is provided, eliminating the need for IR (Intermediate Representation) definitions and enabling efficient model building and app development. This approach is referred to as "single-operator API call", abbreviated as aclnn call.
When calling an operator API, you need to reference the dependent header files and library files. Generally, header files are located in ${INSTALL_DIR}/include/aclnnop by default, and library files are located in ${INSTALL_DIR}/lib64 by default. The specific files are as follows:
Dependent header files: ① Method 1 (recommended): Reference the operator master header file
aclnn_ops_${ops_project}.h. ② Method 2: Reference the single-operator API header fileaclnn_*.has needed.Dependent library files: Reference the operator master library file
libopapi_${ops_project}.soas needed.
Here, ${INSTALL_DIR} indicates the CANN installation directory, and ${ops_project} indicates the operator repository (such as math, nn, cv, transformer). Set it to the actual operator repository name.
API List
Determinism Overview:
- Configuration: Due to factors such as different CANN or NPU models, it may not be possible to guarantee consistent results across multiple runs of the same operator. Under the same conditions (platform, device, version, and other randomness parameters), some operator APIs can enable deterministic algorithms through
aclrtCtxSetSysParamOpt(see acl API (C)) to ensure consistent results across multiple runs.- Performance: Deterministic computation for the same operator is typically slower than non-deterministic computation, which may degrade the single-run performance of the model. However, in scenarios such as experimentation, debugging, and troubleshooting where consistent results across multiple runs are required to locate issues, deterministic computation can improve efficiency.
- Threading: The deterministic state can be set only once per thread. If set multiple times, only the last valid setting takes effect. A valid setting means that after the deterministic state is set, an operator task dispatch is actually executed. If only the setting is performed without any operator dispatch, the deterministic variable is enabled but not dispatched to the operator, so the operator is not executed. Solution: Setting determinism multiple times within a single thread is not recommended at this time. This issue exists in both binary enabled and disabled scenarios and will be resolved in a future version.
- Symbol Description: A " - " symbol in the table indicates that the API does not currently support the product listed in that column.
The operator API list is as follows:
| API Name | Description | Deterministic Implementation (A2/A3) | Deterministic Implementation (Ascend 950) |
|---|---|---|---|
| aclnnAdaLayerNorm | Fuses LayerNorm with downstream Add and Mul operations, and adjusts the normalization process through adaptive parameters scale and shift. | Default | - |
| aclnnAdaLayerNormQuant | Fuses AdaLayerNorm with downstream quantization (currently only DynamicQuant is supported). This operator is primarily used to perform adaptive layer normalization quantization, i.e., normalizing the input data and quantizing it to low-precision integers to improve computational efficiency and reduce memory usage. | Default | Default |
| aclnnAdaLayerNormV2 | Fuses LayerNorm with downstream Add and Mul operations, and adjusts the normalization process through adaptive parameters scale and shift. Compared with the AdaLayerNorm operator, two additional output parameters (the mean of the input and the reciprocal of the input standard deviation) are added; the supported data types for weight and bias are expanded with corresponding constraints. | Default | Default |
| aclnnAdaptiveAvgPool2d | Performs 2D adaptive average pooling on the tensor self given the specified 2D output shape (outputSize). | Default | - |
| aclnnAdaptiveAvgPool2dBackward | Backward computation of aclnnAdaptiveAvgPool2d. | Non-deterministic by default; allowed to enable | - |
| aclnnAdaptiveAvgPool3d | Performs 3D adaptive average pooling on the tensor self given the specified 3D output shape (outputSize). | Default | Default |
| aclnnAdaptiveAvgPool3dBackward | Backward computation of aclnnAdaptiveAvgPool3d. | Non-deterministic by default; allowed to enable | - |
| aclnnAdaptiveMaxPool2d | Computes the kernel size for each step based on the input outputSize, and performs 2D max pooling on the input self. | Default | - |
| aclnnAdaptiveMaxPool2dBackward | Backward propagation of the forward adaptive max pooling. Backfills the gradient to the coordinates of the maximum value in each adaptive window, with accumulation at identical coordinates. | Default Non-deterministic Implementation | - |
| aclnnAdaptiveMaxPool3d | Computes the kernel size for each step based on the input outputSize, and performs 3D max pooling on the input self. | Default | Default |
| aclnnAdaptiveMaxPool3dBackward | Backward propagation of the forward adaptive max pooling. Backfills the gradient to the coordinates of the maximum value in each adaptive window, with accumulation at identical coordinates. | Non-deterministic by default; allowed to enable | - |
| aclnnAddbmm&aclnnInplaceAddbmm | First performs matrix multiplication of batch1 and batch3, then sums the results along the first dimension (batch dimension) to compress the 3D tensor into a 2D tensor (with the shape of the last two dimensions). The result is then multiplied by α, and finally summed with the product of β and self. | Default | Default |
| aclnnAddmm&aclnnInplaceAddmm | Computes α multiplied by the product of mat1 and mat2, then sums the result with the product of β and self. | Non-deterministic by default; allowed to enable. | Default |
| aclnnAddmmWeightNz | Computes α multiplied by the product of mat1 and mat2, then sums the result with the product of β and self. Compared with the original addmm API, the new API supports the NZ format for mat2. | Default | Default |
| aclnnAddmv | Performs matrix-vector multiplication and then adds the result to a vector. | Non-deterministic by default; allowed to enable. | Default |
| aclnnAddLayerNorm | Implements the AddLayerNorm function. | Default | Default |
| aclnnAddLayerNormGrad | LayerNorm is a normalization method that normalizes the input data of a network layer to the range [0, 1]. | Non-deterministic by default; allowed to enable | Non-deterministic by default; allowed to enable |
| aclnnAddLayerNormQuant | The LayerNorm operator is a commonly used normalization operation in large models. | Default | Default |
| aclnnAddRelu&aclnnInplaceAddRelu | Performs addition and then applies activation to the result. | Default | Default |
| aclnnAddRmsNormCast | The RmsNorm operator is a commonly used normalization operation in large models. The AddRmsNormCast operator fuses the Cast operator after AddRmsNorm to reduce load/store operations. | Default | Default |
| aclnnAddRmsNormDynamicQuant | Fuses the Add operator before RmsNorm and one or two DynamicQuant operators after RmsNorm normalization output to reduce load/store operations. | Default | Default |
| aclnnAddRmsNormDynamicQuantV2 | The RmsNorm operator is a commonly used normalization operation in large models. Compared with the LayerNorm operator, it removes the subtract mean part. | Default | - |
| aclnnAddRmsNorm | The RmsNorm operator is a commonly used normalization operation in large models. Compared with the LayerNorm operator, it removes the subtract mean part. | Default | Default |
| aclnnAddRmsNormQuant | Fuses the Add operator before RmsNorm and the Quantize operator after RmsNorm to reduce load/store operations. | Default | Default |
| aclnnAddRmsNormQuantV2 | RmsNorm is a commonly used normalization operation in large models. Compared with LayerNorm, it removes the subtract mean part. | Default | - |
| aclnnAddRelu&aclnnInplaceAddRelu | Performs addition and then applies activation to the result. | Default | Default |
| aclnnAdvanceStep | Advances the inference step, i.e., updates the model state at each generation step and generates new inputTokens, inputPositions, seqLens, and slotMapping to improve inference efficiency for vLLM. | Default | - |
| aclnnAdvanceStepV2 | Advances the inference step, i.e., updates the model state at each generation step and generates new inputTokens, inputPositions, seqLens, and slotMapping to improve inference efficiency for vLLM. | Default | - |
| aclnnApplyAdamW | Implements the AdamW optimizer function. | Default | Default |
| aclnnApplyAdamWQuant | Implements the AdamW optimizer function, with quantization applied to m and v. | Default | Default |
| aclnnApplyAdamWV2 | Implements the AdamW optimizer function. | Default | Default |
| aclnnApplyFusedEmaAdam | Implements the FusedEmaAdam fused optimizer function. | Default | Default |
| aclnnApplyTopKTopP | Performs top-k and top-p sampling filtering on the original input logits. | Default | Default |
| aclnnAscendAntiQuant | Dequantizes the input x based on the input scale and offset. | Default | Default |
| aclnnAscendQuant | Quantizes the input x based on the input scale and offset. The size of scale and offset must be the last dimension of x or 1. | Default | Default |
| aclnnAscendQuantV3 | Performs quantization on the input x. Supports setting axis to specify the axis corresponding to scale and offset. The shape of scale and offset must be equal to the axis-specified dimension of x or 1. | Default | Default |
| aclnnAvgPool2d | Performs 2D average pooling on the input tensor with a window size of and a stride of . | Default | Default |
| aclnnAvgPool2dBackward | Backward propagation of 2D average pooling. Computes the input gradient of the forward 2D average pooling. | Non-deterministic by default; allowed to enable | Default |
| aclnnAvgPool3d | Performs 3D average pooling on the input tensor with a window size of and a stride of . | Default | Default |
| aclnnAvgPool3dBackward | Backward propagation of 3D average pooling. Computes the input gradient of the forward 3D average pooling. | Non-deterministic by default; allowed to enable | - |
| aclnnBaddbmm&aclnnInplaceBaddbmm | Computes α multiplied by the matrix multiplication result of batch1 and batch2, then sums the result with the product of β and self. | Default | Default |
| aclnnBatchMatMul | Performs matrix multiplication of the tensor self and the tensor mat2. | Default | Default |
| aclnnBatchMatMulWeightNz | Performs matrix multiplication of the tensor self and the tensor mat2. mat2 only supports the Ascend affinity data layout format. Only supports self as 3D and mat2 as 5D. | Default | Default |
| aclnnBatchNorm | Performs batch normalization on a batch of data. The statistical result of the normalized data has a mean of 0 and a standard deviation of 1. | Non-deterministic by default; allowed to enable | Default |
| aclnnBatchNormElemt | Takes the global mean and the reciprocal of the standard deviation as operator inputs, and performs BatchNorm computation on x. | Non-deterministic by default; allowed to enable | - |
| aclnnBatchNormElemtBackward | Backward computation of aclnnBatchNormElemt. Used to compute the element-wise gradient of the input tensor for updating model parameters during the backpropagation process. | Default | Default |
| aclnnBatchNormBackward | Backward propagation of aclnnBatchNorm. Used to compute the gradient of the input tensor for updating model parameters during the backpropagation process. | Non-deterministic by default; allowed to enable | Default |
| aclnnBatchNormGatherStatsWithCounts | Collects the mean and variance from all devices, and updates the global mean and the reciprocal of the standard deviation. | Default | Default |
| aclnnBatchNormReduce | The first step of data normalization. Computes the sum and sum of squares of the data. | Non-deterministic by default; allowed to enable | - |
| aclnnBatchNormReduceBackward | Primarily used to compute the gradient of the BatchNorm operation during the backpropagation process, and performs reduction operations on some intermediate results to optimize computational efficiency. | Default | Default |
| aclnnBidirectionLSTM | Performs LSTM network computation. Accepts an input sequence and initial states, and returns the output sequence and final states. | Default | - |
| aclnnBidirectionLSTMV2 | Performs LSTM network computation. Accepts an input sequence and initial states, and returns the output sequence and final states. | Default | - |
| aclnnBinaryCrossEntropy | Computes the binary cross entropy between self and target. | Default | Default |
| aclnnBinaryCrossEntropyBackward | Computes the gradient value of the binary cross entropy backward propagation. | Default | Default |
| aclnnBinaryCrossEntropyWithLogits | Computes the BCELoss between the input logits and the label target. | Default | Default |
| aclnnBinaryCrossEntropyWithLogitsBackward | Performs logits computation on the input self, and then performs BCELoss backward propagation using the resulting value together with the label target. | Default | Default |
| aclnnBinaryCrossEntropyWithLogitsTargetBackward | Performs logits computation on the input self, and then performs BCELoss backward propagation with respect to target using the resulting value together with the label target. | Default | - |
| aclnnCelu&aclnnInplaceCelu | aclnnCelu applies the continuously differentiable exponential linear unit activation function CELU to each element x in the input tensor self, and stores the result in the output tensor out. | Default | - |
| aclnnChamferDistanceBackward | The backward operator of ChamferDistance. Computes the gradient corresponding to the input based on the contribution of the forward input to the output and the initial gradient. | Non-deterministic by default; allowed to enable | - |
| aclnnClippedSwiglu | A clipped Swish gated linear unit activation function. Performs SwiGlu computation on x. | Default | - |
| aclnnConvolution | Implements the convolution function. Supports 1D/2D/3D convolution, transposed convolution, dilated convolution, and grouped convolution. | Default | Default |
| aclnnConvolutionBackward | Implements the backward propagation of convolution. | Non-deterministic by default; allowed to enable. | Default |
| aclnnConvDepthwise2d | Implements 2D depthwise convolution (DepthwiseConv2D) computation. | Default | Default |
| aclnnConvertWeightToINT4Pack | Preprocesses the input weight data to convert low-bit data from sparse storage to dense storage layout. When the data format of the output weightInt4Pack is declared as FRACTAL_NZ, this operator converts the data format from ND to FRACTAL_NZ. | Default | Default |
| aclnnConvTbc | Implements time-based (TBC) 1D convolution. | Default | Default |
| aclnnConvTbcBackward | Used to compute the backward propagation of time-based convolution. | Default | Default |
| aclnnCrossEntropyLoss | Computes the cross entropy loss of the input. | Default | Default |
| aclnnCrossEntropyLossGrad | Computes the gradient value of the binary cross entropy backward propagation. | Default | Default |
| aclnnCtcLoss | Computes the connectionist temporal classification loss value. | Non-deterministic by default; allowed to enable. | Default |
| aclnnCtcLossBackward | Backward propagation of the connectionist temporal classification loss value. | Non-deterministic by default; allowed to enable. | Default |
| aclnnDeepNorm | Performs deep normalization on the elements of the input tensor x. Normalizes each element to an output tensor with zero mean and unit variance by computing its mean and standard deviation. | Default | - |
| aclnnDeepNormGrad | Backward propagation of aclnnDeepNorm. Computes the gradient of tensor x, tensor gx, and tensor gamma, as well as the sum of tensor dy. | Non-deterministic by default; not allowed to enable | - |
| aclnnDeformableConv2d | Implements the convolution function. Supports 2D convolution, as well as deformable convolution and grouped convolution. | Default | Default |
| aclnnDequantBias | Dequantizes the input x, converting int32 input data to FLOAT16/BFLOAT16 output. | Default | - |
| aclnnDequantSwigluQuant | Adds dequant and quant operations before and after the Swish gated linear unit activation function to perform DequantSwigluQuant computation on x. | Default | Default |
| aclnnDequantSwigluQuantV2 | Adds dequant and quant operations before and after the Swish gated linear unit activation function to perform DequantSwigluQuant computation on x. | Default | Default |
| aclnnGroupedDynamicMxQuant | Performs grouped float8 dynamic quantization on the input data based on the starting values of the input group indices. | - | Default |
| aclnnDynamicDualLevelMxQuant | Divides the input twice based on the given level0BlockSize and level1BlockSize, and performs MX two-level quantization with the target data type being FLOAT4 at the data block granularity. | - | Default |
| aclnnGroupedDynamicBlockQuant | Quantizes each group at the basic block granularity based on the starting values of the input group indices, and outputs the quantization parameter scale. | - | Default |
| aclnnDualLevelQuantMatmulWeightNz | Performs matrix multiplication with two-level quantized mxfp4. | - | Default |
| aclnnDynamicMxQuant | Performs MX quantization with the target data type being FLOAT4 or FLOAT8. On the given axis, for every blockSize number of elements, computes the quantization scale mxscale for this group as the corresponding part of the output mxscaleOut, then divides each element in this group by mxscale, converts to the corresponding dstType based on round_mode, and obtains the quantization result y as the corresponding part of the output yOut. When dstType is FLOAT8_E4M3FN or FLOAT8_E5M2, different algorithms for computing mxscale are specified based on the value of scaleAlg. | - | Default |
| aclnnDynamicMxQuantWithDualAxis | Performs MX quantization with the target data type being FLOAT4 or FLOAT8 simultaneously on the -1 and -2 axes. Currently only supports scaleAlg value 0 (OCP algorithm). During operator implementation, axes before the -2 axis (exclusive) are merged. | - | Default |
| aclnnDynamicBlockQuant | Divides the input tensor into multiple data blocks based on the given rowBlockSize and colBlockSize, and performs quantization at the data block granularity. In each block, first computes the quantization parameter scaleOut for the current block, and then quantizes the input based on scaleOut. Outputs the final quantization result and the quantization parameter scaleOut for each block. | Default | Default |
| aclnnDynamicQuant | Performs per-token symmetric dynamic quantization on the input tensor. | Default | Default |
| aclnnDynamicQuantV2 | Performs per-token symmetric/asymmetric dynamic quantization on the input tensor. | Default | Default |
| aclnnDynamicQuantV3 | Performs dynamic quantization on the input tensor. | Default | Default |
| aclnnEinsum | Performs tensor computation using Einstein summation convention in the form of "term1, term2 -> output-term". Generates the output tensor according to the following equation, where reduce-sum performs summation over all indices that appear in the input terms (term1, term2) but not in the output term. | Default | Default |
| aclnnElu&aclnnInplaceElu | Applies the exponential linear unit activation function ELU to each element x in the input tensor self, and stores the result in the output tensor out. | Default | Default |
| aclnnEluBackward | Backward computation of the aclnnElu activation function. Outputs the gradient of the forward input of the ELU activation function. | Default | Default |
| aclnnEmbedding | Maps a dataset to a vector space for data quantization. The 2D embedding weight tensor is weight (m+1 rows, n columns). For any input index tensor indices (e.g., 1 row, 3 columns), the output out is a tensor with 3 rows and n columns. | Default | Default |
| aclnnEmbeddingBag | Obtains a set of aggregated values from weight based on indices, and then aggregates the obtained values using max, sum, or mean according to the offset of offsets and the aggregation mode specified by mode. Other parameters further refine the control of the computation process. | Default | Default |
| aclnnEmbeddingDenseBackward | Implements the backward computation of aclnnEmbedding. Accumulates the row of grad corresponding to the same index indices onto out. | Non-deterministic by default; allowed to enable | Non-deterministic by default; allowed to enable |
| aclnnEmbeddingRenorm | Returns the corrected result of the input tensor at the specified indices based on the given maxNorm and normType. | Default | Default |
| aclnnErfinv&aclnnInplaceErfinv | erfinv is the inverse function of the Gaussian error function erf. Returns the quantile of each element in the input tensor under the standard normal distribution function. | Default | Default |
| aclnnExpandIntoJaggedPermute | Expands the sparse data permutation indices from the table dimension to the batch dimension. Applicable to cases where sparse features have different batch sizes across different ranks. | Default | - |
| aclnnFakeQuantPerChannelAffineCachemask | Performs fake quantization on the input data self using scale and zero_point along the specified axis, and updates the value range of the fake quantization output based on quant_min and quant_max. | Default | - |
| aclnnFakeQuantPerTensorAffineCachemask | Performs fake quantization on the input self, and updates the value range of the fake quantization output based on quant_min and quant_max. | Default | - |
| aclnnFastBatchNormBackward | Backward propagation of aclnnBatchNorm (high-performance version). Used to compute the gradient of the input tensor for updating model parameters during the backpropagation process. | Default | - |
| aclnnFastGelu | Fast Gaussian error linear unit activation function. | Default | Default |
| aclnnFastGeluBackward | Backward computation of FastGelu. | Default | Default |
| aclnnFastLayerNorm | Performs normalization on a specified layer with a mean of 0 and a standard deviation of 1. | Default | - |
| aclnnFatreluMul | Splits the input tensor into left and right tensors along the last dimension: x1 and x2, performs threshold computation on the left x1, and multiplies the result with x2. | Default | - |
| aclnnFlatQuant | A fused operator that performs two small matrix multiplications on the input matrix x in sequence. | Default | Default |
| aclnnFlip | Reverses (inverts the order of) the specified dimensions of an n-dimensional tensor, with the formula for each axis specified in dims. | Default | Default |
| aclnnForeachAbs | Performs an element-wise absolute value operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachAcos | Performs an element-wise arccosine operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachAddcdivList | Performs element-wise addition, multiplication, and division on multiple tensors: divides and element-wise, multiplies the result by scalars, and then adds it to . | Default | - |
| aclnnForeachAddcdivScalar | Performs element-wise addition, multiplication, and division on multiple tensors: divides and element-wise, multiplies the result by scalar, and then adds it to . | Default | - |
| aclnnForeachAddcdivScalarList | Performs element-wise addition, multiplication, and division on multiple tensors: divides and element-wise, multiplies the result by , and then adds it to . | Default | Default |
| aclnnForeachAddcdivScalarV2 | Performs element-wise addition, multiplication, and division on multiple tensors: divides and element-wise, multiplies the result by scalar, and then adds it to . | Default | - |
| aclnnForeachAddcmulList | First performs element-wise multiplication on tensor list x2 and tensor list x3, multiplies the result by tensor scalars, and finally performs element-wise addition of the previously computed result with tensor list x1. | Default | - |
| aclnnForeachAddcmulScalar | First performs element-wise multiplication on tensor list x2 and tensor list x3, then multiplies by tensor scalar, and finally performs element-wise addition of the previously computed result with tensor list x1. | Default | Default |
| aclnnForeachAddcmulScalarList | First performs element-wise multiplication on tensor list x2 and tensor list x3, then performs element-wise multiplication with tensor scalars, and finally performs element-wise addition of the previously computed result with tensor list x1. | Default | - |
| aclnnForeachAddcmulScalarV2 | First performs element-wise multiplication on tensor list x2 and tensor list x3, then multiplies by the scalar value scalar, and finally performs element-wise addition of the previously computed result with tensor list x1. | Default | Default |
| aclnnForeachAddList | Adds elements from two tensor lists element by element, with the addition coefficient adjustable via the alpha parameter. | Default | - |
| aclnnForeachAddListV2 | Adds elements from two tensor lists element by element, with the addition coefficient adjustable via the alpha parameter. | Default | - |
| aclnnForeachAddScalar | Adds the specified tensor value to each tensor in the tensor list. | Default | Default |
| aclnnForeachAddScalarList | Performs element-wise addition between the input tensor list and the input scalar list. | Default | - |
| aclnnForeachAddScalarV2 | Adds the specified scalar value to each tensor in the tensor list. | Default | Default |
| aclnnForeachAsin | Performs an element-wise arcsine function operation. | Default | - |
| aclnnForeachAtan | Performs an element-wise arctangent function operation. | Default | - |
| aclnnForeachCopy | Copies the contents of one tensor list to another. | Default | Default |
| aclnnForeachCos | Performs an element-wise cosine function operation. | Default | - |
| aclnnForeachCosh | Performs an element-wise hyperbolic cosine function operation. | Default | - |
| aclnnForeachDivList | Performs element-wise division on tensor list x1 and tensor list x2. | Default | - |
| aclnnForeachDivScalar | Computes the division of tensor list x by tensor scalar. | Default | - |
| aclnnForeachDivScalarList | Performs element-wise division on tensor list x and scalar list scalars. | Default | Default |
| aclnnForeachDivScalarV2 | Computes the division of tensor list x by the scalar value scalar. | Default | - |
| aclnnForeachErf | Performs an element-wise error function operation (also known as the Gaussian error function). | Default | - |
| aclnnForeachErfc | Performs an element-wise complementary error function operation, integrating from x to infinity. | Default | - |
| aclnnForeachExp | Performs an exponential operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachExpm1 | Performs an exponential operation on each tensor in the input tensor list, and then subtracts 1 from the result. | Default | - |
| aclnnForeachLerpList | Performs interpolation on corresponding elements of two tensor lists, where the tensor list weight serves as the interpolation coefficient. | Default | - |
| aclnnForeachLerpScalar | Performs interpolation on corresponding elements of two tensor lists, where the scalar weight serves as the interpolation coefficient. | Default | Default |
| aclnnForeachLog | Performs an element-wise natural logarithm operation (ln(x)) on the tensor list. | Default | - |
| aclnnForeachLog1p | Adds 1 to each element in the tensor list and then computes the base-e logarithm. | Default | - |
| aclnnForeachLog2 | Computes the base-2 logarithm of each element in the tensor list. | Default | - |
| aclnnForeachLog10 | Computes the base-10 logarithm of each element in the tensor list. | Default | - |
| aclnnForeachMaximumList | Performs element-wise comparison on tensor list x1 and tensor list x2, and computes the maximum value for each element. | Default | - |
| aclnnForeachMaximumScalar | Performs element-wise comparison on the tensor list and tensor scalar, and computes the maximum value for each element. | Default | - |
| aclnnForeachMaximumScalarList | Performs element-wise comparison on tensor list x and scalar list scalars, and computes the maximum value for each element. | Default | - |
| aclnnForeachMaximumScalarV2 | Performs element-wise comparison on the tensor list and the scalar value scalar, and computes the maximum value for each element. | Default | - |
| aclnnForeachMinimumList | Performs element-wise comparison on tensor list x1 and tensor list x2, and computes the minimum value for each element. | Default | - |
| aclnnForeachMinimumScalar | Performs element-wise comparison on tensor list x and tensor scalar, and computes the minimum value for each element. | Default | - |
| aclnnForeachMinimumScalarList | Performs element-wise comparison on tensor list x and scalar list scalars, and computes the minimum value for each element. | Default | - |
| aclnnForeachMinimumScalarV2 | Performs element-wise comparison on tensor list x and the scalar value scalar, and computes the minimum value for each element. | Default | - |
| aclnnForeachMulList | Performs element-wise multiplication on two input tensor lists. | Default | - |
| aclnnForeachMulScalar | Performs multiplication between each tensor in the input tensor list and tensor scalar. | Default | Default |
| aclnnForeachMulScalarList | Performs element-wise multiplication between the input tensor list and the scalar list. | Default | Default |
| aclnnForeachMulScalarV2 | Performs multiplication between each tensor in the input tensor list and the scalar value scalar. | Default | Default |
| aclnnForeachNeg | Computes the opposite number of each tensor in the input tensor list. | Default | - |
| aclnnForeachNonFiniteCheckAndUnscale | Iterates through all tensors in scaledGrads, checks whether Inf or NaN exists, sets foundInf to 1.0 if present (otherwise leaves foundInf unchanged), and unscales all tensors in scaledGrads. | Default | Default |
| aclnnForeachNorm | Performs a norm operation on each tensor in the input tensor list. | Default | Default |
| aclnnForeachPowList | Raises each tensor in the input tensor list to the power of x2. | Default | - |
| aclnnForeachPowScalar | Performs an exponentiation operation on each tensor in the input tensor list x, with the exponent being tensor scale. | Default | - |
| aclnnForeachPowScalarV2 | Performs an exponentiation operation on each tensor in the input tensor list x, with the exponent being the scalar value exponent. | Default | - |
| aclnnForeachPowScalarAndTensor | Performs an exponentiation operation on each tensor in the input tensor list x, with the base being the input scalar value scalar. | Default | - |
| aclnnForeachPowScalarList | Performs an exponentiation operation on each tensor in the input tensor list x, with the exponent being the corresponding scalar from the scalar list exponent. | Default | - |
| aclnnForeachReciprocal | Performs a reciprocal operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachRoundOffNumber | Performs a rounding operation with specified precision on each tensor in the input tensor list, with the rounding mode specifiable via roundMode. | Default | - |
| aclnnForeachRoundOffNumberV2 | Performs a rounding operation with specified precision on each tensor in the input tensor list, with the rounding mode specifiable via roundMode. | Default | - |
| aclnnForeachSigmoid | Performs a Sigmoid function operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachSign | Computes the sign value of each tensor in the input tensor list. | Default | - |
| aclnnForeachSin | Performs a sine function operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachSinh | Performs a hyperbolic sine function operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachSqrt | Performs a square root operation on each tensor in the input tensor list. | Default | Default |
| aclnnForeachSubList | Performs element-wise subtraction on two input tensor lists, with the subtraction coefficient adjustable via the alpha parameter. | Default | - |
| aclnnForeachSubListV2 | Performs element-wise subtraction on elements in two tensor lists, with the subtraction coefficient adjustable via the alpha parameter. | Default | - |
| aclnnForeachSubScalar | Performs subtraction between each tensor in the input tensor list and tensor scalar. | Default | - |
| aclnnForeachSubScalarList | Performs element-wise subtraction between each tensor in the input tensor list and each scalar in the scalar list scalars. | Default | - |
| aclnnForeachSubScalarV2 | Performs subtraction between each tensor in the input tensor list and the scalar value scalar. | Default | - |
| aclnnForeachTan | Performs a tangent function operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachTanh | Performs a hyperbolic tangent function operation on each tensor in the input tensor list. | Default | - |
| aclnnForeachZeroInplace | Updates the input tensor list in-place, setting each tensor in the input tensor list to 0. | Default | - |
| aclnnFusedLinearOnlineMaxSum | Functionally equivalent to Megatron's matmul and fused_vocab_parallel_cross_entropy implementation, supporting vocabulary_size dimension sharding with fused matmul and cross-entropy loss. | Default | Default |
| aclnnFusedCrossEntropyLossWithMaxSum | A component of the cross-entropy computation module in vocabulary-parallel scenarios, addressing memory and computational efficiency issues for ultra-large vocabularies, and computing the loss and softMax results. | Default | - |
| aclnnFusedLinearCrossEntropyLossGrad | A component of the cross-entropy loss computation module in vocabulary-parallel scenarios, addressing memory and computational efficiency issues for ultra-large vocabularies. This part implements gradient calculation for computing the gradients of the leaf nodes input and weight. | Default | - |
| aclnnFusedMatmul | Fuses matrix multiplication with general vector computation. | Default | Default |
| aclnnFusedQuantMatmul | Fuses quantized matrix multiplication with general vector computation. | Default | - |
| aclnnFusedQuantMatmulWeightNz | Fuses quantized matrix multiplication with general vector computation, with WeightNz input. | Default | - |
| aclnnGather | Gathers data along the specified dimension dim of the input tensor. | Default | Default |
| aclnnGatherNd | For an input tensor self with dimension r ≥ 1 and an input tensor indices with dimension q ≥ 1, collects data slices into an output tensor out with dimension (q-1) + (r - indices_shape[-1]). | Default | Default |
| aclnnGatherV2 | Extracts elements from the input tensor along the specified dimension dim according to the index numbers in index, and saves them to the out tensor. | Default | Default |
| aclnnGatherV3 | Extracts elements from the input tensor along the specified dimension dim according to the index numbers in index, where batchDims represents the operation batch. Saves the result to the out tensor. | Default | Default |
| aclnnGeGlu | Gaussian error linear unit activation function. | Default | Default |
| aclnnGeGluBackward | Performs the backward computation of aclnnGeGlu. | Default | Default |
| aclnnGeGluV3 | Gaussian error linear unit activation gating function. Extends aclnnGeGlu by adding the ability to set the direction of the activation function operation data block. | Default | Default |
| aclnnGeGluV3Backward | Performs the backward computation of aclnnGeGluV3. | Default | Default |
| aclnnGelu | Gaussian error linear unit activation function. | Default | Default |
| aclnnGeluBackward | Performs the backward computation of aclnnGelu. | Default | Default |
| aclnnGeluBackwardV2 | Performs the backward computation of aclnnGeluV2. | Default | Default |
| aclnnGeluMul | Splits the input tensor into left and right tensors along the last dimension: x1 and x2, performs Gelu computation on the left x1, and multiplies the result with x2. | Default | Default |
| aclnnGeluQuant | Fuses GeluV2 with DynamicQuant/AscendQuantV2, performs Gelu activation on the input data self, and then quantizes the activation result, outputting the quantized result. | Default | Default |
| aclnnGeluV2 | Gaussian error linear unit activation function. | Default | Default |
| aclnnGemm | Computes the product of α, A, and B, and then sums it with the product of β and input C. | Default | Default |
| aclnnGemmaRmsNorm | The GemmaRmsNorm operator is a normalization operation commonly used in large models. Compared to the RmsNorm operator, it performs a +1 operation on gamma during computation. | Default | - |
| aclnnGlu | GLU is a gated linear unit function that splits the input tensor into two tensors evenly along the specified dimension dim, and performs element-wise multiplication between the front part tensor and the Sigmoid function output of the rear part tensor. | Default | Default |
| aclnnGluBackward | Performs the backward computation of aclnnGlu. | Default | Default |
| aclnnHardshrink | Applies hard shrinkage element-wise, shrinking elements within the range of λ. | Default | - |
| aclnnGroupNorm | Computes the group normalization result out, mean meanOut, and the reciprocal of the standard deviation rstdOut for the input self. | Default | Default |
| aclnnGroupNormBackward | Performs the backward computation of aclnnGroupNorm. Computes the gradient of the input tensor for updating model parameters during backward propagation. | Non-deterministic by default; allowed to enable | Default |
| aclnnGroupNormSilu | Computes the group normalization result groupnormOut, mean meanOut, and reciprocal of the standard deviation rstdOut of the input self, and performs the SiLU operation on groupnormOut to obtain the final output out. | Default | Default |
| aclnnGroupNormSiluV2 | Computes the group normalization result out, mean meanOut, reciprocal of the standard deviation rstdOut, and the SiLU output of the input self. | Default | Default |
| aclnnGroupNormSiluQuant | Computes the group normalization, mean meanOut, reciprocal of the standard deviation rstdOut of the input self, and the quantized result out of the SiLU output. | Default | Default |
| aclnnGroupNormSwish | Computes the group normalization result out, mean meanOut, reciprocal of the standard deviation rstdOut, and the Swish output of the input x. | Default | - |
| aclnnGroupNormSwishGrad | Performs the backward operation of aclnnGroupNormSwish. | Non-deterministic by default; allowed to enable | - |
| aclnnGroupQuant | Performs group quantization on the input x. | Default | - |
| aclnnHardshrinkBackward | Computes the gradient gradInput of the backward propagation for aclnnHardshrink. | Default | - |
| aclnnHardsigmoid&aclnnInplaceHardsigmoid | An activation function variant that returns a new tensor according to the formula. The shape of the result is the same as that of the input tensor. | Default | - |
| aclnnHardsigmoidBackward | Performs the backward propagation of aclnnHardsigmoid. | Default | - |
| aclnnHardswishBackward | Performs the backward propagation of aclnnHardswish, completing the gradient calculation of tensor self. | Default | - |
| aclnnHardswishBackwardV2 | Performs the backward propagation of aclnnHardswish, completing the gradient calculation of tensor self. | Default | - |
| aclnnHardswish&aclnnInplaceHardswish | An activation function that returns an output tensor with the same shape as the input tensor. When the input value is less than -3, the output is 0; when greater than 3, the output is the value itself; otherwise, the output is (value + 3) multiplied by value and then divided by 6. | Default | - |
| aclnnHardtanhBackward | Performs the backward propagation of the activation function aclnnHardtanh. | Default | Default |
| aclnnHeaviside | Computes the Heaviside step function for each element in the input, serving as the activation function of the model. | Default | - |
| aclnnIndex | Retrieves data from the input x at the corresponding coordinates based on the indices. | Default | Default |
| aclnnIndexAdd | Adds values from the source tensor to the values at the corresponding positions in the input tensor along a specified dimension based on the given indices. | Non-deterministic by default; allowed to enable | Non-deterministic by default; allowed to enable |
| aclnnIndexAddV2 | Adds values from the source tensor to the values at the corresponding positions in the input tensor along a specified dimension based on the given indices. Supports enabling high-performance computation mode. | Non-deterministic by default; allowed to enable | Non-deterministic by default; allowed to enable |
| aclnnIndexCopy&aclnnInplaceIndexCopy | Uses the element values in the index tensor as indices to copy elements from source to the corresponding positions in selfRef along the specified axis dim. | Default | Non-deterministic by default; allowed to enable |
| aclnnIndexFill&aclnnInplaceIndexFill | Replaces the values at the positions specified by index with value along the given axis dim of the input self. | Default | Default |
| aclnnIndexFillTensor&aclnnInplaceIndexFillTensor | Replaces the values at the positions specified by index with value along the given axis dim of the input self. | Default | Default |
| aclnnIndexPutImpl | Replaces or accumulates the data at the corresponding coordinates of the input x with the input value based on the indices. | Non-deterministic by default; allowed to enable | Non-deterministic by default; allowed to enable |
| aclnnInplacePut | Treats selfRef as a one-dimensional tensor and uses the element values in the index tensor as indices. If accumulate is true, accumulates the elements from source with the elements at the corresponding positions in selfRef; if accumulate is false, replaces the elements at the corresponding positions in selfRef with the elements from source. | Non-deterministic by default; allowed to enable | Non-deterministic by default; allowed to enable |
| aclnnInplaceScatterUpdate | Updates the values in tensor data element by element with the values from tensor updates along the specified axis and indices. This operator uses custom operator semantics and has no corresponding TensorFlow or PyTorch API. | Default | Default |
| aclnnIndexSelect | Extracts elements from the input tensor along the specified dimension dim according to the index numbers in index, and saves them to the out tensor. | Default | Default |
| aclnnInplaceAddRmsNorm | The RmsNorm operator is a normalization operation commonly used in large models. Compared with the LayerNorm operator, it removes the subtract mean part. | Default | Default |
| aclnnInplaceMaskedScatter | Copies elements from source to the corresponding positions in selfRef based on the positions where the mask tensor elements are True. | Default | Default |
| aclnnInplaceQuantScatter | First quantizes updates along the quantAxis axis: quantScales scales updates, and quantZeroPoints applies an offset. Then updates the values at the corresponding positions in selfRef element by element with the quantized values from updates along the specified axis based on the index tensor indices. | Default | Default |
| aclnnInplaceQuantScatterV2 | An operator fusion of the Quantize operator and the Scatter operator. First quantizes updates along the quantAxis axis: quantScales scales updates, and quantZeroPoints applies an offset. Then updates the values at the corresponding positions in selfRef element by element with the quantized values from updates along the specified axis based on the index tensor indices. Compared with aclnnInplaceQuantScatter, it adds the roundMode input. | - | Default |
| aclnnInstanceNorm | Performs the Instance Normalization operation. | Default | - |
| aclnnInverse | Computes the inverse matrix of the input square matrix. | Default | - |
| aclnnKlDivBackward | Performs the backward computation of the aclnnKlDiv API result. | Default | Default |
| aclnnKlDivTargetBackward | Performs the target backward computation of the aclnnKlDiv API result. | Default | Default |
| aclnnKthvalue | Returns the k-th smallest value and its index along the specified dimension of the input tensor. | Default | Default |
| aclnnL1Loss | Computes the mean absolute error (MAE) between each element in the input self and the target. | Default | Default |
| aclnnL1LossBackward | Computes the backward propagation of aclnnL1Loss. reduction specifies the computation method of the loss function. | Default | Default |
| aclnnLayerNorm&aclnnLayerNormWithImplMode | Performs normalization with a mean of 0 and a standard deviation of 1 on the specified layer. | Default | Default |
| aclnnLayerNormBackward | Performs the backward propagation of aclnnNorm. Computes the gradient of the input tensor for updating model parameters during backward propagation. | Default | Default |
| aclnnLayerNormQuant | Fuses the LayerNorm normalization output with the downstream quantization operator to reduce load/store operations. | - | Default |
| aclnnLeakyRelu&aclnnInplaceLeakyRelu | An activation function that addresses the issue of the ReLU function outputting 0 when the input is less than 0, preventing neurons from being unable to update parameters. | Default | Default |
| aclnnLeakyReluBackward | Performs the backward propagation of the LeakyRelu activation function. | Default | Default |
| aclnnLinalgVectorNorm | Computes the vector norm of the input tensor. | Non-deterministic by default; allowed to enable | Default |
| aclnnLogit | A mathematical operation that converts probabilities to log-odds, commonly used for the inverse transformation of probability values. | Default | Default |
| aclnnLogitGrad | Performs the backward propagation of aclnnLogit. | Default | Default |
| aclnnLogSigmoid | Performs the LogSigmoid operation element-wise on the input tensor. | Default | Default |
| aclnnLogSigmoidBackward | Performs the backward propagation of aclnnLogSigmoid, computing the gradient input based on the gradient propagated from the previous layer and the LogSigmoid forward input. | Default | Default |
| aclnnLogSigmoidForward | Performs the LogSigmoid operation element-wise on the input tensor. | Default | Default |
| aclnnLogSoftmax | Computes the logsoftmax value of the input tensor. | Default | Default |
| aclnnLogSoftmaxBackward | Performs the backward propagation of aclnnLogSoftmax. | Default | Default |
| aclnnLSTM | Performs the LSTM computation. | Default | - |
| aclnnLstmBackward | Performs the backward computation of LSTM. | Default | - |
| aclnnMaskedSoftmaxWithRelPosBias | Replaces the softmax computation part that uses window attention in swinTransformer. | Default | - |
| aclnnMatmul | Performs matrix multiplication of 1-to-6-dimensional tensor self and tensor mat2. | Default | Default |
| aclnnMatmulWeightNz | Performs matrix multiplication of tensor self and tensor mat2, where mat2 only supports the Ascend affinity data layout format. | Default | Default |
| aclnnMatmulCompress | When performing l@r matrix multiplication, the r matrix can be losslessly compressed using the msModelSlim tool to reduce its memory footprint, and then this API performs lossless decompression, matrix multiplication, and dequantization computation. | Default | - |
| aclnnMaxPool | Performs max pooling on a 3-dimensional or 4-dimensional input tensor. | Default | Default |
| aclnnMaxPool2dWithIndices | Performs 2D (H and W dimensions) max pooling on the input channels of the input signal, and outputs the pooled values out and indices. | Default | Default |
| aclnnMaxPool2dWithIndicesBackward | Performs the backward propagation of the forward max pooling operation aclnnMaxPool2dWithIndices. | Non-deterministic by default; allowed to enable. | Default |
| aclnnMaxPool2dWithMask | Performs 2D max pooling on the input channels of the input signal, and outputs the pooled values out and indices (computed using mask semantics). | Default | - |
| aclnnMaxPool2dWithMaskBackward | Performs the backward propagation of the forward max pooling operation aclnnMaxPool2dWithMask. | Non-deterministic by default; allowed to enable. | - |
| aclnnMaxPool3dWithArgmax | Performs 3D max pooling on the input channels of the input signal, and outputs the pooled values out and indices. | Default | Default |
| aclnnMaxPool3dWithArgmaxBackward | Performs the backward propagation of the forward max pooling operation aclnnMaxPool3dWithArgmax, backfilling the gradient to the coordinates of the maximum value in each window, with accumulation at the same coordinates. | Non-deterministic by default; allowed to enable. | Default |
| aclnnMaxUnpool2d | Performs the inverse operation of MaxPool2d, filling the element values of input into out based on the indices. | Default | Default |
| aclnnMaxUnpool2dBackward | Performs the backward propagation of aclnnMaxUnpool2d, the inverse operation of MaxPool2d, filling the element values of gradOutput into out based on the indices. | Default | Default |
| aclnnMaxUnpool3d | Performs the inverse operation of MaxPool3d, filling the element values of input into out based on the indices. | Default | Default |
| aclnnMaxUnpool3dBackward | Performs the backward propagation of aclnnMaxUnpool3d, the inverse operation of MaxPool3d, filling the element values of gradOutput into out based on the indices. | Default | Default |
| aclnnMedian | Returns the median of all elements. | Default | Default |
| aclnnMedianDim | Returns the median of all elements and its position (if the number of elements in the specified dimension is size, the median corresponds to the sorted index (size - 1) // 2). | Default | Default |
| aclnnMm | Performs matrix multiplication of 2-dimensional tensor self and tensor mat2. | Default | Default |
| aclnnMish&aclnnInplaceMish | A self-regularized non-monotonic neural network activation function. | Default | Default |
| aclnnMishBackward | Computes the backpropagation process of aclnnMish. | Default | Default |
| aclnnModulate | Implements adaptive scaling and shifting of features. | Default | Default |
| aclnnModulateBackward | Computes the parameters in the ModulateBackward backward propagation for gradient update. | Default | - |
| aclnnMseLoss | Computes the mean squared error between each element in the input x and the target y. | Default | Default |
| aclnnMseLossBackward | Performs the backward propagation of the mean squared error function aclnnMseLoss. | Default | Default |
| aclnnMseLossOut | Computes the mean squared error between each element in the input x and the target y. | Default | Default |
| aclnnMultilabelMarginLoss | Computes the negative log-likelihood loss value. | Non-deterministic by default; allowed to enable. | - |
| aclnnMultiScaleDeformableAttnFunction | Traverses different sampling points of feature maps of different sizes by specifying parameters. | Default | - |
| aclnnMultiScaleDeformableAttentionGrad | The forward operator mainly traverses different sampling points of feature maps of different sizes by specifying parameters. The backward operator computes the gradient corresponding to the input based on the contribution of the forward input to the output and the initial gradient. | Non-deterministic by default; allowed to enable. | - |
| aclnnMv | Computes the product of the matrix input and the vector vec. | Default | Default |
| aclnnNanMedian | Returns the median of all elements after ignoring NaN values. | Default | Default |
| aclnnNanMedianDim | Returns the median and its position along the specified dimension of the tensor after ignoring NaN values. | Default | Default |
| aclnnNorm | Returns the matrix norm or vector norm of the given tensor. | Non-deterministic by default; allowed to enable. | Default |
| aclnnNLLLoss | Computes the negative log-likelihood loss value. | Non-deterministic by default; allowed to enable. | Default |
| aclnnNLLLoss2d | Computes the negative log-likelihood loss value. | Non-deterministic by default; allowed to enable. | Default |
| aclnnNLLLoss2dBackward | Performs the backward propagation of the negative log-likelihood loss. | Default | Default |
| aclnnNLLLossBackward | Performs the backward propagation of the negative log-likelihood loss function. | Default | Default |
| aclnnNonzero | Finds the positions of non-zero elements in self. Let the dimension of self be D and the number of non-zero elements in self be N. The returned out has a shape of D * N, where each column represents the position coordinates of a non-zero element. | Default | Default |
| aclnnNonzeroV2 | Finds the positions of non-zero elements in self. Let the dimension of self be D and the number of non-zero elements in self be N. The returned out has a shape of D * N, where each column represents the position coordinates of a non-zero element. | Default | Default |
| aclnnPrelu | An activation function. When the value in the tensor is greater than 0, the output is the value itself; when less than 0, the output is the product of the weight and the value. | Default | Default |
| aclnnPreluBackward | Performs the backward function of aclnnPrelu. | Default | Default |
| aclnnQuantConvolution | Performs per-channel quantized 2D/3D convolution computation. | Default | Default |
| aclnnQuantConvolutionWeightNz | Performs per-channel quantized 3D convolution computation, where weight only supports the FRACTAL_Z_3D format. | Default | - |
| aclnnQuantize | Performs quantization on the input tensor. | Default | Default |
| aclnnQuantizedBatchNorm | Performs dequantization on the input tensor, then performs normalization based on the input weight, bias, and epsilon, and finally performs quantization based on the output outputScale and outputZeroPoint. | Default | Default |
| aclnnQuantMatmulV5 | Performs quantized matrix multiplication. | Default | Default |
| aclnnQuantBatchMatmulInplaceAdd | Implements quantized matrix multiplication and in-place accumulation addition, with the basic functionality being a combination of matrix multiplication and addition. | - | Default |
| aclnnQuantMatmulReduceSumWeightNz | Performs quantized grouped matrix computation, and then adds the matrix computation results of all groups for output. | Non-deterministic by default; allowed to enable. | - |
| aclnnQuantMatmulWeightNz | Performs quantized matrix multiplication. | Default | Default |
| aclnnQuantMatmulDequant | Performs quantization, matrix multiplication, and dequantization on the input x. | Default | - |
| aclnnRelu&aclnnInplaceRelu | Activation function. Returns a tensor with the same shape as the input tensor, where values greater than or equal to 0 retain their original values, and values less than 0 are set to 0. | Default | Default |
| aclnnRenorm&aclnnInplaceRenorm | Returns a tensor where each sub-tensor of the input tensor self along dimension dim is normalized so that the p-norm of the sub-tensor is below the maxNorm value. | Default | Default |
| aclnnRepeatInterleave | Flattens the tensor self and repeats it the corresponding number of times specified in the tensor repeats. | Default | Default |
| aclnnRepeatInterleaveGrad | Backward propagation of the repeatInterleave operator. Performs ReduceSum on the axis dimension of the yGrad tensor according to repeats. | Default | Default |
| aclnnRepeatInterleaveInt | Flattens the tensor self and repeats each element the corresponding number of times specified by repeats. | Default | Default |
| aclnnRepeatInterleaveIntWithDim | Repeats each element in the tensor along the dim dimension the corresponding number of times specified by repeats. | Default | Default |
| aclnnRepeatInterleaveTensor | For the i-th element of the tensor repeats, repeats i for repeats[i] times. | Default | Default |
| aclnnRepeatInterleaveWithDim | Repeats each element in the tensor along the dim dimension the corresponding number of times at the corresponding position in the tensor repeats. | Default | Default |
| aclnnRmsNorm | The RmsNorm operator is a normalization operation commonly used in large models. Compared with the LayerNorm operator, it removes the part of subtracting the mean. | Default | Default |
| aclnnRmsNormGrad | Backward computation of aclnnRmsNorm. Computes the gradient of RMSNorm, i.e., calculates the gradient of the input tensor during the backpropagation process. | Non-deterministic by default; allowed to enable. | Default |
| aclnnRmsNormQuant | The aclnnRmsNormQuant operator fuses the Add operator before aclnnRmsNorm and the Quantize operator after aclnnRmsNorm to reduce load/store operations. | Default | Default |
| aclnnRReluWithNoise&aclnnInplaceRReluWithNoise | Implements the randomized leaky rectified linear unit activation function with noise. When the input is less than or equal to 0, the slope is a; when the input is greater than 0, the slope is 1. | Default | - |
| aclnnScatter&aclnnInplaceScatter | Replaces/accumulates/multiplies the values in the tensor src into the tensor self element by element according to the specified axis, direction, and corresponding position relationship. | Default | Non-deterministic by default; allowed to enable |
| aclnnScatterAdd | Fills the values in the src tensor into the self tensor element by element according to the specified axis direction and the position relationship in the index tensor. If more than one src value is filled into the same position of self, these values are accumulated at that position. | Default | Non-deterministic by default; allowed to enable |
| aclnnScatterNd | Copies the data from data to out, and updates the data in out at the specified indices according to updates. | Default | Non-deterministic by default; allowed to enable |
| aclnnScatterNdUpdate | Updates the values in the tensor varRef element by element with the values in the tensor updates according to the specified indices. | Default | Non-deterministic by default; allowed to enable |
| aclnnScatterList | Applies sparse updates to a list of variable reference tensors, scattering the values from updates onto the corresponding dimension of var via indices. | Non-deterministic by default; allowed to enable | - |
| aclnnScatterValue&aclnnInplaceScatterValue | Fills the scalar value into the tensor self element by element according to the specified axis, direction, and corresponding position relationship. | Default | Non-deterministic by default; allowed to enable |
| aclnnScaledMaskedSoftmax | Scales and masks the input data x, then performs softmax to produce the output. | Default | - |
| aclnnScaledMaskedSoftmaxBackward | Backward propagation of softmax, with scaling and masking applied to the result. | Non-deterministic by default; allowed to enable. | - |
| aclnnSelu&aclnnInplaceSelu | Performs the Selu activation function operation on the input tensor element-wise and outputs the result tensor. | Default | - |
| aclnnSeluBackward | Performs the backward propagation of aclnnSelu. | Default | - |
| aclnnShrink | Applies a non-linear transformation to the input tensor. Based on the relationship between the input value self and the threshold lambd, the input is scaled and shifted by the offset bias. | Default | - |
| aclnnSigmoid&aclnnInplaceSigmoid | Performs the sigmoid operation on the input tensor. | Default | Default |
| aclnnSigmoidBackward | Performs the backward propagation of sigmoid. Computes the gradient input of sigmoid based on the sigmoid backward propagation gradient and the forward output. | Default | Default |
| aclnnSilu | This operator is also known as the Swish function. | Default | Default |
| aclnnSiluBackward | Backward propagation of aclnnSilu. Computes the gradient input of silu based on the silu backward propagation gradient and the forward output. | Default | Default |
| aclnnSmoothL1Loss | Computes the SmoothL1 loss function. | Default | Default |
| aclnnSmoothL1LossBackward | Computes the backward propagation of the aclnnSmoothL1Loss API. | Default | Default |
| aclnnSoftMarginLoss | Computes the binary classification logistic loss function between the input self and the target target. | Default | - |
| aclnnSoftMarginLossBackward | Computes the backward propagation of the aclnnSoftMarginLoss binary classification logistic loss function. | Default | - |
| aclnnSoftmax | Computes the softmax value for the input tensor. | Default | Default |
| aclnnSoftmaxBackward | Performs the backward propagation of softmax. | Default | Default |
| aclnnSoftmaxCrossEntropyWithLogits | Computes the cross-entropy loss of softmax and cross entropy, and provides the backward gradient with respect to the input logits. | Default | Default |
| aclnnSoftplus | The softplus activation function. | Default | Default |
| aclnnSoftplusBackward | Backward propagation of aclnnSoftplus. | Default | - |
| aclnnSoftshrink | Shrinks elements within the range of λ element-wise. | Default | - |
| aclnnSoftshrinkBackward | Performs the backward interface of the Softshrink function. | Default | - |
| aclnnSparse4to2QuantMatmulWeightNz | Implements sparse 4:2 quantized matrix multiplication computation. | Default | - |
| aclnnSquaredRelu | The SquaredReLU function is a variant based on the standard ReLU function. Its main feature is squaring the output of the ReLU function, and it is often used as the activation function of a model. | Default | Default |
| aclnnSwiGlu | Swish gated linear unit activation function. Performs the SwiGlu computation on x. | Default | Default |
| aclnnSwiGluGrad | Performs the backward computation of aclnnSwiGlu. Completes the SwiGlu backward gradient calculation on x. | Default | Default |
| aclnnSwiGluQuant | Adds a quant operation after the SwiGlu activation function. Performs the SwiGluQuant computation on the input x. | Default | Default |
| aclnnSwiGluQuantV2 | Adds a quant operation after the SwiGlu activation function. Performs the SwiGluQuant computation on the input x, supporting int8 or int4 quantized output. | Default | Default |
| aclnnSwish | Swish activation function. Performs the Swish function operation on the input tensor element-wise and outputs the result tensor. | Default | Default |
| aclnnSwishBackward | aclnnSwishBackward is the backward propagation of the aclnnSwish activation function. Computes the gradient of the Swish activation function. | Default | Default |
| aclnnSyncBatchNormGatherStats | Gathers the mean and variance from all devices and updates the global mean and variance. | Default | Default |
| aclnnTake | Treats the input self tensor as a one-dimensional array, uses the values of index as indices to retrieve values from self, and outputs a tensor with the same shape as index. | Default | Default |
| aclnnTfScatterAdd | Implements functionality compatible with tf.scatter_add and tf.scatter_nd_add. Adds the values from updates to the slices of varRef according to the specified indices. | Default | - |
| aclnnThnnFusedLstmCell | Performs the subsequent computation after matrix multiplication in the forward computation of an LSTM cell. | Default | - |
| aclnnThnnFusedLstmCellBackward | Performs the backward computation of a single time step LSTM. | Default | - |
| aclnnThreshold&aclnnInplaceThreshold | Applies a threshold operation to the input x. When elements in x are greater than threshold, returns the elements; otherwise, returns value. | Default | - |
| aclnnThresholdBackward | Performs the backward propagation of aclnnThreshold. | Default | Default |
| aclnnTransSparse4to2Para | Performs compression preprocessing on the structurally sparse weight matrix, and outputs the compressed sparse matrix and the corresponding index matrix. | Default | - |
| aclnnTransposeBatchMatMul | Performs matrix multiplication computation on tensor x1 and tensor x2. | Default | Default |
| aclnnTransposeQuantBatchMatMul | Performs quantized matrix multiplication computation on tensor x1 and tensor x2. | Default | Default |
| aclnnTransQuantParam | Converts the input scale data from the FLOAT32 type to the UINT64 type required by the hardware, and stores it in quantParam. | Default | Default |
| aclnnTransQuantParamV2 | Converts the data type of the quantization computation parameter scale, converting the FLOAT32 data type to the UINT64 and INT64 types required by the hardware. | Default | Default |
| aclnnTransQuantParamV3 | Converts the data type of the quantization computation parameter scale, converting the Float32 data type to the UINT64 and INT64 types required by the hardware. | Default | Default |
| aclnnTopKTopPSample | Performs topK-topP-sample sampling computation based on the input word frequency logits, topK/topP sampling parameters, and random sampling weight distribution q. Outputs the maximum word frequency logitsSelectIdx for each batch, and the word frequency distribution logitsTopKPSelect after topK-topP sampling. | Default | - |
| aclnnTopKTopPSampleV2 | Performs topK-topP-minP-sample sampling computation based on the input word frequency logits, topK/topP/minP sampling parameters, and random sampling weight distribution q. When the input isNeedSampleResult is false, outputs the maximum word frequency logitsSelectIdx for each batch, and the word frequency distribution logitsTopKPSelect after topK-topP-minP sampling. When the input isNeedSampleResult is true, outputs the intermediate computation results logitsIdx and logitsSortMasked after topK-topP-minP sampling, where logitsSortMasked is the intermediate result of the word frequency logits after topK-topP-minP sampling computation, and logitsIdx is the corresponding index of logitsSortMasked in logits. | Default | - |
| aclnnUnique | Returns the unique elements in the input tensor. | Default | Default |
| aclnnUnique2 | Deduplicates the input tensor self and returns the unique elements in self. An enhanced version of the unique function, with a new return value countsOut indicating the number of occurrences of each element in valueOut within the input self, controlled by the returnCounts parameter. | Default | Default |
| aclnnUniqueConsecutive | Removes duplicate elements that follow each element. When dim is not empty, removes duplicate tensors that follow each tensor on the corresponding dimension. | Default | Default |
| aclnnUniqueDim | Deduplicates the input tensor self along a specific dim axis. | Default | Default |
| aclnnWeightQuantBatchMatmulNz | Performs matrix multiplication computation where one input is in a pseudo-quantization scenario, supporting only the NZ format. | Default | Default |
| aclnnWeightQuantBatchMatmulV2 | Performs matrix multiplication computation where one input is in a pseudo-quantization scenario, and supports quantization computation for the output. | Non-deterministic by default; allowed to enable. | Default |
| aclnnWeightQuantBatchMatmulV3 | Performs matrix multiplication computation where one input is in a pseudo-quantization scenario, and supports quantization computation for the output. | Non-deterministic by default; allowed to enable. | Default |
Deprecated APIs
| Deprecated API | Description |
|---|---|
| aclnnWeightQuantBatchMatmul | This API will be deprecated in subsequent versions. Use the latest APIs aclnnWeightQuantBatchMatmulV2 and aclnnWeightQuantBatchMatmulV3 instead. |
| aclnnQuantMatmul | This API will be deprecated in subsequent versions. Use the latest API aclnnQuantMatmulV5 instead. |
| aclnnQuantMatmulV2 | This API will be deprecated in subsequent versions. Use the latest API aclnnQuantMatmulV5 instead. |
| aclnnQuantMatmulV3 | This API will be deprecated in subsequent versions. Use the latest API aclnnQuantMatmulV5 instead. |
| aclnnQuantMatmulV4 | This API will be deprecated in subsequent versions. Use the latest API aclnnQuantMatmulV5 instead. |
| aclnnBatchMatmulQuant | This API will be deprecated in subsequent versions. Do not use this API. |