Failed to parse the model into Hef

Hello everyone in the community
Recently, I have been parsing my model into Hef, but the error is as follows:

[error] Mapping Failed (allocation time: 1m 58s)
Compiler could not find a valid partition to contexts. Most commom error is: Automri finished with too many resources on context_4 with 11/56 failures.

[error] Failed to produce compiled graph
[error] BackendAllocatorException: Compilation failed: Compiler could not find a valid partition to contexts. Most commom error is: Automri finished with too many resources on context_4 with 11/56 failures.

I have tried setting up Performance Params:

 performance_param(compiler_optimization_level=max)

But the error is as follows:

[error] Mapping Failed (Timeout, allocation time: 2m 38s)
No valid partition found
Mapping Failed (Timeout, allocation time: 2m 38s)

[error] Failed to produce compiled graph
[error] BackendAllocatorException: Compilation failed: No valid partition found
Mapping Failed (Timeout, allocation time: 2m 38s)

Does this mean that my model is too large for the Hailo platform to accept? This problem has been bothering me for several months, and I would be very grateful if anyone could help me!
Fan Xiaoqin

Hey @user61,

This error is due to resource constraints or model size exceeding available memory.

Can you try the following to fix the issue:

1. Enable Context Switching

context_switch_param(mode=enabled)

or let the compiler decide:

context_switch_param(mode=allowed)

2. Manage Memory Usage

allocator_param(automatic_ddr=False)

3. Extend Compilation Timeout

allocator_param(timeout=3h)

4. Optimize Resource Allocation

resources_param(strategy=greedy, max_compute_utilization=0.8, max_memory_utilization=0.75)

5. Enable Multi-Context Merging

context_switch_param(allow_auto_merge_in_multicontext=True)

If the issue persists, can you share a profile or Netron view of the model?

orima,We had a private message before :smiling_face_with_tear: