How arm-software/cmsis-nn works
Main Components
• Library Core: Represent the core neural network kernel implementations. Highlight the “Source” folder, which is further subdivided into directories for each operator category (e.g., ActivationFunctions, BasicMathFunctions, ConvolutionFunctions, Depthwise, FullyConnectedFunctions, LSTMFunctions, NNSupportFunctions, etc.). These are where the actual optimized implementations reside.
• Public Interface: Show the “Include” directory that contains the public API headers (for example, arm_nnfunctions.h and arm_nn_types.h) that expose the kernel functionality to client projects.
• Internal Interfaces: Optionally, include the “Include/Internal” subfolder that contains helper header files (such as the arm_nn_compiler.h) used privately by the library.
• Build and Configuration: Illustrate the presence of build configuration using CMake (CMakeLists.txt at top-level and in subdirectories) as well as the toolchain/integration with Arm Ethos-U Core Platform toolchain files. This part can include compiler flags and customization options (for example, CMSIS_OPTIMIZATION_LEVEL and OPTIONAL_RESTRICT_KEYWORD).
• Testing Infrastructure: Represent the “Tests/UnitTest” directory where unit tests are organized per operator or group (e.g., RefactoredTestGen, TestCases). This verifies that each algorithm’s performance and accuracy are validated against reference data.
• Documentation: Include the “Documentation” folder showing Doxygen configurations and scripts to auto-generate the library’s documentation.
• CI/External Integration: Optionally, you may also show integration with GitHub workflows, dependency configuration (e.g., .github/workflows and .clang-format), and version check scripts (such as check_pdsc.sh, check_version_and_date.sh).
Out the Operator Variants
• Which quantitative precision is supported – int8, int16, and in some cases int4 – as specified in the README’s feature table.
Detail the Separation of Interface and Implementation
• Optionally, include how “Internal” headers support the implementation and act as glue between various modules.
Build and Testing Flow
• A module/block for the build system where the top-level CMakeLists.txt aggregates submodule builds. Note that toolchain configuration (e.g. TARGET_CPU and optimization flags) is provided during the build process.
• A component for Unit Testing (from “Tests/UnitTest”) which feeds test data and validates each operator function. Indicate that integration and regression tests run via scripts like “build_and_run_tests.sh.”
Final Remarks
• Strive for detail – separate CMSIS-NN into as many distinct architectural components as possible using the file tree. This design helps contributors quickly locate and understand each module’s role in the overall system.