TT-MLIR
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
mlir::tt::LayoutAttr Class Reference
Inheritance diagram for mlir::tt::LayoutAttr:

Public Member Functions

LayoutAttr withGrid (::mlir::MLIRContext *context, ArrayRef< int64_t > tensorShape, GridAttr grid, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}})
 
LayoutAttr withGrid (::mlir::MLIRContext *context, RankedTensorType ty, GridAttr grid, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}})
 
LayoutAttr withElementType (::mlir::MLIRContext *context, Type elementType)
 
LayoutAttr withMemorySpace (::mlir::MLIRContext *context, MemorySpace memorySpace)
 
LayoutAttr withMemoryLayout (::mlir::MLIRContext *context, TensorMemoryLayout memLayout)
 
MemorySpace getMemorySpace () const
 
bool isSystemMemorySpace () const
 
bool isDeviceMemorySpace () const
 
bool hasShardedTensorMemoryLayout () const
 
bool hasShardedL1TensorMemoryLayout () const
 
bool isTiled () const
 
Type getElementType () const
 
Type getScalarElementType () const
 
uint64_t getElementSizeBytes () const
 
llvm::SmallVector< int64_t > getStride (ArrayRef< int64_t > logicalShape) const
 
llvm::SmallVector< int64_t > getPhysicalShape (ArrayRef< int64_t > logicalShape) const
 
llvm::SmallVector< int64_t > getShardShape (bool convertTileToScalar=true) const
 
AffineMap replaceMemoryMapSymbolsWithShardShape (AffineMap physicalMemoryMap) const
 
AffineMap projectOnto (AffineMap linearMap, AffineMap physicalMemoryMap, ArrayRef< int64_t > logicalTensorShape) const
 
AffineMap getIdentityTileLinearMap () const
 
llvm::SmallVector< int64_t > getTiledShape (ArrayRef< int64_t > logicalTensorShape) const
 
void print (::mlir::AsmPrinter &odsPrinter) const
 
AffineMap getLinear () const
 
OOBVal getOobVal () const
 
GridAttr getGrid () const
 
MemRefType getMemref () const
 
TensorMemoryLayout getMemLayout () const
 

Static Public Member Functions

static LayoutAttr get (::mlir::MLIRContext *context, ArrayRef< int64_t > tensorShape, Type elementType, MemorySpace memorySpace=MemorySpace::System, GridAttr grid={}, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}}, OOBVal oobVal=OOBVal::Undef, TensorMemoryLayout memLayout=TensorMemoryLayout::None)
 
static LayoutAttr get (::mlir::MLIRContext *context, RankedTensorType ty, MemorySpace memorySpace=MemorySpace::System, GridAttr grid={}, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}}, OOBVal oobVal=OOBVal::Undef, TensorMemoryLayout memLayout=TensorMemoryLayout::None)
 
static LayoutAttr get (::mlir::MLIRContext *context, RankedTensorType ty, MemorySpace memorySpace, GridAttr grid, Type elementType, TensorMemoryLayout memLayout)
 
static LayoutAttr get (::mlir::MLIRContext *context, AffineMap linear, OOBVal oob_val, GridAttr grid, MemRefType memref, TensorMemoryLayout mem_layout)
 
static constexpr ::llvm::StringLiteral getMnemonic ()
 
::mlir::Attribute parse (::mlir::AsmParser &odsParser, ::mlir::Type odsType)
 

Static Public Attributes

static constexpr ::llvm::StringLiteral name = "tt.layout"
 
static constexpr ::llvm::StringLiteral dialectName = "tt"
 

Member Function Documentation

◆ get() [1/4]

LayoutAttr mlir::tt::LayoutAttr::get ( ::mlir::MLIRContext *  context,
AffineMap  linear,
OOBVal  oob_val,
GridAttr  grid,
MemRefType  memref,
TensorMemoryLayout  mem_layout 
)
static

◆ get() [2/4]

static LayoutAttr mlir::tt::LayoutAttr::get ( ::mlir::MLIRContext *  context,
ArrayRef< int64_t >  tensorShape,
Type  elementType,
MemorySpace  memorySpace = MemorySpace::System,
GridAttr  grid = {},
ArrayRef< std::pair< std::int64_t, std::int64_t >>  collapseIntervals = {{0, -1}},
OOBVal  oobVal = OOBVal::Undef,
TensorMemoryLayout  memLayout = TensorMemoryLayout::None 
)
static

◆ get() [3/4]

static LayoutAttr mlir::tt::LayoutAttr::get ( ::mlir::MLIRContext *  context,
RankedTensorType  ty,
MemorySpace  memorySpace,
GridAttr  grid,
Type  elementType,
TensorMemoryLayout  memLayout 
)
static

◆ get() [4/4]

static LayoutAttr mlir::tt::LayoutAttr::get ( ::mlir::MLIRContext *  context,
RankedTensorType  ty,
MemorySpace  memorySpace = MemorySpace::System,
GridAttr  grid = {},
ArrayRef< std::pair< std::int64_t, std::int64_t >>  collapseIntervals = {{0, -1}},
OOBVal  oobVal = OOBVal::Undef,
TensorMemoryLayout  memLayout = TensorMemoryLayout::None 
)
static

