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

Public Member Functions

MetalLayoutAttr withGrid (::mlir::MLIRContext *context, ArrayRef< int64_t > tensorShape, GridAttr grid, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}})
 
MetalLayoutAttr withGrid (::mlir::MLIRContext *context, RankedTensorType ty, GridAttr grid, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}})
 
MetalLayoutAttr withElementType (::mlir::MLIRContext *context, Type elementType)
 
MetalLayoutAttr withMemorySpace (::mlir::MLIRContext *context, MemorySpace memorySpace)
 
MetalLayoutAttr withMemoryLayout (::mlir::MLIRContext *context, TensorMemoryLayout memLayout)
 
MetalLayoutAttr withShardShape (::mlir::MLIRContext *context, llvm::SmallVector< int64_t > shardShape)
 
uint64_t getMemrefSizeBytes () const
 
MemorySpace getMemorySpace () const
 
bool isSystemMemorySpace () const
 
bool isDeviceMemorySpace () const
 
bool hasShardedTensorMemoryLayout () const
 
bool hasInterleavedTensorMemoryLayout () const
 
bool hasShardedL1TensorMemoryLayout () const
 
bool hasInterleavedL1TensorMemoryLayout () 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) 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 MetalLayoutAttr 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 MetalLayoutAttr 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 MetalLayoutAttr get (::mlir::MLIRContext *context, RankedTensorType ty, MemorySpace memorySpace, GridAttr grid, Type elementType, TensorMemoryLayout memLayout=TensorMemoryLayout::None)
 
static MetalLayoutAttr 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.metal_layout"
 
static constexpr ::llvm::StringLiteral dialectName = "tt"
 

Member Function Documentation

◆ get() [1/4]

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

◆ get() [2/4]

static MetalLayoutAttr mlir::tt::MetalLayoutAttr::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 MetalLayoutAttr mlir::tt::MetalLayoutAttr::get ( ::mlir::MLIRContext *  context,
RankedTensorType  ty,
MemorySpace  memorySpace,
GridAttr  grid,
Type  elementType,
TensorMemoryLayout  memLayout = TensorMemoryLayout::None 
)
static

◆ get() [4/4]

static MetalLayoutAttr mlir::tt::MetalLayoutAttr::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::MetalLayoutAttr::getElementSizeBytes ( ) const

◆ getElementType()

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

◆ getGrid()

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

◆ getIdentityTileLinearMap()

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

◆ getLinear()

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

◆ getMemLayout()

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

◆ getMemorySpace()

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

◆ getMemref()

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

◆ getMemrefSizeBytes()

uint64_t mlir::tt::MetalLayoutAttr::getMemrefSizeBytes ( ) const

◆ getMnemonic()

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

◆ getOobVal()

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

◆ getPhysicalShape()

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

◆ getScalarElementType()

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

◆ getShardShape()

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

◆ getStride()

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

◆ getTiledShape()

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

◆ hasInterleavedL1TensorMemoryLayout()

bool mlir::tt::MetalLayoutAttr::hasInterleavedL1TensorMemoryLayout ( ) const

◆ hasInterleavedTensorMemoryLayout()

bool mlir::tt::MetalLayoutAttr::hasInterleavedTensorMemoryLayout ( ) const

◆ hasShardedL1TensorMemoryLayout()

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

◆ hasShardedTensorMemoryLayout()

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

◆ isDeviceMemorySpace()

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

◆ isSystemMemorySpace()

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

◆ isTiled()

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

◆ parse()

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

◆ print()

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

◆ projectOnto()

AffineMap mlir::tt::MetalLayoutAttr::projectOnto ( AffineMap  linearMap,
AffineMap  physicalMemoryMap 
) const

◆ replaceMemoryMapSymbolsWithShardShape()

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

◆ withElementType()

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

◆ withGrid() [1/2]

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

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

◆ withMemoryLayout()

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

◆ withMemorySpace()

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

◆ withShardShape()

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

Member Data Documentation

◆ dialectName

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

◆ name

constexpr ::llvm::StringLiteral mlir::tt::MetalLayoutAttr::name = "tt.metal_layout"
static

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