Update Regor to enable graph optimization hooks
Regor graph optimizations are statically declared as an array of optimization step C++ functions. The declaration can be found in tflite_graph_optimiser.hpp
Our request is as follow:
-
Provide a hook to add additional graph optimization steps at compile time (currently
TFLiteGraphOptimiser
functions implemented in tflite_graph_optimiser.cpp). -
Provide a path to easily link third-party graph optimization functions alongside the base set.
We want to be minimally prescriptive here, and allow Arm to steer the final design.
We envision a hook adding graph rewrite functions that takes as as arguments:
- A
RewriteFunctions<TFLiteGraphOptimiser>
from an external definition. These structs group both an optional tensor rewrite function and an operator rewrite function. - A potential ordering argument (e.g. an enum or a relative position) describing the relative order in which the provided new graph optimization function should be executed.
With these two inputs, we should be able to build Regor and execute the sequence of optimizations resulting in a customized output.
Edited by Congregate Migrate