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)^)?
              (`input_order` `=` $input_order^)?
              `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)^)?
              (`target_order` `=` $target_order^)?
              attr-dict `:` functional-type(operands, results)

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

Traits: AttrSizedOperandSegments

Interfaces: MemoryEffectOpInterface, TransformOpInterface

Attributes: 

AttributeMLIR TypeDescription
input_order::mlir::DenseI32ArrayAttri32 dense array attribute
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
target_order::mlir::DenseI32ArrayAttri32 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_load_op (transform::GetLoadOp) 

Get a handle to the load_nd op in producer chain of a value.

Syntax:

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

Traces the producers of the given value until an xegpu.load_nd or xegpu.load 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
loadNdHandleTransformHandleTypeInterface instance

transform.xegpu.insert_prefetch (transform::InsertPrefetchOp) 

Adds xegpu prefetch ops to a load op.

Syntax:

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

Inserts xegpu.prefetch_nd operations for the given xegpu.load_nd op. 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
targetTransformHandleTypeInterface instance
dynamic_nb_prefetchtransform any param type or any handle type

Results: 

ResultDescription
desc_opTransformHandleTypeInterface instance

transform.xegpu.set_anchor_layout (transform::SetAnchorLayoutOp) 

Set anchor layout of an op.

Syntax:

operation ::= `transform.xegpu.set_anchor_layout` $target (`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)^)?
              (`order` `=` $order^)?
              (`slice_dims` `=` $slice_dims^)?
              attr-dict `:` qualified(type(operands))

Sets the xegpu.layout anchor layout for XeGPU ops that support it. The target operand value can be set by the index argument (currently only applicable to a DPAS op). The layout is defined by the sg_layout, sg_data and optional inst_data and order attributes. If slice_dims is provided, the xegpu.layout attribute is wrapped in an xegpu.slice<..., dims=slice_dims> attribute. Emits a silenceable failure if the target op does not support anchor layouts.

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
order::mlir::DenseI32ArrayAttri32 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

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