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:

ConceptModel Deployment
On-board modelhbm
Reference baselinequantized_model.bc (including quantized_removed_model.bc)
Runtime frameworkUCP
Inference interfaceshbDNNInferV2 / hbUCPSubmitTask / hbUCPWaitTaskDone
Memory allocationhbUCPMalloc / hbUCPMallocCached
Tensor propertieshbDNNTensorProperties (validShape / stride / alignedByteSize)
Performance evaluationhrt_model_exec perf
Accuracy evaluationhrt_model_exec infer / hbm_infer
Resource monitoringhrt_ucp_monitor
Scheduling tracingUCP Trace

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:

StageInputMain Output / ArtifactsRequiredKey ChecksWhere to Look on Failure
Input/Output Rule Confirmationhbm modelConfirmed validShape / stride / alignedByteSizeYesWhether the model input contains dynamic dimensions, and whether stride needs additional alignment for the platformRefer to Alignment Rule and Dynamic Input Introduction sections
Environment and Dependency PreparationDevelopment board, cross compilerA runnable on-board environmentYesWhether the dependency libraries have been uploaded to the board, and whether LD_LIBRARY_PATH has been setRefer to Environment Deployment and Basic Sample User Guide sections
Application Project Developmenthbm model, UCP interfacesAn executable inference programYesWhether the allocated memory meets the first-address alignment requirement, and whether input data is laid out according to strideRefer to Model Inference Application Development Guide and Alignment Rule sections
On-board Run VerificationInference program, input dataSingle-frame inference resultYesWhether the on-board result matches quantized_model.bcRefer to ONNX Model Deployment Consistency Analysis or PyTorch Model Deployment Consistency Analysis section, and the UCP FAQ section
Performance and Accuracy Evaluationhbm modelLatency / FPS metrics, dataset accuracy reportYesWhether other programs occupy resources during the evaluationRefer to Board Evaluation and Model Performance Optimization sections
Resource Evaluation and TuningRunning inference programHardware IP utilization and memory informationNoWhether resource contention exists in multi-model scenariosRefer 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 the 00_quick_start sample 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.