MLIR  19.0.0git
Macros | Functions
ShardingInterface.cpp File Reference
#include "mlir/Dialect/Mesh/Interfaces/ShardingInterface.h"
#include "mlir/Dialect/Mesh/Interfaces/ShardingInterfaceImpl.h"
#include "mlir/Dialect/Mesh/IR/MeshOps.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Support/Debug.h"
#include <utility>
#include "mlir/Dialect/Mesh/Interfaces/ShardingInterface.cpp.inc"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "sharding-interface"
 
#define DBGS()   (llvm::dbgs() << "[" DEBUG_TYPE << "]: ")
 

Functions

static LogicalResult checkOperandAffineExprRecursively (AffineExpr expr, SmallVectorImpl< bool > &seenIds)
 
static FailureOr< llvm::SmallSet< unsigned, 2 > > checkOperandAffineExpr (AffineExpr expr, unsigned numDims)
 
static LogicalResult addShardOp (OpBuilder &b, OpResult result, const ShardingOption &shardingOption, AffineMap map, ArrayRef< utils::IteratorType > loopTypes, ArrayRef< ReductionKind > reductionLoopKinds)
 
static LogicalResult addShardOp (OpBuilder &b, OpOperand &opOperand, const ShardingOption &shardingOption, AffineMap map)
 
static bool isValueCompatibleWithFullReplicationSharding (Value value, MeshShardingAttr sharding)
 
template<typename ValueRange , typename MeshShardingAttrRage >
static bool areValuesCompatibleWithFullReplicationShardings (ValueRange &&values, MeshShardingAttrRage &&shardings)
 
static void updateMeshAxisAssignmentForLoopIterators (ArrayRef< MeshAxis > meshAxesAssignmentForTensorAxis, AffineExpr indexingExpr, SmallVector< std::optional< SmallVector< MeshAxis >>> &meshAxesAssignmentForLoopIterators)
 

Macro Definition Documentation

◆ DBGS

#define DBGS ( )    (llvm::dbgs() << "[" DEBUG_TYPE << "]: ")

Definition at line 24 of file ShardingInterface.cpp.

◆ DEBUG_TYPE

#define DEBUG_TYPE   "sharding-interface"

Definition at line 23 of file ShardingInterface.cpp.

Function Documentation

◆ addShardOp() [1/2]

static LogicalResult addShardOp ( OpBuilder b,
OpOperand opOperand,
const ShardingOption shardingOption,
AffineMap  map 
)
static

◆ addShardOp() [2/2]

static LogicalResult addShardOp ( OpBuilder b,
OpResult  result,
const ShardingOption shardingOption,
AffineMap  map,
ArrayRef< utils::IteratorType >  loopTypes,
ArrayRef< ReductionKind >  reductionLoopKinds 
)
static

◆ areValuesCompatibleWithFullReplicationShardings()

template<typename ValueRange , typename MeshShardingAttrRage >
static bool areValuesCompatibleWithFullReplicationShardings ( ValueRange &&  values,
MeshShardingAttrRage &&  shardings 
)
static

◆ checkOperandAffineExpr()

static FailureOr<llvm::SmallSet<unsigned, 2> > checkOperandAffineExpr ( AffineExpr  expr,
unsigned  numDims 
)
static

◆ checkOperandAffineExprRecursively()

static LogicalResult checkOperandAffineExprRecursively ( AffineExpr  expr,
SmallVectorImpl< bool > &  seenIds 
)
static

◆ isValueCompatibleWithFullReplicationSharding()

static bool isValueCompatibleWithFullReplicationSharding ( Value  value,
MeshShardingAttr  sharding 
)
static

◆ updateMeshAxisAssignmentForLoopIterators()

static void updateMeshAxisAssignmentForLoopIterators ( ArrayRef< MeshAxis meshAxesAssignmentForTensorAxis,
AffineExpr  indexingExpr,
SmallVector< std::optional< SmallVector< MeshAxis >>> &  meshAxesAssignmentForLoopIterators 
)
static