d2m.empty
(tt::d2m::EmptyOp)
Empty tensor allocation operation (D2M).
Syntax:
operation ::= `d2m.empty` `(` `)` attr-dict `:` type($result)
Create an uninitialized tensor with the specified shape, element type and encoding.
Traits: AlwaysSpeculatableImplTrait
Interfaces: BufferizableOpInterface
, ConditionallySpeculatable
, NoMemoryEffect (MemoryEffectOpInterface)
Effects: MemoryEffects::Effect{}
Results:
Result | Description |
---|---|
result | ranked tensor of any type values |
d2m.generic
(tt::d2m::GenericOp)
Generically dispatch work to a grid of cores (D2M).
Syntax:
operation ::= `d2m.generic` attr-dict `\n`
` ` ` ` ` ` ` ` `ins` `(` $inputs `:` type($inputs) `)` `\n`
` ` ` ` ` ` ` ` `outs` `(` $outputs `:` type($outputs) `)` ` ` $regions (`:` type($results)^ )?
Same semantics as D2M generic; carries regions for compute/datamovement to be consumed by the metal path.
Traits: AttrSizedOperandSegments
, NoTerminator
Interfaces: BufferizableOpInterface
, DestinationStyleOpInterface
, MemoryEffectOpInterface
, OpAsmOpInterface
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
grid | ::mlir::tt::ttcore::GridAttr | TT grid attribute{{% markdown %}} TT grid attribute {{% /markdown %}} |
block_factors | ::mlir::ArrayAttr | 64-bit integer array attribute |
indexing_maps | ::mlir::ArrayAttr | AffineMap array attribute |
iterator_types | ::mlir::ArrayAttr | |
threads | ::mlir::ArrayAttr |
Operands:
Operand | Description |
---|---|
inputs | variadic of ranked tensor of any type values or non-0-ranked.memref of any type values |
outputs | variadic of ranked tensor of any type values or non-0-ranked.memref of any type values |
Results:
Result | Description |
---|---|
results | variadic of ranked tensor of any type values |
d2m.stream_layout
(tt::d2m::StreamLayoutOp)
Stream layout (D2M)
Represent a streaming relationship between a source tensor/memref and a storage buffer, producing a view result.
Traits: AlwaysSpeculatableImplTrait
Interfaces: BufferizableOpInterface
, ConditionallySpeculatable
, D2M_ViewOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
, OpAsmOpInterface
Effects: MemoryEffects::Effect{}
Operands:
Operand | Description |
---|---|
input | ranked tensor of any type values or non-0-ranked.memref of any type values |
storage | ranked tensor of any type values or non-0-ranked.memref of any type values |
Results:
Result | Description |
---|---|
result | ranked tensor of any type values or non-0-ranked.memref of any type values |
d2m.to_layout
(tt::d2m::ToLayoutOp)
Layout op.
Syntax:
operation ::= `d2m.to_layout` $input `,` $output `:` type($input) `into` type($output) (`hostInfo` `=` $layout^)? attr-dict (`->` type($results)^)?
ToLayout operation, transition tensors from one layout to another. Some examples include:
- Transitioning between different memory spaces, e.g. DRAM to L1.
- Transitioning between different data types, e.g. f32 to f16.
- Transitioning between different tile sizes, e.g. 1x16 to 32x32
- Transitioning between different tensor sharding
- Some combination of the above
#layout = #ttcore.metal_layout<8192x128x1, undef, <1x1>, memref<64x128xf32, #system>>
#layout1 = #ttcore.metal_layout<8192x128x1, undef, <1x1>, memref<64x128xf32, #l1_>>
%1 = "d2m.to_layout"(%arg0, %0) : (tensor<64x128xf32, #layout>, tensor<64x128xf32, #layout1>) -> tensor<64x128xf32, #layout1>
Interfaces: BufferizableOpInterface
, MemoryEffectOpInterface
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
layout | ::mlir::tt::ttcore::MetalLayoutAttr | Tensor layout attribute with explicit physical shape{{% markdown %}} The tensor layout attribute captures how tensor data is sharded across a grid of devices/cores and is laid out in memory. Note that the presence of this attribute implies that the tensor shape includes sharding (i.e. the first half of the tensor shape represents the grid shape).
{{% /markdown %}} |
Operands:
Operand | Description |
---|---|
input | ranked tensor of any type values or non-0-ranked.memref of any type values |
output | ranked tensor of any type values or non-0-ranked.memref of any type values |
Results:
Result | Description |
---|---|
results | variadic of ranked tensor of any type values |
d2m.view_layout
(tt::d2m::ViewLayoutOp)
View Layout op (D2M subset)
Syntax:
operation ::= `d2m.view_layout` $input attr-dict `:` type($input) `->` type($result)
Create a representational view of a tensor/memref with a different layout. This is a no-op for codegen; consumers are expected to compose layouts.
Traits: AlwaysSpeculatableImplTrait
Interfaces: BufferizableOpInterface
, ConditionallySpeculatable
, D2M_ViewOpInterface
, NoMemoryEffect (MemoryEffectOpInterface)
, OpAsmOpInterface
Effects: MemoryEffects::Effect{}
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
reinterpretLayout | ::mlir::BoolAttr | bool attribute |
Operands:
Operand | Description |
---|---|
input | ranked tensor of any type values or non-0-ranked.memref of any type values |
Results:
Result | Description |
---|---|
result | ranked tensor of any type values or non-0-ranked.memref of any type values |