Commit Graph

4 Commits

Author SHA1 Message Date
RJ Ascani 85d9b04659 codegen: Remove preprocessor (#2355)
The original idea for the codegen preprocessor was to perform init & prepare stages using a simulator and capture the output. This idea is being abandoned in favor of generating the necessary structures from python.

BUG=cleanup
2026-04-20 14:47:56 +08:00
RJ Ascani 77e2cdbdd6
Create codegen_preprocessor (#2219) 2023-09-14 13:08:49 -07:00
RJ Ascani a0f8970856
Generate op table and subgraph invoke functions (#2176)
As the next step in the codegen experiment, we want to generate the invoke calls for each layer. This is slightly challenging with the existing sources, as kernels only expose a registration function, not their individual Eval functions. In an effort to keep the code churn to a minimum, this PR introduces an inference only registration structure and function. It includes just two function pointers: invoke and reset. For this CL, we've only introduced it for FullyConnected.

In the code generator, this PR creates a new op_table array in the generated source, with an enum for lookup. It also generates an invoke function for each subgraph, that calls each operator's invoke function.

BUG=295174388
2023-08-18 20:38:16 +00:00
RJ Ascani 901d8306e5
Add code generator experiment (#2162)
This PR creates the initial code generator scaffolding for performing inference without an interpreter. Currently, this does nothing other create a header and source file from Mako templates. Mako was chosen as a template engine due to existing dependency.

BUG=b/295076487
2023-08-10 18:48:59 +00:00