Model Deployment Overview
This section is the entry point of the model deployment section. Once you have completed model quantization and compilation and obtained the hbm model, this section walks you through the full action sequence of on-board deployment, together with the input, output, key checks, and troubleshooting entry of each stage.
The prerequisite for reading this section is that you have completed model quantization and compilation through either the ONNX or the PyTorch pipeline and obtained an hbm model that can run on the board.
Model Deployment Terminology and Artifact Reference
Before diving into each stage, use the table below to align on the key terminology and artifacts involved in the model deployment pipeline:
Model Deployment Full-pipeline Stage Table
Model deployment is split into the following stages in actual usage order: Input/Output Rule Confirmation → Environment and Dependency Preparation → Application Project Development → On-board Run Verification → Performance and Accuracy Evaluation → Resource Evaluation and Tuning.
The input, output, whether it is required, key checks, and troubleshooting jumps of each stage are summarized in the following table:
| Stage | Input | Main Output / Artifacts | Required | Key Checks | Where to Look on Failure |
|---|---|---|---|---|---|
| Input/Output Rule Confirmation | hbm model | Confirmed validShape / stride / alignedByteSize | Yes | Whether the model input contains dynamic dimensions, and whether stride needs additional alignment for the platform | Refer to Alignment Rule and Dynamic Input Introduction sections |
| Environment and Dependency Preparation | Development board, cross compiler | A runnable on-board environment | Yes | Whether the dependency libraries have been uploaded to the board, and whether LD_LIBRARY_PATH has been set | Refer to Environment Deployment and Basic Sample User Guide sections |
| Application Project Development | hbm model, UCP interfaces | An executable inference program | Yes | Whether the allocated memory meets the first-address alignment requirement, and whether input data is laid out according to stride | Refer to Model Inference Application Development Guide and Alignment Rule sections |
| On-board Run Verification | Inference program, input data | Single-frame inference result | Yes | Whether the on-board result matches quantized_model.bc | Refer to ONNX Model Deployment Consistency Analysis or PyTorch Model Deployment Consistency Analysis section, and the UCP FAQ section |
| Performance and Accuracy Evaluation | hbm model | Latency / FPS metrics, dataset accuracy report | Yes | Whether other programs occupy resources during the evaluation | Refer to Board Evaluation and Model Performance Optimization sections |
| Resource Evaluation and Tuning | Running inference program | Hardware IP utilization and memory information | No | Whether resource contention exists in multi-model scenarios | Refer to Board Resources Evaluation section and the Model Preemption Control subsection |
Choosing a Deployment Path
When entering the application development stage, you can choose one of the following two paths according to your goal:
-
Start from the Basic Sample package: Use the basic sample package under
samples/ucp_tutorial/dnn/of the OE release package directly. After compilation, run the00_quick_startsample on the board to first confirm that the on-board environment, the dependency libraries, and the model pipeline all work, then adapt the sample code into your own project. This path suits first-time on-board deployment and scenarios where you need a runnable result as soon as possible. For details, refer to the Basic Sample User Guide section. -
Build a project from scratch following the development guide: Build your own cmake project through the three stages of project creation, project implementation, and project compilation and operation, and then apply the multi-model control strategy and application tuning suggestions on top of it. This path suits scenarios where the inference program must be integrated into an existing application framework, or where task scheduling has customized requirements. For details, refer to the Model Inference Application Development Guide section.
Both paths use the same set of UCP interfaces and differ only in the starting point. You may first verify the environment with the basic sample package and then switch to your own project.
Preliminary Notes
Before entering the detailed stages, please note the following:
-
The on-board inference result should match
quantized_model.bc. If it does not, first check the input data preparation and alignment handling instead of suspecting the model itself. -
Input and output alignment requirements vary by platform. For the detailed differences, refer to the Input/Output Handling Differences section of Platform Differences.
-
If the model accuracy already fails to meet the target at the quantization stage, please go back to the quantization pipeline first. The deployment stage cannot fix issues that originate from quantization itself.
-
Performance evaluation results are affected by the hardware capability of the platform. Confirm the platform model first when comparing performance metrics across platforms.
