-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][mesh] Shardingcontrol #102598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mlir][mesh] Shardingcontrol #102598
Conversation
Adding halo_sizes and shard_dims_sizes to sharding. First spmdization of halo annotated sharding
/llvm-project/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp:182:16: error: unused variable 'inAxis' [-Werror,-Wunused-variable] auto inAxis = dimSz % inShape.size(); ^
The cleanest structure is probably at the Func dilaect extensions. It is not critical to make it like that now as everything in Mesh already depends on the Tensor dialect. But in general the mesh dialect itself and the general transforms like sharding propagation and spmdization should also only depend on |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/35/builds/1822 Here is the relevant piece of the build log for the reference:
|
…ion lib (#104913) Follow-up to #102598 : as discussed, move tensor sharding implementation into separate tensor extension lib. @sogartar @yaochengji, could you take a look at this PR?
…ion lib (llvm#104913) Follow-up to llvm#102598 : as discussed, move tensor sharding implementation into separate tensor extension lib. @sogartar @yaochengji, could you take a look at this PR?
This is a fixed copy of #98145 (necessary after it got reverted).
@sogartar @yaochengji
This PR adds the following to #98145:
UpdateHaloOp
accepts amemref
(instead of a tensor) and not returning a result to clarify its inplace-semanticsUpdateHaloOp
acceptssplit_axis
to allow multiple mesh-axes per tensor/memref-axis (similar tomesh.sharding
)Shardinginterface
for tensor operation (tensor.empty
for now) moved from the tensor library to the mesh interface library.spmdize
uses features frommesh
dialect. @rengolin agreed thattensor
should not depend onmesh
so this functionality cannot live in atensor
s lib. The unfulfilled dependency caused the issues leading to reverting [mlir][mesh] adding shard-size control #98145. Such cases are generally possible and might lead to re-considering the current structure (like for tosa ops).Replacing
#mesh.sharding
attribute with operationmesh.sharding
halo_sizes
andsharded_dims_sizes
mesh::MeshSharding
What previously was
is now
and allows additional annotations to control the shard sizes:
mesh.shard
op accepts additional optional attributeforce
, useful for halo updatestensor.empty
reacting onsharded_dims_sizes
andhalo_sizes
in the shardingmesh.update_halo
as a spmdized target for shardings withhalo_sizes