9.1.3. NPU Device Deployment
This page lists what is specific to deploying on devices with a hardware NPU. The common procedure (the four files, picking the SDK example, the expected console output) is in Deploying a ModelZoo Run to an SDK Example (Golden-Vector Check); the CCS steps are in CCS Integration Guide.
9.1.3.1. NPU-Enabled Devices
|
SDK example location |
NPU initialization |
|---|---|---|
F28P55 |
C2000Ware |
SysConfig (NPU module in |
MSPM0G5187 |
MSPM0 SDK (not part of |
See the MSPM0 SDK example |
AM13E2 |
MCU-SDK |
See the MCU-SDK example |
MSPM33C34 has an NPU profile but no model lists it in 1.5.0
(Device Overview). F29 devices (F29H85, F29P58, F29P32) have no hardware NPU: the
model is compiled with the soft NPU preset and runs on the CPU through TI’s NPU software library.
That is why the F29H85 examples still call TI_NPU_init() in application_main.c and carry an
NPU module in their SysConfig; do not remove either from an example you import.
9.1.3.2. NPU Compilation
An NPU device is compiled with one of the NPU presets (default_preset,
compress_npu_layer_data); forced_soft_npu_preset deliberately runs the model on the CPU.
Model layers must satisfy the NPU rules in NPU Guidelines and
NPU Configuration Guidelines for TI Neural Network Compiler; models named *_NPU in the model list are designed for
that. The result is the same four files as for any device.
common:
target_device: 'F28P55'
compilation:
enable: True
compile_preset_name: default_preset # or compress_npu_layer_data to save Flash
9.1.3.3. What Is Different at Run Time
Initialization. The NPU must be initialized before the first
tvmgen_default_run. In the SDK examples this is already done (SysConfig, orTI_NPU_init()for F29H85). Keep the NPU module in the project’s.syscfg.Asynchronous completion. On NPU devices the application waits for
tvmgen_default_finishedbefore it compares the output. If the program hangs there, the NPU was not initialized.Tolerance. The golden-vector check uses the same tolerance (+/-1, or +/-4 for anomaly detection) as on CPU devices.
Memory. Check the linker map after the build. ModelMaker also reports model and feature-extraction memory (see Device Overview).
9.1.3.4. Walkthrough: F28P55x
Install C2000Ware and CCS (CCS Integration Guide).
Import
f28p55x_arc_fault(or the example for your task) from Resource Explorer using the board filterLAUNCHXL-F28P55X.Replace
artifacts/mod.a,artifacts/tvmgen_default.h,test_vector.canduser_input_config.hwith the files from one NPU-compiled run (for exampleexamples/dc_arc_fault/config_dsk.yamlwith modelCLS_1k_NPU).Build, select
TMS320F28P550SJ9_LaunchPad.ccxml, debug, addtest_resultto Watch and resume.Expect
Feature extraction mismatches 0andAll tests have passed..
9.1.3.5. Troubleshooting
Symptom |
Fix |
|---|---|
Hangs at |
NPU not initialized. Keep the NPU module in |
Linker: incompatible object / undefined |
|
Model compiled but not on the NPU |
A layer is not NPU-compatible, or |
Section does not fit in Flash |
Try |