tvm
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tvm::tirx::TileLayoutNode Class Reference

#include <layout.h>

Inheritance diagram for tvm::tirx::TileLayoutNode:
Collaboration diagram for tvm::tirx::TileLayoutNode:

Public Member Functions

bool CompatibleWithShape (const ffi::Array< PrimExpr > &shape) const final
 Check if the layout is compatible with the shape. More...
 
bool VerifyWellFormed () const final
 Verify if the layout is well-formed. More...
 
PrimExpr GetSize (ffi::Optional< ffi::String > axis_name=std::nullopt) const final
 Get the size of the layout (of some axis) More...
 
PrimExpr GetSpan (ffi::Optional< ffi::String > axis_name=std::nullopt) const final
 Get the span of the layout (of some axis) More...
 
ffi::Map< ffi::String, PrimExprApply (ffi::Array< PrimExpr > coord) const final
 Apply the input coordinate and get the mapped output. More...
 
ffi::Map< ffi::String, PrimExprApply (PrimExpr coord) const final
 
Layout Canonicalize () const final
 Turn the layout to canonical form. More...
 
Layout Tile (const TileLayout &outer, const ffi::Array< PrimExpr > &outer_shape, const ffi::Array< PrimExpr > &inner_shape) const final
 Tile the layout with an outer layout. More...
 
Layout DirectSum (const TileLayout &left, const ffi::Array< PrimExpr > &left_shape, const ffi::Array< PrimExpr > &right_shape) const final
 Direct-sum on the tiling domain (unscaled composition) Given left layout A (grouped by left_shape) and this layout B (grouped by right_shape), construct the interleaved-domain direct sum A + B without span scaling. More...
 
ffi::Optional< TileLayoutIsTileInner (const Layout &tile_layout, const ffi::Array< PrimExpr > &tiled_shape, const ffi::Array< PrimExpr > &inner_shape) const final
 Check if the layout is the inner layout of a tiled layout. More...
 
ffi::Optional< LayoutIsTileOuter (const Layout &tile_layout, const ffi::Array< PrimExpr > &tiled_shape, const ffi::Array< PrimExpr > &outer_shape) const final
 Check if the layout is the outer layout of a tiled layout. More...
 
ffi::Optional< TileLayoutIsDirectSumRight (const Layout &sum_layout, const ffi::Array< PrimExpr > &interleaved_shape, const ffi::Array< PrimExpr > &right_shape) const final
 Check if this layout is the right addend B in a direct-sum A + B over the interleaved domain S_A \otimes S_B. If so, return the left layout A. More...
 
ffi::Optional< LayoutIsDirectSumLeft (const Layout &sum_layout, const ffi::Array< PrimExpr > &interleaved_shape, const ffi::Array< PrimExpr > &left_shape) const final
 Check if this layout is the left addend A in a direct-sum A + B over the interleaved domain S_A \otimes S_B. If so, return the right layout B. More...
 
ffi::Array< PrimExprGetShardShape () const
 Get the shape of the shard. More...
 
ffi::Optional< LayoutSlice (const ffi::Array< PrimExpr > &shape, const Region &region) const final
 Slice the layout with a given shape and region. More...
 
bool IsTrivial () const
 Is the layout trivial (pure memory, identical mapping) More...
 
bool IsTrainium () const
 Check if the layout is trainium layout. More...
 
bool HasMemoryAxis () const
 Has Memory Axis. More...
 
bool HasThreadAxis () const
 Has Thread Axis. More...
 
ffi::Optional< Tuple< ExecScope, ExecScope > > GetScope () const
 Get the scope pair of the layout. More...
 
 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("tirx.TileLayout", TileLayoutNode, LayoutNode)
 
- Public Member Functions inherited from tvm::tirx::LayoutNode
ffi::Map< ffi::String, PrimExprApply (const ffi::Array< PrimExpr > &coord, const ffi::Array< PrimExpr > &shape) const
 
 TVM_FFI_DECLARE_OBJECT_INFO ("tirx.Layout", LayoutNode, ffi::Object)
 

Static Public Member Functions

static void RegisterReflection ()
 
static TileLayout DefaultLayout (ffi::Array< PrimExpr > shape)
 Get the default layout for the shape. More...
 

Public Attributes

ffi::Array< Itershard
 
ffi::Array< Iterreplica
 
ffi::Map< Axis, PrimExproffset
 

Additional Inherited Members

- Static Public Attributes inherited from tvm::tirx::LayoutNode
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode
 

Member Function Documentation

◆ Apply() [1/2]

ffi::Map<ffi::String, PrimExpr> tvm::tirx::TileLayoutNode::Apply ( ffi::Array< PrimExpr coord) const
finalvirtual

Apply the input coordinate and get the mapped output.

Implements tvm::tirx::LayoutNode.

◆ Apply() [2/2]

ffi::Map<ffi::String, PrimExpr> tvm::tirx::TileLayoutNode::Apply ( PrimExpr  coord) const
finalvirtual

Implements tvm::tirx::LayoutNode.

◆ Canonicalize()

Layout tvm::tirx::TileLayoutNode::Canonicalize ( ) const
finalvirtual

Turn the layout to canonical form.

Implements tvm::tirx::LayoutNode.

◆ CompatibleWithShape()

bool tvm::tirx::TileLayoutNode::CompatibleWithShape ( const ffi::Array< PrimExpr > &  shape) const
finalvirtual

Check if the layout is compatible with the shape.

Implements tvm::tirx::LayoutNode.

◆ DefaultLayout()

static TileLayout tvm::tirx::TileLayoutNode::DefaultLayout ( ffi::Array< PrimExpr shape)
static

Get the default layout for the shape.