◆ getElementSizeBytes()

uint64_t mlir::tt::LayoutAttr::getElementSizeBytes ( ) const

◆ getElementType()

Type mlir::tt::LayoutAttr::getElementType ( ) const

◆ getGrid()

GridAttr mlir::tt::LayoutAttr::getGrid ( ) const

◆ getIdentityTileLinearMap()

AffineMap mlir::tt::LayoutAttr::getIdentityTileLinearMap ( ) const

◆ getLinear()

AffineMap mlir::tt::LayoutAttr::getLinear ( ) const

◆ getMemLayout()

TensorMemoryLayout mlir::tt::LayoutAttr::getMemLayout ( ) const

◆ getMemorySpace()

MemorySpace mlir::tt::LayoutAttr::getMemorySpace ( ) const

◆ getMemref()

MemRefType mlir::tt::LayoutAttr::getMemref ( ) const

◆ getMnemonic()

static constexpr ::llvm::StringLiteral mlir::tt::LayoutAttr::getMnemonic ( )
inlinestatic

◆ getOobVal()

OOBVal mlir::tt::LayoutAttr::getOobVal ( ) const

◆ getPhysicalShape()

llvm::SmallVector<int64_t> mlir::tt::LayoutAttr::getPhysicalShape ( ArrayRef< int64_t >  logicalShape) const

◆ getScalarElementType()

Type mlir::tt::LayoutAttr::getScalarElementType ( ) const

◆ getShardShape()

llvm::SmallVector<int64_t> mlir::tt::LayoutAttr::getShardShape ( bool  convertTileToScalar = true) const

◆ getStride()

llvm::SmallVector<int64_t> mlir::tt::LayoutAttr::getStride ( ArrayRef< int64_t >  logicalShape) const

◆ getTiledShape()

llvm::SmallVector<int64_t> mlir::tt::LayoutAttr::getTiledShape ( ArrayRef< int64_t >  logicalTensorShape) const

◆ hasShardedL1TensorMemoryLayout()

bool mlir::tt::LayoutAttr::hasShardedL1TensorMemoryLayout ( ) const

◆ hasShardedTensorMemoryLayout()

bool mlir::tt::LayoutAttr::hasShardedTensorMemoryLayout ( ) const

◆ isDeviceMemorySpace()

bool mlir::tt::LayoutAttr::isDeviceMemorySpace ( ) const
inline

◆ isSystemMemorySpace()

bool mlir::tt::LayoutAttr::isSystemMemorySpace ( ) const
inline

◆ isTiled()

bool mlir::tt::LayoutAttr::isTiled ( ) const

◆ parse()

mlir::Attribute mlir::tt::LayoutAttr::parse ( ::mlir::AsmParser &  odsParser,
::mlir::Type  odsType 
)
static

◆ print()

void mlir::tt::LayoutAttr::print ( ::mlir::AsmPrinter &  odsPrinter) const

◆ projectOnto()

AffineMap mlir::tt::LayoutAttr::projectOnto ( AffineMap  linearMap,
AffineMap  physicalMemoryMap,
ArrayRef< int64_t >  logicalTensorShape 
) const

◆ replaceMemoryMapSymbolsWithShardShape()

AffineMap mlir::tt::LayoutAttr::replaceMemoryMapSymbolsWithShardShape ( AffineMap  physicalMemoryMap) const

◆ withElementType()

LayoutAttr mlir::tt::LayoutAttr::withElementType ( ::mlir::MLIRContext *  context,
Type  elementType 
)

◆ withGrid() [1/2]

LayoutAttr mlir::tt::LayoutAttr::withGrid ( ::mlir::MLIRContext *  context,
ArrayRef< int64_t >  tensorShape,
GridAttr  grid,
ArrayRef< std::pair< std::int64_t, std::int64_t >>  collapseIntervals = {{0, -1}} 
)

◆ withGrid() [2/2]

LayoutAttr mlir::tt::LayoutAttr::withGrid ( ::mlir::MLIRContext *  context,
RankedTensorType  ty,
GridAttr  grid,
ArrayRef< std::pair< std::int64_t, std::int64_t >>  collapseIntervals = {{0, -1}} 
)

◆ withMemoryLayout()

LayoutAttr mlir::tt::LayoutAttr::withMemoryLayout ( ::mlir::MLIRContext *  context,
TensorMemoryLayout  memLayout 
)

◆ withMemorySpace()

LayoutAttr mlir::tt::LayoutAttr::withMemorySpace ( ::mlir::MLIRContext *  context,
MemorySpace  memorySpace 
)

Member Data Documentation

◆ dialectName

constexpr ::llvm::StringLiteral mlir::tt::LayoutAttr::dialectName = "tt"
static

◆ name

constexpr ::llvm::StringLiteral mlir::tt::LayoutAttr::name = "tt.layout"
static

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