Error creating hef file after succeseful quantization- mapping fail

:slight_smile: slight_smile: ello,

I have a small (12 MB) segformer b0 onnx file.
I managed to create its har file and the quantized model. -:slight_smile:
But I am failing in the mapping while creating the final hef file.

here is my trace log:

(hcompiler2) nuchailo1@nuchailo1:~/PycharmProjects/hcompiler2$ hailo compiler mapcoresegformer_small_optimized.har
[info] Current Time: 11:47:29, 08/15/24
[info] CPU: Architecture: x86_64, Model: 13th Gen Intel(R) Core™ i7-1360P, Number Of Cores: 16, Utilization: 0.3%
[info] Memory: Total: 15GB, Available: 9GB
[info] System info: OS: Linux, Kernel: 6.5.0-45-generic
[info] Hailo DFC Version: 3.28.0
[info] HailoRT Version: Not Installed
[info] PCIe: 0000:57:00.0: Number Of Lanes: 1, Speed: 8.0 GT/s PCIe
[info] Running hailo compiler mapcoresegformer_small_optimized.har
[info] Compiling network
[info] To achieve optimal performance, set the compiler_optimization_level to “max” by adding performance_param(compiler_optimization_level=max) to the model script. Note that this may increase compilation time.
[info] Loading network parameters
[info] Starting Hailo allocation and compilation flow
[warning] Failed to add spatial reshapes
[info] Adding collapsed format conversion after conv_feature_splitter1_2
[info] Adding collapsed format conversion after conv_feature_splitter2_2
[error] Mapping Failed (allocation time: 31s)
No successful assignment for: format_conversion11
[error] Failed to produce compiled graph
[error] BackendAllocatorException: Compilation failed: No successful assignment for: format_conversion11

Any idea what can I do to make this process finished successfully?

Thanks in advanced,
David


Hey @dudibs,

It looks like the main issue here is the error: “No successful assignment for: format_conversion11.” This means the compiler couldn’t allocate resources for a specific format conversion operation, which seems to be related to data format incompatibilities with the SegFormer architecture on Hailo’s hardware.

Here are some potential solutions:

  1. Analyze the Model: Use the Hailo Profiler or Visualizer to better understand where the problem lies.

  2. Modify Compilation Parameters: Try adjusting the optimization level to MAX during compilation.

  3. Pre-process the Model: Consider modifying your ONNX model before compilation to eliminate the need for format_conversion11. Tools like ONNX Runtime or Netron can help you visualize and adjust the model structure.

  4. Enable Layer Splitting: Turn on automatic layer splitting, which might assist in resource allocation.

  5. Investigate format_conversion11: Review your original model to identify what operation is leading to this format conversion. If possible, replace it with a Hailo-compatible alternative.


Let me know if you need further help!

I cant change too much the segformer architecture.