Skip to content

'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:

AttributeMLIR TypeDescription
scale::mlir::FloatAttr32-bit float attribute
zero_point::mlir::IntegerAttr64-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:

AttributeMLIR TypeDescription
predicate::mlir::streamtensor::arith_ext::MathPredicateAttr
Predicate of math ops{{% markdown %}}Enum cases: * Acos (`acos`) * Acosh (`acosh`) * Asin (`asin`) * Asinh (`asinh`) * Atan (`atan`) * Atanh (`atanh`) * Cbrt (`cbrt`) * Ceil (`ceil`) * Cos (`cos`) * Cosh (`cosh`) * Erf (`erf`) * Exp (`exp`) * Exp2 (`exp2`) * ExpM1 (`expm1`) * Floor (`floor`) * Log (`log`) * Log10 (`log10`) * Log1p (`log1p`) * Round (`round`) * Rsqrt (`rsqrt`) * Sin (`sin`) * Sinh (`sinh`) * Sqrt (`sqrt`) * Tan (`tan`) * Tanh (`tanh`){{% /markdown %}}

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:

AttributeMLIR TypeDescription
scale::mlir::FloatAttr32-bit float attribute
zero_point::mlir::IntegerAttr64-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:

AttributeMLIR TypeDescription
scale::mlir::FloatAttr32-bit float attribute
zero_point::mlir::IntegerAttr64-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
>

Enum cases: * Acos (acos) * Acosh (acosh) * Asin (asin) * Asinh (asinh) * Atan (atan) * Atanh (atanh) * Cbrt (cbrt) * Ceil (ceil) * Cos (cos) * Cosh (cosh) * Erf (erf) * Exp (exp) * Exp2 (exp2) * ExpM1 (expm1) * Floor (floor) * Log (log) * Log10 (log10) * Log1p (log1p) * Round (round) * Rsqrt (rsqrt) * Sin (sin) * Sinh (sinh) * Sqrt (sqrt) * Tan (tan) * Tanh (tanh)

Parameters:

Parameter C++ type Description
value ::mlir::streamtensor::arith_ext::MathPredicate an enum of type MathPredicate