[BYOC] Remove kCompiler attr from external functions (#5615)
authorlhutton1 <35535092+lhutton1@users.noreply.github.com>
Mon, 18 May 2020 17:47:56 +0000 (18:47 +0100)
committerGitHub <noreply@github.com>
Mon, 18 May 2020 17:47:56 +0000 (10:47 -0700)
commit3be9576d90d8fe4bca65e391889860a331df4e06
tree336782c2f05cb5ffd72427d75775e85d496b1a72
parent2594f17a888fe5f07be81c53e01eff9a4f241b2a
[BYOC] Remove kCompiler attr from external functions (#5615)

Functions destined for external codegen keep their kCompiler attribute which means SkipFunction returns true when running a pass over such functions during the codegen step. This makes sense during graph partitioning, however when lowering the functions for codegen the is no reason to keep this behaviour.

Allowing this behaviour will mean a codegen can run a pass on functions only intended for one 3rd party library. Specifically, allowing pre-processing of a series of sub-graphs right before it is passes through codegen. This helps ensure that the functions destined for the 3rd party library are in the expected format. For example, we may want to ensure that these functions have a kernel layout of OHWI because the 3rd party library only supports OHWI. This wouldn't be possible before partitioning the graph as we don't know how the graph will be partitioned ahead of time.

Change-Id: Ia68b9da335ef1acfc405a8528aac823de60a65c2
src/relay/backend/compile_engine.cc