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 file aclnn_*.h as needed.

  • Dependent library files: Reference the operator master library file libopapi_${ops_project}.so as 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 NameDescriptionDeterministic Implementation (A2/A3)Deterministic Implementation (Ascend 950)
aclnnAdaLayerNormFuses LayerNorm with downstream Add and Mul operations, and adjusts the normalization process through adaptive parameters scale and shift.Default-
aclnnAdaLayerNormQuantFuses 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.DefaultDefault
aclnnAdaLayerNormV2Fuses 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.DefaultDefault
aclnnAdaptiveAvgPool2dPerforms 2D adaptive average pooling on the tensor self given the specified 2D output shape (outputSize).Default-
aclnnAdaptiveAvgPool2dBackwardBackward computation of aclnnAdaptiveAvgPool2d.Non-deterministic by default; allowed to enable-
aclnnAdaptiveAvgPool3dPerforms 3D adaptive average pooling on the tensor self given the specified 3D output shape (outputSize).DefaultDefault
aclnnAdaptiveAvgPool3dBackwardBackward computation of aclnnAdaptiveAvgPool3d.Non-deterministic by default; allowed to enable-
aclnnAdaptiveMaxPool2dComputes the kernel size for each step based on the input outputSize, and performs 2D max pooling on the input self.Default-
aclnnAdaptiveMaxPool2dBackwardBackward 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-
aclnnAdaptiveMaxPool3dComputes the kernel size for each step based on the input outputSize, and performs 3D max pooling on the input self.DefaultDefault
aclnnAdaptiveMaxPool3dBackwardBackward 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&aclnnInplaceAddbmmFirst 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.DefaultDefault
aclnnAddmm&aclnnInplaceAddmmComputes α 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
aclnnAddmmWeightNzComputes α 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.DefaultDefault
aclnnAddmvPerforms matrix-vector multiplication and then adds the result to a vector.Non-deterministic by default; allowed to enable.Default
aclnnAddLayerNormImplements the AddLayerNorm function.DefaultDefault
aclnnAddLayerNormGradLayerNorm is a normalization method that normalizes the input data of a network layer to the range [0, 1].Non-deterministic by default; allowed to enableNon-deterministic by default; allowed to enable
aclnnAddLayerNormQuantThe LayerNorm operator is a commonly used normalization operation in large models.DefaultDefault
aclnnAddRelu&aclnnInplaceAddReluPerforms addition and then applies activation to the result.DefaultDefault
aclnnAddRmsNormCastThe 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.DefaultDefault
aclnnAddRmsNormDynamicQuantFuses the Add operator before RmsNorm and one or two DynamicQuant operators after RmsNorm normalization output to reduce load/store operations.DefaultDefault
aclnnAddRmsNormDynamicQuantV2The RmsNorm operator is a commonly used normalization operation in large models. Compared with the LayerNorm operator, it removes the subtract mean part.Default-
aclnnAddRmsNormThe RmsNorm operator is a commonly used normalization operation in large models. Compared with the LayerNorm operator, it removes the subtract mean part.DefaultDefault
aclnnAddRmsNormQuantFuses the Add operator before RmsNorm and the Quantize operator after RmsNorm to reduce load/store operations.DefaultDefault
aclnnAddRmsNormQuantV2RmsNorm is a commonly used normalization operation in large models. Compared with LayerNorm, it removes the subtract mean part.Default-
aclnnAddRelu&aclnnInplaceAddReluPerforms addition and then applies activation to the result.DefaultDefault
aclnnAdvanceStepAdvances 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-
aclnnAdvanceStepV2Advances 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-
aclnnApplyAdamWImplements the AdamW optimizer function.DefaultDefault
aclnnApplyAdamWQuantImplements the AdamW optimizer function, with quantization applied to m and v.DefaultDefault
aclnnApplyAdamWV2Implements the AdamW optimizer function.DefaultDefault
aclnnApplyFusedEmaAdamImplements the FusedEmaAdam fused optimizer function.DefaultDefault
aclnnApplyTopKTopPPerforms top-k and top-p sampling filtering on the original input logits.DefaultDefault
aclnnAscendAntiQuantDequantizes the input x based on the input scale and offset.DefaultDefault
aclnnAscendQuantQuantizes 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.DefaultDefault
aclnnAscendQuantV3Performs 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.DefaultDefault
aclnnAvgPool2dPerforms 2D average pooling on the input tensor with a window size of kH∗kWkH * kW and a stride of sH∗sWsH * sW.DefaultDefault
aclnnAvgPool2dBackwardBackward propagation of 2D average pooling. Computes the input gradient of the forward 2D average pooling.Non-deterministic by default; allowed to enableDefault
aclnnAvgPool3dPerforms 3D average pooling on the input tensor with a window size of kD∗kH∗kWkD * kH * kW and a stride of sD∗sH∗sWsD * sH * sW.DefaultDefault
aclnnAvgPool3dBackwardBackward propagation of 3D average pooling. Computes the input gradient of the forward 3D average pooling.Non-deterministic by default; allowed to enable-
aclnnBaddbmm&aclnnInplaceBaddbmmComputes α multiplied by the matrix multiplication result of batch1 and batch2, then sums the result with the product of β and self.DefaultDefault
aclnnBatchMatMulPerforms matrix multiplication of the tensor self and the tensor mat2.DefaultDefault
aclnnBatchMatMulWeightNzPerforms 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.DefaultDefault
aclnnBatchNormPerforms 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 enableDefault
aclnnBatchNormElemtTakes 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-
aclnnBatchNormElemtBackwardBackward computation of aclnnBatchNormElemt. Used to compute the element-wise gradient of the input tensor for updating model parameters during the backpropagation process.DefaultDefault
aclnnBatchNormBackwardBackward 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 enableDefault
aclnnBatchNormGatherStatsWithCountsCollects the mean and variance from all devices, and updates the global mean and the reciprocal of the standard deviation.DefaultDefault
aclnnBatchNormReduceThe first step of data normalization. Computes the sum and sum of squares of the data.Non-deterministic by default; allowed to enable-
aclnnBatchNormReduceBackwardPrimarily 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.DefaultDefault
aclnnBidirectionLSTMPerforms LSTM network computation. Accepts an input sequence and initial states, and returns the output sequence and final states.Default-
aclnnBidirectionLSTMV2Performs LSTM network computation. Accepts an input sequence and initial states, and returns the output sequence and final states.Default-
aclnnBinaryCrossEntropyComputes the binary cross entropy between self and target.DefaultDefault
aclnnBinaryCrossEntropyBackwardComputes the gradient value of the binary cross entropy backward propagation.DefaultDefault
aclnnBinaryCrossEntropyWithLogitsComputes the BCELoss between the input logits and the label target.DefaultDefault
aclnnBinaryCrossEntropyWithLogitsBackwardPerforms logits computation on the input self, and then performs BCELoss backward propagation using the resulting value together with the label target.DefaultDefault
aclnnBinaryCrossEntropyWithLogitsTargetBackwardPerforms 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&aclnnInplaceCeluaclnnCelu 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-
aclnnChamferDistanceBackwardThe 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-
aclnnClippedSwigluA clipped Swish gated linear unit activation function. Performs SwiGlu computation on x.Default-
aclnnConvolutionImplements the convolution function. Supports 1D/2D/3D convolution, transposed convolution, dilated convolution, and grouped convolution.DefaultDefault
aclnnConvolutionBackwardImplements the backward propagation of convolution.Non-deterministic by default; allowed to enable.Default
aclnnConvDepthwise2dImplements 2D depthwise convolution (DepthwiseConv2D) computation.DefaultDefault
aclnnConvertWeightToINT4PackPreprocesses 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.DefaultDefault
aclnnConvTbcImplements time-based (TBC) 1D convolution.DefaultDefault
aclnnConvTbcBackwardUsed to compute the backward propagation of time-based convolution.DefaultDefault
aclnnCrossEntropyLossComputes the cross entropy loss of the input.DefaultDefault
aclnnCrossEntropyLossGradComputes the gradient value of the binary cross entropy backward propagation.DefaultDefault
aclnnCtcLossComputes the connectionist temporal classification loss value.Non-deterministic by default; allowed to enable.Default
aclnnCtcLossBackwardBackward propagation of the connectionist temporal classification loss value.Non-deterministic by default; allowed to enable.Default
aclnnDeepNormPerforms 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-
aclnnDeepNormGradBackward 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-
aclnnDeformableConv2dImplements the convolution function. Supports 2D convolution, as well as deformable convolution and grouped convolution.DefaultDefault
aclnnDequantBiasDequantizes the input x, converting int32 input data to FLOAT16/BFLOAT16 output.Default-
aclnnDequantSwigluQuantAdds dequant and quant operations before and after the Swish gated linear unit activation function to perform DequantSwigluQuant computation on x.DefaultDefault
aclnnDequantSwigluQuantV2Adds dequant and quant operations before and after the Swish gated linear unit activation function to perform DequantSwigluQuant computation on x.DefaultDefault
aclnnGroupedDynamicMxQuantPerforms grouped float8 dynamic quantization on the input data based on the starting values of the input group indices.-Default
aclnnDynamicDualLevelMxQuantDivides 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
aclnnGroupedDynamicBlockQuantQuantizes each group at the basic block granularity based on the starting values of the input group indices, and outputs the quantization parameter scale.-Default
aclnnDualLevelQuantMatmulWeightNzPerforms matrix multiplication with two-level quantized mxfp4.-Default
aclnnDynamicMxQuantPerforms 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
aclnnDynamicMxQuantWithDualAxisPerforms 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
aclnnDynamicBlockQuantDivides 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.DefaultDefault
aclnnDynamicQuantPerforms per-token symmetric dynamic quantization on the input tensor.DefaultDefault
aclnnDynamicQuantV2Performs per-token symmetric/asymmetric dynamic quantization on the input tensor.DefaultDefault
aclnnDynamicQuantV3Performs dynamic quantization on the input tensor.DefaultDefault
aclnnEinsumPerforms 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.DefaultDefault
aclnnElu&aclnnInplaceEluApplies 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.DefaultDefault
aclnnEluBackwardBackward computation of the aclnnElu activation function. Outputs the gradient of the forward input of the ELU activation function.DefaultDefault
aclnnEmbeddingMaps 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.DefaultDefault
aclnnEmbeddingBagObtains 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.DefaultDefault
aclnnEmbeddingDenseBackwardImplements the backward computation of aclnnEmbedding. Accumulates the row of grad corresponding to the same index indices onto out.Non-deterministic by default; allowed to enableNon-deterministic by default; allowed to enable
aclnnEmbeddingRenormReturns the corrected result of the input tensor at the specified indices based on the given maxNorm and normType.DefaultDefault
aclnnErfinv&aclnnInplaceErfinverfinv 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.DefaultDefault
aclnnExpandIntoJaggedPermuteExpands 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-
aclnnFakeQuantPerChannelAffineCachemaskPerforms 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-
aclnnFakeQuantPerTensorAffineCachemaskPerforms fake quantization on the input self, and updates the value range of the fake quantization output based on quant_min and quant_max.Default-
aclnnFastBatchNormBackwardBackward propagation of aclnnBatchNorm (high-performance version). Used to compute the gradient of the input tensor for updating model parameters during the backpropagation process.Default-
aclnnFastGeluFast Gaussian error linear unit activation function.DefaultDefault
aclnnFastGeluBackwardBackward computation of FastGelu.DefaultDefault
aclnnFastLayerNormPerforms normalization on a specified layer with a mean of 0 and a standard deviation of 1.Default-
aclnnFatreluMulSplits 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-
aclnnFlatQuantA fused operator that performs two small matrix multiplications on the input matrix x in sequence.DefaultDefault
aclnnFlipReverses (inverts the order of) the specified dimensions of an n-dimensional tensor, with the formula for each axis specified in dims.DefaultDefault
aclnnForeachAbsPerforms an element-wise absolute value operation on each tensor in the input tensor list.Default-
aclnnForeachAcosPerforms an element-wise arccosine operation on each tensor in the input tensor list.Default-
aclnnForeachAddcdivListPerforms element-wise addition, multiplication, and division on multiple tensors: divides x2ix2_{i} and x3ix3_{i} element-wise, multiplies the result by scalars, and then adds it to x1ix1_{i}.Default-
aclnnForeachAddcdivScalarPerforms element-wise addition, multiplication, and division on multiple tensors: divides x2ix2_{i} and x3ix3_{i} element-wise, multiplies the result by scalar, and then adds it to x1ix1_{i}.Default-
aclnnForeachAddcdivScalarListPerforms element-wise addition, multiplication, and division on multiple tensors: divides x2ix2_{i} and x3ix3_{i} element-wise, multiplies the result by scalarsiscalars_{i}, and then adds it to x1ix1_{i}.DefaultDefault
aclnnForeachAddcdivScalarV2Performs element-wise addition, multiplication, and division on multiple tensors: divides x2ix2_{i} and x3ix3_{i} element-wise, multiplies the result by scalar, and then adds it to x1ix1_{i}.Default-
aclnnForeachAddcmulListFirst 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-
aclnnForeachAddcmulScalarFirst 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.DefaultDefault
aclnnForeachAddcmulScalarListFirst 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-
aclnnForeachAddcmulScalarV2First 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.DefaultDefault
aclnnForeachAddListAdds elements from two tensor lists element by element, with the addition coefficient adjustable via the alpha parameter.Default-
aclnnForeachAddListV2Adds elements from two tensor lists element by element, with the addition coefficient adjustable via the alpha parameter.Default-
aclnnForeachAddScalarAdds the specified tensor value to each tensor in the tensor list.DefaultDefault
aclnnForeachAddScalarListPerforms element-wise addition between the input tensor list and the input scalar list.Default-
aclnnForeachAddScalarV2Adds the specified scalar value to each tensor in the tensor list.DefaultDefault
aclnnForeachAsinPerforms an element-wise arcsine function operation.Default-
aclnnForeachAtanPerforms an element-wise arctangent function operation.Default-
aclnnForeachCopyCopies the contents of one tensor list to another.DefaultDefault
aclnnForeachCosPerforms an element-wise cosine function operation.Default-
aclnnForeachCoshPerforms an element-wise hyperbolic cosine function operation.Default-
aclnnForeachDivListPerforms element-wise division on tensor list x1 and tensor list x2.Default-
aclnnForeachDivScalarComputes the division of tensor list x by tensor scalar.Default-
aclnnForeachDivScalarListPerforms element-wise division on tensor list x and scalar list scalars.DefaultDefault
aclnnForeachDivScalarV2Computes the division of tensor list x by the scalar value scalar.Default-
aclnnForeachErfPerforms an element-wise error function operation (also known as the Gaussian error function).Default-
aclnnForeachErfcPerforms an element-wise complementary error function operation, integrating from x to infinity.Default-
aclnnForeachExpPerforms an exponential operation on each tensor in the input tensor list.Default-
aclnnForeachExpm1Performs an exponential operation on each tensor in the input tensor list, and then subtracts 1 from the result.Default-
aclnnForeachLerpListPerforms interpolation on corresponding elements of two tensor lists, where the tensor list weight serves as the interpolation coefficient.Default-
aclnnForeachLerpScalarPerforms interpolation on corresponding elements of two tensor lists, where the scalar weight serves as the interpolation coefficient.DefaultDefault
aclnnForeachLogPerforms an element-wise natural logarithm operation (ln(x)) on the tensor list.Default-
aclnnForeachLog1pAdds 1 to each element in the tensor list and then computes the base-e logarithm.Default-
aclnnForeachLog2Computes the base-2 logarithm of each element in the tensor list.Default-
aclnnForeachLog10Computes the base-10 logarithm of each element in the tensor list.Default-
aclnnForeachMaximumListPerforms element-wise comparison on tensor list x1 and tensor list x2, and computes the maximum value for each element.Default-
aclnnForeachMaximumScalarPerforms element-wise comparison on the tensor list and tensor scalar, and computes the maximum value for each element.Default-
aclnnForeachMaximumScalarListPerforms element-wise comparison on tensor list x and scalar list scalars, and computes the maximum value for each element.Default-
aclnnForeachMaximumScalarV2Performs element-wise comparison on the tensor list and the scalar value scalar, and computes the maximum value for each element.Default-
aclnnForeachMinimumListPerforms element-wise comparison on tensor list x1 and tensor list x2, and computes the minimum value for each element.Default-
aclnnForeachMinimumScalarPerforms element-wise comparison on tensor list x and tensor scalar, and computes the minimum value for each element.Default-
aclnnForeachMinimumScalarListPerforms element-wise comparison on tensor list x and scalar list scalars, and computes the minimum value for each element.Default-
aclnnForeachMinimumScalarV2Performs element-wise comparison on tensor list x and the scalar value scalar, and computes the minimum value for each element.Default-
aclnnForeachMulListPerforms element-wise multiplication on two input tensor lists.Default-
aclnnForeachMulScalarPerforms multiplication between each tensor in the input tensor list and tensor scalar.DefaultDefault
aclnnForeachMulScalarListPerforms element-wise multiplication between the input tensor list and the scalar list.DefaultDefault
aclnnForeachMulScalarV2Performs multiplication between each tensor in the input tensor list and the scalar value scalar.DefaultDefault
aclnnForeachNegComputes the opposite number of each tensor in the input tensor list.Default-
aclnnForeachNonFiniteCheckAndUnscaleIterates 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.DefaultDefault
aclnnForeachNormPerforms a norm operation on each tensor in the input tensor list.DefaultDefault
aclnnForeachPowListRaises each tensor in the input tensor list to the power of x2.Default-
aclnnForeachPowScalarPerforms an exponentiation operation on each tensor in the input tensor list x, with the exponent being tensor scale.Default-
aclnnForeachPowScalarV2Performs an exponentiation operation on each tensor in the input tensor list x, with the exponent being the scalar value exponent.Default-
aclnnForeachPowScalarAndTensorPerforms an exponentiation operation on each tensor in the input tensor list x, with the base being the input scalar value scalar.Default-
aclnnForeachPowScalarListPerforms 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-
aclnnForeachReciprocalPerforms a reciprocal operation on each tensor in the input tensor list.Default-
aclnnForeachRoundOffNumberPerforms a rounding operation with specified precision on each tensor in the input tensor list, with the rounding mode specifiable via roundMode.Default-
aclnnForeachRoundOffNumberV2Performs a rounding operation with specified precision on each tensor in the input tensor list, with the rounding mode specifiable via roundMode.Default-
aclnnForeachSigmoidPerforms a Sigmoid function operation on each tensor in the input tensor list.Default-
aclnnForeachSignComputes the sign value of each tensor in the input tensor list.Default-
aclnnForeachSinPerforms a sine function operation on each tensor in the input tensor list.Default-
aclnnForeachSinhPerforms a hyperbolic sine function operation on each tensor in the input tensor list.Default-
aclnnForeachSqrtPerforms a square root operation on each tensor in the input tensor list.DefaultDefault
aclnnForeachSubListPerforms element-wise subtraction on two input tensor lists, with the subtraction coefficient adjustable via the alpha parameter.Default-
aclnnForeachSubListV2Performs element-wise subtraction on elements in two tensor lists, with the subtraction coefficient adjustable via the alpha parameter.Default-
aclnnForeachSubScalarPerforms subtraction between each tensor in the input tensor list and tensor scalar.Default-
aclnnForeachSubScalarListPerforms element-wise subtraction between each tensor in the input tensor list and each scalar in the scalar list scalars.Default-
aclnnForeachSubScalarV2Performs subtraction between each tensor in the input tensor list and the scalar value scalar.Default-
aclnnForeachTanPerforms a tangent function operation on each tensor in the input tensor list.Default-
aclnnForeachTanhPerforms a hyperbolic tangent function operation on each tensor in the input tensor list.Default-
aclnnForeachZeroInplaceUpdates the input tensor list in-place, setting each tensor in the input tensor list to 0.Default-
aclnnFusedLinearOnlineMaxSumFunctionally equivalent to Megatron's matmul and fused_vocab_parallel_cross_entropy implementation, supporting vocabulary_size dimension sharding with fused matmul and cross-entropy loss.DefaultDefault
aclnnFusedCrossEntropyLossWithMaxSumA 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-
aclnnFusedLinearCrossEntropyLossGradA 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-
aclnnFusedMatmulFuses matrix multiplication with general vector computation.DefaultDefault
aclnnFusedQuantMatmulFuses quantized matrix multiplication with general vector computation.Default-
aclnnFusedQuantMatmulWeightNzFuses quantized matrix multiplication with general vector computation, with WeightNz input.Default-
aclnnGatherGathers data along the specified dimension dim of the input tensor.DefaultDefault
aclnnGatherNdFor 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]).DefaultDefault
aclnnGatherV2Extracts elements from the input tensor along the specified dimension dim according to the index numbers in index, and saves them to the out tensor.DefaultDefault
aclnnGatherV3Extracts 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.DefaultDefault
aclnnGeGluGaussian error linear unit activation function.DefaultDefault
aclnnGeGluBackwardPerforms the backward computation of aclnnGeGlu.DefaultDefault
aclnnGeGluV3Gaussian error linear unit activation gating function. Extends aclnnGeGlu by adding the ability to set the direction of the activation function operation data block.DefaultDefault
aclnnGeGluV3BackwardPerforms the backward computation of aclnnGeGluV3.DefaultDefault
aclnnGeluGaussian error linear unit activation function.DefaultDefault
aclnnGeluBackwardPerforms the backward computation of aclnnGelu.DefaultDefault
aclnnGeluBackwardV2Performs the backward computation of aclnnGeluV2.DefaultDefault
aclnnGeluMulSplits 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.DefaultDefault
aclnnGeluQuantFuses GeluV2 with DynamicQuant/AscendQuantV2, performs Gelu activation on the input data self, and then quantizes the activation result, outputting the quantized result.DefaultDefault
aclnnGeluV2Gaussian error linear unit activation function.DefaultDefault
aclnnGemmComputes the product of α, A, and B, and then sums it with the product of β and input C.DefaultDefault
aclnnGemmaRmsNormThe 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-
aclnnGluGLU 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.DefaultDefault
aclnnGluBackwardPerforms the backward computation of aclnnGlu.DefaultDefault
aclnnHardshrinkApplies hard shrinkage element-wise, shrinking elements within the range of λ.Default-
aclnnGroupNormComputes the group normalization result out, mean meanOut, and the reciprocal of the standard deviation rstdOut for the input self.DefaultDefault
aclnnGroupNormBackwardPerforms 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 enableDefault
aclnnGroupNormSiluComputes 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.DefaultDefault
aclnnGroupNormSiluV2Computes the group normalization result out, mean meanOut, reciprocal of the standard deviation rstdOut, and the SiLU output of the input self.DefaultDefault
aclnnGroupNormSiluQuantComputes the group normalization, mean meanOut, reciprocal of the standard deviation rstdOut of the input self, and the quantized result out of the SiLU output.DefaultDefault
aclnnGroupNormSwishComputes the group normalization result out, mean meanOut, reciprocal of the standard deviation rstdOut, and the Swish output of the input x.Default-
aclnnGroupNormSwishGradPerforms the backward operation of aclnnGroupNormSwish.Non-deterministic by default; allowed to enable-
aclnnGroupQuantPerforms group quantization on the input x.Default-
aclnnHardshrinkBackwardComputes the gradient gradInput of the backward propagation for aclnnHardshrink.Default-
aclnnHardsigmoid&aclnnInplaceHardsigmoidAn 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-
aclnnHardsigmoidBackwardPerforms the backward propagation of aclnnHardsigmoid.Default-
aclnnHardswishBackwardPerforms the backward propagation of aclnnHardswish, completing the gradient calculation of tensor self.Default-
aclnnHardswishBackwardV2Performs the backward propagation of aclnnHardswish, completing the gradient calculation of tensor self.Default-
aclnnHardswish&aclnnInplaceHardswishAn 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-
aclnnHardtanhBackwardPerforms the backward propagation of the activation function aclnnHardtanh.DefaultDefault
aclnnHeavisideComputes the Heaviside step function for each element in the input, serving as the activation function of the model.Default-
aclnnIndexRetrieves data from the input x at the corresponding coordinates based on the indices.DefaultDefault
aclnnIndexAddAdds 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 enableNon-deterministic by default; allowed to enable
aclnnIndexAddV2Adds 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 enableNon-deterministic by default; allowed to enable
aclnnIndexCopy&aclnnInplaceIndexCopyUses 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.DefaultNon-deterministic by default; allowed to enable
aclnnIndexFill&aclnnInplaceIndexFillReplaces the values at the positions specified by index with value along the given axis dim of the input self.DefaultDefault
aclnnIndexFillTensor&aclnnInplaceIndexFillTensorReplaces the values at the positions specified by index with value along the given axis dim of the input self.DefaultDefault
aclnnIndexPutImplReplaces 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 enableNon-deterministic by default; allowed to enable
aclnnInplacePutTreats 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 enableNon-deterministic by default; allowed to enable
aclnnInplaceScatterUpdateUpdates 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.DefaultDefault
aclnnIndexSelectExtracts elements from the input tensor along the specified dimension dim according to the index numbers in index, and saves them to the out tensor.DefaultDefault
aclnnInplaceAddRmsNormThe RmsNorm operator is a normalization operation commonly used in large models. Compared with the LayerNorm operator, it removes the subtract mean part.DefaultDefault
aclnnInplaceMaskedScatterCopies elements from source to the corresponding positions in selfRef based on the positions where the mask tensor elements are True.DefaultDefault
aclnnInplaceQuantScatterFirst 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.DefaultDefault
aclnnInplaceQuantScatterV2An 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
aclnnInstanceNormPerforms the Instance Normalization operation.Default-
aclnnInverseComputes the inverse matrix of the input square matrix.Default-
aclnnKlDivBackwardPerforms the backward computation of the aclnnKlDiv API result.DefaultDefault
aclnnKlDivTargetBackwardPerforms the target backward computation of the aclnnKlDiv API result.DefaultDefault
aclnnKthvalueReturns the k-th smallest value and its index along the specified dimension of the input tensor.DefaultDefault
aclnnL1LossComputes the mean absolute error (MAE) between each element in the input self and the target.DefaultDefault
aclnnL1LossBackwardComputes the backward propagation of aclnnL1Loss. reduction specifies the computation method of the loss function.DefaultDefault
aclnnLayerNorm&aclnnLayerNormWithImplModePerforms normalization with a mean of 0 and a standard deviation of 1 on the specified layer.DefaultDefault
aclnnLayerNormBackwardPerforms the backward propagation of aclnnNorm. Computes the gradient of the input tensor for updating model parameters during backward propagation.DefaultDefault
aclnnLayerNormQuantFuses the LayerNorm normalization output with the downstream quantization operator to reduce load/store operations.-Default
aclnnLeakyRelu&aclnnInplaceLeakyReluAn 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.DefaultDefault
aclnnLeakyReluBackwardPerforms the backward propagation of the LeakyRelu activation function.DefaultDefault
aclnnLinalgVectorNormComputes the vector norm of the input tensor.Non-deterministic by default; allowed to enableDefault
aclnnLogitA mathematical operation that converts probabilities to log-odds, commonly used for the inverse transformation of probability values.DefaultDefault
aclnnLogitGradPerforms the backward propagation of aclnnLogit.DefaultDefault
aclnnLogSigmoidPerforms the LogSigmoid operation element-wise on the input tensor.DefaultDefault
aclnnLogSigmoidBackwardPerforms the backward propagation of aclnnLogSigmoid, computing the gradient input based on the gradient propagated from the previous layer and the LogSigmoid forward input.DefaultDefault
aclnnLogSigmoidForwardPerforms the LogSigmoid operation element-wise on the input tensor.DefaultDefault
aclnnLogSoftmaxComputes the logsoftmax value of the input tensor.DefaultDefault
aclnnLogSoftmaxBackwardPerforms the backward propagation of aclnnLogSoftmax.DefaultDefault
aclnnLSTMPerforms the LSTM computation.Default-
aclnnLstmBackwardPerforms the backward computation of LSTM.Default-
aclnnMaskedSoftmaxWithRelPosBiasReplaces the softmax computation part that uses window attention in swinTransformer.Default-
aclnnMatmulPerforms matrix multiplication of 1-to-6-dimensional tensor self and tensor mat2.DefaultDefault
aclnnMatmulWeightNzPerforms matrix multiplication of tensor self and tensor mat2, where mat2 only supports the Ascend affinity data layout format.DefaultDefault
aclnnMatmulCompressWhen 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-
aclnnMaxPoolPerforms max pooling on a 3-dimensional or 4-dimensional input tensor.DefaultDefault
aclnnMaxPool2dWithIndicesPerforms 2D (H and W dimensions) max pooling on the input channels of the input signal, and outputs the pooled values out and indices.DefaultDefault
aclnnMaxPool2dWithIndicesBackwardPerforms the backward propagation of the forward max pooling operation aclnnMaxPool2dWithIndices.Non-deterministic by default; allowed to enable.Default
aclnnMaxPool2dWithMaskPerforms 2D max pooling on the input channels of the input signal, and outputs the pooled values out and indices (computed using mask semantics).Default-
aclnnMaxPool2dWithMaskBackwardPerforms the backward propagation of the forward max pooling operation aclnnMaxPool2dWithMask.Non-deterministic by default; allowed to enable.-
aclnnMaxPool3dWithArgmaxPerforms 3D max pooling on the input channels of the input signal, and outputs the pooled values out and indices.DefaultDefault
aclnnMaxPool3dWithArgmaxBackwardPerforms 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
aclnnMaxUnpool2dPerforms the inverse operation of MaxPool2d, filling the element values of input into out based on the indices.DefaultDefault
aclnnMaxUnpool2dBackwardPerforms the backward propagation of aclnnMaxUnpool2d, the inverse operation of MaxPool2d, filling the element values of gradOutput into out based on the indices.DefaultDefault
aclnnMaxUnpool3dPerforms the inverse operation of MaxPool3d, filling the element values of input into out based on the indices.DefaultDefault
aclnnMaxUnpool3dBackwardPerforms the backward propagation of aclnnMaxUnpool3d, the inverse operation of MaxPool3d, filling the element values of gradOutput into out based on the indices.DefaultDefault
aclnnMedianReturns the median of all elements.DefaultDefault
aclnnMedianDimReturns 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).DefaultDefault
aclnnMmPerforms matrix multiplication of 2-dimensional tensor self and tensor mat2.DefaultDefault
aclnnMish&aclnnInplaceMishA self-regularized non-monotonic neural network activation function.DefaultDefault
aclnnMishBackwardComputes the backpropagation process of aclnnMish.DefaultDefault
aclnnModulateImplements adaptive scaling and shifting of features.DefaultDefault
aclnnModulateBackwardComputes the parameters in the ModulateBackward backward propagation for gradient update.Default-
aclnnMseLossComputes the mean squared error between each element in the input x and the target y.DefaultDefault
aclnnMseLossBackwardPerforms the backward propagation of the mean squared error function aclnnMseLoss.DefaultDefault
aclnnMseLossOutComputes the mean squared error between each element in the input x and the target y.DefaultDefault
aclnnMultilabelMarginLossComputes the negative log-likelihood loss value.Non-deterministic by default; allowed to enable.-
aclnnMultiScaleDeformableAttnFunctionTraverses different sampling points of feature maps of different sizes by specifying parameters.Default-
aclnnMultiScaleDeformableAttentionGradThe 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.-
aclnnMvComputes the product of the matrix input and the vector vec.DefaultDefault
aclnnNanMedianReturns the median of all elements after ignoring NaN values.DefaultDefault
aclnnNanMedianDimReturns the median and its position along the specified dimension of the tensor after ignoring NaN values.DefaultDefault
aclnnNormReturns the matrix norm or vector norm of the given tensor.Non-deterministic by default; allowed to enable.Default
aclnnNLLLossComputes the negative log-likelihood loss value.Non-deterministic by default; allowed to enable.Default
aclnnNLLLoss2dComputes the negative log-likelihood loss value.Non-deterministic by default; allowed to enable.Default
aclnnNLLLoss2dBackwardPerforms the backward propagation of the negative log-likelihood loss.DefaultDefault
aclnnNLLLossBackwardPerforms the backward propagation of the negative log-likelihood loss function.DefaultDefault
aclnnNonzeroFinds 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.DefaultDefault
aclnnNonzeroV2Finds 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.DefaultDefault
aclnnPreluAn 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.DefaultDefault
aclnnPreluBackwardPerforms the backward function of aclnnPrelu.DefaultDefault
aclnnQuantConvolutionPerforms per-channel quantized 2D/3D convolution computation.DefaultDefault
aclnnQuantConvolutionWeightNzPerforms per-channel quantized 3D convolution computation, where weight only supports the FRACTAL_Z_3D format.Default-
aclnnQuantizePerforms quantization on the input tensor.DefaultDefault
aclnnQuantizedBatchNormPerforms 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.DefaultDefault
aclnnQuantMatmulV5Performs quantized matrix multiplication.DefaultDefault
aclnnQuantBatchMatmulInplaceAddImplements quantized matrix multiplication and in-place accumulation addition, with the basic functionality being a combination of matrix multiplication and addition.-Default
aclnnQuantMatmulReduceSumWeightNzPerforms quantized grouped matrix computation, and then adds the matrix computation results of all groups for output.Non-deterministic by default; allowed to enable.-
aclnnQuantMatmulWeightNzPerforms quantized matrix multiplication.DefaultDefault
aclnnQuantMatmulDequantPerforms quantization, matrix multiplication, and dequantization on the input x.Default-
aclnnRelu&aclnnInplaceReluActivation 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.DefaultDefault
aclnnRenorm&aclnnInplaceRenormReturns 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.DefaultDefault
aclnnRepeatInterleaveFlattens the tensor self and repeats it the corresponding number of times specified in the tensor repeats.DefaultDefault
aclnnRepeatInterleaveGradBackward propagation of the repeatInterleave operator. Performs ReduceSum on the axis dimension of the yGrad tensor according to repeats.DefaultDefault
aclnnRepeatInterleaveIntFlattens the tensor self and repeats each element the corresponding number of times specified by repeats.DefaultDefault
aclnnRepeatInterleaveIntWithDimRepeats each element in the tensor along the dim dimension the corresponding number of times specified by repeats.DefaultDefault
aclnnRepeatInterleaveTensorFor the i-th element of the tensor repeats, repeats i for repeats[i] times.DefaultDefault
aclnnRepeatInterleaveWithDimRepeats each element in the tensor along the dim dimension the corresponding number of times at the corresponding position in the tensor repeats.DefaultDefault
aclnnRmsNormThe RmsNorm operator is a normalization operation commonly used in large models. Compared with the LayerNorm operator, it removes the part of subtracting the mean.DefaultDefault
aclnnRmsNormGradBackward 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
aclnnRmsNormQuantThe aclnnRmsNormQuant operator fuses the Add operator before aclnnRmsNorm and the Quantize operator after aclnnRmsNorm to reduce load/store operations.DefaultDefault
aclnnRReluWithNoise&aclnnInplaceRReluWithNoiseImplements 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&aclnnInplaceScatterReplaces/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.DefaultNon-deterministic by default; allowed to enable
aclnnScatterAddFills 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.DefaultNon-deterministic by default; allowed to enable
aclnnScatterNdCopies the data from data to out, and updates the data in out at the specified indices according to updates.DefaultNon-deterministic by default; allowed to enable
aclnnScatterNdUpdateUpdates the values in the tensor varRef element by element with the values in the tensor updates according to the specified indices.DefaultNon-deterministic by default; allowed to enable
aclnnScatterListApplies 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&aclnnInplaceScatterValueFills the scalar value into the tensor self element by element according to the specified axis, direction, and corresponding position relationship.DefaultNon-deterministic by default; allowed to enable
aclnnScaledMaskedSoftmaxScales and masks the input data x, then performs softmax to produce the output.Default-
aclnnScaledMaskedSoftmaxBackwardBackward propagation of softmax, with scaling and masking applied to the result.Non-deterministic by default; allowed to enable.-
aclnnSelu&aclnnInplaceSeluPerforms the Selu activation function operation on the input tensor element-wise and outputs the result tensor.Default-
aclnnSeluBackwardPerforms the backward propagation of aclnnSelu.Default-
aclnnShrinkApplies 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&aclnnInplaceSigmoidPerforms the sigmoid operation on the input tensor.DefaultDefault
aclnnSigmoidBackwardPerforms the backward propagation of sigmoid. Computes the gradient input of sigmoid based on the sigmoid backward propagation gradient and the forward output.DefaultDefault
aclnnSiluThis operator is also known as the Swish function.DefaultDefault
aclnnSiluBackwardBackward propagation of aclnnSilu. Computes the gradient input of silu based on the silu backward propagation gradient and the forward output.DefaultDefault
aclnnSmoothL1LossComputes the SmoothL1 loss function.DefaultDefault
aclnnSmoothL1LossBackwardComputes the backward propagation of the aclnnSmoothL1Loss API.DefaultDefault
aclnnSoftMarginLossComputes the binary classification logistic loss function between the input self and the target target.Default-
aclnnSoftMarginLossBackwardComputes the backward propagation of the aclnnSoftMarginLoss binary classification logistic loss function.Default-
aclnnSoftmaxComputes the softmax value for the input tensor.DefaultDefault
aclnnSoftmaxBackwardPerforms the backward propagation of softmax.DefaultDefault
aclnnSoftmaxCrossEntropyWithLogitsComputes the cross-entropy loss of softmax and cross entropy, and provides the backward gradient with respect to the input logits.DefaultDefault
aclnnSoftplusThe softplus activation function.DefaultDefault
aclnnSoftplusBackwardBackward propagation of aclnnSoftplus.Default-
aclnnSoftshrinkShrinks elements within the range of λ element-wise.Default-
aclnnSoftshrinkBackwardPerforms the backward interface of the Softshrink function.Default-
aclnnSparse4to2QuantMatmulWeightNzImplements sparse 4:2 quantized matrix multiplication computation.Default-
aclnnSquaredReluThe 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.DefaultDefault
aclnnSwiGluSwish gated linear unit activation function. Performs the SwiGlu computation on x.DefaultDefault
aclnnSwiGluGradPerforms the backward computation of aclnnSwiGlu. Completes the SwiGlu backward gradient calculation on x.DefaultDefault
aclnnSwiGluQuantAdds a quant operation after the SwiGlu activation function. Performs the SwiGluQuant computation on the input x.DefaultDefault
aclnnSwiGluQuantV2Adds a quant operation after the SwiGlu activation function. Performs the SwiGluQuant computation on the input x, supporting int8 or int4 quantized output.DefaultDefault
aclnnSwishSwish activation function. Performs the Swish function operation on the input tensor element-wise and outputs the result tensor.DefaultDefault
aclnnSwishBackwardaclnnSwishBackward is the backward propagation of the aclnnSwish activation function. Computes the gradient of the Swish activation function.DefaultDefault
aclnnSyncBatchNormGatherStatsGathers the mean and variance from all devices and updates the global mean and variance.DefaultDefault
aclnnTakeTreats 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.DefaultDefault
aclnnTfScatterAddImplements 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-
aclnnThnnFusedLstmCellPerforms the subsequent computation after matrix multiplication in the forward computation of an LSTM cell.Default-
aclnnThnnFusedLstmCellBackwardPerforms the backward computation of a single time step LSTM.Default-
aclnnThreshold&aclnnInplaceThresholdApplies a threshold operation to the input x. When elements in x are greater than threshold, returns the elements; otherwise, returns value.Default-
aclnnThresholdBackwardPerforms the backward propagation of aclnnThreshold.DefaultDefault
aclnnTransSparse4to2ParaPerforms compression preprocessing on the structurally sparse weight matrix, and outputs the compressed sparse matrix and the corresponding index matrix.Default-
aclnnTransposeBatchMatMulPerforms matrix multiplication computation on tensor x1 and tensor x2.DefaultDefault
aclnnTransposeQuantBatchMatMulPerforms quantized matrix multiplication computation on tensor x1 and tensor x2.DefaultDefault
aclnnTransQuantParamConverts the input scale data from the FLOAT32 type to the UINT64 type required by the hardware, and stores it in quantParam.DefaultDefault
aclnnTransQuantParamV2Converts the data type of the quantization computation parameter scale, converting the FLOAT32 data type to the UINT64 and INT64 types required by the hardware.DefaultDefault
aclnnTransQuantParamV3Converts the data type of the quantization computation parameter scale, converting the Float32 data type to the UINT64 and INT64 types required by the hardware.DefaultDefault
aclnnTopKTopPSamplePerforms 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-
aclnnTopKTopPSampleV2Performs 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-
aclnnUniqueReturns the unique elements in the input tensor.DefaultDefault
aclnnUnique2Deduplicates 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.DefaultDefault
aclnnUniqueConsecutiveRemoves duplicate elements that follow each element. When dim is not empty, removes duplicate tensors that follow each tensor on the corresponding dimension.DefaultDefault
aclnnUniqueDimDeduplicates the input tensor self along a specific dim axis.DefaultDefault
aclnnWeightQuantBatchMatmulNzPerforms matrix multiplication computation where one input is in a pseudo-quantization scenario, supporting only the NZ format.DefaultDefault
aclnnWeightQuantBatchMatmulV2Performs 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
aclnnWeightQuantBatchMatmulV3Performs 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 APIDescription
aclnnWeightQuantBatchMatmulThis API will be deprecated in subsequent versions. Use the latest APIs aclnnWeightQuantBatchMatmulV2 and aclnnWeightQuantBatchMatmulV3 instead.
aclnnQuantMatmulThis API will be deprecated in subsequent versions. Use the latest API aclnnQuantMatmulV5 instead.
aclnnQuantMatmulV2This API will be deprecated in subsequent versions. Use the latest API aclnnQuantMatmulV5 instead.
aclnnQuantMatmulV3This API will be deprecated in subsequent versions. Use the latest API aclnnQuantMatmulV5 instead.
aclnnQuantMatmulV4This API will be deprecated in subsequent versions. Use the latest API aclnnQuantMatmulV5 instead.
aclnnBatchMatmulQuantThis API will be deprecated in subsequent versions. Do not use this API.