Skip to main content
Visitor II
October 17, 2026
Question

STM32N6570-DK Neural-ART: transformer encoder output is wrong (planner aliases a Concat onto its input) and encode is slow

Setup
- Board: STM32N6570-DK, Neural-ART NPU, dev boot.
- Tool: ST Edge AI Core 4.0.1 (target stm32n6), ll_aton 1.1.3.275 / NetworkRuntime1201_CM55_GCC.a.
- Model: ViT-style autoencoder encoder. Input 1×3×256×256 RGB, output INT8 [128,12] → 128 LE-uint16 tokens (256 B). Weights in xSPI2 NOR @ 0x70380000.
Problem 1 — wrong latent (NPU)
The board latent doesn't match ONNX Runtime on the compiled graph (0/128 tokens). Epoch tracing shows input, weights and the first conv are correct, but the first Concat output is placed by the planner on top of one of its inputs:
input1  [1,256,512] @0x34310000
output  [1,257,512] @0x34310000   (starts where input1 starts)
LL_ATON_LIB_Concat copies inputs in order with forward memcpy, so it corrupts the tensor (every row becomes the class token). I added an overlap-safe copy as a local patch; that fixes the Concat, but a second fault remains in epochs 8..72 (first LayerNorm / start of the first attention block) → latent still wrong.
Problem 2 — speed
One encode is ~36 s on Neural-ART (942 epochs, 548 pure software on the M55), and minutes on a CPU-only variant.

1 reply

Julian E.
ST Technical Moderator
October 21, 2026

Hi ​@Adevil9504,

 

The current NPU is mainly made to compute convolutions.

Today, the support of Transformer is not that good, it depends a lot on what is being done.

 

Could you please share a model for us to look at this issue?

(you need to put it in a .zip to attach it to community)

 

Have a good day,

Julian

​In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.