SAM 2 in Hailo8L

update on this:

  • downloaded hailo_model_zoo
  • hailo optimize fast_sam_s.har --hw-arch hailo8l --use-random-calib-set --model-script hailo_model_zoo-2.12/hailo_model_zoo/cfg/alls/generic/fast_sam_s.alls

the optimization results are

[info] Current Time: 14:03:28, 08/19/24
[info] CPU: Architecture: x86_64, Model: 12th Gen Intel(R) Core™ i7-12700H, Number Of Cores: 8, Utilization: 0.0%
[info] Memory: Total: 11GB, Available: 8GB
[info] System info: OS: Linux, Kernel: 5.15.153.1-microsoft-standard-WSL2
[info] Hailo DFC Version: 3.28.0
[info] HailoRT Version: Not Installed
[info] PCIe: No Hailo PCIe device was found
[info] Running hailo optimize fast_sam_s.har --hw-arch hailo8l --use-random-calib-set --model-script hailo_model_zoo-2.12/hailo_model_zoo/cfg/alls/generic/fast_sam_s.alls
[info] Loading model script commands to fast_sam_s from hailo_model_zoo-2.12/hailo_model_zoo/cfg/alls/generic/fast_sam_s.alls
[info] Found model with 3 input channels, using real RGB images for calibration instead of sampling random data.
[info] Starting Model Optimization
[warning] Reducing optimization level to 0 (the accuracy won’t be optimized and compression won’t be used) because there’s no available GPU
[warning] Running model optimization with zero level of optimization is not recommended for production use and might lead to suboptimal accuracy results
[info] Model received quantization params from the hn
[info] Starting Mixed Precision
[info] Mixed Precision is done (completion time is 00:00:00.46)
[info] Layer Norm Decomposition skipped
[info] Starting Stats Collector
[info] Using dataset with 64 entries for calibration
Calibration: 100%| 64/64 [00:31<00:00, 2.03entries/s]
[info] Stats Collector is done (completion time is 00:00:32.75)
[info] Starting Fix zp_comp Encoding
[info] Fix zp_comp Encoding is done (completion time is 00:00:00.00)
[info] matmul_equalization skipped
[info] No shifts available for layer fast_sam_s/conv1/conv_op, using max shift instead. delta=1.3022
[info] No shifts available for layer fast_sam_s/conv1/conv_op, using max shift instead. delta=0.6511
[info] No shifts available for layer fast_sam_s/conv47/conv_op, using max shift instead. delta=0.6172
[info] No shifts available for layer fast_sam_s/conv47/conv_op, using max shift instead. delta=0.3086
[info] activation fitting started for fast_sam_s/ew_sub_softmax1/act_op
[info] activation fitting started for fast_sam_s/reduce_sum_softmax1/act_op
[info] Finetune encoding skipped
[info] Bias Correction skipped
[info] Adaround skipped
[info] Fine Tune skipped
[info] Layer Noise Analysis skipped
[warning] The expected calibration set should be [0, 255] when using an in-net normalization layer, but the range received is [(0.0, 1.0), (0.0, 1.0), (0.0, 1.0)].
[info] Model Optimization is done
[info] Saved HAR to: /home/dario/hailo/fast_sam_s_optimized.har

Then launched compilation

hailo compiler fast_sam_s_optimized.har --hw-arch hailo8l --model-script hailo_model_zoo-2.12/hailo_model_zoo/cfg/alls/generic/fast_sam_s.alls

output of the compilation

[info] Current Time: 14:05:49, 08/19/24
[info] CPU: Architecture: x86_64, Model: 12th Gen Intel(R) Core™ i7-12700H, Number Of Cores: 8, Utilization: 0.0%
[info] Memory: Total: 11GB, Available: 8GB
[info] System info: OS: Linux, Kernel: 5.15.153.1-microsoft-standard-WSL2
[info] Hailo DFC Version: 3.28.0
[info] HailoRT Version: Not Installed
[info] PCIe: No Hailo PCIe device was found
[info] Running hailo compiler fast_sam_s_optimized.har --hw-arch hailo8l --model-script hailo_model_zoo-2.12/hailo_model_zoo/cfg/alls/generic/fast_sam_s.alls
[info] Loading model script commands to fast_sam_s from hailo_model_zoo-2.12/hailo_model_zoo/cfg/alls/generic/fast_sam_s.alls
[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
[error] Mapping Failed (allocation time: 11s)
No successful assignment for: format_conversion2, concat18, feature_splitter9, shortcut_softmax1, reduce_max_softmax1, ew_sub_softmax1, reduce_sum_softmax1, ew_mult_softmax1, conv76

[error] Failed to produce compiled graph
[error] BackendAllocatorException: Compilation failed: No successful assignment for: format_conversion2, concat18, feature_splitter9, shortcut_softmax1, reduce_max_softmax1, ew_sub_softmax1, reduce_sum_softmax1, ew_mult_softmax1, conv76