Hi, suppose I have a set of external functions created with the BYOC flow. Currently I disable AlterOpLayout
pass, so everything is in the NCHW layout. I want to achieve the following:
- All extern functions take and output NCHWc value
- Ops that I fall back to CPU should also use and keep NCHWc layout as much as possible using existing infra in Relay and topi.
How should I do this? Since AlterOpLayout
seems to be something to be used with topi, I think this is not what I’m looking for. There is also ConvertLayout
pass, but from briefly looking at this interface it seems to work by op-by-op fashion.
I want to be able to say
- For all calls to functions marked with a particular compiler, treat them as if it was a single op that takes and outputs NCHWc layout
- Other ops should be layout-transformed according to AlterOpLayout