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.
