[Mlir-commits] [mlir] [mlir][Tensor] Retain discardable attrs in pack(cast) folder (PR #115772)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Nov 13 16:38:57 PST 2024
MaheshRavishankar wrote:
> > but I dont see why just drop the attribute is any better compared to just keep the attribute. Both are equally wrong
>
> I don't think so: one is a miscompile / correctness problem, the other is a conservative / safe options. These are called _discardable_ attributes for a reason, and the reason is so that the options are absolutely not "equally wrong".
I am not sure I follow that... but maybe thats a tangent. On the same thread Chris says https://discourse.llvm.org/t/on-querying-an-operations-intrinsic-core-vs-external-user-defined-attributes/4498/10?u=maheshravishankar . Specifically
```
We can define a schema for attributes, so the attributes themselves carry information about “I am safe to implicitly propagate”. We would nail down what that exactly means, but if we had that, you could put this bit on the attributes in question and we could make the infra look for it and propagate “just these” attributes.
```
We seem to have stopped at discardable attributes and have not added "preserved attributes". The transformation does not need to worry about the semantics of these preserved attributes. In cases where it is effectively cloning the operation, you can clone the preserved attributes. If these attributes are such that the meaning changes, well that is a burden on downstream users to adapt accordingly.
https://github.com/llvm/llvm-project/pull/115772
More information about the Mlir-commits
mailing list