MLIR

Multi-Level IR Compiler Framework

source

transform.xegpu.convert_layout (transform::ConvertLayoutOp) 

Convert xegpu.layout attribute for a value.

Syntax:

operation ::= `transform.xegpu.convert_layout` $target
              `input_sg_layout` `=` custom<DynamicIndexList>($input_sg_layout, $static_input_sg_layout)
              `input_sg_data` `=` custom<DynamicIndexList>($input_sg_data, $static_input_sg_data)
              (`input_inst_data` `=` custom<DynamicIndexList>($input_inst_data, $static_input_inst_data)^)?
              `target_sg_layout` `=` custom<DynamicIndexList>($target_sg_layout, $static_target_sg_layout)
              `target_sg_data` `=` custom<DynamicIndexList>($target_sg_data, $static_target_sg_data)
              (`target_inst_data` `=` custom<DynamicIndexList>($target_inst_data, $static_target_inst_data)^)?
              attr-dict `:` functional-type(operands, results)

Adds an xegpu.convert_layout op to convert the xegpu.layout attribute of a value. The input and target layouts are defined by the *sg_layout, *sg_data and optional *inst_data attributes. Returns a handle to the emitted xegpu.convert_layout op.

Traits: AttrSizedOperandSegments

Interfaces: MemoryEffectOpInterface, TransformOpInterface

Attributes: 

AttributeMLIR TypeDescription
static_input_sg_layout::mlir::DenseI64ArrayAttri64 dense array attribute
static_input_sg_data::mlir::DenseI64ArrayAttri64 dense array attribute
static_input_inst_data::mlir::DenseI64ArrayAttri64 dense array attribute
static_target_sg_layout::mlir::DenseI64ArrayAttri64 dense array attribute
static_target_sg_data::mlir::DenseI64ArrayAttri64 dense array attribute
static_target_inst_data::mlir::DenseI64ArrayAttri64 dense array attribute

Operands: 

OperandDescription
targetTransformValueHandleTypeInterface instance
input_sg_layoutvariadic of transform any param type or any handle type
input_sg_datavariadic of transform any param type or any handle type
input_inst_datavariadic of transform any param type or any handle type
target_sg_layoutvariadic of transform any param type or any handle type
target_sg_datavariadic of transform any param type or any handle type
target_inst_datavariadic of transform any param type or any handle type

Results: 

ResultDescription
newConvertOpTransformHandleTypeInterface instance

transform.xegpu.get_desc_op (transform::GetDescOp) 

Get a handle to the descriptor op of a value.

Syntax:

operation ::= `transform.xegpu.get_desc_op` $target attr-dict `:` functional-type(operands, results)

Traces the producers of the given value until an xegpu.create_nd_tdesc descriptor op is found. Returns a handle to it. Currently traces producers by following only the first operand of producer ops.

Traits: NavigationTransformOpTrait

Interfaces: MemoryEffectsOpInterface, TransformOpInterface

Operands: 

OperandDescription
targetTransformValueHandleTypeInterface instance

Results: 

ResultDescription
descHandleTransformHandleTypeInterface instance

transform.xegpu.insert_prefetch (transform::InsertPrefetchOp) 

Adds xegpu prefetch ops to matmul operand tiles.

Syntax:

operation ::= `transform.xegpu.insert_prefetch` $target
              `nb_prefetch` `=` ($dynamic_nb_prefetch^):($static_nb_prefetch)?
              attr-dict `:` functional-type(operands, results)

Given a target value (e.g., vector) residing in a scf.for loop, this transform finds the corresponding xegpu.load_nd op and inserts xegpu.prefetch_nd operations for the tile. The load op must reside within the scf.for loop. Number of prefetch steps is set by the nb_prefetch argument (default value is 1). Returns a handle to the created xegpu.create_nd_desc op.

Interfaces: MemoryEffectOpInterface, TransformOpInterface

Attributes: 

AttributeMLIR TypeDescription
static_nb_prefetch::mlir::IntegerAttr64-bit signless integer attribute

Operands: 

OperandDescription
targetTransformValueHandleTypeInterface instance
dynamic_nb_prefetchtransform any param type or any handle type

Results: 

ResultDescription
desc_opTransformHandleTypeInterface instance

transform.xegpu.set_desc_layout (transform::SetDescLayoutOp) 

