9. Deployment

A Tiny ML ModelZoo run produces a compiled model library (mod.a), the model header (tvmgen_default.h), the feature-extraction configuration (user_input_config.h) and golden vectors (test_vector.c). Deploying means dropping these four files into a ready-made example from the device SDK and confirming on the board that the model gives the same answer as on your PC.

Note

Deployment in 1.5.0 is based on the SDK examples in tinyml-sdk (C2000Ware, F29H85x SDK, MSPM33 SDK, AM13 MCU-SDK, AM26x MCU-PLUS-SDK). The 1.4.0 flow of writing your own main.c around mod_inference() and extract_features() is gone; the SDK examples already contain the application, the feature-extraction library calls and the test harness.

9.1. Start Here

Deploy to an SDK Example

The 4 files, which SDK and example to pick, and the expected “All tests have passed.” output.

Deploying a ModelZoo Run to an SDK Example (Golden-Vector Check)
CCS Integration

Importing, building, flashing and debugging the example in Code Composer Studio.

CCS Integration Guide
NPU Devices

What changes for F28P55, MSPM0G5187 and AM13E2 (NPU initialization, memory, debugging).

NPU Device Deployment
Non-NPU Devices

CPU-only devices: C28x, F29H85, MSPM0G3507, MSPM33C32, AM26x.

Non-NPU Deployment

The deck Deploying to an SDK example summarizes the same steps as slides.

Contents

9.2. Deployment Workflow

  1. Train and compile with a config that has compilation: enable: True (see Quickstart). Check the device-support matrix in Device Overview.

  2. Open the run folder data/projects/<project_name>/run/<date-time>/<model_name>/ (see Understanding the Run Output).

  3. Pick the SDK and example for your target_device and task_type (tables in Deploying a ModelZoo Run to an SDK Example (Golden-Vector Check)).

  4. Import the example in CCS, replace the four files, build, flash.

  5. Read the console: Feature extraction mismatches 0, All tests have passed., Golden vectors matched: X not matched: 0.

  6. Replace the test vector input with your ADC or sensor data in application_main.c.

Per-task walkthroughs (with screenshots) are the four task readmes in the toctree above.