Skip to content

'tensor_ext' Dialect

An tensor extension out-of-tree MLIR dialect This dialect contains dedicated operations, types, and attributes designed for extending the in-tree tensor dialect in MLIR.

Operations

tensor_ext.chunk (streamtensor::tensor_ext::ChunkOp)

Chunk a tensor to multiple tensors

Syntax:

operation ::= `tensor_ext.chunk` `dim` `(` $dim `)` $source `to` $size attr-dict `:`
              functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
dim::mlir::IntegerAttr64-bit signed integer attribute
size::mlir::IntegerAttr64-bit signed integer attribute

Operands:

Operand Description
source ranked tensor of any type values

Results:

Result Description
results variadic of ranked tensor of any type values

tensor_ext.dequantize (streamtensor::tensor_ext::DeQuantizeOp)

Dequantize a tensor to float type

Syntax:

operation ::= `tensor_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

tensor_ext.instance (streamtensor::tensor_ext::InstanceOp)

A tensor instance that is not pure

Syntax:

operation ::= `tensor_ext.instance` attr-dict `:` type(results)

Results:

Result Description
result ranked tensor of any type values

tensor_ext.quantize (streamtensor::tensor_ext::QuantizeOp)

Quantize a tensor to integer type

Syntax:

operation ::= `tensor_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

tensor_ext.requantize (streamtensor::tensor_ext::ReQuantizeOp)

Requantize a tensor to integer type

Syntax:

operation ::= `tensor_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

tensor_ext.unwiden (streamtensor::tensor_ext::UnWidenOp)

Unwiden a tensor to scalar type

Syntax:

operation ::= `tensor_ext.unwiden` $source attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), TensorViewLikeOpInterface

Effects: MemoryEffects::Effect{}

Operands:

Operand Description
source ranked tensor of vector of any type values values

Results:

Result Description
result ranked tensor of any type values

tensor_ext.widen (streamtensor::tensor_ext::WidenOp)

Widen a tensor to vector element

Syntax:

operation ::= `tensor_ext.widen` $source attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface), TensorViewLikeOpInterface

Effects: MemoryEffects::Effect{}

Operands:

Operand Description
source ranked tensor of any type values

Results:

Result Description
result ranked tensor of vector of any type values values

Attributes

VectorizationEncodingAttr

Vectorization encoding of a tensor

Syntax:

#tensor_ext.vector<
  ::llvm::ArrayRef<int64_t>   # shape
>

Parameters:

Parameter C++ type Description
shape ::llvm::ArrayRef<int64_t>