# eIQ Neutron The targeted **TF Lite** model is converted using the **{doc}`Neutron Converter <../../softwareTools/NeutronConverter>` ** tool on the host PC in order to obtain a custom **TFLite** model. * * * **Flow 1** is the most common flow for eIQ Neutron and is applicable to models which are partially and fully converted. This flow is similar to the eIQ Neutron-S Flow 1 except it uses a eIQ Neutron platform that only has 1 Neutron core with no dedicated controller, TCM, Data Mover. The major distinctions from the eIQ Neutron-S flow are: - Since there is no dedicated controller for programming the Neutron core, the target CPU which is the main application processor must also spend time in coordinating Neutron execution. This means that the target CPU must also run the Neutron Firmware component. - The Neutron Driver and Neutron Firmware run on the same core and so they must employ a mechanism for intra-core communication. This means basically linking the Neutron Driver and Neutron Firmware libraries together and having the Neutron Driver call functions directly from the Neutron Firmware. The symbols between the two libraries are linked directly without requiring extra glue code, making the integration seamless. - Another major distinction from Neutron-S flow is that the kernels are no longer produced by the Neutron-Converter dynamically, for each model. Instead all the kernels (Neutron-Library) are linked inside the Firmware monolith which will have the availability of running any kernel the microcode requires for any model. ```{figure} images/eiq_neutron_inference_flow1.png :name: fig-neutron-inference-flow1 :width: 776px eIQ Neutron inference standard flow, for partially and fully converted models ``` What is specific to this flow is: - The inference is controlled by the CPU. - The model can be fully or partly executed by Neutron. - Parts of the graph that are not supported by Neutron can be offloaded by the inference engine to CPU, potentially using SW acceleration from an optimized library (for example CMSIS-NN for Cortex-M). * * * **Flow 2** is applicable to models **fully converted**, no CPU fallback is possible. - This flow can be used when the entire graph is supported by Neutron (the entire graph collapses to a single NeutronGraph container) and hence no CPU fallback is required. In this case the inference engine can be removed altogether because it provides no functionality and instead only adds unnecessary latency. - The Neutron Converter will provide directly the microcode/weights as raw buffers to the application. - The application will provide directly the microcode, weights and input/output buffers to the Neutron Driver. This will improve the latency of the model execution because the extra indirection of the inference engine is removed. ```{figure} images/eiq_neutron_inference_flow2.png :name: fig-neutron-inference-flow2 :width: 776px eIQ Neutron inference flow without inference engine, for fully converted models ``` What is specific to this flow is: - The inference is controlled by the CPU. - The model is fully executed by Neutron, no CPU fallback. - No inference engine is used.