$ model_deploy.py --mlir model_yolo26n-pose/yolo26n-pose.mlir --chip cv181x --quantize INT8 --calibration_table model_yolo26n-pose/yolo26n-pose_cali_table --model model_yolo26n-pose/yolo26n-pose-cv181x-int8.bmodel --fuse_preprocess --aligned_input
2026/03/28 03:02:02 - INFO : TPU-MLIR v1.0.0.dev-3c489cf-20260328
2026/03/28 03:02:02 - INFO :
load_config Preprocess args :
resize_dims : [640, 640]
keep_aspect_ratio : False
keep_ratio_mode : letterbox
pad_value : 0
pad_type : center
input_dims : [640, 640]
--------------------------
mean : [0.0, 0.0, 0.0]
scale : [0.0039216, 0.0039216, 0.0039216]
--------------------------
pixel_format : rgb
channel_format : nchw
yuv_type :
[Success] Create config file 'yolo26n-pose_cv181x_int8.layer_group_config.json'.
Content:
{
"shape_secs_search_strategy": 0,
"structure_detect_opt": true,
"sc_method_configs": [
{
"sc_method": "sc_method_quick_search",
"MAX_TRY_NUM": 20
},
{
"sc_method": "sc_method_search_better_v1",
"NSECS_SEARCH_RECORD_THRESHOLD": 3,
"CSECS_SEARCH_RECORD_THRESHOLD": 3,
"DSECS_SEARCH_RECORD_THRESHOLD": 3,
"HSECS_SEARCH_RECORD_THRESHOLD": 3,
"WSECS_SEARCH_RECORD_THRESHOLD": 3
},
{
"sc_method": "sc_method_search_better_v2",
"MAX_NSECS": 32,
"MAX_CSECS": 32,
"MAX_DSECS": 32,
"MAX_HSECS": 32,
"MAX_WSECS": 32,
"NSECS_SEARCH_RECORD_THRESHOLD": 2,
"CSECS_SEARCH_RECORD_THRESHOLD": 2,
"DSECS_SEARCH_RECORD_THRESHOLD": 2,
"HSECS_SEARCH_RECORD_THRESHOLD": 2,
"WSECS_SEARCH_RECORD_THRESHOLD": 2
}
]
}
[Running]: tpuc-opt model_yolo26n-pose/yolo26n-pose.mlir --processor-assign="chip=cv181x mode=INT8 num_device=1 num_core=1 addr_mode=auto high_precision=False" --import-calibration-table="file=model_yolo26n-pose/yolo26n-pose_cali_table asymmetric=False" --processor-top-optimize --fuse-preprocess="mode=INT8 customizatio
n_format=RGB_PLANAR align=True" --convert-top-to-tpu="weightFileName=yolo26n-pose_cv181x_int8_sym_tpu_weights.npz asymmetric=False doWinograd=False q_group_size=0 q_symmetric=False matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo26n-pose_cv181x_int8_sym_tpu.mlir
module @"yolo26n-pose" attributes {module.FLOPs = 7757193000 : i64, module.addr_mode = "basic", module.chip = "cv181x", module.cores = 1 : i64, module.devices = 1 : i64, module.high_precision = false, module.mode = "INT8", module.platform = "ONNX", module.postprocess = "yolov26", module.state = "TOP_CALIBRATED", module
.top_run_mode = "STATIC", module.weight_file = "yolo26n-pose_top_f32_all_weight.npz"} {
func.func @main(%arg0: tensor<1x3x640x640xf32> loc(unknown)) -> tensor<1x1x200x7x!quant.calibrated<f32<-679.54791260000002:679.54791260000002>>> {
%0 = "top.None"() : () -> none loc(unknown)
%1 = "top.Input"(%arg0) {channel_format = "nchw", do_preprocess = true, keep_aspect_ratio = false, keep_ratio_mode = "letterbox", mean = [0.000000e+00, 0.000000e+00, 0.000000e+00], pad_type = "center", pad_value = 0 : i64, pixel_format = "rgb", resize_dims = [640, 640], scale = [0.0039216000586748123, 0.00392160005
86748123, 0.0039216000586748123], yuv_type = ""} : (tensor<1x3x640x640xf32>) -> tensor<1x3x640x640x!quant.calibrated<f32<-1.000008:1.000008>>> loc("images")
%2 = "top.Weight"() : () -> tensor<16x3x3x3xf32> loc("model.0.conv.weight")
%3 = "top.Weight"() : () -> tensor<16xf32> loc("model.0.conv.bias")
%4 = "top.Conv"(%1, %2, %3) {dilations = [1, 1], do_relu = false, dynweight_reorderd = false, group = 1 : i64, kernel_shape = [3, 3], pads = [1, 1, 1, 1], relu_limit = -1.000000e+00 : f64, strides = [2, 2], weight_is_coeff = 1 : i64} : (tensor<1x3x640x640x!quant.calibrated<f32<-1.000008:1.000008>>>, tensor<16x3x3x3
xf32>, tensor<16xf32>) -> tensor<1x16x320x320x!quant.calibrated<f32<-46.822227499999997:46.822227499999997>>> loc("/model.0/conv/Conv_output_0_Conv")
%5 = "top.SiLU"(%4) : (tensor<1x16x320x320x!quant.calibrated<f32<-46.822227499999997:46.822227499999997>>>) -> tensor<1x16x320x320x!quant.calibrated<f32<-39.618843099999999:39.618843099999999>>> loc("/model.0/act/Mul_output_0_Mul")
%6 = "top.Weight"() : () -> tensor<32x16x3x3xf32> loc("model.1.conv.weight")
%7 = "top.Weight"() : () -> tensor<32xf32> loc("model.1.conv.bias")
%8 = "top.Conv"(%5, %6, %7) {dilations = [1, 1], do_relu = false, dynweight_reorderd = false, group = 1 : i64, kernel_shape = [3, 3], pads = [1, 1, 1, 1], relu_limit = -1.000000e+00 : f64, strides = [2, 2], weight_is_coeff = 1 : i64} : (tensor<1x16x320x320x!quant.calibrated<f32<-39.618843099999999:39.61884309999999
9>>>, tensor<32x16x3x3xf32>, tensor<32xf32>) -> tensor<1x32x160x160x!quant.calibrated<f32<-68.7999954:68.7999954>>> loc("/model.1/conv/Conv_output_0_Conv")
%9 = "top.SiLU"(%8) : (tensor<1x32x160x160x!quant.calibrated<f32<-68.7999954:68.7999954>>>) -> tensor<1x32x160x160x!quant.calibrated<f32<-47.066119899999997:47.066119899999997>>> loc("/model.1/act/Mul_output_0_Mul")
%10 = "top.Weight"() : () -> tensor<32x32x1x1xf32> loc("model.2.cv1.conv.weight")
%11 = "top.Weight"() : () -> tensor<32xf32> loc("model.2.cv1.conv.bias")
%12 = "top.Conv"(%9, %10, %11) {dilations = [1, 1], do_relu = false, dynweight_reorderd = false, group = 1 : i64, kernel_shape = [1, 1], pads = [0, 0, 0, 0], relu_limit = -1.000000e+00 : f64, strides = [1, 1], weight_is_coeff = 1 : i64} : (tensor<1x32x160x160x!quant.calibrated<f32<-47.066119899999997:47.06611989999
9997>>>, tensor<32x32x1x1xf32>, tensor<32xf32>) -> tensor<1x32x160x160x!quant.calibrated<f32<-55.433734899999997:55.433734899999997>>> loc("/model.2/cv1/conv/Conv_output_0_Conv")
%13 = "top.SiLU"(%12) : (tensor<1x32x160x160x!quant.calibrated<f32<-55.433734899999997:55.433734899999997>>>) -> tensor<1x32x160x160x!quant.calibrated<f32<-39.016002700000001:39.016002700000001>>> loc("/model.2/cv1/act/Mul_output_0_Mul")
%14 = "top.Slice"(%13, %0, %0, %0) {axes = [], ends = [9223372036854775807, 16, 9223372036854775807, 9223372036854775807], hasparamConvert_axes = [1], offset = [0, 0, 0, 0], steps = [1, 1, 1, 1]} : (tensor<1x32x160x160x!quant.calibrated<f32<-39.016002700000001:39.016002700000001>>>, none, none, none) -> tensor<1x16
x160x160x!quant.calibrated<f32<-39.016002700000001:39.016002700000001>>> loc("/model.2/Split_output_0_Split")
<...>
%563 = "top.Reshape"(%562) {flatten_start_dim = -1 : i64} : (tensor<1x300x!quant.calibrated<f32<-1.000000e-05:1.000000e-05>>>) -> tensor<1x300x1x!quant.calibrated<f32<-1.000000e-05:1.000000e-05>>> loc("/model.23/Unsqueeze_2_output_0_Unsqueeze")
%564 = "top.Gather"(%555, %indices_1) {axis = 0 : si32, is_lora = false, is_scalar = false, keepdims = true} : (tensor<300x1x!quant.calibrated<f32<-8383.0830077999999:8383.0830077999999>>>, tensor<1x300x!quant.calibrated<f32<-2.990000e+02:2.990000e+02>>>) -> tensor<1x300x1x!quant.calibrated<f32<-8383.0830077999999:8383.0830077999999>>> loc("/model.23/Reshape_12_output_0_Gather")
%565 = "top.Cast"(%563) {round_mode = "HalfAwayFromZero", to = "F32"} : (tensor<1x300x1x!quant.calibrated<f32<-1.000000e-05:1.000000e-05>>>) -> tensor<1x300x1x!quant.calibrated<f32<-1.000000e-05:1.000000e-05>>> loc("/model.23/Cast_2_output_0_Cast")
%566 = "top.Tile"(%564) {tile = [1, 1, 4]} : (tensor<1x300x1x!quant.calibrated<f32<-8383.0830077999999:8383.0830077999999>>>) -> tensor<1x300x4x!quant.calibrated<f32<-8383.0830077999999:8383.0830077999999>>> loc("/model.23/Tile_1_output_0_Tile")
%567 = "top.Tile"(%564) {tile = [1, 1, 51]} : (tensor<1x300x1x!quant.calibrated<f32<-8383.0830077999999:8383.0830077999999>>>) -> tensor<1x300x51x!quant.calibrated<f32<-8383.0830077999999:8383.0830077999999>>> loc("/model.23/Tile_2_output_0_Tile")
%568 = "top.GatherElements"(%550, %566) {axis = 1 : i64} : (tensor<1x8400x4x!quant.calibrated<f32<-762.5643311:762.5643311>>>, tensor<1x300x4x!quant.calibrated<f32<-8383.0830077999999:8383.0830077999999>>>) -> tensor<1x300x4x!quant.calibrated<f32<-646.18310550000001:646.18310550000001>>> loc("/model.23/GatherElements_1_output_0_GatherElements")
%569 = "top.GatherElements"(%552, %567) {axis = 1 : i64} : (tensor<1x8400x51x!quant.calibrated<f32<-640.83679199999995:640.83679199999995>>>, tensor<1x300x51x!quant.calibrated<f32<-8383.0830077999999:8383.0830077999999>>>) -> tensor<1x300x51x!quant.calibrated<f32<-679.57073969999999:679.57073969999999>>> loc("/model.23/GatherElements_2_output_0_GatherElements")
%570 = "top.Concat"(%568, %558, %565, %569) {axis = 2 : si32, do_relu = false, only_merge = false, relu_limit = -1.000000e+00 : f64, round_mode = "HalfAwayFromZero"} : (tensor<1x300x4x!quant.calibrated<f32<-646.18310550000001:646.18310550000001>>>, tensor<1x300x1x!quant.calibrated<f32<-0.94782730000000004:0.94782730000000004>>>, tensor<1x300x1x!quant.calibrated<f32<-1.000000e-05:1.000000e-05>>>, tensor<1x300x51x!quant.calibrated<f32<-679.57073969999999:679.57073969999999>>>) -> tensor<1x300x57x!quant.calibrated<f32<-724.69607980000001:724.69607980000001>>> loc("output0_Concat")
%571 = "top.YoloDetection"(%570) {agnostic_nms = false, anchors = [0.000000e+00], class_num = 80 : i64, keep_topk = 200 : i64, net_input_h = 640 : i64, net_input_w = 640 : i64, nms_threshold = 5.000000e-01 : f64, num_boxes = 3 : i64, obj_threshold = 5.000000e-01 : f64, version = "yolov26"} : (tensor<1x300x57x!quant.calibrated<f32<-724.69607980000001:724.69607980000001>>>) -> tensor<1x1x200x7x!quant.calibrated<f32<-679.54791260000002:679.54791260000002>>> loc("yolo_post")
return %571 : tensor<1x1x200x7x!quant.calibrated<f32<-679.54791260000002:679.54791260000002>>> loc(unknown)
} loc(unknown)
} loc(unknown)
Entering FusePreprocessPass.
WARNING: qscale > 1, = 9.999990e-01
Not support now.
UNREACHABLE executed at /w/tpu-mlir/lib/Conversion/TopToTpu/CV18xx/CompareConst.cpp:32!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: tpuc-opt model_yolo26n-pose/yolo26n-pose.mlir --init "--processor-assign=chip=cv181x mode=INT8 num_device=1 num_core=1 addr_mode=auto high_precision=False" "--import-calibration-table=file=model_yolo26n-pose/yolo26n-pose_cali_table asymmetric=False" --processor-top-optimize "--fuse-prepr
ocess=mode=INT8 customization_format=RGB_PLANAR align=True" "--convert-top-to-tpu=weightFileName=yolo26n-pose_cv181x_int8_sym_tpu_weights.npz asymmetric=False doWinograd=False q_group_size=0 q_symmetric=False matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold --deinit --mlir-print-debuginfo -o yolo26n-pose_cv181x_int8_sym_tpu.mlir
#0 0x0000559086914ce7 (/w/tpu-mlir/install/bin/tpuc-opt+0x91ece7)
#1 0x0000559086912a0e (/w/tpu-mlir/install/bin/tpuc-opt+0x91ca0e)
#2 0x000055908691566a (/w/tpu-mlir/install/bin/tpuc-opt+0x91f66a)
#3 0x00007fa0c4c3f520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007fa0c4c939fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007fa0c4c3f476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007fa0c4c257f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x0000559086912831 (/w/tpu-mlir/install/bin/tpuc-opt+0x91c831)
#8 0x0000559086d58633 (/w/tpu-mlir/install/bin/tpuc-opt+0xd62633)
#9 0x0000559086b20406 (/w/tpu-mlir/install/bin/tpuc-opt+0xb2a406)
#10 0x0000559086b1fba4 (/w/tpu-mlir/install/bin/tpuc-opt+0xb29ba4)
#11 0x0000559088200e67 (/w/tpu-mlir/install/bin/tpuc-opt+0x220ae67)
#12 0x00005590881fd77f (/w/tpu-mlir/install/bin/tpuc-opt+0x220777f)
#13 0x00005590881c697c (/w/tpu-mlir/install/bin/tpuc-opt+0x21d097c)
#14 0x00005590881c37cc (/w/tpu-mlir/install/bin/tpuc-opt+0x21cd7cc)
#15 0x0000559086a713d4 (/w/tpu-mlir/install/bin/tpuc-opt+0xa7b3d4)
#16 0x000055908822a154 (/w/tpu-mlir/install/bin/tpuc-opt+0x2234154)
#17 0x000055908822a781 (/w/tpu-mlir/install/bin/tpuc-opt+0x2234781)
#18 0x000055908822cc28 (/w/tpu-mlir/install/bin/tpuc-opt+0x2236c28)
#19 0x000055908690636b (/w/tpu-mlir/install/bin/tpuc-opt+0x91036b)
#20 0x0000559086905734 (/w/tpu-mlir/install/bin/tpuc-opt+0x90f734)
#21 0x0000559088447a28 (/w/tpu-mlir/install/bin/tpuc-opt+0x2451a28)
#22 0x00005590868ffa3a (/w/tpu-mlir/install/bin/tpuc-opt+0x909a3a)
#23 0x00005590868fff04 (/w/tpu-mlir/install/bin/tpuc-opt+0x909f04)
#24 0x00005590868fe94a (/w/tpu-mlir/install/bin/tpuc-opt+0x90894a)
#25 0x00007fa0c4c26d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#26 0x00007fa0c4c26e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#27 0x00005590868fdd55 (/w/tpu-mlir/install/bin/tpuc-opt+0x907d55)
Aborted
Traceback (most recent call last):
File "/w/tpu-mlir/python/tools/model_deploy.py", line 670, in <module>
lowering_patterns = tool.lowering()
File "/w/tpu-mlir/python/tools/model_deploy.py", line 247, in lowering
patterns = mlir_lowering(self.mlir_file,
File "/w/tpu-mlir/install/python/utils/mlir_shell.py", line 642, in mlir_lowering
_os_system(cmd, mute=mute, log_level=log_level)
File "/w/tpu-mlir/install/python/utils/mlir_shell.py", line 495, in _os_system
raise RuntimeError("[!Error]: {}".format(cmd_str))
RuntimeError: [!Error]: tpuc-opt model_yolo26n-pose/yolo26n-pose.mlir --processor-assign="chip=cv181x mode=INT8 num_device=1 num_core=1 addr_mode=auto high_precision=False" --import-calibration-table="file=model_yolo26n-pose/yolo26n-pose_cali_table asymmetric=False" --processor-top-optimize --fuse-preprocess="mode=INT8 customization_format=RGB_PLANAR align=True" --convert-top-to-tpu="weightFileName=yolo26n-pose_cv181x_int8_sym_tpu_weights.npz asymmetric=False doWinograd=False q_group_size=0 q_symmetric=False matmul_perchannel=False gelu_mode=normal" --canonicalize --weight-fold -o yolo26n-pose_cv181x_int8_sym_tpu.mlir
Versions:
docker.io/sophgo/tpuc_dev:v3.4-20250411ultralytics==8.4.30 onnxruntime==1.22.1 onnx==1.19.1 onnxslim==0.1.90Problems:
model_deploy.py(see logs below)run_calibration.py(did not attach logs because I would like to try running yolo26n-pose on Milk-V Duo 256M)The error from model_deploy:
Partial run logs below
1. onnx → mlir finishes, but needs
--tolerance 0.94,0.66and also logsWARNING : onnxsim opt failed.2. calibration finishes with warnings
3. mlir → bmodel fails