ODM Tomorrow (2/4): Discuss the role of dialect attributes, merging, and propagation

Tomorrow we don’t have a presentation, instead we can follow up on the discussion started in [RFC] Implicit propagation of dialect attributes (best effort) ; I’m interested to hear what various downstream project needs have been around non-dependent attributes (attributes that aren’t specific to a particular operation).

The discussion this morning prompted me with a question. Inherent attributes vs discardable attributes: are they the same type of thing? My understanding from the meeting is that the former is allowed to change the functional behavior of an op. Discardable (as the name implies) can be safely dropped without affecting correctness. (Note that this classification is orthogonal to which dialect they are defined in.) Given this pretty clear difference, does it make sense to track them the same way? All just as “attributes”? Or would it make sense to track them separately as in each op would have operands, inherent properties (attributes), and discardable annotations (attributes)?

Just a random thought I wanted to mention. There may or may not be merit to it.

It would be possible to track and store them differently indeed, we’d have to separate them in two groups in the textual syntax though. That would also make Operation slightly heavier, and we’d have to rethink all the APIs / the accessors, which right now are all assuming a single dictionary.

FYI, just posted a patch. I landed on “intrinsic” and “annotation”. PTAL ⚙ D96093 [mlir] Introduce more intuitive wording for attributes.

Yeah, it’d be a pretty big change but does it make sense conceptually? If not, there’s no reason to worry about the practicality of the change. If so, we have to determine if the juice is worth the squeeze. (Don’t take my usage of ‘we’ as signing up for any work.) I suspect it’s not very good juice in a very hard fruit.

“Intrinsic” makes me think of compiler intrinsics, which this is not. I like “property” since they are necessary properties of ops. I don’t have a strong preference other than the rejection reasons you give.

Can you comment on the patch so we can have the discussion centralized there?

1 Like