Rockchip · AI & Linux Hub

AI inference

RKNN3 Toolkit Lite: Python inference and asynchronous resource ownership

Python can connect inference to cameras, queues and prototypes, but a higher-level API does not remove device-memory, asynchronous-task or session-state concerns.

Python can connect inference to cameras, queues and prototypes, but a higher-level API does not remove device-memory, asynchronous-task or session-state concerns. Establish single-request behavior before introducing concurrency.

This is an original technical interpretation and implementation guide based on official documentation. This workflow has not been verified on ArmSoM hardware. Match the target chip, SDK, Runtime, driver and firmware before deployment.

Python on the target: Load matching artifacts → Inspect tensor attributes → Submit and await completion → Read results and release

Original ArmSoM workflow illustration; it does not represent hardware test results. Open the image for its vector version.

Lite runs converted models

The V1.2.0 reference describes RKNN3Lite as a Python interface for executing converted models with a matching Runtime. It addresses synchronous and asynchronous inference, tensor attributes, LLM Sessions, callbacks and memory lifetimes. Conversion belongs to Toolkit.

Importing a conversion package on a development computer does not establish a ready device environment. Verify the Python package, shared libraries and model-build identity separately.

Validate inputs at the application boundary

Check dimensions, type, layout and batch meaning as data enters the application. Unconditionally casting every input can hide an upstream change and defer failure until inference.

Boundary Recommended check
Application input Format, dimensions, missing values and origin
Model input Tensor attributes, preprocessing and contiguity
Model output Count, structure and invalid results
Business output Thresholds, coordinates and text parsing

Keep a known-good offline input to separate camera, decoder and networking behavior from model execution.

Submission is not completion

The interface includes inference_async. A returned submission is distinct from completed computation: use the documented waiting contract before reading results or reclaiming objects used by the task. Callbacks also need defined lifetimes.

For a buffer pool, track each slot as free, in flight or ready for reading. Allow only valid transitions. Decide explicitly whether a full queue drops, blocks or rejects work rather than accumulating requests indefinitely.

Map business conversations to Sessions

Maintain an explicit relationship between application conversations and Runtime Sessions. Define cleanup for cancellation, timeouts and user departure. Alternate requests between two conversations and verify that application state and callback objects do not cross. Memory reuse and session reuse require separate checks.

Test beyond the successful prototype

Add empty inputs, wrong dimensions, cancellation and repeated task creation. Observe recovery, memory return and the next request’s behavior. No device measurements are claimed here. An ArmSoM host integration still requires validation of the actual accelerator, image and Runtime.

Plan an ArmSoM-based project

If an ArmSoM board is being considered as the application host, start with the product information for Sige7, Sige5 and CM5. Check interfaces, power, OS image and drivers for the actual board and carrier revision. These are host-selection references, not a plug-and-play compatibility claim for RK182X modules. The integrated NPUs in RK3588 / RK3576 use the corresponding RKNN Toolkit2 stack; selecting one of these hosts does not move its internal NPU to RKNN3.

Related interface and module documentation: RK182X M.2 · RK182X SO-DIMM · RK3572 Datasheet V1.0

Official documentation and version

Based on official repository snapshot 141883c8e11b0, checked on 2026-11-14. Consult the source for complete interfaces, parameters and restrictions. This article is not a replacement for the manual or a reproduction of the full PDF.

Reading order

Products and development resources

Check the hardware revision, carrier, image and interfaces in the product documentation. An article association is not evidence that a configuration has been tested.

These models are linked for further platform reading; the examples are not claimed to be ported to them.

Explore this topic → · Learning paths →