Mismatch between intermediate connection sizes error while compiling trasformer-based model

Hi,

I am compiling a transformer-based model (custom LightGlue keypoint matching model, 9 transformer layers, 4 inputs, 1 output). The compiler successfully identifies a valid mapping (Successful Mapping, multiple contexts), but fails during the final binary generation (HEF build) with a “Mismatch between intermediate connection sizes”. It occurs also for models with less layers, however the model with up to 4 layers could be compiled to hef.

The mismatch error always occurs between conv and matmul nodes when the producer and consumer layers are using different padding/alignment requirements for the same tensor at the context boundary (2112 vs 2048 bytes)

Mismatch between intermediate connection sizes: conv14 (lightglue_v4_context_0, sys_index=0, bytest_per_buffer=2112 Bytes), buffers_per_frame=4 Bytes), matmul10 (lightglue_v4_context_1, sys_index=4, bytest_per_buffer=2048 Bytes), buffers_per_frame=4 Bytes)

I tried:

  • model_optimization_flavor(optimization_level=0)
  • performance_param(compiler_optimization_level=0, 1, 2)

My questions are:

  1. Are there specific parameters or models scripts directives to force consistent alignment across context splits?
  2. Is there a way to force specific layers into the same hardware context to prevent this mismatch without manually splitting the model graph?
  3. Are there other compiler parameters I should adjust to handle these padding differences?

Environment

  • Target - Hailo8
  • DFC version - 3.32.0
  • OS: WSL2

Thanks in advance!