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 withShardShape (::mlir::MLIRContext *context, llvm::SmallVector< int64_t > shardShape)
 
MetalLayoutAttr withStreamLayout (::mlir::MLIRContext *context, StreamLayoutAttr stream)
 
uint64_t getMemrefSizeBytes () const
 
MemorySpace getMemorySpace () const
 
bool isSystemMemorySpace () const
 
bool isDeviceMemorySpace () 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
 
llvm::SmallVector< int64_t > getShardStride () 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
 
MemRefType getBufferType () const
 
void print (::mlir::AsmPrinter &odsPrinter) const
 
AffineMap getLinear () const
 
OOBVal getOobVal () const
 
GridAttr getGrid () const
 
MemRefType getMemref () const
 

Static Public Member Functions

static MetalLayoutAttr get (::mlir::MLIRContext *context, RankedTensorType ty, uint64_t gridRank, bool tiled=false, MemorySpace memorySpace=MemorySpace::System, ArrayRef< std::pair< std::int64_t, std::int64_t >> collapseIntervals={{0, -1}}, OOBVal oobVal=OOBVal::Undef)
 
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)
 
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)
 
static MetalLayoutAttr get (::mlir::MLIRContext *context, RankedTensorType ty, MemorySpace memorySpace, GridAttr grid, Type elementType)
 
static MetalLayoutAttr get (::mlir::MLIRContext *context, AffineMap linear, OOBVal oob_val, GridAttr grid, MemRefType memref)
 
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/5]

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

◆ get() [2/5]

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 
)
static

◆ get() [3/5]

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

◆ get() [4/5]

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 
)
static

◆ get() [5/5]

static MetalLayoutAttr mlir::tt::MetalLayoutAttr::get ( ::mlir::MLIRContext *  context,
RankedTensorType  ty,
uint64_t  gridRank,
bool  tiled = false,
MemorySpace  memorySpace = MemorySpace::System,
ArrayRef< std::pair< std::int64_t, std::int64_t >>  collapseIntervals = {{0, -1}},
OOBVal  oobVal = OOBVal::Undef 
)
static

◆ getBufferType()

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

◆ 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

◆ 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

◆ getShardStride()

llvm::SmallVector<int64_t> mlir::tt::MetalLayoutAttr::getShardStride ( ) 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

◆ 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}} 
)

◆ 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 
)

◆ withStreamLayout()

MetalLayoutAttr mlir::tt::MetalLayoutAttr::withStreamLayout ( ::mlir::MLIRContext *  context,
StreamLayoutAttr  stream 
)

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: