QNN runtime: backend extensions and model integration in the on-vehicle runtime

The company's on-vehicle inference runtime hides chip differences behind three unified interfaces (net, session, tensor), so the same model code runs on vehicle chips and in x86 simulation and replay. The runtime predates me and is maintained by several teams; my team and I extend its backends and bring production models in. This page covers three concrete pieces of work, namely moving a LiDAR detector into the runtime, tracing a latency regression, and adapting more than twenty models to the AXERA backend this year.

QCraft 2022 – 2026 Backend extensions and model integration (contributor)

4 → 1sub-models merged into one inside the runtime
79.5 → 51.3 msa latency regression traced and fixed (Orin)
20+models adapted to the AXERA backend on mainline (2026)
  • On-vehicle runtime
  • TensorRT plugins
  • LibTorch
  • Multi-chip backends
  • Model integration
On this page

What the runtime is

QNN runtime is the framework that runs neural networks on the vehicle. It has three layers:

structure of the on-vehicle inference runtime and my team's work in itModel code: written onceone config per platform for each model; the code does not fork per chipUNIFIED INTERFACENetbuilt from config; picks thebackendSessioninference context; bindsinputs and outputsTensorshape, type, quantizationscaleSWAPPABLE BACKENDSOn-vehicle chipsHorizonNVIDIAQualcommAXERAx86 simulation and replayTensorRTLibTorchfixed-point simThe runtime predates me and is maintained by several teams. The right-hand side is what my team and I do: backend extensions and model integration.What my team and I do in it1Models on the new chip backend2026: 20+ models adapted to the AXERA backend, merged to mainline2Custom TensorRT operatora scatter-max plugin (CUDA) with unit tests3More input typesint32 and other input types added to the runtime4Faster LibTorch backendspeeds up inference in x86 simulation and replay5Legacy model migrationa lidar detector that ran outside the runtime, merged and moved in
  • Model code is written once. Each model has one config per platform; when a backend already supports the operators and input types a model needs, moving to another chip only changes the config.
  • Three unified interfaces: net, session and tensor. Model code talks only to these.
  • Backends are swappable: four chip families on the vehicle, and TensorRT, LibTorch and fixed-point simulation on x86.

The direct benefit is that a problem found on the road can be replayed and debugged on x86 with the same model code, without going to the board each time.

Who did what

Moving a LiDAR detector into the runtime

At the end of 2022 the LiDAR detector still ran outside the runtime, as four sub-models chained together. That was a separate piece of inference code outside the runtime, maintained on its own.

  • Merge: the four sub-models were merged into one model, which was then moved into the runtime.
  • Missing operator: the model needs scatter-max (the maximum within each index group), for which TensorRT had no ready implementation at the time. I wrote a TensorRT plugin for it in CUDA.
  • Input types: the runtime gained new input types such as int32.

Tracing a latency regression

In March 2023 the model's latency on Orin went from 51.2 ms to 79.5 ms. Post-processing had been left inside the model, so work that belongs outside the model was being counted as inference. Moving it back out brought latency to 51.3 ms.

Separately, I sped up inference on the LibTorch backend.

2026: adapting models to the AXERA backend

In 2026 the company moved its urban NOA stack to the AXERA platform. At the runtime level, each model needs a working config on the new backend and outputs that match the original platform. I landed the AXERA backend adaptation of more than twenty models on mainline.

The AXERA platform has two conversion paths, quantized (QDQ) and FP16; in November the quantized versions of four Transformer models were merged to mainline. The program's plan, road tests and results are on Urban NOA on a new chip (AXERA M97).

Lessons

  • Move into the runtime first, optimize second. A model outside it is a separate piece of inference code that has to be maintained and debugged on its own.
  • Check a latency regression at the model boundary. Confirm which computation is being counted as inference before looking at individual operators.
  • State who did what. In a runtime many people maintain, saying which part is yours tells others whom to ask.