|
MLIR 23.0.0git
|
Base class for resharding patterns. More...
Public Member Functions | |
| virtual | ~ReshardingPattern ()=default |
| virtual std::optional< std::tuple< TypedValue< ShapedType >, Sharding > > | tryApply (ImplicitLocOpBuilder &builder, GridOp grid, int64_t tensorDim, const Sharding &srcSharding, const Sharding &tgtSharding, ShapedType srcUnshardedType, TypedValue< ShapedType > srcShard)=0 |
| Try to apply this resharding pattern. | |
Static Protected Member Functions | |
| static bool | hasStaticOffsets (const Sharding &srcSharding, const Sharding &tgtSharding) |
| Returns true if either sharding has non-empty static sharded dims offsets. | |
| static bool | hasStaticOffsetsOrHalos (const Sharding &srcSharding, const Sharding &tgtSharding) |
| Returns true if either sharding has non-empty static sharded dims offsets or non-empty static halo sizes. | |
Base class for resharding patterns.
Subclasses implement tryApply to detect and apply a specific resharding.
Definition at line 51 of file Partition.cpp.
|
virtualdefault |
|
inlinestaticprotected |
Returns true if either sharding has non-empty static sharded dims offsets.
Definition at line 65 of file Partition.cpp.
References mlir::shard::Sharding::getStaticShardedDimsOffsets().
Referenced by mlir::shard::UpdateHaloPattern::tryApply().
|
inlinestaticprotected |
Returns true if either sharding has non-empty static sharded dims offsets or non-empty static halo sizes.
Definition at line 73 of file Partition.cpp.
Referenced by mlir::shard::MoveSplitAxisPattern::tryApply(), mlir::shard::SplitLastAxisPattern::tryApply(), and mlir::shard::UnsplitLastAxesPattern::tryApply().
|
pure virtual |
Try to apply this resharding pattern.
Returns the resharded value and resulting sharding on success, or std::nullopt if the pattern doesn't match.
Implemented in mlir::shard::MoveSplitAxisPattern, mlir::shard::SplitLastAxisPattern, mlir::shard::UnsplitLastAxesPattern, and mlir::shard::UpdateHaloPattern.