You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the dispatch region creation use the shape inference interface to get workload values #5041
When the workload depends on the shape of the result of an operation, directly using the shape of the result will not make the operation that was cloned into the dispatch dead. So far we have been relying on canonicalizations to resolve the shape of the output in terms of shape of the input. This issue is to not use the shape of the output, but rather use the values computed using the interface which returns the shape in terms of shape of the inputs.
An initial implementation of the interface to use is here. But due to some upstream discussions the current decision is to land something like that in Linalg dialect for now.
I think this may help with that when made transitive: asking for the shape of the outputs should recursively ask for the shapes based on op inputs until some unfoldable op is reached. This happens by construction in that PR for the IREE shape-carrying ops as there will never be an std.dim inserted as the SSA values for each dim are always materialized and can be referenced. How that works here with linalg will be the trick. I think it will all work out so long as all of the IR inserted only ever depends on non-tensor values: if IR is inserted that does an std.dim on an input tensor that is then later pulled into the region, that'll explode.
changed the title [-]Make the dispatch region creation use the shape inference interface in https://reviews.llvm.org/D97887 to get workload values[/-][+]Make the dispatch region creation use the shape inference interface to get workload values[/+]on Mar 10, 2021
Activity
benvanik commentedon Mar 10, 2021
awesome! This is what I'm currently using, which has the domination issues because buildOrFindDynamicDimsForValue can end up inserting IR that uses the input values (for std.dim and such, and not just their shapes), and then during the dispatch region formation loop those input values may get pulled into the dispatch region:
https://github.com/google/iree/pull/4881/files#diff-82293d824c87cda5526d05e124e505f62abe7c5f8d85a53c791b9f5217bdfd8eR526-R532
and
https://github.com/google/iree/pull/4881/files#diff-82293d824c87cda5526d05e124e505f62abe7c5f8d85a53c791b9f5217bdfd8eR628-R633
I think this may help with that when made transitive: asking for the shape of the outputs should recursively ask for the shapes based on op inputs until some unfoldable op is reached. This happens by construction in that PR for the IREE shape-carrying ops as there will never be an std.dim inserted as the SSA values for each dim are always materialized and can be referenced. How that works here with linalg will be the trick. I think it will all work out so long as all of the IR inserted only ever depends on non-tensor values: if IR is inserted that does an std.dim on an input tensor that is then later pulled into the region, that'll explode.
[-]Make the dispatch region creation use the shape inference interface in https://reviews.llvm.org/D97887 to get workload values[/-][+]Make the dispatch region creation use the shape inference interface to get workload values[/+]MaheshRavishankar commentedon May 4, 2021
Closing. This is done now.