model could not fit in single context

I added context_switch_param(mode=disabled) to the compilation configuration to compile the model into single context. The original YOLOX_s model with three downsampling branches was successfully compiled into a HEF file. However, when I added an additional output (4x downsampling branch) to YOLOX_s, the following error occurred during the compilation stage. How can I resolve this issue?

[info] ParsedPerformanceParam command, setting optimization_level(max=2)
[info] Loading model script commands to model from string
[info] ParsedPerformanceParam command, setting optimization_level(max=2)
[info] Loading network parameters
[info] Starting Hailo allocation and compilation flow
[error] Mapping Failed (allocation time: 0s)
Context switch is disabled, but model could not fit in single context. consider changing it and try again.
Detailed error is: Recoverable single context error

[error] Failed to produce compiled graph
[error] BackendAllocatorException: Compilation failed: Context switch is disabled, but model could not fit in single context. consider changing it and try again.
Detailed error is: Recoverable single context error

You can try using performance mode. In performance mode, the compiler will try as hard as it can to find a solution that will fit in a single context, with the highest performance. This method of compilation will require significantly longer time to complete, because the compiler tries to use very high utilization levels, that might not allocate successfully.

If that fails you will need to allow the compiler to compile the model to multiple contexts.

I have added “performance_param(compiler_optimization_level=max)”, but still same error.

This suggests that the compiler is running out of one or multiple of the three resources (compute, memory or control) available on the Hailo-8.

You can create a profiler report of the model that fits into s single context and have a look at the resources. For the Yolox s model in the Model Zoo it looks like the control resource (96%) is the limiting factor.