The affine_apply operation is currently "doubly" affine and conflates two things:1. it applies an affine map to a list of values of type `index` that are defined as either dim or symbol2. it restricts (and propagates constraints on) the provenance of dims and symbols to a small subset of ops for which more restrictive polyhedral constraints.Point 2. is related to the ability to form so-called static control parts and is related to dependence analysis and legality of transformations.Point 1. however is completely independent, the only local implication of dims and symbol for affine_apply is that dims compose while symbols concatenate as well the structural constraint that dims may not be multiplied.The properties of composition and canonicalization in affine_apply are more generally useful for the std dialect.This is a higher-level abstraction for arithmetic expressions, irrespective of what is useful for polyhedral style analysis.
It seems affine_apply would be a good candidate to be moved to std assuming the restrictions can be successfully lifted from the op without breaking affine analyses.
Another possibility would be to also have a std.apply operation.However this would result in quite some code duplication for little envisioned benefits (i.e. it is unclear a generalization of affine_apply would be useful in the absence of examples).
What are people's thoughts on this?
--
You received this message because you are subscribed to the Google Groups "MLIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/mlir/72b9953e-2d7c-498f-86a8-949d247ce8b1%40tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to mlir+unsubscribe@tensorflow.org.
The affine_apply operation is currently "doubly" affine and conflates two things:1. it applies an affine map to a list of values of type `index` that are defined as either dim or symbol2. it restricts (and propagates constraints on) the provenance of dims and symbols to a small subset of ops for which more restrictive polyhedral constraints.Point 2. is related to the ability to form so-called static control parts and is related to dependence analysis and legality of transformations.Point 1. however is completely independent, the only local implication of dims and symbol for affine_apply is that dims compose while symbols concatenate as well the structural constraint that dims may not be multiplied.The properties of composition and canonicalization in affine_apply are more generally useful for the std dialect.
This is a higher-level abstraction for arithmetic expressions, irrespective of what is useful for polyhedral style analysis.It seems affine_apply would be a good candidate to be moved to std assuming the restrictions can be successfully lifted from the op without breaking affine analyses.
Another possibility would be to also have a std.apply operation.However this would result in quite some code duplication for little envisioned benefits (i.e. it is unclear a generalization of affine_apply would be useful in the absence of examples).What are people's thoughts on this?
On Fri, Oct 18, 2019 at 1:19 PM 'Nicolas Vasilache' via MLIR <ml...@tensorflow.org> wrote:The affine_apply operation is currently "doubly" affine and conflates two things:1. it applies an affine map to a list of values of type `index` that are defined as either dim or symbol2. it restricts (and propagates constraints on) the provenance of dims and symbols to a small subset of ops for which more restrictive polyhedral constraints.Point 2. is related to the ability to form so-called static control parts and is related to dependence analysis and legality of transformations.Point 1. however is completely independent, the only local implication of dims and symbol for affine_apply is that dims compose while symbols concatenate as well the structural constraint that dims may not be multiplied.The properties of composition and canonicalization in affine_apply are more generally useful for the std dialect.This is a higher-level abstraction for arithmetic expressions, irrespective of what is useful for polyhedral style analysis.It seems affine_apply would be a good candidate to be moved to std assuming the restrictions can be successfully lifted from the op without breaking affine analyses.I don't really understand why would affine.apply need to move to std? What is limiting in having it in the affine dialect?
Another possibility would be to also have a std.apply operation.However this would result in quite some code duplication for little envisioned benefits (i.e. it is unclear a generalization of affine_apply would be useful in the absence of examples).What are people's thoughts on this?I am not sure I totally understand the proposal: would std.apply operate on an affine map? (in which case I have strong concerns about this: our most recent discussions are about making std dialect thinner, and decouple affine maps from core to move these into the affine dialect, and it seems to goes against it).
Or would std.apply operate the arithmetic operations in the std dialect?
Would it take a region? Can you provide an example about how would this work?
Thanks,--Mehdi