◆ DirectSum()

Layout tvm::tirx::TileLayoutNode::DirectSum ( const TileLayout left,
const ffi::Array< PrimExpr > &  left_shape,
const ffi::Array< PrimExpr > &  right_shape 
) const
finalvirtual

Direct-sum on the tiling domain (unscaled composition) Given left layout A (grouped by left_shape) and this layout B (grouped by right_shape), construct the interleaved-domain direct sum A + B without span scaling.

Implements tvm::tirx::LayoutNode.

◆ GetScope()

ffi::Optional<Tuple<ExecScope, ExecScope> > tvm::tirx::TileLayoutNode::GetScope ( ) const

Get the scope pair of the layout.

◆ GetShardShape()

ffi::Array<PrimExpr> tvm::tirx::TileLayoutNode::GetShardShape ( ) const

Get the shape of the shard.

◆ GetSize()

PrimExpr tvm::tirx::TileLayoutNode::GetSize ( ffi::Optional< ffi::String >  axis_name = std::nullopt) const
finalvirtual

Get the size of the layout (of some axis)

Implements tvm::tirx::LayoutNode.

◆ GetSpan()

PrimExpr tvm::tirx::TileLayoutNode::GetSpan ( ffi::Optional< ffi::String >  axis_name = std::nullopt) const
finalvirtual

Get the span of the layout (of some axis)

Implements tvm::tirx::LayoutNode.

◆ HasMemoryAxis()

bool tvm::tirx::TileLayoutNode::HasMemoryAxis ( ) const

Has Memory Axis.

◆ HasThreadAxis()

bool tvm::tirx::TileLayoutNode::HasThreadAxis ( ) const

Has Thread Axis.

◆ IsDirectSumLeft()

ffi::Optional<Layout> tvm::tirx::TileLayoutNode::IsDirectSumLeft ( const Layout sum_layout,
const ffi::Array< PrimExpr > &  interleaved_shape,
const ffi::Array< PrimExpr > &  left_shape 
) const
finalvirtual

Check if this layout is the left addend A in a direct-sum A + B over the interleaved domain S_A \otimes S_B. If so, return the right layout B.

Parameters
sum_layoutThe resulting direct-sum layout
interleaved_shapeThe interleaved domain S_A \otimes S_B, i.e., [A0, B0, A1, B1, ...]
left_shapeThe shape that groups this (left) layout

Implements tvm::tirx::LayoutNode.

◆ IsDirectSumRight()

ffi::Optional<TileLayout> tvm::tirx::TileLayoutNode::IsDirectSumRight ( const Layout sum_layout,
const ffi::Array< PrimExpr > &  interleaved_shape,
const ffi::Array< PrimExpr > &  right_shape 
) const
finalvirtual

Check if this layout is the right addend B in a direct-sum A + B over the interleaved domain S_A \otimes S_B. If so, return the left layout A.

Parameters
sum_layoutThe resulting direct-sum layout
interleaved_shapeThe interleaved domain S_A \otimes S_B, i.e., [A0, B0, A1, B1, ...]
right_shapeThe shape that groups this (right) layout

Implements tvm::tirx::LayoutNode.

◆ IsTileInner()

ffi::Optional<TileLayout> tvm::tirx::TileLayoutNode::IsTileInner ( const Layout tile_layout,
const ffi::Array< PrimExpr > &  tiled_shape,
const ffi::Array< PrimExpr > &  inner_shape 
) const
finalvirtual

Check if the layout is the inner layout of a tiled layout.

Implements tvm::tirx::LayoutNode.

◆ IsTileOuter()

ffi::Optional<Layout> tvm::tirx::TileLayoutNode::IsTileOuter ( const Layout tile_layout,
const ffi::Array< PrimExpr > &  tiled_shape,
const ffi::Array< PrimExpr > &  outer_shape 
) const
finalvirtual

Check if the layout is the outer layout of a tiled layout.

Implements tvm::tirx::LayoutNode.

◆ IsTrainium()

bool tvm::tirx::TileLayoutNode::IsTrainium ( ) const

Check if the layout is trainium layout.

◆ IsTrivial()

bool tvm::tirx::TileLayoutNode::IsTrivial ( ) const

Is the layout trivial (pure memory, identical mapping)

◆ RegisterReflection()

static void tvm::tirx::TileLayoutNode::RegisterReflection ( )
inlinestatic

◆ Slice()

ffi::Optional<Layout> tvm::tirx::TileLayoutNode::Slice ( const ffi::Array< PrimExpr > &  shape,
const Region region 
) const
finalvirtual

Slice the layout with a given shape and region.

Implements tvm::tirx::LayoutNode.

◆ Tile()

Layout tvm::tirx::TileLayoutNode::Tile ( const TileLayout outer,
const ffi::Array< PrimExpr > &  outer_shape,
const ffi::Array< PrimExpr > &  inner_shape 
) const
finalvirtual

Tile the layout with an outer layout.

Implements tvm::tirx::LayoutNode.

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::tirx::TileLayoutNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "tirx.TileLayout"  ,
TileLayoutNode  ,
LayoutNode   
)

◆ VerifyWellFormed()

bool tvm::tirx::TileLayoutNode::VerifyWellFormed ( ) const
finalvirtual

Verify if the layout is well-formed.

Implements tvm::tirx::LayoutNode.

Member Data Documentation

◆ offset

ffi::Map<Axis, PrimExpr> tvm::tirx::TileLayoutNode::offset

◆ replica

ffi::Array<Iter> tvm::tirx::TileLayoutNode::replica

◆ shard

ffi::Array<Iter> tvm::tirx::TileLayoutNode::shard

The documentation for this class was generated from the following file: