[Mlir-commits] [mlir] [mlir][linalg] Emit a warning when tiling using forall generates non thread-safe code (PR #80813)

Pablo Antonio Martinez llvmlistbot at llvm.org
Tue Feb 27 00:49:27 PST 2024


pabloantoniom wrote:

> Thanks for spending effort on describing what you're doing in the description, however:
> 
> > This PR detects whether it's safe to tile_using_forall and emits a warning in the case it is not.
> 
> I don't find in the description a motivation for this change right now. Why is a warning a good thing here?

The motivation behind this change is to complement the comment in the documentation that says:

"_It is the user’s responsibility to ensure that num_threads/tile_sizes is a valid tiling specification (i.e. that only tiles parallel dimensions, e.g. in the Linalg case)._"

because:

1. Not all users of `tile_using_forall` know that tiling the wrong dimension/s (e.g., a non-parallel dimension) will generate non thread-safe code (like me a few months ago), so a warning will inform the user about it.
2. Users of `tile_using_forall` may know this limitation, but they may not realise that they are tiling a non-parallel dimension (like me a few weeks ago), so the warning may help those users in the debugging process.

https://github.com/llvm/llvm-project/pull/80813


More information about the Mlir-commits mailing list