'arith_ext' Dialect
An arithmetic extension out-of-tree MLIR dialect
This dialect contains dedicated operations, types, and attributes designed for extending the in-tree arithmetic dialect in MLIR.
Operations¶
arith_ext.dequantize
(streamtensor::arith_ext::DeQuantizeOp)¶
Dequantize a tensor to float type
Syntax:
operation ::= `arith_ext.dequantize` $source `scale` $scale `zero_point` $zero_point attr-dict `:`
functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:¶
Attribute | MLIR Type | Description |
---|---|---|
scale | ::mlir::FloatAttr | 32-bit float attribute |
zero_point | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operands:¶
Operand | Description |
---|---|
source |
primitive/tensor of integer |
Results:¶
Result | Description |
---|---|
result |
primitive/tensor of floating-point |
arith_ext.mathi
(streamtensor::arith_ext::MathIOp)¶
Integer math operation
Syntax:
operation ::= `arith_ext.mathi` $predicate $operand attr-dict `:` functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
, SameOperandsAndResultElementType
, SameOperandsAndResultShape
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:¶
Attribute | MLIR Type | Description |
---|---|---|
predicate | ::mlir::streamtensor::arith_ext::MathPredicateAttr | Predicate of math ops |
Operands:¶
Operand | Description |
---|---|
operand |
primitive/tensor of integer |
Results:¶
Result | Description |
---|---|
result |
primitive/tensor of integer |
arith_ext.quantize
(streamtensor::arith_ext::QuantizeOp)¶
Quantize a tensor to integer type
Syntax:
operation ::= `arith_ext.quantize` $source `scale` $scale `zero_point` $zero_point attr-dict `:`
functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:¶
Attribute | MLIR Type | Description |
---|---|---|
scale | ::mlir::FloatAttr | 32-bit float attribute |
zero_point | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operands:¶
Operand | Description |
---|---|
source |
primitive/tensor of floating-point |
Results:¶
Result | Description |
---|---|
result |
primitive/tensor of integer |
arith_ext.requantize
(streamtensor::arith_ext::ReQuantizeOp)¶
Requantize a tensor to integer type
Syntax:
operation ::= `arith_ext.requantize` $source `scale` $scale `zero_point` $zero_point attr-dict `:`
functional-type(operands, results)
Traits: AlwaysSpeculatableImplTrait
Interfaces: ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Attributes:¶
Attribute | MLIR Type | Description |
---|---|---|
scale | ::mlir::FloatAttr | 32-bit float attribute |
zero_point | ::mlir::IntegerAttr | 64-bit signed integer attribute |
Operands:¶
Operand | Description |
---|---|
source |
primitive/tensor of integer |
Results:¶
Result | Description |
---|---|
result |
primitive/tensor of integer |
Attributes¶
MathPredicateAttr¶
Predicate of math ops
Syntax:
#arith_ext.math_predicate<
::mlir::streamtensor::arith_ext::MathPredicate # value
>
Parameters:¶
Parameter | C++ type | Description |
---|---|---|
value | ::mlir::streamtensor::arith_ext::MathPredicate |
an enum of type MathPredicate |
Enums¶
MathPredicate¶
Predicate of math ops
Cases:¶
Symbol | Value | String |
---|---|---|
acos | 0 |
Acos |
acosh | 1 |
Acosh |
asin | 2 |
Asin |
asinh | 3 |
Asinh |
atan | 4 |
Atan |
atanh | 5 |
Atanh |
cbrt | 6 |
Cbrt |
ceil | 7 |
Ceil |
cos | 8 |
Cos |
cosh | 9 |
Cosh |
erf | 10 |
Erf |
exp | 11 |
Exp |
exp2 | 12 |
Exp2 |
expm1 | 13 |
ExpM1 |
floor | 14 |
Floor |
log | 15 |
Log |
log10 | 16 |
Log10 |
log1p | 17 |
Log1p |
round | 18 |
Round |
rsqrt | 19 |
Rsqrt |
sin | 20 |
Sin |
sinh | 21 |
Sinh |
sqrt | 22 |
Sqrt |
tan | 23 |
Tan |
tanh | 24 |
Tanh |