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

Public Member Functions

uint64_t getShardSizeInBytes () const
 
BufferType getBufferType () const
 
TTNNLayoutAttr withGrid (::mlir::MLIRContext *context, ArrayRef< int64_t > tensorShape, GridAttr grid, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}})
 
TTNNLayoutAttr withGrid (::mlir::MLIRContext *context, RankedTensorType ty, GridAttr grid, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}})
 
TTNNLayoutAttr withElementType (::mlir::MLIRContext *context, Type elementType)
 
TTNNLayoutAttr withBufferType (::mlir::MLIRContext *context, BufferType bufferType)
 
TTNNLayoutAttr withMemoryLayout (::mlir::MLIRContext *context, TensorMemoryLayout memLayout)
 
TTNNLayoutAttr withShardShape (::mlir::MLIRContext *context, llvm::SmallVector< int64_t > shardShape)
 
bool isSystemBufferType () const
 
bool isDeviceBufferType () const
 
bool hasShardedTensorMemoryLayout () const
 
bool hasShardedL1TensorMemoryLayout () const
 
bool hasInterleavedL1TensorMemoryLayout () const
 
bool isTiled () const
 
Type getElementType () const
 
DataType getDataTypeFromMemRef () const
 
uint64_t getElementSizeBytes () const
 
int64_t getTensorSizeInBytes (ArrayRef< int64_t > tensorShape, ::mlir::tt::DeviceAttr device) 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) const
 
AffineMap getIdentityTileLinearMap () const
 
llvm::SmallVector< int64_t > getTiledShape (ArrayRef< int64_t > logicalTensorShape) const
 
void print (::mlir::AsmPrinter &odsPrinter) const
 
AffineMap getLinear () const
 
GridAttr getGrid () const
 
MemRefType getMemref () const
 
TensorMemoryLayout getMemLayout () const
 

Static Public Member Functions

static TTNNLayoutAttr get (::mlir::MLIRContext *context, ArrayRef< int64_t > tensorShape, Type elementType, BufferType bufferType, GridAttr grid, TensorMemoryLayout memoryLayout, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}})
 
static TTNNLayoutAttr get (::mlir::MLIRContext *context, AffineMap linear, 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 = "ttnn.ttnn_layout"
 
static constexpr ::llvm::StringLiteral dialectName = "ttnn"
 

Member Function Documentation

◆ get() [1/2]

TTNNLayoutAttr mlir::tt::ttnn::TTNNLayoutAttr::get ( ::mlir::MLIRContext *  context,
AffineMap  linear,
GridAttr  grid,
MemRefType  memref,
TensorMemoryLayout  mem_layout 
)
static

◆ get() [2/2]

static TTNNLayoutAttr mlir::tt::ttnn::TTNNLayoutAttr::get ( ::mlir::MLIRContext *  context,
ArrayRef< int64_t >  tensorShape,
Type  elementType,
BufferType  bufferType,
GridAttr  grid,
TensorMemoryLayout  memoryLayout,
ArrayRef< std::pair< std::int64_t, std::int64_t >>  collapseIntervals = {{0, -1}} 
)
static

◆ getBufferType()

BufferType mlir::tt::ttnn::TTNNLayoutAttr::getBufferType ( ) const

◆ getDataTypeFromMemRef()

DataType mlir::tt::ttnn::TTNNLayoutAttr::getDataTypeFromMemRef ( ) const

◆ getElementSizeBytes()

uint64_t mlir::tt::ttnn::TTNNLayoutAttr::getElementSizeBytes ( ) const

◆ getElementType()

Type mlir::tt::ttnn::TTNNLayoutAttr::getElementType ( ) const

◆ getGrid()

GridAttr mlir::tt::ttnn::TTNNLayoutAttr::getGrid ( ) const

◆ getIdentityTileLinearMap()

AffineMap mlir::tt::ttnn::TTNNLayoutAttr::getIdentityTileLinearMap ( ) const

◆ getLinear()

AffineMap mlir::tt::ttnn::TTNNLayoutAttr::getLinear ( ) const

◆ getMemLayout()

TensorMemoryLayout mlir::tt::ttnn::TTNNLayoutAttr::getMemLayout ( ) const

◆ getMemref()

MemRefType mlir::tt::ttnn::TTNNLayoutAttr::getMemref ( ) const

◆ getMnemonic()

static constexpr ::llvm::StringLiteral mlir::tt::ttnn::TTNNLayoutAttr::getMnemonic ( )
inlinestatic

◆ getPhysicalShape()

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

◆ getShardShape()

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

◆ getShardSizeInBytes()

uint64_t mlir::tt::ttnn::TTNNLayoutAttr::getShardSizeInBytes ( ) const

◆ getStride()

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

◆ getTensorSizeInBytes()

int64_t mlir::tt::ttnn::TTNNLayoutAttr::getTensorSizeInBytes ( ArrayRef< int64_t >  tensorShape,
::mlir::tt::DeviceAttr  device 
) const

◆ getTiledShape()

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

◆ hasInterleavedL1TensorMemoryLayout()

bool mlir::tt::ttnn::TTNNLayoutAttr::hasInterleavedL1TensorMemoryLayout ( ) const

◆ hasShardedL1TensorMemoryLayout()

bool mlir::tt::ttnn::TTNNLayoutAttr::hasShardedL1TensorMemoryLayout ( ) const

◆ hasShardedTensorMemoryLayout()

bool mlir::tt::ttnn::TTNNLayoutAttr::hasShardedTensorMemoryLayout ( ) const

◆ isDeviceBufferType()

bool mlir::tt::ttnn::TTNNLayoutAttr::isDeviceBufferType ( ) const
inline

◆ isSystemBufferType()

bool mlir::tt::ttnn::TTNNLayoutAttr::isSystemBufferType ( ) const
inline

◆ isTiled()

bool mlir::tt::ttnn::TTNNLayoutAttr::isTiled ( ) const

◆ parse()

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

◆ print()

void mlir::tt::ttnn::TTNNLayoutAttr::print ( ::mlir::AsmPrinter &  odsPrinter) const

◆ projectOnto()

AffineMap mlir::tt::ttnn::TTNNLayoutAttr::projectOnto ( AffineMap  linearMap,
AffineMap  physicalMemoryMap 
) const

◆ replaceMemoryMapSymbolsWithShardShape()

AffineMap mlir::tt::ttnn::TTNNLayoutAttr::replaceMemoryMapSymbolsWithShardShape ( AffineMap  physicalMemoryMap) const

◆ withBufferType()

TTNNLayoutAttr mlir::tt::ttnn::TTNNLayoutAttr::withBufferType ( ::mlir::MLIRContext *  context,
BufferType  bufferType 
)

◆ withElementType()

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

◆ withGrid() [1/2]

TTNNLayoutAttr mlir::tt::ttnn::TTNNLayoutAttr::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]

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

◆ withMemoryLayout()

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

◆ withShardShape()

TTNNLayoutAttr mlir::tt::ttnn::TTNNLayoutAttr::withShardShape ( ::mlir::MLIRContext *  context,
llvm::SmallVector< int64_t >  shardShape 
)

Member Data Documentation

◆ dialectName

constexpr ::llvm::StringLiteral mlir::tt::ttnn::TTNNLayoutAttr::dialectName = "ttnn"
static

◆ name

constexpr ::llvm::StringLiteral mlir::tt::ttnn::TTNNLayoutAttr::name = "ttnn.ttnn_layout"
static

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