[Mlir-commits] [mlir] [MLIR] MPI: add `count` optional argument to communication ops (PR #129095)
Frank Schlimbach
llvmlistbot at llvm.org
Fri Feb 28 00:50:20 PST 2025
fschlimb wrote:
It's not clear to me how the additional `count` would make anything better, except maybe for very special cases.
It seems difficult to define clean semantics to a count argument unless the input memref is guaranteed to be 1d (and possibly non-strided). Restricting the allowed input memref type could be a possible route to simplify the lowering (but puts more burden on the producer). But I do not see that the count would be really helpful.
The general form for communicating only a subset is using a subview before calling MPI:
- a count does not provide strides (only allows a stride of 1)
- a count does not provide an offset (only allows selecting the first n elements)
The lowering needs to handle non-contiguous memrefs no matter what (not yet, though).
Also, existing lowering to LLVM does not depend on static shapes, so the count would not make a difference. Where else do you see an explicit count operand be useful?
https://github.com/llvm/llvm-project/pull/129095
More information about the Mlir-commits
mailing list