HBIR Operator Definition
hbir.abs (::mlir::hbdk::hbir::AbsOp)
HBIR tensor abs.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, EltwiseLike, MoveF16CastLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.acos (::mlir::hbdk::hbir::AcosOp)
HBIR tensor acos.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.acosh (::mlir::hbdk::hbir::AcoshOp)
HBIR tensor acosh.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.add (::mlir::hbdk::hbir::AddOp)
HBIR tensor addition.
Applies addition operator element-wise, .
Note:
- Our arithmetic operator support broadcast.
Prototype: Pytorch add.
Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.arith_shift (::mlir::hbdk::hbir::ArithShiftOp)
HBIR arith shift op
arith shift, positive value as right shift. Traits: CommonVerifier, EltwiseLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.asin (::mlir::hbdk::hbir::AsinOp)
HBIR tensor asin.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.asinh (::mlir::hbdk::hbir::AsinhOp)
HBIR tensor asinh.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.atan2 (::mlir::hbdk::hbir::Atan2Op)
HBIR tensor atan2.
Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.atan (::mlir::hbdk::hbir::AtanOp)
HBIR tensor atan.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.atanh (::mlir::hbdk::hbir::AtanhOp)
HBIR tensor atanh.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.avg_pool (::mlir::hbdk::hbir::AvgPoolOp)
HBIR n-D average pooling(only support 1d and 2d currently).
Applies a nD average pooling over input.
In the simplest case, the output value of the operator with input size , output and kernel size can be precisely described as:
where respectively represent the size of H and W.
Note:
-
parameters has the same manner as the Conv2D operator, the same goes for the output size.
-
ceilMode controls output's compute is mode of floor or ceil, it's default value is false.
Shape:
-
Input: or or
-
Output: or or , where represents any number of dimension.
if ceilMode = true, please use ceil replace floor in the above output formula.
Prototype: Pytorch avg_pool.
Traits: CommonVerifier, PoolLike, StencilLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.batchnorm (::mlir::hbdk::hbir::BatchNormOp)
Hbir Batch Normalize
Applies Batch Normalization over each dimension of input. This compute can be precisely described as:
This mean and standard-deviation are calculated per-dimension over the batches and weight and bias are learnable parameter vectors of the input size.
Note:
- eps - a value added to the denominator for numerical stability.
- and 's shape are .
- weight and bias are learnable scalar.
Shape:
- Input: or or or , where reprensent any number of dimension.
- Output: same shape as input.
Prototype: Pytorch BatchNorm.
Traits: CommonVerifier, Misc, SameVariadicOperandSize
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.bev_pool_v2 (::mlir::hbdk::hbir::BevPoolV2Op)
HBIR bev_pool_v2 op, cpu operator, from mmdet3d, no corresponding operator in torch/onnx
Convert several planar image inputs into bev image outputs, thus providing support for data processing under bird's eye view.
Parameters:
- depth: the depth tensor.
- feat: the feat tensor.
- ranks_depth: Stores the index value of depth.
- ranks_feat: Stores the index value of feat.
- ranks_bev: Stores the Voxel index value of the valid bev space.
- interval_starts: Each element marks the starting point of each "continuation segment" of the ranks_bev feat.
- interval_lengths: Each element identifies the length of each "continuous segment" of the ranks_bev feat.
- bev_feat_shape: output's shape. Aligned with the public version of cudu kernel, no permute(0, 4, 1, 2, 3) operation is performed in the kernel. And can support rank>=4.
Shape:
- depth: (B, N, D, fH, fW)
- feat: (B, N, fH, fW, C)
- ranks_depth: (N_points, )
- ranks_feat: (N_points, )
- ranks_bev: (N_points, )
- interval_starts: (N_pillar, )
- interval_lengths: (N_pillar, )
- output: shape same as bev_feat_shape, (B, D_Z, D_Y, D_X, C)
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.bitshift (::mlir::hbdk::hbir::BitShiftOp)
HBIR bitshift op
logic shift, positive value as right shift. Traits: CommonVerifier, EltwiseLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.bitwise_and (::mlir::hbdk::hbir::BitwiseAndOp)
HBIR tensor and.
Applies 'bitwise and' operator element-wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike, SameOperandsAndResultElementType
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.bitwise_not (::mlir::hbdk::hbir::BitwiseNotOp)
HBIR tensor bitwise not.
Traits: CommonVerifier, EltwiseLike, SameOperandsAndResultElementType
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.bitwise_or (::mlir::hbdk::hbir::BitwiseOrOp)
HBIR tensor or.
Applies 'bitwise or' operator element-wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike, SameOperandsAndResultElementType
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.bitwise_xor (::mlir::hbdk::hbir::BitwiseXorOp)
HBIR tensor xor.
Applies 'bitwise xor' operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike, SameOperandsAndResultElementType
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.bool_index (::mlir::hbdk::hbir::BoolIndexOp)
HBIR bool_index op
Returns a tensor which indexes the input tensor according to the boolean mask which is a BoolTensor. rank(mask) <= rank(input), and mask.shape == x.shape[:rank(mask)]. rank(output) = rank(input) - rank(mask) + 1, and output.shape[1:] = input.shape[-(rank(input) - rank(mask)): ].
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.cast_type (::mlir::hbdk::hbir::CastTypeOp)
elemental type cast operation
Data are actually moved. Traits: CommonVerifier, Misc, NaiveRoiInfer, SameOperandsAndResultShape
Interfaces: CastOpInterface, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.ceil (::mlir::hbdk::hbir::CeilOp)
HBIR tensor ceil.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, EltwiseLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.clip (::mlir::hbdk::hbir::ClipOp)
HBIR Clip Op.
Clamps all elements in input into the range .Assume min_value and max_value be min and max, respectively, this performs:
Note:
- min(min_value): lower-bound of the range to be clamped to
- max(max_value): upper-bound of the range to be clamped to
Shape:
- Input: (*), where * means any number of dimensions.
- Output: (*), same shape as the input.
Prototype: Pytorch hardtanh.
Traits: CommonVerifier, LutLike, MoveF16CastLike, NaiveRoiInfer, NaiveTiling, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.concat (::mlir::hbdk::hbir::ConcatOp)
Concatenates tensors along one dimension
Concatenates the given sequence of seq tensors in the given dimension. No elemental type conversion.
Note:
- dim - the dimension over which the tensors are concatenated.
Prototype: Pytorch cat.
Traits: CommonVerifier, ConcatLike, MoveF16CastLike, MoveLike, NaiveTiling, SameElementType
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, Layout, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, PortAccess, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.constant (::mlir::hbdk::hbir::ConstantOp)
HBIR constant generation op.
Generate a constant with specified type and value Traits: CommonVerifier, Constant, NoFuseFp16TypeLike
Interfaces: ExtraOpInterface, HBTLExecutable, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Results:
hbir.conv2d (::mlir::hbdk::hbir::Conv2dOp)
HBIR 2-D convolution.
Applies a 2D convolution over an input signal composed of several input channels.
In the simplest case, the output value of the layer with input size and output can be precisely descibed as:
where is the valid 2D cross-correlation operation, is the batch size, denotes a number of channels, and are the size of pixels.
Note:
-
stride controls the stride for the cross-correlation, an integer array with 2 elements, default value is (1,1).
-
padding controls the amount of padding applied to the input, an integer array with 4 elements, the padding sequences is (h_begin,w_begin,h_end,w_end), default value is (0,0,0,0).
-
dilation controls the spacing between kernel points, an integer array with 2 elements, default value is (0,0). It's harder to describe, but this link has a nice visualization of what dilation does.
-
groups controls the connections between inputs and outputs, an integer variable, default value is 1.
-
Weight: , bias shape = where KW and KH represent kernel's height and width, respectively.
Shape:
-
Input: or or or , where * represent any number of dimension.
-
Output: or or or
Prototype: Pytorch convolution.
Traits: CommonVerifier, ConvLike, NoFuseFp16TypeLike, StencilLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.conv3d (::mlir::hbdk::hbir::Conv3dOp)
HBIR 3-D convolution.
Applies a 3D convolution over an input signal composed of several input planes.
In the simplest case, the output value of the layer with input size and output can be precisely described as:
where is the valid 3D [cross-correlation] operation, is the batch size, denotes a number of channels, , and are the size of pixels.
Note:
-
stride controls the stride for the cross-correlation, an integer array with 3 elements, default value is (1,1,1).
-
padding controls the amount of padding applied to the input, an integer array with 5 elements, the padding sequences is (d_begin,h_begin,w_begin,d_end,h_end,w_end), default value is (0,0,0,0,0,0).
-
dilation controls the spacing between kernel points, an integer array with 3 elements, default value is (0,0,0). It's harder to describe, but this link has a nice visualization of what dilation does.
-
groups controls the connections between inputs and outputs, an integer variable, default value is 1.
-
Weight: , bias shape = where KW and KH represent kernel's height and width, respectively.
Shape:
-
Input: or or , where * represent any number of dimension.
-
Output: or or .
Prototype: Pytorch convolution.
Traits: CommonVerifier, ConvLike, StencilLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.conv (::mlir::hbdk::hbir::ConvOp)
HBIR convolution.
Applies a convolution over an input signal composed of several input planes.
rank in convolution is an integer greater than or equal to 1.
In the simplest case, for 2D convolution, rank=2 the output value of the layer with input size and output can be precisely described as:
where is the valid 2D cross-correlation operation, is the batch size, denotes a number of channels, and are the size of pixels.
Note:
-
stride controls the stride for the cross-correlation, an integer array with rank elements, default value is (1,1,...).
-
padding controls the amount of padding applied to the input, an integer array with 2*rank elements, when rank=2, the padding sequences is (h_begin,w_begin,h_end,w_end), default value is (0,0,0,0), when n=3, the padding sequences is (d_begin,h_begin,w_begin,d_end,h_end,w_end), default value is (0,0,0,0,0,0).
-
dilation controls the spacing between kernel points, an integer array with rank elements, default value is (0,0,...). It's harder to describe, but this link has a nice visualization of what dilation does.
-
groups controls the connections between inputs and outputs, an integer variable, default value is 1.
-
Weight for 2D: , bias shape = where KW and KH represent kernel's height and width, respectively.
Shape for 2D:
-
Input: or or or , where * represent any number of dimension.
-
Output: or or or
Prototype: Pytorch convolution.
Traits: CommonVerifier, ConvLike, NoFuseFp16TypeLike, StencilLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.convtranspose (::mlir::hbdk::hbir::ConvTransposeOp)
HBIR transposed conv1d or conv2d or conv3d op.
Inverse operation of Conv op.
Parameters:
- input: the input tensor
- weight: the deconvolution kernel
- stride: same as conv1d's stride, [s_w];same as conv2d's stride, [s_h, s_w];same as conv3d's stride, [s_d, s_h, s_w]
- pad: 1d pad information for clipping output [w_left,w_right];2d pad information for clipping output [h_top,w_left,h_bottom,w_right];3d pad information for clipping output [d_front,h_top,w_left,d_back,h_bottom,w_right]
- dilation: same as conv1d's dilation, [d_w];same as conv2d's dilation, [d_h, d_w];same as conv3d's dilation, [d_d, d_h, d_w]
- group: same as conv1d's or conv2d's or conv3d's group
1d Shape:
- input:
- weight:
- output:
- bias:
where:
2d Shape:
- input:
- weight:
- output:
- bias:
where:
3d Shape:
- input:
- weight:
- output:
- bias:
where:
Traits: CommonVerifier, ConvLike, StencilLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.cos (::mlir::hbdk::hbir::CosOp)
HBIR tensor cos.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.cosh (::mlir::hbdk::hbir::CoshOp)
HBIR tensor cosh.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.cumsum (::mlir::hbdk::hbir::CumSumOp)
HBIR cumsum.
Performs cumulative sum of the input elements along the given axis. By default, it will do the sum inclusively meaning the first element is copied as is. Through an exclusive attribute, this behavior can change to exclude the first element. It can also perform summation in the opposite direction of the axis. For that, set reverse attribute to 1.
Args: input (Tensor): the input tensor. output (Tensor): Output tensor of the same type as input with cumulative sums of the input elements Attribute: axis (int): Must be in the range [-rank(input), rank(input)-1]. Negative value means counting dimensions from the back. exclusive (int): Must be 0 or 1, defaut is 0. 0 means the first element is copied to output, 1 will not. reverse (int): Must be 0 or 1, defaut is 0. 1 means performing summation in the opposite direction of the axis.
Prototype: Pytorch cumsum.
Traits: CommonVerifier, Misc, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.custom (::mlir::hbdk::hbir::CustomOp)
HBIR custom op
CPU custom operator placeholder.
Parameters:
- inputs - tensor inputs, which type is list
- Other non-tensor arguments for CPU operators
Returns:
- outputs - list of tensor
Traits: CommonVerifier, LeapOp, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.deform_conv2d (::mlir::hbdk::hbir::DeformConv2dOp)
HBIR deformable 2-D convolution.
Applies a deformable 2D convolution over an input signal composed of several input channels.
Note:
-
offset controls the offset for the sampling locations in the convolution kernel.
-
mask controls different weights to different positions in the convolution kernel.
-
stride controls the stride for the cross-correlation, an integer array with 2 elements, default value is (1,1).
-
padding controls the amount of padding applied to the input, an integer array with 4 elements, the padding sequences is (h_begin,w_begin,h_end,w_end), default value is (0,0,0,0).
-
dilation controls the spacing between kernel points, an integer array with 2 elements, default value is (0,0). It's harder to describe, but this link has a nice visualization of what dilation does.
-
groups controls the connections between inputs and outputs, an integer variable, default value is 1.
-
offsetGroup controls the connections between inputs and offset, an integer variable, default value is 1.
-
weight: , bias shape = where KW and KH represent kernel's height and width, respectively.
Shape:
-
Input: or , where * represent any number of dimension.
-
Offset: or , where * represent any number of dimension.
-
Mask: or , where * represent any number of dimension.
-
Output: or or
Prototype: Pytorch convolution.
Traits: CommonVerifier, Misc, NoFuseFp16TypeLike, SameVariadicOperandSize, StencilLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.div (::mlir::hbdk::hbir::DivOp)
HBIR tensor division.
Applies division operator element-wise, .
Note:
- Our arithmetic operator support broadcast.
Parameters:
- rounding_mode: NONE means no round. For integer, only support TRUNC now; For float, only support NONE now.
Prototype: Pytorch div.
Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.dpp (::mlir::hbdk::hbir::DppOp)
HBIR detection post process.
Legacy Operator: Detection Process.
Note
- The input features only supports shift quantization.
- On J5 and later platforms, DPP will be split into Filter OP and CPU operators. Filter Op will run on BPU.
Shape:
- Input:
- [1 - 5] input features. Normally, the input feature size is 1/2, 1/4, ..., or 1/32 of the original input image.
- anchors: anchor table of dpp op.
- anchorNum: anchor number of each input branch.
- filterThreshold: threshold for score value.
- nmsThreshold: threshold for nms operation.
- nmsMargin: score margin of nms operation.
- seed: seed for random() function.
- useClipping: clipping flag for each input branch. if set, the box which exceeds the original image will be clipped.
- stride: input features' stride.
- clsOffset: class offset of each input branch.
- imageSize: the image size, if clippling is set, all box should within this range.
- inputShift: the input feature's quantization coefficient. for legacy mode, only shift quantization is supported.
- legacyMode: legacy mode to be compatible with J2J3.
- useBpuFilter: use Filter OP on BPU to accelerate dpp.
- maxBoxNum: max box num for output
- Output:
- boxData: The output box data with format [coord0, coord1, coord2, coord3, max_score, class_index, pad, pad] @ int16.
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, Layout, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.dynamic_slice (::mlir::hbdk::hbir::DynamicSliceOp)
Slice a tensor out of a tensor, support dynamic input, begin, end, step, axes. Same as onnx slice.
Slice uses the starts, ends, axes and steps inputs to select a sub-tensor of its input data tensor.
Note:
- starts -1-D tensor of starting indices of corresponding axis in axes.
- ends -1-D tensor of ending indices (exclusive) of corresponding axis in axes.
- axes -1-D tensor of axes that starts and ends apply to.
- steps -1-D tensor of slice step of corresponding axis in axes.
Prototype: onnx slice.
Traits: CommonVerifier, Misc, SameVariadicOperandSize
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.equal (::mlir::hbdk::hbir::EqualOp)
HBIR tensor equal.
Determines whether two tensors are equal element by element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.erf (::mlir::hbdk::hbir::ErfOp)
HBIR tensor erf.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.exp (::mlir::hbdk::hbir::ExpOp)
HBIR tensor exp.
Applies exponential operator element - wise, .
Note:
- Returns a new tensor with the exponential of the elements of the input tensor input.
Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.fake_cast (::mlir::hbdk::hbir::FakeCastOp)
fake elemental type cast operation
Cast float input to specified dtype, and then cast back to the same float type. Traits: CommonVerifier, Misc, SameElementType, SameOperandsAndResultShape
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.filter (::mlir::hbdk::hbir::FilterOp)
HBIR filter op
Filter data by comparing its correspond score and given threshold. Filter constains two steps: Apply reduce max on channel c of input to get filter score and index, followed by filter of input supported by hardware.
Traits: CommonVerifier, Misc
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.flip (::mlir::hbdk::hbir::FlipOp)
HBIR flip
Reverse the order of the input tensor along given axis in dims.
Parametes:
- input: the input tensor.
- dims: axis need to reverse.
Shape:
- input: , where * represents any dimension.
- output: same as the input.
Traits: CommonVerifier, MoveF16CastLike, MoveLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.floor (::mlir::hbdk::hbir::FloorOp)
HBIR tensor floor.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, EltwiseLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.fpp (::mlir::hbdk::hbir::FppOp)
HBIR Filter Post Process.
Operator: Filter Detection Process.
Note
- The input features only supports shift quantization.
Shape:
- Input:
- [1 - 5] input features from bpu filter raw data.
- anchors: anchor table to calculate boxes.
- anchorNum: anchor number of each input branch.
- filterThreshold: threshold for score value.
- nmsThreshold: threshold for nms operation.
- nmsMargin: score margin of nms operation.
- seed: seed for random() function.
- headerPadSize: padding size of filtered box header, nash is 8.
- dataChannel: the origin filter input data channel
- useClipping: clipping flag for each input branch. if set, the box which exceeds the original image will be clipped.
- stride: input features' stride.
- clsOffset: class offset of each input branch.
- imageSize: the image size, if clippling is set, all box should within this range.
- inputShift: the input feature's quantization coefficient. for legacy mode, only shift quantization is supported.
- legacyMode: legacy mode to be compatible with J2J3.
- maxBoxNum: config max box num for output, if not 4096, output is static shape.
- dataRank: the origin filter input data rank, since bpu filter is rank1 output.
- Output:
- boxData: The output box data with format [coord0, coord1, coord2, coord3, max_score, class_index, pad, pad] @ int16.
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, Layout, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.gelu (::mlir::hbdk::hbir::GELUOp)
HBIR GELU activation.
Applies gelu funciton element-wise. Gelu functon defined as:
Note:
- Gelu is shorthand for Gaussian Error Linear Unit.
- approximate - support 'none' or 'tanh' mode
Shape:
- Input: (*), where * means any number of dimensions.
- Output: (*), same shape as the input.
Prototype: Pytorch gelu.
Traits: CommonVerifier, LutLike, NaiveRoiInfer, NaiveTiling, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.gather_elements (::mlir::hbdk::hbir::GatherElementsOp)
HBIR gather op for onnx GatherElements.
HBIR gather op for onnx GatherElements. Traits: CommonVerifier, Misc, MoveF16CastLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, RandomAccessInterface, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.gather_nd (::mlir::hbdk::hbir::GatherNdOp)
HBIR gather_nd op for onnx gather_nd.
HBIR gather_nd op for onnx gather_nd. Traits: CommonVerifier, Misc, MoveF16CastLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, RandomAccessInterface, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.greater_equal (::mlir::hbdk::hbir::GreaterEqualOp)
HBIR tensor greater_equal.
Applies greater_equal operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.greater (::mlir::hbdk::hbir::GreaterOp)
HBIR tensor greater.
Applies greater operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.grid_sample (::mlir::hbdk::hbir::GridSampleOp)
HBIR grid_sample.
From the input and a flow-field grid, computes the output using input values and pixel locations from the grid.
Shape:
- input: input of shape , where * represent any number of dimension.
- grid: flow - field of shape
- output:
Traits: CommonVerifier, Expansion, Round, SampleLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RandomAccessInterface, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.horizon_scatter_nd (::mlir::hbdk::hbir::HorizonScatterNDOp)
HBIR horizonScatterND op.
Copy the data to output, then use the values in updates to update the values in the output at the location specified by indices.
Note
- The size of the last axis of indices can only be 1 or 2, for this op just support scatter1d and scatter2d.
Parameters:
- data: Original data.
- indices: Specify the location for updates.
- updates: data to update the values in the output.
- scatterReduceMode: mode can be add max min count none.
Traits: CommonVerifier, Misc
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RandomAccessInterface, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.identity (::mlir::hbdk::hbir::IdentityOp)
Identity operator.
Return tensor copy from input tensor. Traits: CommonVerifier, MoveLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.index (::mlir::hbdk::hbir::IndexOp)
HBIR index op for aten::index_select
Returns a new tensor which indexes the :attr:input tensor along dimension
:attr:dim using the entries in :attr:index which is a LongTensor.
The returned tensor has the same number of dimensions as the original tensor
(:attr:input). The :attr:dim\ th dimension has the same size as the length
of :attr:index; other dimensions have the same size as in the original tensor.
Args: input (Tensor): the input tensor. dim (int): the dimension in which we index index (IntTensor or LongTensor): the tensor containing the indices to index
Traits: CommonVerifier, Misc, MoveF16CastLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RandomAccessInterface, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.layernorm (::mlir::hbdk::hbir::LayerNormOp)
Hbir Layer Normalize
Applies Layer Normalization over a mini - batch of inputs. This compute can be precisely described as:
The Mean and standard-deviation are calculated over the last D dimensions, where D is the dimension of normalized_shape(dims).
Note:
- Unlike Batch Normalization, which compute mean and standard - deviation, LayerNormalization compute these in single sample's different dimension.
- dims controls normalized_shape.
Shape:
- Input:
- Output: (same shape as input)
Prototype: Pytorch layerNorm.
Traits: CommonVerifier, Misc, SameVariadicOperandSize
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, Layout, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.leaky_relu (::mlir::hbdk::hbir::LeakyReLUOp)
HBIR Leaky ReLU Op.
Applies LeakyRelu funciton element - wise.LeakyRelu function defined as:
Note:
- slope - Controls the angle of the negative slope.
Shape:
- Input: (*), where * means any number of dimensions.
- Output: (*), same shape as the input.
Prototype: Pytorch leaky_relu.
Traits: CommonVerifier, LutLike, NaiveRoiInfer, NaiveTiling, SameElementType, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.less_equal (::mlir::hbdk::hbir::LessEqualOp)
HBIR tensor less_equal.
Applies less_equal operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.less (::mlir::hbdk::hbir::LessOp)
HBIR tensor less.
Applies less operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.linear (::mlir::hbdk::hbir::LinearOp)
HBIR Linear.
Applies a linear transformation to the incoming data:
Note:
- Weight's shape is .
Shape:
- Input: where represents any number of dimensions and = in_features.
- Output: where all but the last dimension are the same shape as the input and = out_features.
Prototype: pytorch linear.
Traits: CommonVerifier, LinearLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.log (::mlir::hbdk::hbir::LogOp)
HBIR tensor log.
Applies natural logarithm operator element - wise, .
Note:
- Returns a new tensor with the natural logarithm of the elements of input.
Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.log_softmax (::mlir::hbdk::hbir::LogSoftmaxOp)
HBIR LogSoftmax Op.
Applies the LogSoftmax function to an n - dimensional input Tensor rescaling them so that the elements of the n-dimensional output. The output tensor has the same dimension and shape as the input with values in the range [-inf, 0)
LogSoftmax function is defined as:
Shape:
- Input(*), where * means, any number of additional dimensions.
- Output(*), same shape as the input.
Prototype: Pytorch LogSoftmax.
Traits: CommonVerifier, LutLike, NaiveRoiInfer, NaiveTiling, SameOperandsAndResultShape
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.logical_and (::mlir::hbdk::hbir::LogicalAndOp)
HBIR tensor and.
Applies 'logical and' operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike, SameOperandsElementType
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.logical_not (::mlir::hbdk::hbir::LogicalNotOp)
HBIR tensor logical not, output bool.
Traits: CommonVerifier, EltwiseLike, SameOperandsAndResultShape, SameOperandsElementType
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.logical_or (::mlir::hbdk::hbir::LogicalOrOp)
HBIR tensor or.
Applies 'logical or' operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike, SameOperandsElementType
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.logical_xor (::mlir::hbdk::hbir::LogicalXorOp)
HBIR tensor xor.
Applies 'logical xor' operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike, SameOperandsElementType
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.lp_normalize (::mlir::hbdk::hbir::LpNormalizeOp)
HBIR LpNormalization.
Performs normalization of inputs over specified dimension.
For a tensor of sizes , each -element vector along dimension is transformed as .
With the default arguments it uses the Euclidean norm over vectors along dimension for normalization.
Prototype: Pytorch normalize.
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.lp_pool (::mlir::hbdk::hbir::LpPoolOp)
Hbir LpPool
Applies a n-D power-average pooling over an input signal composed of several input planes.
On each window, the function computed is:
- At p = , one gets Max Pooling
- At p = 1, one gets Sum Pooling (which is proportional to Average Pooling)
Note:
- If the sum to the power of is zero, the gradient of this function is not defined. This implementation will set the gradient to zero in this case.
Prototype: Pytorch LPPool1d & LPPool2d.
Traits: CommonVerifier, Misc, StencilLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.lut (::mlir::hbdk::hbir::LutOp)
HBIR lut op
lut on int8 Traits: CommonVerifier, LutLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.masked_select (::mlir::hbdk::hbir::MaskedSelectOp)
HBIR masked_select op
Returns a new 1-D tensor which indexes the input tensor according to the boolean mask mask which is a BoolTensor.
The shapes of the mask tensor and the input tensor don't need to match, but they must be broadcastable.
Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.matmul (::mlir::hbdk::hbir::MatMulOp)
HBIR Matrix Multiplication.
Applies matrix multiplication between two inputs: , where means matrix multiplication.
Note:
- If both tensors are 1-dimensional, the dot product (scalar) is returned
- If both arguments are 2-dimensional, the matrix-matrix product is returned
- If the first argument is 1-dimensional and the second argument is 2-dimensional, the matrix-vector product is returned
- If the first argument is 2-dimensional and the second argument is 1-dimensional, the matrix-vector product is returned
- If both arguments are at least 1-dimensional and at least one argument is N-dimensional (where N > 2), then a batched matrix multiply is returned
Shape:
- lhs: , where represent any number of dimension.
- rhs: , where represent any number of dimension.
- output: , where represent represent the result of broadcast between and .
Prototype: Pytorch Matmul.
Traits: CommonVerifier, MatmulLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.max (::mlir::hbdk::hbir::MaxOp)
HBIR tensor max.
Applies maximum operator element-wise, .
Note:
- Our arithmetic operator support broadcast.
Traits: Broadcastable, CommonVerifier, EltwiseLike, MoveF16CastLike, SameElementType
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.max_pool (::mlir::hbdk::hbir::MaxPoolOp)
HBIR n-D max pooling(supports 1d, 2d and 3d).
Applies a n-D max Pooling over an input.
In the 2d case, for example, the output value of the operator with input size , output and kernel size can be precisely described as:
where respectively represent the size of H and W.
Note:
- parameters has the same manner as the Conv2D operator, the same goes for the output size.
- ceilMode controls output 's compute is mode of floor or ceil, it' s default value is false.
Shape:
-
Input: or or
-
Output: or or , where represents any number of dimension.
if ceilMode = true, please use ceil replace floor in the above ouput formula.
Prototype: Pytorch max_pool.
Traits: CommonVerifier, MoveF16CastLike, PoolLike, StencilLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.max_unpool (::mlir::hbdk::hbir::MaxUnpoolOp)
HBIR max_unpool op
MaxUnpool2d takes in as input the output of MaxPool2d including the indices of the maximal values and computes a partial inverse in which all non-maximal values are set to zero. When converting from torch op or onnx op, converting method should set legal attributes.
Traits: CommonVerifier, PoolLike, StencilLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.min (::mlir::hbdk::hbir::MinOp)
HBIR tensor min.
Applies minimum operator element-wise, .
Note:
- Our arithmetic operator support broadcast.
Traits: Broadcastable, CommonVerifier, EltwiseLike, MoveF16CastLike, SameElementType
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.mish (::mlir::hbdk::hbir::MishOp)
HBIR Mish activation.
Applies the mish function element-wise. Mish fucntion defined as:
Shape:
- Input: (*), where * means any number of dimensions.
- Output: (*), same shape as the input.
Traits: CommonVerifier, LutLike, NaiveRoiInfer, NaiveTiling, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.mod (::mlir::hbdk::hbir::ModOp)
Hbir get modulo of two dividing tensors
Computes the modulo function. It is equivalent to the operator x1 % x2
Parameters:
- sameSignAsDividend: result has the same sign as dividend or divisor. Default true means same sign as dividend.
Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.mul (::mlir::hbdk::hbir::MulOp)
HBIR tensor multiplication.
Applies multiplication operator element-wise, .
Note:
- Our arithmetic operator support broadcast.
Prototype: Pytorch mul.
Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.nan_to_num (::mlir::hbdk::hbir::NanToNumOp)
HBIR tensor nan_to_num.
Replaces NaN, positive infinity, and negative infinity values in input with the values specified by nan, posinf, and neginf.
Note:
- Returns a new tensor with the replace value of the elements of input.
Traits: CommonVerifier, EltwiseLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.nash_flt_f16 (::mlir::hbdk::hbir::NashFltF16Op)
HBIR nash flt f16 op
fitting lut on fp16 Traits: CommonVerifier, LutLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.nash_flt (::mlir::hbdk::hbir::NashFltOp)
HBIR nash flt op
fitting lut on int16 Traits: CommonVerifier, LutLike
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.neg (::mlir::hbdk::hbir::NegOp)
HBIR tensor neg.
Applies negation operator element - wise, .
Note:
- Returns a new tensor with the negative of the elements of input.
Traits: CommonVerifier, EltwiseLike, MoveF16CastLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.nms (::mlir::hbdk::hbir::NonMaxSuppressionOp)
HBIR NonMaxSuppression
Filter out boxes that have high intersection-over-union (IOU) overlap with previously selected boxes.
Parameters:
- boxes: The input boxes.
- scores: The dimension to sort along.
- boxType: The format of the box data. Support mode are "xyxy": [x1,y1,x2,y2], "yxyx": [y1,x1,y2,x2], "xywh": [x_center, y_center, width, height]
- iouThreshold: Representing the threshold for deciding whether boxes overlap too much with respect to IOU. It is scalar. Value range [0, 1]. Default to 0.
- scoreThreshold: Representing the threshold for deciding when to remove boxes based on score. It is a scalar.
- maxOutputBoxesPerClass: Representing the maximum number of boxes to be selected per batch per class. It is a scalar. Default to 1, must be greater than 0.
Shape:
- boxes:
- scores:
- Indices: . N is euqal batchclassNummin(boxesNum,maxOutputBoxesPerClass). The last dim means selected index, format is [batch_index, class_index, box_index].
Prototype: ONNX NonMaxSuppression
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.nonzero (::mlir::hbdk::hbir::NonZeroOp)
HBIR nonzero op for torch.nonzero
Find all indices in tensor that are not 0
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.not_equal (::mlir::hbdk::hbir::NotEqualOp)
HBIR tensor not_equal.
Applies not_equal operator element - wise, . Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.pad (::mlir::hbdk::hbir::PadOp)
Pad at both edges of Tensor.
Padding at the begin and end position with constant / border value. Traits: CommonVerifier, Expansion, Foldable, MoveF16CastLike, MoveLike, PadLike, SameElementType
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.point_pillar_preprocess (::mlir::hbdk::hbir::PointPillarPreProcessOp)
HBIR point pillar preprocess op.
HBIR point pillar preprocess.Voxelization and Normalization Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.point_pillar_scatter (::mlir::hbdk::hbir::PointPillarScatterOp)
HBIR point pillar scatter op.
HBIR point pillar scatter. Traits: CommonVerifier, Misc
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.pow (::mlir::hbdk::hbir::PowOp)
HBIR tensor pow.
Pow takes input data(lhs) and exponent Tensor(rhs), and produces one output data where the function , is applied to the data tensor element - wise Traits: Broadcastable, CommonVerifier, EltwiseLike, MoveF16CastLike
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.prelu (::mlir::hbdk::hbir::PreluOp)
HBIR tensor prelu
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, Misc
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.relu (::mlir::hbdk::hbir::ReLUOp)
HBIR ReLU activation.
Applies the rectified linear unit function element - wise.Relu function is defined as:
Shape:
- Input(*), where * means any number of dimensions.
- Output(*), same shapes as the input.
Prototype: Pytorch Relu.
Traits: CommonVerifier, LutLike, MoveF16CastLike, NaiveRoiInfer, NaiveTiling, SameElementType, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.reciprocal (::mlir::hbdk::hbir::ReciprocalOp)
HBIR tensor reciprocal.
Applies reciprocal operator element - wise, .
Note:
- Returns a new tensor with the reciprocal of the elements of input.
Traits: CommonVerifier, EltwiseLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.reduce_all (::mlir::hbdk::hbir::ReduceAllOp)
Tests if all elements in input evaluate to True.
Return True if all elements in the row evaluate to True and False otherwise.
Parameters:
- input: the input tensor.
- dims: dimensions to perform reduce all on. If it's a list, reduce over all of them. Accepted range is [-r, r - 1] where r = rank(input).
- keepDim: keep the reduced dimensions or not. Default true means keep reduced dimensions.
Shape:
- input: , where * represents any dimension.
- output: if keepDim is True, same as input. Otherwise, all reduced dims will be discarded (e.g. if input is of shape 1x2x3x4 and dims=[1, 2], the output shape will be 1x4).
Traits: CommonVerifier, ReduceLike
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_any (::mlir::hbdk::hbir::ReduceAnyOp)
Tests if any elements in input evaluate to True.
Return True if any elements in the row evaluate to True and False otherwise.
Parameters:
- input: the input tensor.
- dims: dimensions to perform reduce all on. If it's a list, reduce over all of them. Accepted range is [-r, r - 1] where r = rank(input).
- keepDim: keep the reduced dimensions or not. Default true means keep reduced dimensions.
Shape:
- input: , where * represents any dimension.
- output: if keepDim is True, same as input. Otherwise, all reduced dims will be discarded (e.g. if input is of shape 1x2x3x4 and dims=[1, 2], the output shape will be 1x4).
Traits: CommonVerifier, ReduceLike
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_argmax (::mlir::hbdk::hbir::ReduceArgmaxOp)
Calculate max on multiple axes and return its index.
Return the indices of the max elements of the input tensor's element along the provided axis.
Parameters:
- input: the input tensor.
- dims: dimension to perform reduce argmax on. Accepted range is [-r, r - 1] where r = rank(input).
- keepDim: keep the reduced dimensions or not. Default true means keep reduced dimensions.
Shape:
- input: , where * represents any dimension.
- output: if keepDim is True, same as input. Otherwise, all reduced dims will be discarded (e.g. if input is of shape 1x2x3x4 and dims=[1], the output shape will be 1x3x4).
Prototype: ONNX ReduceArgMax.
Traits: CommonVerifier, MoveF16CastLike, ReduceLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_argmin (::mlir::hbdk::hbir::ReduceArgminOp)
Calculate min on multiple axes and return its index.
Return the indices of the min elements of the input tensor's element along the provided axis.
Parameters:
- input: the input tensor.
- dims: dimension to perform reduce argmin on. Accepted range is [-r, r - 1] where r = rank(input).
- keepDim: keep the reduced dimensions or not. Default true means keep reduced dimensions.
Shape:
- input: , where * represents any dimension.
- output: if keepDim is True, same as input. Otherwise, all reduced dims will be discarded (e.g. if input is of shape 1x2x3x4 and dims=[1], the output shape will be 1x3x4).
Prototype: ONNX ReduceArgMin.
Traits: CommonVerifier, MoveF16CastLike, ReduceLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_logsum (::mlir::hbdk::hbir::ReduceLogSumOp)
Calculate the logsum (i.e. reduce sum -> log) on multiple axes.
Return the logsum of all elements in the input tensor.
Note:
- Returns the logsum of each row of the input tensor in the given dimension dims.If dims is a list of dimensions, reduce over all of them.
- keepdim is True, the output tensor is of the same size as input.
Prototype: ONNX ReduceLogSum
Traits: CommonVerifier, ReduceLike
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_max (::mlir::hbdk::hbir::ReduceMaxOp)
Calculate max on multiple axes.
Return the max value of all elements in the provided axes of the input tensor.
Parameters:
- input: the input tensor.
- dims: dimensions to perform reduce max on. If it's a list, reduce over all of them. Accepted range is [-r, r - 1] where r = rank(input).
- keepDim: keep the reduced dimensions or not. Default true means keep reduced dimensions.
Shape:
- input: , where * represents any dimension.
- output: if keepDim is True, same as input. Otherwise, all reduced dims will be discarded (e.g. if input is of shape 1x2x3x4 and dims=[1, 2], the output shape will be 1x4).
Prototype: ONNX ReduceMax.
Traits: CommonVerifier, MoveF16CastLike, ReduceLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_mean (::mlir::hbdk::hbir::ReduceMeanOp)
Calculate mean on multiple axes.
Return the mean of all elements in the provided axes of the input tensor.
Parameters:
- input: the input tensor.
- dims: dimensions to perform reduce mean on. If it's a list, reduce over all of them. Accepted range is [-r, r - 1] where r = rank(input).
- keepDim: keep the reduced dimensions or not. Default true means keep reduced dimensions.
Shape:
- input: , where * represents any dimension.
- output: if keepDim is True, same as input. Otherwise, all reduced dims will be discarded (e.g. if input is of shape 1x2x3x4 and dims=[1, 2], the output shape will be 1x4).
Prototype: ONNX ReduceMean.
Traits: CommonVerifier, ReduceLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_min (::mlir::hbdk::hbir::ReduceMinOp)
Calculate min on multiple axes.
Return the min value of all elements in the provided axes of the input tensor.
Parameters:
- input: the input tensor.
- dims: dimensions to perform reduce min on. If it's a list, reduce over all of them. Accepted range is [-r, r - 1] where r = rank(input).
- keepDim: keep the reduced dimensions or not. Default true means keep reduced dimensions.
Shape:
- input: , where * represents any dimension.
- output: if keepDim is True, same as input. Otherwise, all reduced dims will be discarded (e.g. if input is of shape 1x2x3x4 and dims=[1, 2], the output shape will be 1x4).
Prototype: ONNX ReduceMin
Traits: CommonVerifier, MoveF16CastLike, ReduceLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_prod (::mlir::hbdk::hbir::ReduceProdOp)
Calculate product (i.e multiplication) on multiple axes.
Return the product of all elements in the input tensor.
Note:
- Returns the product of each row of the input tensor in the given dimension dims.If dims is a list of dimensions, reduce over all of them.
- keepdim is True, the output tensor is of the same size as input.
Prototype: TensorFlow reduce_prod
Traits: CommonVerifier, ReduceLike
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reduce_sum (::mlir::hbdk::hbir::ReduceSumOp)
Calculate sum on multiple axes.
Return the sum of all elements in the provided axes of the input tensor.
Parameters:
- input: the input tensor.
- dims: dimensions to perform reduce sum on. If it's a list, reduce over all of them. Accepted range is [-r, r - 1] where r = rank(input).
- keepDim: keep the reduced dimensions or not. Default true means keep reduced dimensions.
Shape:
- input: , where * represents any dimension.
- output: if keepDim is True, same as input. Otherwise, all reduced dims will be discarded (e.g. if input is of shape 1x2x3x4 and dims=[1, 2], the output shape will be 1x4).
Prototype: ONNX ReduceSum.
Traits: CommonVerifier, ReduceLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.reshape (::mlir::hbdk::hbir::ReshapeOp)
View a tensor as another shape
Returns a tensor with the same data and number of elements as input, but with the specified shape.When possible, the returned tensor will be a view of input.
Note:
- shape - the new shape.
Prototype: Pytorch reshape.
Traits: CommonVerifier, Foldable, MoveF16CastLike, MoveLike, ReshapeLike, SameElementType
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.resize2d (::mlir::hbdk::hbir::Resize2dOp)
HBIR 2-D resizing.
Scale the input proportionally.
Note:
- ratio controls zoom size.
- mode controls interpolation type, mode support: nearest, bilinear, bicubic, default value is nearest.
Shape:
- Input:
- Output: , where
Prototype: Pytorch upsample_nearest2d.
Traits: CommonVerifier, Expansion, Round, SampleLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.rle (::mlir::hbdk::hbir::RleOp)
HBIR rle op
Run length encode along with writing data from L1M to Ddr. Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.roi_align (::mlir::hbdk::hbir::RoiAlignOp)
HBIR roi align.
Crop the ROIs from a few feature maps, and resize them to the specified shape.The first input represents the ROI, and the rest of the inputs serve as features.
Shape:
- Inputs: this first input is Roi: or represent the N ROIs, the rest of the inputs is input features:
- Output: , where and are the specified shape controled by the parameter.
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.roll (::mlir::hbdk::hbir::RollOp)
Roll the tensor along the given dimensions
Roll the tensor along the given dimension.Elements that are shifted beyond the last position are re-introduced at the first position.
Note:
- shifts - The number of places by which the elements of the tensor are shifted.
- dims -Axis along which to roll.
Prototype: Pytorch roll.
Traits: CommonVerifier, MoveF16CastLike, MoveLike, SameElementType
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.round (::mlir::hbdk::hbir::RoundOp)
HBIR tensor round.
Rounds elements of input to the nearest integer.
Note:
- This function implements the round half to even.
- Returns a new tensor with the round of the elements of input.
Traits: CommonVerifier, EltwiseLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.rpp_v2 (::mlir::hbdk::hbir::RppV2Op)
HBIR RCNN post process.Real useful version
Process a few feature maps, generating a few boxes(ROIs). Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.rsqrt (::mlir::hbdk::hbir::RsqrtOp)
HBIR tensor rsqrt.
Applies the rsqrt function element-wise.Rsqrt function defined as:
Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.scatter_elements (::mlir::hbdk::hbir::ScatterElementsOp)
HBIR scatter elements op. Same semantics as scatter elements in onnx. In addition, it supports the mean mode of torch scatter_reduce
HBIR scatter elements scatter.The ONNX op link: https: // github.com/onnx/onnx/blob/main/docs/Operators.md#ScatterElements
Copy the data to output, the specify a direction axis, use the values in updates to update the values in output at specific location according to indices.
In addition, it supports the mean mode of torch scatter_reduce. And add or mul or mean mode support stash_type to control whether to use high precision for intermediate precision, default is true.
Traits: CommonVerifier, Misc
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RandomAccessInterface, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.scatter_nd (::mlir::hbdk::hbir::ScatterNDOp)
HBIR scatterND op. Same semantics as scatterND in onnx.
HBIR scatterDN.The ONNX op link: https: // github.com/onnx/onnx/blob/main/docs/Operators.md#ScatterND
Copy the data to output, then use the values in updates to update the values in the output at some directions given by the indices.
Traits: CommonVerifier, Misc
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RandomAccessInterface, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.select (::mlir::hbdk::hbir::SelectOp)
select a tensor from a bigger tensor on a specific dim and index
Slices the input tensor along the selected dimension at the given index.
Note:
- dim - the dimension to slice.
- index - the index to select with.
- Select operator is equivalent to slicing.
Prototype:Pytorch select.
Traits: CommonVerifier, MoveF16CastLike, MoveLike, SameElementType
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.sigmoid (::mlir::hbdk::hbir::SigmoidOp)
HBIR Sigmoid activation.
Applies the element - wise function.Sigmoid function is defined as:
Shape:
- Input: (*), where * means any number of dimensions.
- Output: (*), same shape as the input.
Prototype: Pytorch sigmoid.
Traits: CommonVerifier, LutLike, NaiveRoiInfer, NaiveTiling, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.sign (::mlir::hbdk::hbir::SignOp)
HBIR tensor sign.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, EltwiseLike, MoveF16CastLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.sin (::mlir::hbdk::hbir::SinOp)
HBIR tensor sin.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.sinh (::mlir::hbdk::hbir::SinhOp)
HBIR tensor sinh.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.slice (::mlir::hbdk::hbir::SliceOp)
Slice a tensor out of a tensor
Slicing like python's style means taking elements from one given index to another given index.
Note:
- begin -the index start to pick(inclusive).
- end -the index end to pick(exclusive).
- step -the step interval of picking.
Prototype: Pytorch slice.
Traits: CommonVerifier, Foldable, MoveF16CastLike, MoveLike, SameElementType, SliceLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.slice_scatter (::mlir::hbdk::hbir::SliceScatterOp)
Embeds the values of the src tensor into input at the given dimension
Embeds the values of the src tensor into input at the given dimension. This function returns a tensor with fresh storage; it does not create a view.
Note:
- src (Tensor) -the tensor to embed into input.
- dim (int) -the dimension to insert the slice into.
- start (int) -the start index of where to insert the slice.
- end (int) -the end index of where to insert the slice.
- step (int) -the how many elements to skip in.
Prototype: Pytorch slice_scatter.
Traits: CommonVerifier, Misc
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.softmax (::mlir::hbdk::hbir::SoftmaxOp)
HBIR Softmax Op.
Applies the Softmax function to an n - dimensional input Tensor rescaling them so that the elements of the n-dimensional output. Tensor lie in the range and sum to 1.
Softmax function is defined as:
Shape:
- Input(*), where means, any number of additional dimensions.Output(), same shape as the input.
Prototype: Pytorch softmax.
Traits: CommonVerifier, Misc, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, RoiInfer, SchedInterface, SchedTemp, ShapeInference, Tiling
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.softplus (::mlir::hbdk::hbir::SoftplusOp)
HBIR Softplus Op.
Applies the SoftPlus function element-wise. SoftPlus function defined as:
SoftPlus is a smooth approximation to the ReLU function.
Note:
- beta - the value for the Softplus formulation.
- max - values is for numerical stability, when .
Shape:
- Input: (*), where * means any number of dimensions.
- Output: (*), same shape as the input.
Prototype: Pytorch softplus.
Traits: CommonVerifier, LutLike, NaiveRoiInfer, NaiveTiling, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.sort (::mlir::hbdk::hbir::SortOp)
HBIR tensor sort
Sorts the elements of the input tensor along a given dimension in ascending order by value.
Parameters:
- input: the input tensor.
- dim: the dimension to sort along.
- descending: controls the sorting order (ascending or descending).
- stable: makes the sorting routine stable, which guarantees that the order of equivalent elements is preserved.
Shape:
- Input:
- Values: (same shape as input)
- Indices: (same shape as input)
Prototype: Pytorch sort.
Traits: CommonVerifier, Misc
Interfaces: ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.sqrt (::mlir::hbdk::hbir::SqrtOp)
HBIR tensor sqrt.
Applies square root operator element - wise, .
Note:
- Returns a new tensor with the square root of the elements of input. If input is negative, then it will return NaN.
Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.stack (::mlir::hbdk::hbir::StackOp)
Stack multiple tensors along one extra dimension
Concatenates a sequence of tensors along a new dimension.No elemental type conversion.
Note:
- All tensors need to be of the same size.
Prototype: Pytorch stack.
Traits: CommonVerifier, MoveF16CastLike, MoveLike, SameElementType
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.sub (::mlir::hbdk::hbir::SubOp)
HBIR tensor substraction.
Applies substraction operator element-wise, .
Note:
- Our arithmetic operator support broadcast.
Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.swish (::mlir::hbdk::hbir::SwishOp)
HBIR Swish activation.
Applies the swish function element-wise.Swish function defined as:
Shape:
- Input: (*), where * means any number of dimensions.
- Output: (*), same shape as the input.
Prototype: Pytorch silu.
Traits: CommonVerifier, LutLike, NaiveRoiInfer, NaiveTiling, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.tan (::mlir::hbdk::hbir::TanOp)
HBIR tensor tan.
Return tensor after the operation, which has the same shape as the input. Traits: CommonVerifier, LutLike, SameOperandsAndResultShape
Interfaces: DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.tanh (::mlir::hbdk::hbir::TanhOp)
HBIR Tanh activation.
Applies the tanh function element - wise.Tanh function is defined as:
Shape:
- Input: (*), where * means any number of dimensions.
- Output: (*), same shape as the input.
Prototype: Pytorch tanh.
Traits: CommonVerifier, LutLike, NaiveRoiInfer, NaiveTiling, SameOperandsAndResultShape
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, MoveTransposeInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Operands:
Results:
hbir.tile (::mlir::hbdk::hbir::TileOp)
Constructs a tensor by tiling a given tensor.
Traits: CommonVerifier, MoveF16CastLike, MoveLike, SameElementType, TileLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.topk (::mlir::hbdk::hbir::TopkOp)
HBIR tensor topk
Returns the k largest elements of the given input tensor along a given dimension.
If dim is not given, the last dimension of the input is chosen.
If largest is False then the k smallest elements are returned.
values, indices are returned in separate tensors, where the indices are the indices of the elements in the original input tensor.
The boolean option sorted only supports true, will make sure that the returned k elements are themselves sorted.
Traits: CommonVerifier, Misc, MoveF16CastLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, IndexOpInterface, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.transpose (::mlir::hbdk::hbir::TransposeOp)
Reverse or permute the dims of an array; returns the modified array.
Returns a tensor that is a view of the original tensor input with its dimesions permuted.
Note:
- input: the input tensor.
- dims: the desired ordering of dimensions.
Prototype: Pytorch permute.
Traits: CommonVerifier, MoveF16CastLike, MoveLike, SameElementType, TransposeLike
Interfaces: CalibOp, DataMovePropagate, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), NonBatchAxesInfer, Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.warp (::mlir::hbdk::hbir::WarpOp)
HBIR warp.
From the input, sample(bi - linear interpolation) pixels specified by grid.
Shape:
- input: input of shape , where * represent any number of dimension.
- grid: flow - field of shape
- output:
Traits: CommonVerifier, Expansion, Round, SampleLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, RandomAccessInterface, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
Attributes:
Operands:
Results:
hbir.where (::mlir::hbdk::hbir::WhereOp)
HBIR where op
Return a tensor of elements selected from either lhs or rhs, depending on condition.
Traits: Broadcastable, CommonVerifier, EltwiseLike
Interfaces: CalibOp, ExtraOpInterface, HBTLExecutable, HbdkInferType, NoMemoryEffect (MemoryEffectOpInterface), Perf, Quantizable, SchedInterface, SchedTemp, ShapeInference
Effects: MemoryEffects::Effect{}
