[mlir][linalg] `linalg.generic`: requirement for the output buffer to be written to fully?
After observing some interesting behaviour recently, I learned (from @ftynse) that there is a convention where linalg.generic operations should always write to the output buffer fully, i.e. write to every element in the buffer.
As far as I can see, the closest wording I can find that hints at this convention/behaviour on the documentation is as follows - outside of the description of the linalg.generic operation:
A linalg.generic op represents a perfectly nested loop nest that writes the entire memory region.
It is unclear what the behaviour should be when not all of the memory region has been written to. Such programs can certainly be expressed within the current IR, and these programs are not rejected by the compiler (for instance the example from the discourse post)
Should we add something to linalg.generic documentation to clarify the behaviour when the outputs are not fully written? If so, should it be undefined behaviour, or something more defined, like only "the indices written to are defined"?
@llvm/issue-subscribers-mlir-linalg
Author: Jacob Yu (pingshiyu)
As far as I can see, the closest wording I can find that hints at this convention/behaviour on the documentation is as follows - outside of the description of the linalg.generic operation:
A linalg.generic op represents a perfectly nested loop nest that writes the entire memory region.
It is unclear what the behaviour should be when not all of the memory region has been written to. Such programs can certainly be expressed within the current IR, and these programs are not rejected by the compiler (for instance the example from the discourse post)
Should we add something to linalg.generic documentation to clarify the behaviour when the outputs are not fully written? If so, should it be undefined behaviour, or something more defined, like only "the indices written to are defined"?