Deploying a Model with RKNN Toolkit2: An RK3588 NPU Workflow

What the RKNN workflow actually covers

A model that runs on a workstation does not become a board-ready application by copying a file. On Rockchip hardware the usual path is: train or obtain a model, export it to an intermediate format, convert it with RKNN Toolkit2, quantize it, evaluate accuracy, and finally load the resulting .rknn file through the runtime library on the target board. This article walks through that path as an RKNN Toolkit2 tutorial aimed at engineers specifying an sbc with npu for a product. It describes the workflow and the decisions around it; it does not promise particular throughput figures, because performance depends on the model, operator coverage, memory, runtime version and thermal conditions. Always confirm current capabilities against the vendor's documentation for the exact chip and software release you plan to ship.

Step 1: prepare the model and check operator support

Start from a trained network exported in a format the converter accepts — ONNX is a common intermediate step. Before spending time on conversion, check which operators in your model are supported by the toolkit version you intend to use. Unsupported layers usually mean either rewriting part of the graph, replacing an activation with a supported equivalent, or accepting that part of the inference will fall back to the CPU. That fallback can dominate latency, so treat operator coverage as a design input rather than a late-stage detail.

Also decide at this stage whether the model must run entirely on the NPU. If your application mixes preprocessing, inference and postprocessing, the memory copies between these stages matter as much as inference time. A simpler model that stays entirely on the accelerator often outperforms a more accurate one that repeatedly crosses that boundary.

Step 2: convert and quantize

Conversion produces an RKNN graph; quantization maps floating-point weights and activations to integers so the NPU can execute them efficiently. The converter needs a representative dataset for this step — typically a few hundred samples that reflect the real input distribution, not just a convenient subset of the training set.

Why representative data matters

Model quantization RKNN workflows fail most often here. If the calibration images are brighter, cleaner or more tightly cropped than production inputs, accuracy can collapse after conversion even though the model looks correct on paper. Use data captured from the actual camera or sensor, include edge cases such as low light and motion blur, and keep the preprocessing identical to the deployment pipeline. Keep the floating-point version as a reference so that accuracy loss can be measured rather than guessed.

Step 3: evaluate before rk3588 npu deployment

Run the converted model on the development host where possible, then on the target board, and compare both against the original. Measure three things separately: accuracy on a fixed validation set, end-to-end latency including input and output handling, and sustained behaviour under thermal load. A board that meets latency targets for the first hundred frames may throttle when enclosed without adequate heat dissipation.

Record the toolkit version, runtime version, OS image and model hash together. This is the only reliable way to reproduce a result six months later, especially when an image update changes the runtime library.

Step 4: deploy and integrate on the board

On the target, the application initialises the RKNN runtime, loads the model, feeds input tensors and reads outputs. For a camera pipeline, the surrounding code — capture, colour conversion, crop and resize — is often where integration time goes. Keep that code modular so you can replace the inference backend without rewriting the rest of the application.

The iTOP-RK3588 SBC is a practical development platform for this stage because it exposes the interfaces needed to connect cameras and peripherals while running a complete Linux or Android image. Teams building around the smaller tier can evaluate an RK3576 board such as the iTOP-RK3576 SBC, and products that need a custom carrier board can start from the iTOP-RK3588 connector SoM. Check current memory and interface configurations on each product page before selecting a SKU; inference workloads are sensitive to available memory bandwidth.

Choosing the compute target

Not every deployment belongs on the integrated NPU. If your model is large, changes frequently, or needs workloads the built-in accelerator does not support, an M.2 accelerator such as the RK1828 / RK1820 accelerator card can be evaluated. If the goal is a conversational assistant rather than vision inference, our guide to running a local LLM on embedded hardware covers the different memory and bandwidth constraints. For the underlying performance tiers, see RK3568 vs RK3576 vs RK3588.

Version control and lifecycle checks

  • Pin the toolkit and runtime versions, and treat an OS image update as a change that requires re-validation.
  • Keep calibration data under version control alongside the model and conversion script.
  • Confirm that any operator you rely on is still supported before committing to a multi-year BOM.
  • Ask the board supplier which BSP and kernel versions are maintained for the specific SKU you are buying.

FAQ

Do I need to retrain a model for RKNN?

Usually not. Most projects export an existing trained model and convert it. Retraining becomes necessary when unsupported operators must be replaced or when quantization loss cannot be reduced with better calibration data.

Can evaluation be done entirely on the PC?

Initial accuracy checks can, but final validation should run on the target board with the production runtime, camera input and enclosure. Host results do not capture thermal or driver behaviour.

Does every sbc with npu support the same workflow?

The broad steps are similar, but operator support, runtime APIs and performance differ by chip and software release. Verify each platform separately rather than assuming compatibility.

What should I check before a production order?

Confirm model accuracy after quantization, sustained latency in the final enclosure, and a written statement of BSP and security-update support for the exact board revision.

0 comments

Leave a comment

Please note, comments need to be approved before they are published.