How mit-han-lab/tinyengine works
Code Generator Module (Python)
• Location: The “code_generator” directory.
• Purpose: This module takes TFLite or other neural network graphs as input and converts them into optimized low‐level C/C++ source code that is tailored for the TinyEngine runtime.
• Subcomponents: It includes converters, operator templates (found in codetemplate), allocators, and parser utilities.
TinyEngine Inference Library Module (C/C++ Runtime)
• Location: “TinyEngine” directory.
• Purpose: This is the runtime core that contains all the operator implementations (organized in subdirectories like kernels, both fp_ and int_ operators) and integrates third-party components (e.g., CMSIS code) to deploy the network on microcontrollers.
• Interaction: Show that the generated code from the Code Generator is integrated/linked with TinyEngine’s runtime kernels. Also indicate that TinyEngine implements the key inference optimizations to reduce peak memory, improve MAC/s, and handle patch-based scheduling.
Deployment/Examples and Tutorial Module
• Location: “examples” and “tutorial” directories.
• Purpose: These modules demonstrate how to use TinyEngine (and the generated C code) within an application. The tutorials include both inference demos and training demos. They also interface with hardware-specific SDKs (e.g., STM32CubeIDE) for microcontroller deployment.
Model Assets and External Resources
• Location: “assets” directory, along with references to online repositories and demo videos in the README.
• Purpose: This contains pre-trained models in TFLite format, configuration files, and other media (e.g., figures for demo purposes).
Platform & Toolchain
• Detail the internal modularity of TinyEngine by drawing sub-modules (like kernels that implement various forward and backward ops) and note that these implement specific optimizations (in-place depthwise, patch-based inference, etc.).
• “code_generator” part separately to highlight the co-design approach between algorithm development (via model conversion) and system-level memory/compute optimizations in TinyEngine.
• Since the project also supports training (as seen in the “tutorial/training” directory), you might optionally add a separate block labeled “On-Device Training (Tiny Training Engine)” that shares the same low-level optimizations; connect that with the runtime and demo examples.
1. Model Assets (TFLite/Pre-trained models)
2. Code Generator Module (Python library – code_generator) with its subcomponents (converters, allocators, template engine)
3. TinyEngine Runtime Library (C/C++ modules – kernels, operator implementations, memory scheduling optimizations) with submodules as needed
4. Example Applications and Tutorial Demos (deployment demos, training demos)
5. Microcontroller Deployment Platform (hardware toolchain, STM32CubeIDE integration)