Set xegpu.layout attribute to a xegpu.create_nd_desc op result.

Syntax:

operation ::= `transform.xegpu.set_desc_layout` $target
              `sg_layout` `=` custom<DynamicIndexList>($sg_layout, $static_sg_layout)
              `sg_data` `=` custom<DynamicIndexList>($sg_data, $static_sg_data)
              (`inst_data` `=` custom<DynamicIndexList>($inst_data, $static_inst_data)^)?
              (`slice_dims` `=` $slice_dims^)?
              attr-dict `:` functional-type(operands, results)

Given an xegpu.create_nd_desc operation, this transform adds xegpu.layout attribute to the result tensor descriptor. The layout is defined by the sg_layout, and sg_data and optional inst_data attributes. If slice_dims is provided, the xegpu.layout attribute is wrapped in an xegpu.slice<..., dims=slice_dims> attribute. Returns a handle to the transformed op.

Traits: AttrSizedOperandSegments

Interfaces: MemoryEffectOpInterface, TransformOpInterface

Attributes: 

AttributeMLIR TypeDescription
static_sg_layout::mlir::DenseI64ArrayAttri64 dense array attribute
static_sg_data::mlir::DenseI64ArrayAttri64 dense array attribute
static_inst_data::mlir::DenseI64ArrayAttri64 dense array attribute
slice_dims::mlir::DenseI64ArrayAttri64 dense array attribute

Operands: 

OperandDescription
targetTransformHandleTypeInterface instance
sg_layoutvariadic of transform any param type or any handle type
sg_datavariadic of transform any param type or any handle type
inst_datavariadic of transform any param type or any handle type

Results: 

ResultDescription
transformedTransformHandleTypeInterface instance

transform.xegpu.set_gpu_launch_threads (transform::SetGPULaunchThreadsOp) 

Set number of threads for a given gpu.launch operation

Syntax:

operation ::= `transform.xegpu.set_gpu_launch_threads` $target
              `threads` `=` custom<DynamicIndexList>($threads, $static_threads)
              attr-dict `:` qualified(type(operands))

Overrides the x,y,z threads operands of a given gpu.launch operation in-place.

Interfaces: MemoryEffectOpInterface, TransformOpInterface

Attributes: 

AttributeMLIR TypeDescription
static_threads::mlir::DenseI64ArrayAttri64 dense array attribute

Operands: 

OperandDescription
targetTransformHandleTypeInterface instance
threadsvariadic of transform any param type or any handle type

transform.xegpu.set_op_layout_attr (transform::SetOpLayoutAttrOp) 

Set xegpu.layout attribute of an op.

Syntax:

operation ::= `transform.xegpu.set_op_layout_attr` $target (`result` $result^)? (`index` `=` $index^)?
              `sg_layout` `=` custom<DynamicIndexList>($sg_layout, $static_sg_layout)
              `sg_data` `=` custom<DynamicIndexList>($sg_data, $static_sg_data)
              (`inst_data` `=` custom<DynamicIndexList>($inst_data, $static_inst_data)^)?
              (`slice_dims` `=` $slice_dims^)?
              attr-dict `:` qualified(type(operands))

Sets the xegpu.layout attribute of an op. If result=true, sets the layout_result_{index}, otherwise layout_operand_{index} attribute. The target operand/result value is defined by the index argument. The layout is defined by the sg_layout, sg_data and optional inst_data attributes. If slice_dims is provided, the xegpu.layout attribute is wrapped in an xegpu.slice<..., dims=slice_dims> attribute.

Traits: AttrSizedOperandSegments

Interfaces: MemoryEffectOpInterface, TransformOpInterface

Attributes: 

AttributeMLIR TypeDescription
index::mlir::IntegerAttr64-bit signless integer attribute
static_sg_layout::mlir::DenseI64ArrayAttri64 dense array attribute
static_sg_data::mlir::DenseI64ArrayAttri64 dense array attribute
static_inst_data::mlir::DenseI64ArrayAttri64 dense array attribute
slice_dims::mlir::DenseI64ArrayAttri64 dense array attribute
result::mlir::UnitAttrunit attribute

Operands: 

OperandDescription
targetTransformHandleTypeInterface instance
sg_layoutvariadic of transform any param type or any handle type
sg_datavariadic of transform any param type or any handle type
inst_datavariadic of transform any param type or any handle type